Re: What happened to "err" operator?

2008-09-07 Thread Dr.Ruud
"TSa (Thomas Sandlaß)" schreef: > Larry Wall: >> Another potential issue is that CATCH doesn't distinguish exceptions >> coming from the current block from those coming from the subcall to >> a(). So it could end up returning Failure from the current block when >> you intended to force return of F

Re: treatment of "isa" and inheritance

2008-05-02 Thread Dr.Ruud
TSa schreef: > Brandon S. Allbery: >> It occurs to me that this shouldn't be new keywords, but adverbs, >> i.e. ``is :strict Dog''. > > Great idea! And it leaves room for ':stricter' and ':strictest'. ;) -- Affijn, Ruud "Gewoon is een tijger."

Re: pluralization idea that keeps bugging me

2008-01-26 Thread Dr.Ruud
"Jonathan Lang" schreef: > I'm not fond of the 'ox\soxen' idea; but I could get behind something > like '\s' or 'ox\s'. "$n ox\s< en>" "$n\s cat\s< s > fight\s< s s>" ;) -- Affijn, Ruud "Gewoon is een tijger."

Re: Indirect objects, adverbial arguments and whitespace

2007-10-08 Thread Dr.Ruud
Markus Laker schreef: > If I've got this right: > > mangle $foo :a;# mangle($foo, a => 1); > mangle $foo: a;# $foo.mangle(a()); > > So these -- > > mangle $foo:a; > mangle $foo : a; > > are ambiguous and, as far as I can tell from the synopses, undefined. > So what's the rule: that ind

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

2007-03-29 Thread Dr.Ruud
[EMAIL PROTECTED] schreef: > -Attempting to access an index outside a array's defined range will > fail: > +Attempting to access an index outside an array's defined range > will fail: Idea for Perl6 test code: detecting (simple) typos in documentation. -- Affijn, Ruud "Gewoon is een tijger."

Re: [S09] "Whatever" indices and shaped arrays

2007-03-08 Thread Dr.Ruud
David Green schreef: > Jonathan Lang: >> (In fact, the semantics for "@x[*+n]" follows directly from the fact >> that an array returns the count of its elements in scalar context.) >> And "@x[*]" would be the same as "@x[0..^*]" or "@x[0..(*-1)]". > > That's an elegance in its favour. In Perl5 a

Re: Relief for rw/ro

2007-02-22 Thread Dr.Ruud
Steve Lukas schreef: > In between, I think 'variable' is too long, so: > $code =~ s/variable/vari/g; I don't think it is too long, since most of the times you don't need to mention it. Could 'rw' be an alias? my rw @heredoc_stubs is context = (); my @heredoc_stubs is rw context = (); my

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

2007-02-03 Thread Dr.Ruud
Larry Wall schreef: > Dr.Ruud wrote: >> I would expect >> >> %hash.exists{$key} > > Except $foo.bar{$key} is interpreted as $foo.bar().{$key}. Things > like "exists" and "delete" need to evaluate the key before calling > the meth

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

2007-02-02 Thread Dr.Ruud
[EMAIL PROTECTED] schreef: > Just glad someone's reading these things... Of course we are. But it is hard to react when the syntax isn't in your muscle memory yet. >From r13565: > +%hash.:exists{$key} I would expect %hash.exists{$key} with the shortcut %hash.:{$key} to test (at ru

Re: Map on a multislice

2007-01-26 Thread Dr.Ruud
Joe Gottman schreef: > When you call map on a multislice, does it do deep or shallow > iteration? And with deep, there is the choice: depth first or not. -- Affijn, Ruud "Gewoon is een tijger."

Re: Numeric Semantics

2006-12-31 Thread Dr.Ruud
"Luke Palmer" schreef: > When do we do integer/rational math and when do we do floating point > math? > > That is, is 1 different from 1.0? Should 10**500 be infinity or a 1 > with 500 zeroes after it? Should 10**10**6 run out of memory? Should > "say (1/3)**500" print a bunch of digits to the

Re: Set-returning .keys

2006-11-28 Thread Dr.Ruud
Smylers schreef: > Ruud H.G. van Tol: >> Darren Duncan: >>> TSa: set operations ... make them Bag operations to start with. >>> >>> I agree with ... making Set the main type and making Bag an >>> extension built upon that, as complex is built upon num, etc. >> >> I don't think that will work

Re: named sub-expressions, n-ary functions, things and stuff

2006-11-14 Thread Dr.Ruud
Smylers schreef: > my $whatever > = do { my $baz = $bar * 17; my $quux = $baz - 3; $baz / $quux }; ($bar better not be 3/17) Just a rewrite: my $whatever = do { my $quux = (my $baz = $bar * 17) - 3; $baz / $quux }; And maybe even something like: my $whatever = do

Re: class interface of roles

2006-10-19 Thread Dr.Ruud
"Jonathan Lang" schreef: > role R does A does B does C { ... } # unordered composition > $x does A does B does C; # ordered composition > $y does A | B | C; # unordered composition > > I'd like to see it done something like: > > role R does A does B does C { ... } # unordered com

Re: S5: substitutions

2006-10-08 Thread Dr.Ruud
Smylers schreef: > in > this particular case the particular behaviour involves _executing as > Perl code something which the programmer never intended to be code in > the first place_. That's crazily dangerous. I wouldn't mind eval() to be off by default, so to have to put a "use eval" in every

[OT] Unicode fonts (was: Re: Hash composers and code blocks)

2006-10-06 Thread Dr.Ruud
Mark J. Reed: > Aaron Sherman: >> Proposal: A sigil followed by [...] is always a composer for that type. >> >> %[...] - Hash. Unicode: ?...? >> @[...] - Array. Unicode: [...] >> ? - Seq. Unicode: ?...? >> &[...] - Code. Unicode: ?...? >> |[...] -

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

2006-09-12 Thread Dr.Ruud
Larry Wall schreef: > Dr.Ruud: >> larry: >>> +Likewise, from the fact that list context flattens inner arrays and >>> +lists, it follows that a reduced assignment does no special >>> syntactic +dwimmery, and hence only scalar assigments are >>> suppo

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

2006-09-12 Thread Dr.Ruud
larry schreef: > +Likewise, from the fact that list context flattens inner arrays and > +lists, it follows that a reduced assignment does no special syntactic > +dwimmery, and hence only scalar assigments are supported. Therefore > + > +[=] $x, @y, $z, 0 > +[+=] $x, @y, $z, 1 > + > +are e

Re: Nested statement modifiers.

2006-09-02 Thread Dr.Ruud
Paul Seamons schreef: > In the samples you gave I had to read the entire line to see > what the outcome of the code is. I was not addressing reading skills, but just your "you'd either have ... or ...". One always needs to read the full line, but one doesn't have to do that linearly or just from

Re: Nested statement modifiers.

2006-09-01 Thread Dr.Ruud
Paul Seamons schreef: > The following is one more interesting case. > > say "Ok then" if $yes and $true unless $no or $false; > > Without nested modifiers you'd have either: > > say "Ok then" if $yes and $true and ! $no and ! $false; > > or > > say "OK then" unless ! $yes or ! $true or $no $or $fa

Re: Implicit current-index variable, scoped inside for-loops

2006-08-30 Thread Dr.Ruud
Damian Conway schreef: > [for @array -> $index, $value {...}] > > No. There's no such magic. I simply screwed up. I should have written: > for @array.kv -> $index, $value {...} > :-( Ah, much clearer now. -- Affijn, Ruud "Gewoon is een tijger."

Re: Implicit current-index variable, scoped inside for-loops

2006-08-29 Thread Dr.Ruud
"Damian Conway" schreef: > Ruud: >> Damian: >>> Carl: But it can hardly be blamed for clarity. >>> >>> That's a little unfair. >> >> "can hardly be blamed" -> "can easily be praised" > > Apologies to Carl if I misinterpreted. I read it as: > "can hardly be blamed for (having) clarity" >

Re: Implicit current-index variable, scoped inside for-loops

2006-08-29 Thread Dr.Ruud
Damian Conway schreef: > [attribution repaired] Carl: >> But it can hardly be blamed for clarity. > > That's a little unfair. "can hardly be blamed" -> "can easily be praised" -- Affijn, Ruud "Gewoon is een tijger."

Re: Implicit current-index variable, scoped inside for-loops

2006-08-29 Thread Dr.Ruud
Carl Mäsak schreef: > I suppose doing a map or a grep over @array.kv is possible: > > pugs> my @array = > ("london", "bridge", "is", "falling", "down") > > pugs> map { "Element $^a is called $^b" }: @array.kv; > ("Element 0 is called london", > "Element 1 is called bridge", > "Element 2 is call

Re: Implicit current-index variable, scoped inside for-loops

2006-08-29 Thread Dr.Ruud
"Carl Mäsak" schreef: > Ruud: >> Carl: >>> But maybe a variable that implicitly carries along the loop index >>> would be even snazzier? >>> >>> for @array -> $val { >>> say "$.\t$val"; >>> } >> >> Or give the block a name (label), and have an index (or several >> indexes, like some that are res

Re: multi-line comments, C macros, & Pod abuse

2006-08-19 Thread Dr.Ruud
"Stuart Cook" schreef: > Larry Wall: >> if 0 { >> ... >> } > > The one disadvantage of that approach is that it will break if the > "commented-out" code temporarily fails to compile. How frequent does that happen? And in that case s/if 0/\#/, as Luke mentioned. And if the compile fai

Re: === and array-refs

2006-08-16 Thread Dr.Ruud
Larry Wall schreef: > Dr.Ruud: >> Comparing strings in Perl5, using NFKD: >> >> perl5 -MUnicode::Normalize -we ' >> ($\, $,) = ("\n", "\t") ; >> $x = qq{Henry IV} ; >> $y = qq{Henry \x{2163}} ; >> print qq{<$

Re: === and array-refs

2006-08-16 Thread Dr.Ruud
"Markus Laire" schreef: > Dr.Ruud: >> Markus Laire: >>> my $x = 'Just Another'; >>> my $y := $x; >>> $y = 'Perl Hacker'; >>> >>> After this, both $x and $y contain the string "Perl Hacker"

Re: === and array-refs

2006-08-16 Thread Dr.Ruud
"Markus Laire" schreef: > my $x = 'Just Another'; > my $y := $x; > $y = 'Perl Hacker'; > > After this, both $x and $y contain the string "Perl Hacker", since > they are really just two different names for the same variable. > So "$x === Sy" stil holds. -- Affijn, Ruud "Gewoon is e

Re: ===, =:=, ~~, eq and == revisited (blame ajs!) -- Explained

2006-08-15 Thread Dr.Ruud
David Green schreef: > === > ...is equality-of-contents, basically meaning that the things you're > comparing contain the same [...] values. How about strings; are normalized copies used with the === ? http://www.unicode.org/faq/normalization.html http://www.unicode.org/notes/tn5/ -- Affijn, R

just laugh your heart out

2006-07-19 Thread Dr.Ruud
As sometimes Perl6 to Perl5 is explained as C++ to C: Newsgroups: rec.arts.humor Subject: The truth about 'C++' revealed Date: Tuesday, December 31, 2002 5:20 AM On the 1st of January, 1998, Bjarne Stroustrup gave an interview to the IEEE's 'Computer' magazine. Naturally, the editors thought he

Re: ===, =:=, ~~, eq and == revisited (blame ajs!) -- Explained

2006-07-14 Thread Dr.Ruud
Darren Duncan schreef: > Dr.Ruud: >>>say "foo" if $x !== $y; >>> into >>>say "foo" unless $x === $y; >> >> And how about symmetry: >>say "foo" unless $y === $x; > > Any equality or inequality ope

Re: Run time dispatch on ~~

2006-07-14 Thread Dr.Ruud
Larry Wall schreef: > Dr.Ruud: >> Aaron Sherman: >>> $_ ~~ $x >> >> Can that be written as ".~~ $x"? > > No, but you might just possibly get away with writing: > > .infix:<~~>($x) > > assuming that the $_.foo($x) SMD eventually

Re: ===, =:=, ~~, eq and == revisited (blame ajs!) -- Explained

2006-07-14 Thread Dr.Ruud
"Mark A. Biggar" schreef: > Darren Duncan: >> Now, I didn't see them yet anywhere in Synopsis 3, but I strongly >> recommend having negated versions of all these various types of >> equality tests. Eg, !== for ===, nev for eqv, etc. They would be >> used very frequently, I believe (and I have ev

Re: Run time dispatch on ~~

2006-07-14 Thread Dr.Ruud
Aaron Sherman schreef: > given $_ { >when $x {...} > } > > or > > $_ ~~ $x Can that be written as ".~~ $x"? -- Affijn, Ruud "Gewoon is een tijger."

Re: "normalized" hash-keys

2006-05-09 Thread Dr.Ruud
Larry Wall schreef: > Dr.Ruud: >> What would be the way to define-or-set that a specific hash has >> non-case-sensitive keys? > > Use a shaped hash with a key type that defines infix:<===> > appropriately, since object hashes are based on infix:<===> rather >

"normalized" hash-keys

2006-05-08 Thread Dr.Ruud
What would be the way to define-or-set that a specific hash has non-case-sensitive keys? Or broader: that the keys should be normalized (think NFKC()) before usage? Would it be easy to "delegate it to the hash"? (or use a hardly noticeable wrapper) -- Affijn, Ruud "Gewoon is een tijger."

S11 - s/beings/begins/

2006-05-05 Thread Dr.Ruud
S11, near the end: s/beings/begins/ :) -- Affijn, Ruud "Gewoon is een tijger."

[S05] /ee

2006-05-05 Thread Dr.Ruud
Instead of /ee say: s/pattern/{ eval doit() }/ s/eval/try/ ? -- Affijn, Ruud "Gewoon is een tijger."

Re: A shorter long dot

2006-05-01 Thread Dr.Ruud
"Jonathan Lang" schreef: > When is the last time that you saw an underscore-only method name? sub _{print"$_\n"}; -- Affijn, Ruud "Gewoon is een tijger."

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

2006-04-17 Thread Dr.Ruud
[EMAIL PROTECTED] schreef: > Author: autrijus > Date: Sun Apr 16 18:24:04 2006 > New Revision: 8724 > > Modified: >doc/trunk/design/syn/S06.pod >doc/trunk/design/syn/S09.pod > > Log: > * more typo cleanups promted by Dr. Ruud. I love tradition: s/mt/mpt ;) > -The unary prefix operator C<

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

2006-04-16 Thread Dr.Ruud
[EMAIL PROTECTED] schreef: > +The unary prefix operator C<*> casts a value to an C s/\ban\b/a > @@ -1340,7 +1340,7 @@ > PairTuple of two elements that serves as an one-element idem > +my $ref = [EMAIL PROTECTED]; # $ref is an Capture object - see S02 idem -- Affijn

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

2006-04-06 Thread Dr.Ruud
"Ruud H.G. van Tol" schreef: > Juerd: >> autrijus: >>> -&foo.($arg1, $arg2); >>> +&foo. ($arg1, $arg2); >> [...] >> Please reconsider. > > Yes, please come up with a different character to > bridge/cross/hide/cloak/skip/zap the succeeding "not allowed" > whitespace. > > Maybe the "\"

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

2006-04-02 Thread Dr.Ruud
Uri Guttman schreef: > you might as well attribute the s:g/Into/into/ to dr. ruud. Right, s:g/I/i/ is all that remained. I really was amazed by your new capitalization style. :) -- Affijn, Ruud "Gewoon is een tijger." (posted via news://nntp.perl.org again)

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

2006-04-02 Thread Dr.Ruud
Larry Wall schreef: > Ruud H.G. van Tol: >> Uri Guttman: >>> When cast into an array, you can access all the positional >>> arguments; Into a hash, all named arguments; Into a scalar, the >>> invocant; Into code, into slurpy nameless block. >> >> The last 'into' should be 'the'. And it has becom

Re: relational data models and Perl 6

2005-12-15 Thread Dr.Ruud
Ruud H.G. van Tol schreef: > [RD-interface] See also these Haskell Hierarchical Libraries (base package) http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Set.html http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Map.html -- Affijn, Ruud "Gewoon is een tijger."

Re: type sigils redux, and new unary ^ operator

2005-11-26 Thread Dr.Ruud
TSa: > Perhaps we > can live with the numerically lower end always beeing part > of the range, the larger one never, I don't think so. >0 .. 5 == ( 0, 1, 2, 3, 4) { action } for 0 .. 5 is supposed to run for 0,1,2,3,4,5. But '0 .. ^5' should not mean '( 0, 1, 2, 3, 4, 5)' just becaus

Re: type sigils redux, and new unary ^ operator

2005-11-24 Thread Dr.Ruud
Juerd: > Rob Kinyon: >> What about @array.indices instead? > > Oops, I said "indexes" in a former message. AFAIK they share most of their meanings nowadays. (My old Chambers says that indexes are books.) > Maybe a good candidate for an alias? No doubt about it. -- Affijn, Ruud "Gewoon is ee