Re: Defaulting params (reprise)

2002-09-05 Thread Damian Conway
Trey Harris wrote: A more practical application would be: my $foo; # Code which might or might not set $foo... $foo //= 23; # or $foo is default(23); In such a case, the Cis default just looks plain odd to me. It is. More than that, it's plain wrong. Cis properties are

Re: Multimethod Dispatch

2002-09-05 Thread Dan Sugalski
At 9:27 PM -0400 9/4/02, Ken Fox wrote: Dan Sugalski wrote: At 9:10 AM -0400 9/4/02, [EMAIL PROTECTED] wrote: So, just to clarify, does that mean that multi-dispatch is (by definition) a run-time thing, and overloading is (by def) a compile time thing? No. They can be both compile time things or

Re: First crack at Builtins.p6m

2002-09-05 Thread Leopold Toetsch
Brent Dax wrote: Aaron Sherman: sub abs($num is int){ return $num=0 ?? $num :: -$num } ^ I believe that should be (int $num). and there is a »abs« in core.ops. Anyway, before implementing a bunch of builtins, it should be organized a little, where they

Re: Defaulting params (reprise)

2002-09-05 Thread [EMAIL PROTECTED]
From: Trey Harris [EMAIL PROTECTED] Properties are meant to be out-of-band information; miko's suggestion would have this property setting the *value* of the variable. Ah, but my exact point is that the default *isn't* set immediately. The property is held until the sub is called. If the

Re: Hypotheticals again

2002-09-05 Thread Peter Haworth
On Wed, 4 Sep 2002 17:29:27 -0400 (EDT), Trey Harris wrote: In a message dated Wed, 4 Sep 2002, Jonathan Scott Duff writes: So, each time I use a hypothetical, I have to be concious of which variables are currently in scope? Perl can't help be with this task because how does it know if I

RE: First crack at Builtins.p6m

2002-09-05 Thread Aaron Sherman
On Thu, 2002-09-05 at 01:47, Brent Dax wrote: Aaron Sherman: # Ok, so without knowing what the XS-replacement will look like # and without knowing what we're doing with # filehandle-functions (is tell() staying or does it get # removed in favor of $fh.tell()) and a whole lot of other

RE: First crack at Builtins.p6m

2002-09-05 Thread Aaron Sherman
On Thu, 2002-09-05 at 01:47, Brent Dax wrote: Aaron Sherman: The one thing I notice all over the place is: sub abs($num is int){ return $num=0 ?? $num :: -$num } Another thing I'm not sure on... how do you force numeric, but not integer typing on a parameter? Is that Cnum[ber]? $var

Re: First crack at Builtins.p6m

2002-09-05 Thread Aaron Sherman
On Thu, 2002-09-05 at 03:18, Leopold Toetsch wrote: Brent Dax wrote: Aaron Sherman: sub abs($num is int){ return $num=0 ?? $num :: -$num } ^ I believe that should be (int $num). and there is a »abs« in core.ops. I'll remove that then, and replace it

RE: First crack at Builtins.p6m

2002-09-05 Thread Luke Palmer
On 5 Sep 2002, Aaron Sherman wrote: On Thu, 2002-09-05 at 01:47, Brent Dax wrote: Aaron Sherman: The one thing I notice all over the place is: sub abs($num is int){ return $num=0 ?? $num :: -$num } Another thing I'm not sure on... how do you force numeric, but not integer

RE: First crack at Builtins.p6m

2002-09-05 Thread Trey Harris
In a message dated Thu, 5 Sep 2002, Luke Palmer writes: Why would bitwise have anything but integer signatures. What does 4.56 | 2.81 mean? Also, should perl lossily convert real to int, or give an error if it can't? Seems to me that that's a decision that has to be made for each function.

RE: First crack at Builtins.p6m

2002-09-05 Thread Trey Harris
(Sorry for responding to my own post, and on a tangential point at that, but...) In a message dated Thu, 5 Sep 2002, Trey Harris writes: In a message dated Thu, 5 Sep 2002, Luke Palmer writes: Why would bitwise have anything but integer signatures. What does 4.56 | 2.81 mean? Also,

Re: First crack at Builtins.p6m

2002-09-05 Thread Nicholas Clark
On Thu, Sep 05, 2002 at 09:57:07AM -0400, Aaron Sherman wrote: On Thu, 2002-09-05 at 03:18, Leopold Toetsch wrote: Brent Dax wrote: Aaron Sherman: sub abs($num is int){ return $num=0 ?? $num :: -$num } ^ I believe that should be (int $num). and

Re: Argument aliasing for subs

2002-09-05 Thread Damian Conway
Erik Steven Harrison wrote: Is it just me or is the 'is' property syntax a little too intuitive? Seems like everywhere I turn, the proposed syntax to solve a problem is to apply a property. That's because most of the problems we're discussing are solved by changing the semantics of a

Re: Argument aliasing for subs

2002-09-05 Thread Damian Conway
Erik Steven Harrison wrote: I know that the property syntax is pseudo established, but I'm beggining to become a bit jaded about all the built in properties were building. What about good ol' aliases? sub hidden (str $name, int $force := $override) {...} I'm not keen on it because it

Re: Hypothetical variables and scope

2002-09-05 Thread Damian Conway
Jonathan Scott Duff wrote: This continues to make no sense to me. The hypotheticality of a variable seems quite orthogonal to what you do with it (bind, assign, whatever). Why should these two things be intimate? Because what you do with a hypothetical has to be reversible. And binding is

Re: Request for default rule modifiers in a grammar

2002-09-05 Thread Damian Conway
Ken Fox wrote: I'm messing around with regex code generation by converting first to a grammar. The modifiers seem to need intimate knowledge of regex - grammar conversion. This may be a quirk of my approach. People using tree traversal or generating code directly from the regex might see

Re: regex args and interpolation

2002-09-05 Thread Aaron Sherman
On Wed, 2002-09-04 at 22:46, Ken Fox wrote: rule iso_date { $year:=(\d{4}) - $month:=(\d{2}) - $day:=(\d{2}) } You mean C \d4 , etc. I presume.

Re: Request for default rule modifiers in a grammar

2002-09-05 Thread Ken Fox
Damian Conway wrote: I would imagine that modifiers would be passed some kind of hierarchical representation of the rule they're modifying (i.e. a parse tree of it), and would be expected to manipulate that structure representation. Excellent. Will there be an abstract syntax for tree

Re: Hypothetical variables and scope

2002-09-05 Thread Ken Fox
Damian Conway wrote: Because what you do with a hypothetical has to be reversible. And binding is far more cheaply reversible than assignment. Why not leave it in the language spec then? If it's too hard to implement, then the first release of Perl 6 can leave it out. Someday somebody might

Re: Hypothetical variables and scope

2002-09-05 Thread Jonathan Scott Duff
On Thu, Sep 05, 2002 at 03:38:03PM +, Damian Conway wrote: Jonathan Scott Duff wrote: This continues to make no sense to me. The hypotheticality of a variable seems quite orthogonal to what you do with it (bind, assign, whatever). Why should these two things be intimate? Because

Re: Argument aliasing for subs

2002-09-05 Thread Peter Behroozi
On Thu, 2002-09-05 at 04:31, Damian Conway wrote: sub hidden (str $name, int $force is aka($override)) {...} Hang on a moment! In your original answer to this question, you used the is named('alias') syntax, but now you are suggesting using the sigil in the syntax. So, should it really be

Second try: Builtins

2002-09-05 Thread Aaron Sherman
This is still a monolith, but it's getting better. It's now stored in P6C/Builtins/CORE.p6m in my tree. More functions are coded, and I now differentiate between the functions that need external support (e.g. POSIX/libc functions) and those that just need to be written (e.g. sort). I think I've