Re: Sets vs Junctions

2005-02-22 Thread Jonathan Lang
Michele Dondi wrote: > OTOH all these discussions seem to imply that there is some demand (by > me, for one!) for a "set-like" builtin data-type as well as for the > already existing hashes and junctions and of course for > interoperability between any two of them, e.g. in terms of automatic > c

Re: Junctions, Sets, and Threading.

2005-02-22 Thread Rod Adams
Damian Conway wrote: Rod Adams wrote: This is my major point of the post. In my opinion, your example of: # Print a list of substrings... my $substring = substr("junctions", any(1..3), any(3..6)); say $substring.values(); Is a perfect example of a place where saying: # Print a list of s

Re: Parenthasized not in Perl 6 -> not()

2005-02-22 Thread Larry Wall
On Tue, Feb 22, 2005 at 10:21:00PM -0600, Steve Peters wrote: : A recent bug that showed up in Perl 5 caused a few people to wonder what : the purpose of C. It worked up to Perl 5.6 and returned the same : value as C. Starting with 5.6, it just core dumped. This has been : fixed it in the cur

Parenthasized not in Perl 6 -> not()

2005-02-22 Thread Steve Peters
A recent bug that showed up in Perl 5 caused a few people to wonder what the purpose of C. It worked up to Perl 5.6 and returned the same value as C. Starting with 5.6, it just core dumped. This has been fixed it in the current bleadperl to go back to its original functionality of behaving li

Perl 6 Summary for 2005-02-08 through 2005-02-22

2005-02-22 Thread Matt Fowles
Perl 6 Summary for 2005-02-08 through 2005-02-22 All~ Welcome to yet another fortnight summary. Lately p6l has been out stripping p6i in volume. While this used to be the norm, lately it has become a rare occurrence. Strange... Anyway, this summary would be brought to you buy c

Re: Junctions, Sets, and Threading.

2005-02-22 Thread Uri Guttman
> "DC" == Damian Conway <[EMAIL PROTECTED]> writes: DC> my %seen is shape(IO) of Bool; # %seen maps IO objects to boolean values DC> while get_next_input_stream() -> $in { DC> next if %seen{$in}; DC> $text ~= slurp $in; DC> %seen{$in} = 1; DC

Re: Junctions, Sets, and Threading.

2005-02-22 Thread Damian Conway
Rod Adams wrote: This is my major point of the post. In my opinion, your example of: # Print a list of substrings... my $substring = substr("junctions", any(1..3), any(3..6)); say $substring.values(); Is a perfect example of a place where saying: # Print a list of substrings... my @s

Re: Junctions, Sets, and Threading.

2005-02-22 Thread Damian Conway
Aldo Calpini wrote: Damian Conway wrote: >@s = 'item' _ [EMAIL PROTECTED]; That's: @s = 'item »_« @x; (just checking that my unerstanding is correct, don't want to be nitpicking :-) assuming that you meant to prepend the string "item" to each element of @x, isn't that: @s = 'i

Re: Octals

2005-02-22 Thread Mark J. Reed
On 2005-02-22 at 15:47:08, Larry Wall wrote: >Maybe \x is short for \0x and that also gives us \0o, \0d and \0b, >plus any other radix we come up with, assuming we decide it isn't >overly ambiguous with bare \0. Works for me. So when you really do want a \0 in the middle of a string f

Re: Octals

2005-02-22 Thread Larry Wall
On Tue, Feb 22, 2005 at 02:47:53PM -0500, Mark J. Reed wrote: : Incidentally, will \o, \x, and the hypothetical \d still work without : curlies for a certain number of digits but require curlies for larger : numbers? I'd rather see consistency there. Well, we switched to square brackets for those

Re: Octals

2005-02-22 Thread Mark J. Reed
On 2005-02-22 at 14:26:04, Juerd wrote: >I think \777 should be chr(777). As should \0d777, should you want to >document that it's really not octal. (Important mostly the first year >after the first release.) I don't think you can assume it'll only be confusing for a year. For one thi

Re: Octals

2005-02-22 Thread [EMAIL PROTECTED]
On Tue, 22 Feb 2005 11:37:21 -0800, "Larry Wall" <[EMAIL PROTECTED]> said: > or our great-grandchildren > will curse our lack of foresight. > > Larry It won't matter then anyway...Perl 25 code will come straight from our brainwaves: _ __...---'-`---...__ _===

Re: Octals

2005-02-22 Thread Juerd
Uri Guttman skribis 2005-02-22 14:41 (-0500): > in a regex \d is a digit, so that isn't a good idea In a rule, whitespace is a very good disambiguator. > it would be better to require \0d. I think nullbyte-d is rather likely to occur. > why would we need 0d123 as a literal? Symmetry. 0x10

Re: Octals

2005-02-22 Thread Uri Guttman
> "J" == Juerd <[EMAIL PROTECTED]> writes: J> And for symmetry, can we get 0d and \d for decimal, for those cases J> where you want to be explicit? in a regex \d is a digit, so that isn't a good idea. it would be better to require \0d. the others also need a base designator character so

Re: Octals

2005-02-22 Thread Larry Wall
On Tue, Feb 22, 2005 at 11:40:23AM -0700, Luke Palmer wrote: : Some time ago on perl6-documentation (when it existed) we decided that : octals would now be represented as 0o777 and, in strings, \o777. Should : 0777 and, in particular, \777 come with warnings? What, exactly, does : \777 mean in a

Re: Octals

2005-02-22 Thread Juerd
Luke Palmer skribis 2005-02-22 11:40 (-0700): > Some time ago on perl6-documentation (when it existed) we decided that > octals would now be represented as 0o777 and, in strings, \o777. Should > 0777 and, in particular, \777 come with warnings? What, exactly, does > \777 mean in a string? And fo

Re: Junctions, Sets, and Threading.

2005-02-22 Thread Rod Adams
Damian Conway wrote: Rod Adams wrote: > The purpose of a junction is to allow for performing several tests at a > given time, with the testing code needing no knowledge of that junctions > are present. While a junction can represent several values at the same > time, such notions as "hold" and "co

Octals

2005-02-22 Thread Luke Palmer
Some time ago on perl6-documentation (when it existed) we decided that octals would now be represented as 0o777 and, in strings, \o777. Should 0777 and, in particular, \777 come with warnings? What, exactly, does \777 mean in a string? Luke

Re: Junctions, Sets, and Threading.

2005-02-22 Thread Luke Palmer
Juerd writes: > Damian Conway skribis 2005-02-22 22:13 (+1100): > > >@x = func($a, [EMAIL PROTECTED]); > > That's: > > @x = ÂfuncÂ($a, @y); > > But, y'know, this one almost convinces me. Especially when you consider: > > sub func ($i, $j, $k) {...} > > @x = func($a, [EMAIL PROTEC

Re: Question about pairs

2005-02-22 Thread Larry Wall
On Tue, Feb 22, 2005 at 09:07:27PM +0800, Autrijus Tang wrote: : On Tue, Feb 22, 2005 at 12:20:35AM -0800, Larry Wall wrote: : > That seems right to me. Or at least right associative. :-) : > : > In any event, right associativity seems more useful in this case. : : Okay, implemented as such. :

Re: Sets vs Junctions

2005-02-22 Thread Michele Dondi
On Tue, 22 Feb 2005, Larry Wall wrote: On Mon, Feb 21, 2005 at 10:32:15PM -0800, Jonathan Lang wrote: : ...then you've got the notion of Fuzzy Logic Sets, where the key would be [snip] But using values for degree of membership is an interesting idea. On the other hand, if we ever have numeric datat

Re: Junctions, Sets, and Threading.

2005-02-22 Thread Aldo Calpini
Damian Conway wrote: >@s = 'item' _ [EMAIL PROTECTED]; That's: @s = 'item »_« @x; (just checking that my unerstanding is correct, don't want to be nitpicking :-) assuming that you meant to prepend the string "item" to each element of @x, isn't that: @s = 'item' »~« @x; ? furthe

Re: Question about pairs

2005-02-22 Thread Autrijus Tang
On Tue, Feb 22, 2005 at 12:20:35AM -0800, Larry Wall wrote: > That seems right to me. Or at least right associative. :-) > > In any event, right associativity seems more useful in this case. Okay, implemented as such. Of the "non-chaining binaries" in S06: => but does cmp <=> .. ^.. ..^ ^

Re: Slurpy nullary vs nonslurpy nullary

2005-02-22 Thread Autrijus Tang
On Tue, Feb 22, 2005 at 10:38:04PM +1100, Damian Conway wrote: > >So, even if the clash is Num vs Str context, we still run it > >under List context? Or is it their common ancestor, "Scalar"? > > Yes. When I said "indeterminate contexts" I meant List vs Scalar. After > all, the whole point of mu

Re: Slurpy nullary vs nonslurpy nullary

2005-02-22 Thread Damian Conway
Autrijus wrote: Personally, I think the only reasonable way of resolving this is to assume (as in the last paragraph above) that function calls in these kinds of indeterminate contexts are always in list context. So, even if the clash is Num vs Str context, we still run it under List context? Or i

Re: Junctions, Sets, and Threading.

2005-02-22 Thread Damian Conway
Juerd wrote: Naievely, I'd expect my @a = @b = 1..3; »foo«(@a, @b) to result in foo(@a[0], @b[0]), foo(@a[1], @b[1]), foo(@a[2], @b[2]); but foo([EMAIL PROTECTED], [EMAIL PROTECTED]) with the same arrays in foo(@a[0], @b[0]), foo(@a[0], @b[1]), foo(@a[0], @b[2]),

Re: Junctions, Sets, and Threading.

2005-02-22 Thread Juerd
Damian Conway skribis 2005-02-22 22:13 (+1100): > >@x = func($a, [EMAIL PROTECTED]); > That's: > @x = »func«($a, @y); > But, y'know, this one almost convinces me. Especially when you consider: > sub func ($i, $j, $k) {...} > @x = func($a, [EMAIL PROTECTED], @z); Naievely, I'd ex

Re: Junctions, Sets, and Threading.

2005-02-22 Thread Damian Conway
Rod Adams wrote: > The purpose of a junction is to allow for performing several tests at a > given time, with the testing code needing no knowledge of that junctions > are present. While a junction can represent several values at the same > time, such notions as "hold" and "contain" should be avoid

Re: Sets vs Junctions

2005-02-22 Thread Michele Dondi
On Mon, 21 Feb 2005, Jonathan Lang wrote: There are a couple of problems: first, a hash's keys are limited to strings; a set ought to be able to handle a wider range of data types. Well, if I had learnt something about Perl6 it is that it is no longer necessarily so. Michele -- It's also amazing

Junctions, Sets, and Threading.

2005-02-22 Thread Rod Adams
Definitions === set (n) : A data container that can hold many elements simultaneously. The order of elements in a set is meaningless. No two elements in a set may hold the same value. junction (n) : The combination of several independent values and an explicit boolean predicate, to form an

Re: Question about pairs

2005-02-22 Thread Larry Wall
On Mon, Feb 21, 2005 at 09:37:02PM -0600, Steve Peters wrote: : On Mon, Feb 21, 2005 at 11:32:16AM -0800, Larry Wall wrote: : > On Mon, Feb 21, 2005 at 02:07:10PM +, osfameron wrote: : > : >In Perl 6, C<< => >> is a fully-fledged anonymous object constructor -- : > : >like C<[...]> and

Re: Sets vs Junctions

2005-02-22 Thread Larry Wall
On Mon, Feb 21, 2005 at 10:32:15PM -0800, Jonathan Lang wrote: : ...then you've got the notion of Fuzzy Logic Sets, where the key would be : the prospective element and the value would be the degree of membership. : For fuzzy sets, hashes seem to be a better fit than junctions, which have : no obv

Re: Sets vs Junctions

2005-02-22 Thread Brent 'Dax' Royal-Gordon
Jonathan Lang <[EMAIL PROTECTED]> wrote: > There are a couple of problems: first, a hash's keys are limited to > strings; a set ought to be able to handle a wider range of data types. Last time I checked, there was going to be a way to declare a different data type for the key (which could easily