Re: [svn:perl6-synopsis] r13545 - doc/trunk/design/syn

2007-01-29 Thread Gaal Yahas
is entered twice here :-) (If I'm following correctly, then take's args are basically evaluated in list context. If YYY is something like "$scalar = " that list gets Captured, but there's still a list there.) -- Gaal Yahas <[EMAIL PROTECTED]> http://gaal.livejournal.com/

Re: [svn:perl6-synopsis] r13543 - doc/trunk/design/syn

2007-01-29 Thread Gaal Yahas
On Mon, Jan 29, 2007 at 10:08:34PM +0200, Gaal Yahas wrote: > On Mon, Jan 29, 2007 at 10:01:08PM +0200, Gaal Yahas wrote: > > > +Because C evaluates its block or statement in void context, > > > +this typically causes the C statement to be evaluated in void > > > +co

Re: [svn:perl6-synopsis] r13543 - doc/trunk/design/syn

2007-01-29 Thread Gaal Yahas
On Mon, Jan 29, 2007 at 10:01:08PM +0200, Gaal Yahas wrote: > > +Because C evaluates its block or statement in void context, > > +this typically causes the C statement to be evaluated in void > > +context. However, a C statement that is not in void context > > +gathers

Re: [svn:perl6-synopsis] r13543 - doc/trunk/design/syn

2007-01-29 Thread Gaal Yahas
an for take to be evaluated in void context? What are the gathered values here? take 1, 2; # easy. flattened 1 and then 2, right? @x = take 1, 2; # same thing? $x = take 1, 2; # same thing? [1, 2]? -- Gaal Yahas <[EMAIL PROTECTED]> http://gaal.livejournal.com/

Re: single named param

2006-09-12 Thread Gaal Yahas
thing to "default" to. :-) What invocant is constructed in this signature then? method foo ($just_a_named_param) Is the signature for &foo really the same as that of bar? sub bar ($just_a_named_param) I was sort of assuming you could tell by a signature if it was f

single named param

2006-09-12 Thread Gaal Yahas
I was writing tests for signatures and came across this ambiguity: :(:$x) Does this mean a single named parameter called $x, or a default invocant and a single required positional named $x? -- Gaal Yahas <[EMAIL PROTECTED]> http://gaal.livejournal.com/

Unpacking tree node parameters

2006-09-03 Thread Gaal Yahas
aragraph and introduce the optionality of the colon less jarringly. -- Gaal Yahas <[EMAIL PROTECTED]> http://gaal.livejournal.com/

Two Signature questions

2006-09-02 Thread Gaal Yahas
:($x where {...} is elk)# ambiguous auxillary Is this legal? does the 'elk' trait pertain to $x or to the where-block? :($x is ro is rw) # conflicting traits Is this legal? Is $x ro or rw? -- Gaal Yahas <[EMAIL PROTECTED]> http://gaal.livejournal.com/

Re: Pair of lists => list of pairs?

2006-08-23 Thread Gaal Yahas
v) this week? -- Gaal Yahas <[EMAIL PROTECTED]> http://gaal.livejournal.com/

Re: designing a test suite for multiple implementations

2006-08-12 Thread Gaal Yahas
%?CONFIG variable which I propose each implementation support. Pugs says 'pugs'. Also, there's a %?CONFIG so there's no need to parse $?PUGS_VERSION. pugs> %?CONFIG{%?CONFIG ~ <_versnum>} 6.2.12 -- Gaal Yahas <[EMAIL PROTECTED]> http://gaal.livejournal.com/

[patch] S04: CATCH blocks

2006-07-25 Thread Gaal Yahas
threw the exception. That is, the stack is not unwound until some exception handler chooses to -- Gaal Yahas <[EMAIL PROTECTED]> http://gaal.livejournal.com/

Re: Scans

2006-05-09 Thread Gaal Yahas
sum yields closer and closer approximations of some value, you can use a scan to efficiently cut off once some epsilon is reached. -- Gaal Yahas <[EMAIL PROTECTED]> http://gaal.livejournal.com/

Re: Scans

2006-05-09 Thread Gaal Yahas
rs do in list context. I love this idea and have implemented it in r10246. One question though, what should a scan for chained ops do? list [==] 0, 0, 1, 2, 2; # bool::false? # (bool::true, bool::true, bool::false, bool::false, bool::false) ? -- Gaal Yahas <[EMAIL PROTECTED]> http://gaal.livejournal.com/

Re: Scans

2006-05-08 Thread Gaal Yahas
make @input be the last index when used in a range, or did you mean ..^ ?) -- Gaal Yahas <[EMAIL PROTECTED]> http://gaal.livejournal.com/

Scans

2006-05-08 Thread Gaal Yahas
nking hard enough, so if anyone can come up with an implementation please give it :) Otherwise, how about we add this to the language? -- Gaal Yahas <[EMAIL PROTECTED]> http://gaal.livejournal.com/

Re: A shorter long dot

2006-04-30 Thread Gaal Yahas
On Sun, Apr 30, 2006 at 07:01:06PM +0200, Juerd wrote: > Gaal Yahas skribis 2006-04-30 16:05 (+0300): > > But it doesn't work across lines: > > $and_a_long_one_I_still_want_to_align. > > :foo() > > Explain to me why it wouldn't work, please.

Re: A shorter long dot

2006-04-30 Thread Gaal Yahas
have > foo.___:bar, and $foo.__:bar is clean. But it doesn't work across lines: $xyzzy.foo() $fooz.:foo() $foo. :foo() $fa. :foo() $and_a_long_one_I_still_want_to_align. :foo() $etc. :foo() -- Gaal Yahas <[EMAIL PROTECTED]> http://gaal.livejournal.com/

split on empty string

2006-01-17 Thread Gaal Yahas
While cleaning up tests for release: "".split(':')=> ()# Perl 5 ("",) # pugs Which is correct? It doesn's seem to be specced yet. -- Gaal Yahas <[EMAIL PROTECTED]> http://gaal.livejournal.com/

facades, use_ok, and lexical export

2006-01-09 Thread Gaal Yahas
ugh to do this. For example if a module one wishes to pull in isn't a Role :) There are over a hundred "use_ok" in the Pugs test suite; we are about to work around the problem by changing them to use+pass, but that's obviously the Wrong Thing. Is there a better workaround

Obsoleting "require 'Some/Module.pm'"

2005-12-19 Thread Gaal Yahas
an interesting structure containing the relative and actual absolute path of the resources loaded. (In fact, this is what recent pugs does :). I know some code does "require 'foo.ini'", but can't that be relegated to a module and use a different store than %*INC? -- Gaal Yahas <[EMAIL PROTECTED]> http://gaal.livejournal.com/

Re: import/export and module configuration

2005-12-19 Thread Gaal Yahas
be to stipulate an explicit configuration argument. &import can receive it as a named arg. use Test::More conf => "no_plan"; Alternatively disallow implicit my importation specs and treat everything to the right of the module name syntactically as arguments to import, with the parser picking out things it recognizes as imports and passing everything else through. -- Gaal Yahas <[EMAIL PROTECTED]> http://gaal.livejournal.com/

Fully-qualified symbols and exportation

2005-12-14 Thread Gaal Yahas
export" trait is just for formal signature matching / documentation purposes then. What is the scope of this override? -- Gaal Yahas <[EMAIL PROTECTED]> http://gaal.livejournal.com/

import/export and module configuration

2005-12-13 Thread Gaal Yahas
e import directives (that say something about how the caller sees the module) with other configurations (that say something about the demands made by the caller to the module). -- Gaal Yahas <[EMAIL PROTECTED]> http://gaal.livejournal.com/

Flunking tests and failing code

2005-12-04 Thread Gaal Yahas
ht up &flunk as a candidate name. Its merits, including its, uh, dropout cuteness, are many; it rings well against fail, alludes to tests, can probably be backported to the Perl 5 test modules, etc. What say? [++] -- Gaal Yahas <[EMAIL PROTECTED]> http://gaal.livejournal.com/

dis-junctive patterns

2005-11-21 Thread Gaal Yahas
In pugs, r7961: my @pats = /1/, /2/; say "MATCH" if 1 ~~ any @pats; # MATCH say "MATCH" if 0 ~~ any @pats; # no match So far so good. But: my $junc = any @pats; say "MATCH" if 1 ~~ $junc; # no match say "MATCH" if 0 ~~ $j

Re: given too little

2005-11-10 Thread Gaal Yahas
s accepting a single scalar and no arguments? If so then my and Eric's wishes are answered: when { $_ > 5 } { ... } when { .caloric_value > $doctors_orders } { ... } This isn't implemented in pugs yet, but I guess it can be once this is clarified. -- Gaal Yahas <[EMAIL PROTECTED]> http://gaal.livejournal.com/

given too little

2005-11-10 Thread Gaal Yahas
ession, the whole thing should become a terminal if. Inconsistent but possibly what people want. -- Gaal Yahas <[EMAIL PROTECTED]> http://gaal.livejournal.com/

Re: Default values for instance variables

2005-11-08 Thread Gaal Yahas
gs's problem. > :-) Noted. Perhaps it'd be worth foregrounding this feature in the Synopsis? I was just about to add tests -- but I found they already existed, with a comment # These tests are not specified by p6l, But these should be right... -- Gaal Yahas <[EMAIL PROTECTED]> http://gaal.livejournal.com/

Default values for instance variables

2005-11-08 Thread Gaal Yahas
new(jaws => "chew", claws => "tenderly comb"); S<12/Roles/"Roles may have attributes"> implies that this kind of thing is okay in roles. Is there any reason not to allow it as in the above too? This replaces the need for an explicit BUILD in many cases

Re: Re(vised): Proposal to make class method non-inheritable

2005-10-19 Thread Gaal Yahas
commit feed available somewhere? -- Gaal Yahas <[EMAIL PROTECTED]> http://gaal.livejournal.com/

Re: Translating (or at least parsing) Java interface definitions

2005-08-11 Thread Gaal Yahas
ch to Parase::RecDescent somewhere that fixes that, or you could use Class::Rebless which I wrote initially because of this problem -- though I ended up doing the blesswork inside the code sections manually as it made much more algorithmic sense. Hope this helps. -- Gaal Yahas

module init hooks and pragmas

2005-07-30 Thread Gaal Yahas
aps in light of L, we can make "use" and "no" activate TURNON and TURNOFF blocks? -- Gaal Yahas <[EMAIL PROTECTED]> http://gaal.livejournal.com/

Re: &say's return value

2005-07-30 Thread Gaal Yahas
to tag a sub as failable? Should there be one? -- Gaal Yahas <[EMAIL PROTECTED]> http://gaal.livejournal.com/

&say's return value

2005-07-30 Thread Gaal Yahas
when looking at the return value of a printed "0" or "" while not using "fatal", but the code can use a defined guard.) -- Gaal Yahas <[EMAIL PROTECTED]> http://gaal.livejournal.com/

Re: What do use and require evaluate to?

2005-07-12 Thread Gaal Yahas
ternals), ), URI.new("http://codeIZus.com/perl/randommodule.cgi";) => Module.new(name=> "Acme::emcA", ...), $an_open_file => ... ); @*INC = ("/usr/local/lib/perl6", U

Re: Time::Local

2005-07-05 Thread Gaal Yahas
rt of the language, _or_ localtime & gmtime should be in a library. Not my call, but I think we can add timelocal and timegm soon. They're mostly cleverly-caching facades to Time.new anyway, no? Drop by on #perl6 if you want to hack on the Prelude side of this. -- Gaal Yahas <[EMAIL PROTECTED]> http://gaal.livejournal.com/

Re: Time::Local

2005-07-05 Thread Gaal Yahas
st is okay? If so I'll submit a doc patch to S29. -- Gaal Yahas <[EMAIL PROTECTED]> http://gaal.livejournal.com/

Time::Local

2005-07-05 Thread Gaal Yahas
lti sub localtime(Int $sec, Int ?$pico = 0) returns Time::Local {...} The first form uses the second, but might be less precise. [1] http://haskell.org/ghc/docs/latest/html/libraries/base/System.Time.html#t%3ACalendarTime -- Gaal Yahas <[EMAIL PROTECTED]> http://gaal.livejournal.com/

caller with no sub scope

2005-06-17 Thread Gaal Yahas
quot; if caller().package ~~ Rival; ... } Anyone spot any problems? -- Gaal Yahas <[EMAIL PROTECTED]> http://gaal.livejournal.com/

Re: Ignoring parameters

2005-06-16 Thread Gaal Yahas
ct that I don't think this is the right way to > specify class methods... What do you think is the right way to specify them? -- Gaal Yahas <[EMAIL PROTECTED]> http://gaal.livejournal.com/

Re: sub my_zip (...?) {}

2005-06-16 Thread Gaal Yahas
it needs to be renamed maybe IPC could work. -- Gaal Yahas <[EMAIL PROTECTED]> http://gaal.livejournal.com/

Ignoring parameters

2005-06-16 Thread Gaal Yahas
for a "floor" as 1st arg method bereaucracy(Int undef, Int $office_number) { ... } I'm not sure how this works for named fields, but for positional ones it should do well, and is similar to ($a, undef, $c) = LIST syntax. -- Gaal Yahas <[EMAIL PROTECTED]> http://gaal.livejournal.com/

Re: caller and want

2005-06-12 Thread Gaal Yahas
;), as "the third sub". And unless I'm wrong, caller(Block, :skip<2>, :label) would mean, "once you get to the third Block, look on for one labeled "moose". So we don't have a way to skip three methods and then look for a labeled block, but if the user really wants that, let them grovel over a complete call chain themselves. -- Gaal Yahas <[EMAIL PROTECTED]> http://gaal.livejournal.com/

Re: Musing on registerable event handlers for some specific events

2005-06-08 Thread Gaal Yahas
be able to write Perl6 code with a certain flag that possibly limits my choice of modules/builtins, but which promises me identical behavior on all supported platforms? To take a notorious example, you mentioned fork() -- if this event manager becomes part of Perl6, does that mean we're re

caller and want

2005-06-08 Thread Gaal Yahas
at it -- the actual runtime parameters (if still available, and if this doesn't turn out too hard to implement)? S06's "want" is much simpler than A06's. Can it for now be considered complete? (I'm asking because A06 links "want" intimately to "caller" and that appears to no longer be the case.) -- Gaal Yahas <[EMAIL PROTECTED]> http://gaal.livejournal.com/

"returns" and context

2005-05-31 Thread Gaal Yahas
nt|List to express this kind of thing but that looks weird to me (how would you return a typed junction?). S06 and E06 don't raise this issue. -- Gaal Yahas <[EMAIL PROTECTED]> http://gaal.livejournal.com/

Re: Unicode Operators cheatsheet, please!

2005-05-27 Thread Gaal Yahas
Good idea. A modest start is at docs/quickref/unicode . -- Gaal Yahas <[EMAIL PROTECTED]> http://gaal.livejournal.com/

Re: Overriding/redefining p6 built-in functions

2005-05-08 Thread Gaal Yahas
ote, http://perlnomic.org/ . -- Gaal Yahas <[EMAIL PROTECTED]> http://gaal.livejournal.com/

Re: stdio

2005-05-05 Thread Gaal Yahas
On Thu, May 05, 2005 at 01:32:56AM -0600, Luke Palmer wrote: > On 5/5/05, Gaal Yahas <[EMAIL PROTECTED]> wrote: > > getopt(...); > > $fh = open $in, :allowstdio; > > Maybe the opposite: > > $fh = open $in, :literal; > > One of the nice things

Re: stdio

2005-05-05 Thread Gaal Yahas
e a few options. What does '"file"' do in these examples? If we take your trailing-args suggestion from the Open and pipe thread, the filename could be optional. How to make this "-"-friendly? If my earlier suggestion is okay, then by symmetry: $logfile = "-"; open $log, :a:allowstdio; -- Gaal Yahas <[EMAIL PROTECTED]> http://gaal.livejournal.com/

stdio

2005-05-04 Thread Gaal Yahas
How do I open a file named "-"? How do I open stdout (and the other standard handles)? -- Gaal Yahas <[EMAIL PROTECTED]> http://gaal.livejournal.com/

Re: Open and pipe

2005-05-04 Thread Gaal Yahas
solution suffices in a clean way: > > $h = open a pipe; > > Now, > $h.in; > $h.out; > $h.err; > > $h.print("foo"); # use $h.out > $l = $h.readline; # use $h.in Yes, if $h is the not-very-primitive version of IO. Surely the

Re: Open and pipe

2005-05-04 Thread Gaal Yahas
OUT variables (yech)). Should we provide further procedural interfaces for pipe2 and pipe3? [1] "Process handle" encapsulates unix pid / win32 process handle. -- Gaal Yahas <[EMAIL PROTECTED]> http://gaal.livejournal.com/

Signatures and option specs [was: Open and pipe]

2005-05-04 Thread Gaal Yahas
uld exclude :append) * computed options (if by "let Perl figure that out" $mode you didn't mean "let perl's open figure it out with explicit code). How would you suggest formalizing these? (By the way, we need a spec for perl's command line, too. So far we

Open and pipe

2005-05-02 Thread Gaal Yahas
was to honor a BOM if it is present but default to ASCII otherwise. Or should we UTF-8 otherwise? Or what's in the environment...? And what about IO layers? :) What else belongs here? dirhandles, sockets? How are they specced? I was looking for a happy medium between overdwim and underlying library primitives level. [1] Should this be "Perl(..5) style"? -- Gaal Yahas <[EMAIL PROTECTED]> http://gaal.livejournal.com/

Re: alarm() and later()

2005-04-20 Thread Gaal Yahas
Either require everything to be explicit with adverbs, or have the closure's return value determine whether to keep calling back or to quit. GLib does the latter, and there's a cleanliness in how the closure itself can control when to stop, but the former means you can schedule arbitrar

alarm() and later()

2005-04-18 Thread Gaal Yahas
return a reference to some object instead of an id?) If the alarm builtin is getting too overloaded, I propose the closure version be named "later". -- Gaal Yahas <[EMAIL PROTECTED]> http://gaal.livejournal.com/

Perl6 and Duff's Device

2005-03-20 Thread Gaal Yahas
~= (substr $from, $i++, 1); } while (--$n>0); return $to; } In Pugs at least, labels may only only be assigned to blocks. Any chance the language gets to have them in more arbitrary places? Would this in fact be enough to make this work? -- Gaal Y

Symbol table lookup and hash

2005-03-17 Thread Gaal Yahas
ot;) ?) If I do the analogous thing with the symbol table hash, (how) is the behavior any different? What can you express with ::() but not with the symtable hash? -- Gaal Yahas <[EMAIL PROTECTED]> http://gaal.livejournal.com/