Re: Translitteration and combining strings and array references

2005-10-19 Thread TSa
HaloO, Luke Palmer wrote: It looks nicer if you use the indirect object form: trans string: [ h e = 0, ]; Given the right interpretation this just looks like a typed label selection in a multi method. multi trans { Str $x: ...; return; Int $x: ...; return;

Re: Translitteration and combining strings and array references

2005-10-19 Thread TSa
HaloO, Juerd wrote: Luke Palmer skribis 2005-10-18 11:57 (-0600): It looks nicer if you use the indirect object form: trans string: [ h e = 0, ]; It'd also look very nice with optional parens: string.trans [ h e = 0 ]; Or is it not yet time to resuggest that? :) I like

Re: Translitteration and combining strings and array references

2005-10-19 Thread Larry Wall
On Wed, Oct 19, 2005 at 03:02:14PM +0200, TSa wrote: : HaloO, : : Juerd wrote: : Luke Palmer skribis 2005-10-18 11:57 (-0600): : : It looks nicer if you use the indirect object form: :trans string: [ :h e = 0, :]; : : : It'd also look very nice with optional parens: : :

Re: Translitteration and combining strings and array references

2005-10-18 Thread Peter Makholm
[EMAIL PROTECTED] (Eric) writes: On Fri, 14 Oct 2005 08:38:55 +0200, Peter Makholm [EMAIL PROTECTED] wrote: Yesterday I spend some hours getting pugs to understand translitterations with multiple ranges in each pair. E.g. Actually its been fixed already. Of course i think the whole thing

Re: Translitteration and combining strings and array references

2005-10-18 Thread Eric
I have a suggestion/proposal/whatever. I am just starting to get a grasp of uses for pairs and where they are handy. Working on string.trans some showed that it would be useful to have the function accept a list of pairs. That was working until the fix for magical pairs went through and now the

Re: Translitteration and combining strings and array references

2005-10-18 Thread Luke Palmer
On 10/18/05, Eric [EMAIL PROTECTED] wrote: Currently we (can|will be able to) do string.trans( (['h','e'] = 0) ); string.trans( == ['h','e'] = 0); Those are fine and i can live with that, but it seems that if we made the signature of trans method trans(Str $self: [EMAIL PROTECTED]) {};

Re: Translitteration and combining strings and array references

2005-10-18 Thread Eric
On 10/18/05, Luke Palmer [EMAIL PROTECTED] wrote: Uh, no. Certainly not for a method. For a bare sub that has been predeclared it may be possible. But we don't want to remagicalize pairs after we just argued the heck out of it to make pairs *always* be named parameters. My thought was that

Re: Translitteration and combining strings and array references

2005-10-16 Thread David Formosa \(aka ? the Platypus\)
On Fri, 14 Oct 2005 08:38:55 +0200, Peter Makholm [EMAIL PROTECTED] wrote: Yesterday I spend some hours getting pugs to understand translitterations with multiple ranges in each pair. E.g. foobar.trans( a-z = n-za-n ); By accident I tested something like: foobar.trans( ['a' .. 'z']

Re: Translitteration and combining strings and array references

2005-10-15 Thread Peter Makholm
[EMAIL PROTECTED] (Larry Wall) writes: : my %transtable; : for %intable.kv - $k, $v { : # $k is stringified by the = operator. Interesting comment. I wonder if it's true. That was my attempt to explain the observations I did. Clearly I put the blame the wrong

Re: Translitteration and combining strings and array references

2005-10-15 Thread Nicholas Clark
On Fri, Oct 14, 2005 at 05:17:48PM -0700, Larry Wall wrote: form of tr/// should always use lists, with a helper function to translate a..z to a list and also carp about the fact that it will break under Unicode. :-) And EBCDIC. The dinosaurs are not extinct yet. I guess that they are

Translitteration and combining strings and array references

2005-10-14 Thread Peter Makholm
Yesterday I spend some hours getting pugs to understand translitterations with multiple ranges in each pair. E.g. foobar.trans( a-z = n-za-n ); By accident I tested something like: foobar.trans( ['a' .. 'z'] = n-za-m ); and it didn't work. The problem is that ['a' .. 'z'] gets

Re: Translitteration and combining strings and array references

2005-10-14 Thread Larry Wall
On Fri, Oct 14, 2005 at 08:38:55AM +0200, Peter Makholm wrote: : Yesterday I spend some hours getting pugs to understand : translitterations with multiple ranges in each pair. E.g. : : foobar.trans( a-z = n-za-n ); : : By accident I tested something like: : : foobar.trans( ['a' .. 'z'] =

Re: Translitteration and combining strings and array references

2005-10-14 Thread Peter Makholm
[EMAIL PROTECTED] (Larry Wall) writes: On Fri, Oct 14, 2005 at 08:38:55AM +0200, Peter Makholm wrote: : Yesterday I spend some hours getting pugs to understand : translitterations with multiple ranges in each pair. E.g. : : foobar.trans( a-z = n-za-n ); : : By accident I tested

Re: Translitteration and combining strings and array references

2005-10-14 Thread Juerd
Larry Wall skribis 2005-10-14 10:43 (-0700): Actually, it looks like the bug is probably that = is forcing stringification on its left argument too agressively. It should only do that for an identifier. Would it work to call this process autoquoting, instead of stringification? I'm assuming

Re: Translitteration and combining strings and array references

2005-10-14 Thread Larry Wall
On Fri, Oct 14, 2005 at 08:49:50PM +0200, Peter Makholm wrote: : The code I'm lookin at is in pugs/src/perl6/Prelude.pm around line 380: : : method trans (Str $self: *%intable) is primitive is safe { : : my sub expand (Str $string is copy) { : ... : } : :

Re: Translitteration and combining strings and array references

2005-10-14 Thread Larry Wall
On Sat, Oct 15, 2005 at 01:27:58AM +0200, Juerd wrote: : Larry Wall skribis 2005-10-14 10:43 (-0700): : Actually, it looks like the bug is probably that = is forcing : stringification on its left argument too agressively. It should only : do that for an identifier. : : Would it work to call