develooper Front page | perl.perl6.language | Postings from May 2001

Re: Exegesis2 and the "is" keyword

Thread Previous | Thread Next
From:
Dave Storrs
Date:
May 16, 2001 08:11
Subject:
Re: Exegesis2 and the "is" keyword
Message ID:
Pine.BSF.4.21.0105160802150.27601-100000@megazone23.bigpanda.com

Ok, this is basically a bunch of "me too!"s.



On Tue, 15 May 2001, Nathan Wiger wrote:

> Awesome. Simple, Perlish, easy to read, etc. Also, I see you took the
> suggestion of:
> 
>    Access through...       Perl 5          Perl 6
>    =================       ======          ======
>    Array slice             @foo[@ns]       @foo[@ns]
>    Hash slice              @foo{@ks}       %foo{@ks}
> 
> Which is kewl since it makes a good amount of sense IMO.

	Here's the first one.

 
>    $*ARGS is chomped;
> I wonder if that wouldn't be better phrased as:
>    autochomp $*ARGS;    # $ARGS.autochomp
> 
> [...] I don't think actions should be declared using "is",
> necessarily. [...] In particular, it puts the action in the passive
> voice[...]
> It seems actions should be active functions, so:
> 
>    autoflush $STDERR;   # $STDERR.autoflush
>    $var = read $ARGS;
>    print $STDOUT "Hello, World!\n";

	Here's the second one.

> :
> :    $ARGS prompts("Search? ");                              # Perl 6
> :    while (<$ARGS>) {
> 
> I'd think I'd rather see that as:
>    prompt $ARGS "Search? ";         # $ARGS.prompt("Search? ")
> Without the extra new ambiguity. Thoughts?

	Hmmm...the '$ARGS prompts("Foo?")' version actually works better
for me.  I think that, in line with what you said above, 'prompt $ARGS
"Foo?"' should be interpreted as an action...that is, something that
should be done _right_now_.  But I don't want the prompt to be printed
right now...I want it to be printed just before I do a read on the
filehandle.  In this case, I really am setting a property, not setting a
property.

	I'm not sure what the appropriate way to disambiguate the two is,
or if there even needs to be a specific mechanism (can perl be smart
enough to DWIM on this?).  Definitely something to think about.

	Dave


Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About