Javascript poetry

Discussion in 'Javascript' started by VK, Mar 29, 2011.

  1. VK

    VK Guest

    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, Mar 29, 2011
    #1
    1. Advertising

  2. VK

    VK Guest

    On Mar 29, 6:59 pm, VK <> 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>
     
    VK, Mar 29, 2011
    #2
    1. Advertising

  3. VK

    P E Schoen Guest

    "VK" wrote in message
    news:...

    > <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
     
    P E Schoen, Mar 29, 2011
    #3
  4. 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
     
    Thomas 'PointedEars' Lahn, Mar 29, 2011
    #4
  5. VK

    P E Schoen Guest

    "Thomas 'PointedEars' Lahn" wrote in message
    news:...

    > 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=mZimZYTwuDk&feature=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
     
    P E Schoen, Mar 30, 2011
    #5
  6. VK

    VK Guest

    On Mar 30, 1:29 am, Thomas 'PointedEars' Lahn <>
    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.
    :)
     
    VK, Mar 30, 2011
    #6
  7. VK

    Laser Lips Guest

    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, Mar 30, 2011
    #7
  8. VK

    Laser Lips Guest

    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 <> 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
     
    Laser Lips, Mar 30, 2011
    #8
  9. VK

    VK Guest

    On Mar 30, 2:34 pm, Laser Lips <> 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, Mar 30, 2011
    #9
  10. VK

    VK Guest

    On Mar 30, 4:13 am, "P E Schoen" <> wrote:
    > This pattern is best illustrated by the middle portion of "The Mexican Hat
    > Dance":http://www.youtube.com/watch?v=mZimZYTwuDk&feature=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.

    :)
     
    VK, Mar 30, 2011
    #10
  11. VK

    Laser Lips Guest

    On Mar 30, 4:02 pm, VK <> wrote:
    > On Mar 30, 2:34 pm, Laser Lips <> 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, are you not aware of the saying, "People in glass houses should'nt
    throw stones" ?

    Graham
     
    Laser Lips, Apr 1, 2011
    #11
  12. VK

    VK Guest

    > > 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, are you not aware of the saying, "People in glass houses shouldn't
    > throw stones" ?


    Oh, that one... I was mislead by ["brick","mud","glass"] with "mud" in
    it, sorry.
     
    VK, Apr 3, 2011
    #12
  13. VK

    P E Schoen Guest

    "VK" wrote in message
    news:...

    >> VK, are you not aware of the saying, "People in glass houses
    >> shouldn't throw stones" ?


    > Oh, that one... I was mislead by ["brick","mud","glass"] with
    > "mud" in it, sorry.


    Or

    var $houses=["brick","grass"];
    var $people;
    function advice() {
    var $whatNot = "thrones";
    if ($people.liveIn($houses.grass) ) {
    alert("Should not stow " + $whatNot);
    }
    }

    Paul
     
    P E Schoen, Apr 4, 2011
    #13
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Kazoo

    formatting poetry,

    Kazoo, Jul 5, 2004, in forum: HTML
    Replies:
    9
    Views:
    662
  2. BartlebyScrivener

    python poetry?

    BartlebyScrivener, Dec 19, 2006, in forum: Python
    Replies:
    5
    Views:
    425
    BartlebyScrivener
    Dec 20, 2006
  3. JWS

    poetry advice sought

    JWS, Mar 28, 2008, in forum: HTML
    Replies:
    16
    Views:
    620
    dorayme
    Mar 29, 2008
  4. Mark Lawrence

    [OT]romantic poetry

    Mark Lawrence, Jun 11, 2010, in forum: Python
    Replies:
    0
    Views:
    227
    Mark Lawrence
    Jun 11, 2010
  5. Elias Athanasopoulos

    Ruby Poetry

    Elias Athanasopoulos, Apr 7, 2004, in forum: Ruby
    Replies:
    0
    Views:
    75
    Elias Athanasopoulos
    Apr 7, 2004
Loading...

Share This Page