Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re^2: Perl can do it, take 1 (sentence generation)

by spurperl (Priest)
on Jun 19, 2005 at 16:36 UTC ( [id://468149]=note: print w/replies, xml ) Need Help??


in reply to Re: Perl can do it, take 1 (sentence generation)
in thread Perl can do it, take 1 (sentence generation)

Can you please explain what .does(List) means ? I understand intuitively that it asks whether $phrase is a list, but how does it work, exactly ?

Replies are listed 'Best First'.
Re^3: Perl can do it, take 1 (sentence generation)
by eric256 (Parson) on Jun 19, 2005 at 18:25 UTC

    As far as I know that is all there is to tell. ;) The . by itself acts on the topic ($_) So that is the same as $_.does(List). My understanding is that does is checking the roles of the object it is called on. Evnetualy (when pugs gets more mature) we will be able to do. when List {} and it will DWIM, hopefully. BTW the given $phrase makes $phrase the current topic.


    ___________
    Eric Hodges
      OK, thanks - I figured most of it out after posting by reading the apocalypse / exegesis on objects.

      Frankly, the syntax .does(List) doesn't feel good to me, so I'm glad you're saying we'll eventually be able to just say when List. Is the latter legal Perl 6 and you didn't use it just because you wanted a working pugs-compilable code ?

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://468149]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (4)
As of 2024-03-29 13:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found