Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Javascript (http://www.velocityreviews.com/forums/f68-javascript.html)
-   -   Javascript poetry (http://www.velocityreviews.com/forums/t942326-javascript-poetry.html)

VK 03-29-2011 02:59 PM

Javascript poetry
 
This was indirectly inspired by the "Idiomatic for ... in" thread and
I sincerely hope that Pedro Pinheiro will not take it as anything
personal. Just while typing in "belletristic" I realized that
Javascript still doesn't have(?) its own poetry. Perl does since
nearly the beginning ( http://en.wikipedia.org/wiki/Perl#Perl_pastimes
)

So I am proposing to fill out this humiliating gap :-)

The rules:

1) can be wrapped into a function
2) no pre-declared variables
3) no [var]
4) sensual
5) corresponds to the basic rules of English grammar
! 6) has to be a valid executable code, its usefulness is not
important

I am first with a sad poem about the love and the life :-( :-)

<script>

(function JSPoetry() {
// by VK


somePeople: do {for (ManyYears in Error) {
continue somePeople; Date;}}
while (void arguments);}).apply();


// validity check
window.alert('OK');

</script>

VK 03-29-2011 06:54 PM

Re: Javascript poetry
 
On Mar 29, 6:59*pm, VK <schools_r...@yahoo.com> wrote:
> The rules:
>
> 1) can be wrapped into a function
> 2) no pre-declared variables
> 3) no [var]


Sorry if breaking someone's poetic product :-) but two more obvious
rules:

3b) no string literals
3c) LABELS: only where they are syntactically functional (for, for-
in, do loops entry points)
Otherwise it could be just
"string",
"string";
or
STRING:
STRING:
and no sport at all :-)

> <script>
>
> (function JSPoetry() {
> // by VK
>
> *somePeople: do {for (ManyYears in Error) {
> *continue somePeople; Date;}}
> *while (void arguments);}).apply();
>
> // validity check
> window.alert('OK');
>
> </script>


This poem came out so sad that put a depression on myself :-) So I
wrote a cheerful poetical answer to it:

<script>

(function JSPoetry() {
// by VK

try {new Object}
catch (on_Fly){}
finally {with (self){}}}).apply();


// validity check
window.alert('OK');

</script>

P E Schoen 03-29-2011 08:04 PM

Re: Javascript poetry
 
"VK" wrote in message
news:0cbeac72-ca90-49ce-8aaf-74fb87980b5d@d19g2000yql.googlegroups.com...

> <script>


> (function JSPoetry() {
> // by VK
>
> try {new Object}
> catch (on_Fly){}
> finally {with (self){}}}).apply();



> // validity check
> window.alert('OK');


> </script>


if (u !object) {
i.say( u.r ) = q[white][a.bar.d];
}

Paul


Thomas 'PointedEars' Lahn 03-29-2011 09:29 PM

Re: Javascript poetry
 
P E Schoen wrote:

> "VK" wrote:
>> <script>
>>
>> (function JSPoetry() {
>> // by VK
>>
>> try {new Object}
>> catch (on_Fly){}
>> finally {with (self){}}}).apply();

>
>
>> // validity check
>> window.alert('OK');

>
>> </script>

>
> if (u !object) {
> i.say( u.r ) = q[white][a.bar.d];
> }


I think the point was that it must also compile, in the best case run
(surprisingly for VK, their code does both in several Web browsers).
Also, I do not understand the right-hand side of your assignment, and
I do not see a verse.

Anyhow, aside from the well-known

var theQuestion = ("bb" || !"bb");

there is also this Shakespearan wisdom:

this
all: ({self: true}) && ("day", "night") && !({} === {});


PointedEars :)
--
var bugRiddenCrashPronePieceOfJunk = (
navigator.userAgent.indexOf('MSIE 5') != -1
&& navigator.userAgent.indexOf('Mac') != -1
) // Plone, register_function.js:16

P E Schoen 03-30-2011 12:13 AM

Re: Javascript poetry
 
"Thomas 'PointedEars' Lahn" wrote in message
news:4507451.MhkbZ0Pkbq@PointedEars.de...

> P E Schoen wrote:


>> if (u !object) {
>> i.say( u.r ) = q[white][a.bar.d];
>> }


> I think the point was that it must also compile, in the best case
> run (surprisingly for VK, their code does both in several Web
> browsers).


Agreed.

> Also, I do not understand the right-hand side of your assignment,
> and I do not see a verse.


Well, the translation to "verse" could be:

If you do not object,
I say you are quite a bard.

It is similar to iambic trimeter. The stress pattern is thus:

x/x/x/
x/xx/x/

This notation is used for some examples in
http://en.wikipedia.org/wiki/Meter_(poetry), where a stressed syllable is
"/" and an unstressed one is "x". It is also described as
dah-DUM-dah-DUM-dah-DUM (first line iambic trimeter), and
dah-DUM-dah-dah-DUM-dah-DUM (second line with the second foot being an
anapest).

This pattern is best illustrated by the middle portion of "The Mexican Hat
Dance":
http://www.youtube.com/watch?v=mZimZ...eature=related

Paul the Poet
http://www.smart.net/~pstech/bsn/EarlyPoems.txt
http://www.smart.net/~pstech/bsn/kpoems.htm
http://www.smart.net/~pstech/bsn/NewPoems.htm


VK 03-30-2011 05:02 AM

Re: Javascript poetry
 
On Mar 30, 1:29*am, Thomas 'PointedEars' Lahn <PointedE...@web.de>
wrote:
> (surprisingly for VK, their code does both in several Web browsers).


"several Web browsers"?! My well versed profound poetry is readable by
any ECMA 262 3rd ed. compliant engine. I am proclaiming right now to
the faces of all Javascript engines around: the one that doesn't
understand my poetry is an illiterate sorry loser! :-))

> there is also this Shakespearan wisdom:
>
> * this
> * all: ({self: true}) && ("day", "night") && !({} === {});


Puzzled on that one. Is it "O day and night, but this is wondrous
strange!" ?
I see you are working in Richard Kostelanetz style while I am tending
to classical forms.
:-)

Laser Lips 03-30-2011 10:28 AM

Re: Javascript poetry
 
OK this is not a poem but an quote.

<script type='text/javascript'>
var houses=["brick","mud","glass"];
for(people in houses)
{
try
{
if (houses[people]!="glass")throw "Stone";
}
catch(er)
{
if(er=="Stone")alert("");
}
}
</script>
Graham Vincent

Laser Lips 03-30-2011 10:34 AM

Re: Javascript poetry
 
Which should probably be...

<script type='text/javascript'>
var houses=["brick","mud","glass"];
for(people in houses)
{
try{if(houses[people]!="glass")throw "Stone";}catch(e){}
}
</script>


On Mar 30, 11:28*am, Laser Lips <loudsphi...@gmail.com> wrote:
> OK this is not a poem but an quote.
>
> <script type='text/javascript'>
> var houses=["brick","mud","glass"];
> for(people in houses)
> {
> *try
> *{
> * *if (houses[people]!="glass")throw "Stone";
> *}
> *catch(er)
> *{
> * *if(er=="Stone")alert("");
> *}}
>
> </script>
> Graham Vincent



VK 03-30-2011 03:02 PM

Re: Javascript poetry
 
On Mar 30, 2:34 pm, Laser Lips <loudsphi...@gmail.com> wrote:
> <script type='text/javascript'>
>
> var houses=["brick","mud","glass"];
> for(people in houses)
> {
> try{if(houses[people]!="glass")throw "Stone";}catch(e){}}
>
> </script>


Your message is rather hard to interpret to me at the line
(houses[people]!="glass").
Should it be read in the Punk style or in the Hippie style? Should one
throw the stone if seeing careless people in the window - or one
should not throw stone into people looking through the window at the
blue sky? Or is it an intentional ambiguity left by the author?

VK 03-30-2011 03:04 PM

Re: Javascript poetry
 
On Mar 30, 4:13 am, "P E Schoen" <p...@pstech-inc.com> wrote:
> This pattern is best illustrated by the middle portion of "The Mexican Hat
> Dance":http://www.youtube.com/watch?v=mZimZ...eature=related


From my observations of Javascript language the most suitable meter
for it is choliamb ( http://en.wikipedia.org/wiki/Choliamb ) though of
course we cannot use syllable weights to fully enjoy it. That is
basically true for English itself anyway.

For a lightweight/energetic poetry, because of the primarily
monosyllabic nature of English and because of the forced lack of
articles: the most suitable meter is trochee ( http://en.wikipedia.org/wiki/Trochee
).

IMHO of course.

:-)


All times are GMT. The time now is 01:36 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.