in reply to Re^6: why does push not default to $_?
in thread why does push not default to $_?

"Print, photocopy, and fax it" where the first two verbs are referring to "it". Not really sure if this works as a good example, though.

I'm so adjective, I verb nouns!

chomp; # nom nom nom

Replies are listed 'Best First'.
Re^8: why does push not default to $_?
by ikegami (Patriarch) on Dec 07, 2008 at 13:05 UTC
    No, the subject of those three verbs is an unstated "you". "It" is the direct object. But the pronoun wasn't optional. Imperative verbs can't have a explicit subject.

      Of course, you're already making the assumption that the example was an imperative sentence. It could just as easily have been the answer to the question "what do you think Fred should do with that email?"

      (I don't think I really have a point, other than that natural language, like Perl, is highly context-sensitive. Similar ambiguities arise in languages other than English, even those such as Japanese that are sometimes claimed to be logical and consistent by people who don't know much about them.)

      So the default pronoun is the "you" in imperativ forms? I'm sure it can't be so different in Latin ...(e.g. "Vade retro (Satanas)!" )... so thinking Perl has to be unorthogonal because English is, is a little speculative.

      "Irregularities" in human languages derrive from abbreviation of frequent constructs, but the rules of abbreviation can be very regular. Only sometimes there are conflicts between regular abbreviation and standard constructs with different meaning, so one need an irregular abbreviation to distiguish the meanings (Can't find an example in English).

      These conflicst are unavoidable in languages with a active vocabulary of 30000 words, but computer languages hardly have this extent ... (maybe except inhuman examples like PHP or Cobol ... ; )

      Anyway the direct object "it" is the equivalent to $_, the direct object of "push it" is also $_. The reason why the "indirect object" @array is at first place in perl syntax, is because you can't push a list otherwise. Well and this breaks the analogy to English, since AFAIK the direct object has to be at first place...

      "push $it,@to_array".

      I remeber when I started Perl, I was frequently putting the array at the end of the push parameters! So we see Perl is already not readable the way AppleScript or HyperTalk is (thank God!)

      Cheers Rolf

        So the default pronoun is the "you" in imperative forms?

        There's no default. It can equally be "you" (singular) and "you" (plural) and "we" (plural).

        Anyway the direct object "it" is the equivalent to $_,

        But the "it" isn't optional. "eat" and "eat it" are not synonymous.

        I'm not sure why you guys are comparing English with Perl. There might be similarities, but the differences are more numerous. It's not helping you at all.

      Ikegami, reconsider your stance on imperative verbs. ;-)

      for(split(" ","tsuJ rehtonA lreP rekcaH")){print reverse . " "}print "\b.\n";
        I don't remember what the "Ikegami," is called, but it's not considered the subject. It's still the implied "you". Of course, that implied "you" is defined by the "Ikegami,". Nice try, though (++).