Re: undef.chars?

2005-08-04 Thread Brent 'Dax' Royal-Gordon
Luke Palmer <[EMAIL PROTECTED]> wrote: > On 8/4/05, Ingo Blechschmidt <[EMAIL PROTECTED]> wrote: > > my $undef = undef; > > say $undef.chars? # 0? undef? die? > > say chars $undef; # 0? undef? die? > > > > I'd opt for "undef.chars" to be an error ("no such method") and "chars > > un

Data constructors / Unidirectional unification

2005-08-04 Thread Luke Palmer
I'm writing a new module that optimizes sets of conditions into decision trees. Initially I allowed the user to specify conditions as strings, and if that condition began with a "!", it would be the inverse of the condition without the "!". But then I thought, "the user will more than likely have

Re: $pair[0]?

2005-08-04 Thread Ingo Blechschmidt
Hi, Luke Palmer wrote: > On 8/4/05, Ingo Blechschmidt <[EMAIL PROTECTED]> wrote: >> my $pair = (a => 1); >> say $pair[0]; # a? >> say $pair[1]; # 1? >> >> I've found this in the Pugs testsuite -- is it legal? > > Nope. That's: > > say $pair.key; > say $pair.value; > > Al

Re: undef.chars?

2005-08-04 Thread Luke Palmer
On 8/4/05, Ingo Blechschmidt <[EMAIL PROTECTED]> wrote: > Hi, > > (found in the Pugs testsuite.) > > my $undef = undef; > say $undef.chars? # 0? undef? die? > say chars $undef; # 0? undef? die? > > I'd opt for "undef.chars" to be an error ("no such method") and "chars > undef" to

Re: Reading a large data structure

2005-08-04 Thread Leopold Toetsch
On Aug 4, 2005, at 22:20, Leopold Toetsch wrote: On Aug 4, 2005, at 14:59, Amir Karger wrote: Is there a way to declare an array of, say, 300 strings in PIR other than Read the array entries from a text file? The more, that it looks like that you are dealing with the string abbreviat

Re: $pair[0]?

2005-08-04 Thread Luke Palmer
On 8/4/05, Ingo Blechschmidt <[EMAIL PROTECTED]> wrote: > Hi, > > my $pair = (a => 1); > say $pair[0]; # a? > say $pair[1]; # 1? > > I've found this in the Pugs testsuite -- is it legal? Nope. That's: say $pair.key; say $pair.value; Also: say $pair; # 1 say $pa

Re: $pair[0]?

2005-08-04 Thread Ingo Blechschmidt
Hi, Andrew Shitov wrote: >> say $pair[0]; # a? > > It looks like $pair is an arrayref while 'say ref $pair' tells 'Pair'. right, this is why I asked, IMHO it's bogus. > And may I ask a relating question: > > my $pair = ('name' => 'age'); > say $pair{'name'}; # prints 'age' > say $pair['na

undef.chars?

2005-08-04 Thread Ingo Blechschmidt
Hi, (found in the Pugs testsuite.) my $undef = undef; say $undef.chars? # 0? undef? die? say chars $undef; # 0? undef? die? I'd opt for "undef.chars" to be an error ("no such method") and "chars undef" to return 0 (with a warning printed to STDERR^W$*ERR). Opinions? --Ingo --

Re: $pair[0]?

2005-08-04 Thread Andrew Shitov
> say $pair[0]; # a? It looks like $pair is an arrayref while 'say ref $pair' tells 'Pair'. And may I ask a relating question: my $pair = ('name' => 'age'); say $pair{'name'}; # prints 'age' say $pair['name']; # why prints 'name'? <== question say $pair['age']; # prints 'name' --

$pair[0]?

2005-08-04 Thread Ingo Blechschmidt
Hi, my $pair = (a => 1); say $pair[0]; # a? say $pair[1]; # 1? I've found this in the Pugs testsuite -- is it legal? --Ingo -- Linux, the choice of a GNU | Black holes result when God divides the generation on a dual AMD | universe by zero. Athlon!|

Re: Reading a large data structure

2005-08-04 Thread Leopold Toetsch
On Aug 4, 2005, at 14:59, Amir Karger wrote: Is there a way to declare an array of, say, 300 strings in PIR other than arr = 300 arr[0] = "hi" arr[1] = "there" arr[2] = "my" ... arr[298] = "very" arr[299] = "tired" Read the array entries from a text file? -Amir leo

Re: Reading a large data structure

2005-08-04 Thread Bernhard Schmalhofer
Amir Karger schrieb: Is there a way to declare an array of, say, 300 strings in PIR other than arr = 300 arr[0] = "hi" arr[1] = "there" arr[2] = "my" ... arr[298] = "very" arr[299] = "tired" Same question with a hash of hashes or whatever. Assigning an integer to the array should do the t

Re: What's needed for a new languages/t/*?

2005-08-04 Thread Bernhard Schmalhofer
Amir Karger schrieb: I have a test script that runs 85 tests (and will run many more once I write more opcodes. Luckily, I developed it already when I was doing plotz). I could easily modify it to output "ok n" and "not ok" with a comment about what went wrong. However, because it's a big Z-cod

Re: [perl #36812] Compiling Pugs against Parrot

2005-08-04 Thread Leopold Toetsch
On Aug 4, 2005, at 16:17, Lambeck (via RT) wrote: # New Ticket Created by Lambeck # Please include the string: [perl #36812] # in the subject line of all future correspondence about this issue. # https://rt.perl.org/rt3/Ticket/Display.html?id=36812 > For the last 2 hours I tried to compile

Re: What's needed for a new languages/t/*?

2005-08-04 Thread Will Coleda
Excellent questions. Perhaps I can whip up a languages.pod once 0.2.3 is out the door, based on partcl and the current state of a few other languages out there. Right now, the "unified language testing harness", such as it is, would rather you had a script called "harness" that took a --fil

Re: zip with ()

2005-08-04 Thread Larry Wall
On Mon, Aug 01, 2005 at 01:13:52PM +0200, "TSa (Thomas Sandlaß)" wrote: : BTW, you didn't mean originally: : : say zip (@odd), (@even); # prints 13572468 or 12345678? That doesn't work, since () in list context does not enforce scalar context. It's exactly equivalent to say zip @odd, @even

Reading a large data structure

2005-08-04 Thread Amir Karger
Is there a way to declare an array of, say, 300 strings in PIR other than arr = 300 arr[0] = "hi" arr[1] = "there" arr[2] = "my" ... arr[298] = "very" arr[299] = "tired" Same question with a hash of hashes or whatever. -Amir

Re: Whitespace

2005-08-04 Thread Andrew Shitov
print (1+2)*3; can print 9, instead of 3. I'd prefer always have '3' (as a result of sum 1 + 2) here. A C-programmer would tread this like (print (1 + 2) * 3); # prints int, then returns void print (or do)? And is print .(1+2)*3 allowed? in fact, that is exactly (print.g

[perl #36812] Compiling Pugs against Parrot

2005-08-04 Thread via RT
# New Ticket Created by Lambeck # Please include the string: [perl #36812] # in the subject line of all future correspondence about this issue. # https://rt.perl.org/rt3/Ticket/Display.html?id=36812 > For the last 2 hours I tried to compile Pugs-2.6.9 against Parrot-0.2.2. It does not work be

Re: Whitespace (Was: [RELEASE] Pugs 6.2.9 released!)

2005-08-04 Thread H.Merijn Brand
On Thu, 4 Aug 2005 20:21:18 +0800, Autrijus Tang <[EMAIL PROTECTED]> wrote: > On Thu, Aug 04, 2005 at 10:55:12AM +0400, Andrew Shitov wrote: > > why do we have to give up a space when calling functions under Pugs? > > > > A need to type open('file.txt') instead of open ('file.txt') makes > > me p

What's needed for a new languages/t/*?

2005-08-04 Thread Amir Karger
I'm about to commit an updated version of leo's Z-code-to-PIR translator. I'm wondering what I should do about t. I have a test script that runs 85 tests (and will run many more once I write more opcodes. Luckily, I developed it already when I was doing plotz). I could easily modify it to output "

TSa's Perl 6 type lattice version 1.0

2005-08-04 Thread TSa (Thomas Sandlaß)
HaloO, in case someone might be interested, here is my more or less complete idea of the Perl 6 type lattice as ASCII art. Enjoy. Comments welcome. ::Any ...| ... ___:___/|\__

Re: [perl #36808] [PATCH] python_group broken on Win32

2005-08-04 Thread Jonathan Worthington
"François PERRAD (via RT)" <[EMAIL PROTECTED]> wrote: This patch solves the following link problem : pystring.o(.text+0x15a): In function `Parrot_PyString_get_repr': trunk/dynclasses/pystring.pmc:307: undefined reference to `Parrot_binary_charset_ptr' collect2: ld returned 1 exit status partia

PXPerl 5.8.7-4 released with Windows binaries of Pugs 6.2.9

2005-08-04 Thread Grégoire Péan
Hello, This time, I made as swift as possible :) Windows users, save time compiling Pugs 6.2.9 and Parrot 0.2.2, download PXPerl today! http://pixigreg.com/?pxperl See you soon, Grégoire -- www.pixigreg.com [EMAIL PROTECTED]

Re: Whitespace (Was: [RELEASE] Pugs 6.2.9 released!)

2005-08-04 Thread Carl Franks
I've just realised I quoted the wrong doc earlier, I meant to link to: http://dev.perl.org/perl6/doc/design/syn/S12.html#Methods .doit ()# ILLEGAL (two terms in a row) .doit .() # okay, no arguments, same as .doit() I had wrongly thought this also applied to subroutine calls, and th

Re: Whitespace (Was: [RELEASE] Pugs 6.2.9 released!)

2005-08-04 Thread Brano Tichý
Thus spake Autrijus: This is so: print (1+2)*3; can print 9, instead of 3. Just a newbie question: what would print (1+2)x3; print (or do)? And is print .(1+2)*3 allowed? brano tichý

Re: Whitespace (Was: [RELEASE] Pugs 6.2.9 released!)

2005-08-04 Thread Autrijus Tang
On Thu, Aug 04, 2005 at 10:55:12AM +0400, Andrew Shitov wrote: > why do we have to give up a space when calling functions under Pugs? > > A need to type open('file.txt') instead of open ('file.txt') makes > me perplexing (not perl-flexing ;-) Our recent discussions in 'zip with()' > gave no answer

Re: Do slurpy parameters auto-flatten arrays?

2005-08-04 Thread TSa (Thomas Sandlaß)
HaloO, Piers Cawley wrote: By the way, if flattening that way, what's the prototype for zip? We can after all do: zip @ary1, @ary2, @ary3, ... @aryn How about sub zip( List [EMAIL PROTECTED] ) {...} a slurpy List of Array of List. The return value is a not yet iterated Code object tha

Re: Re[2]: Whitespace (Was: [RELEASE] Pugs 6.2.9 released!)

2005-08-04 Thread Carl Franks
> > why do we have to give up a space when calling functions under Pugs? > > >> Not sure whether it's enough of an answer, but see: > >> http://dev.perl.org/perl6/doc/design/syn/S04.html#Statement_parsing > > it says: > > if $term ($x) # syntax error (two terms in a row) > > if this ca

Re[2]: Whitespace (Was: [RELEASE] Pugs 6.2.9 released!)

2005-08-04 Thread Andrew Shitov
> why do we have to give up a space when calling functions under Pugs? >> Not sure whether it's enough of an answer, but see: >> http://dev.perl.org/perl6/doc/design/syn/S04.html#Statement_parsing it says: if $term ($x) # syntax error (two terms in a row) if this cause an error, why not

Re: zip with ()

2005-08-04 Thread TSa (Thomas Sandlaß)
HaloO, Luke Palmer wrote: On 8/1/05, Ingo Blechschmidt <[EMAIL PROTECTED]> wrote: In general, (@foo, @bar) returns a new list with the element joined, i.e. "@foo.concat(@bar)". If you want to create a list with two sublists, you've to use ([EMAIL PROTECTED], [EMAIL PROTECTED]) or ([EMAIL PROTE

Re: [perl #36794] [BUG] substr opcode segfault

2005-08-04 Thread Leopold Toetsch
Will Coleda (via RT) wrote: causes a segfault in the substr opcode (from tcl's lib/tclconst.pir), and forces a few tcl-unicode escape tests into TODOs. A short PIR test that is equivalent: .sub main @MAIN $S0 = "\\u666" $I0 = 0x666 $S1 = chr $I0 # works, but substr doesn't l

Re: If topicalization

2005-08-04 Thread Stuart Cook
On 8/4/05, Luke Palmer <[EMAIL PROTECTED]> wrote: > How can that possibly work? If a bare closure { } is equivalent to -> > ?$_ is rw { }, then the normal: > > if foo() {...} > > Turns into: > > if foo() -> ?$_ is rw { } > > And every if topicalizes! I'm sure we don't want that. > > L

Re: [perl #36778] [PATCH] gdbmhash with MinGW32

2005-08-04 Thread François PERRAD
At 09:52 03/08/2005 -0700, you wrote: > [EMAIL PROTECTED] - Mi 03. Aug 2005, 00:40:59]: > > With this small patch, gdbmhash works on MinGW. > Thanks, the patch is applied, and thinks look OK under Linux as well. Do you have an explaination why config/auto/gdbm.pl seems to see a gdbm library. I

Re: Whitespace (Was: [RELEASE] Pugs 6.2.9 released!)

2005-08-04 Thread Carl Franks
> why do we have to give up a space when calling functions under Pugs? > > A need to type open('file.txt') instead of open ('file.txt') makes > me perplexing (not perl-flexing ;-) Our recent discussions in 'zip with()' > gave no answer. Not sure whether it's enough of an answer, but see: http://d

Re: Do slurpy parameters auto-flatten arrays?

2005-08-04 Thread TSa (Thomas Sandlaß)
HaloO, Luke Palmer wrote: On 8/3/05, Aankhen <[EMAIL PROTECTED]> wrote: On 8/3/05, Piers Cawley <[EMAIL PROTECTED]> wrote: So how *do* I pass an unflattened array to a function with a slurpy parameter? Good question. I would have thought that one of the major gains from turning arrays and

[perl #36808] [PATCH] python_group broken on Win32

2005-08-04 Thread François
# New Ticket Created by François PERRAD # Please include the string: [perl #36808] # in the subject line of all future correspondence about this issue. # https://rt.perl.org/rt3/Ticket/Display.html?id=36808 > This patch solves the following link problem : pystring.o(.text+0x15a): In functio

Re: urgent parrot bug / PR opportunity

2005-08-04 Thread Leopold Toetsch
Michal Wallace wrote: +PMC *iter = pmc_new_init(INTERP, PyBuiltin_PyIter, SELF); Done - r8801 -if (!((List *) PMC_data(SELF))->length) +if (!((List *) PMC_int_val(SELF))) ~ Bogus. Changed to !SELF.elements() leo

Whitespace (Was: [RELEASE] Pugs 6.2.9 released!)

2005-08-04 Thread Andrew Shitov
> I am glad to announce Pugs 6.2.9, released during Ingy's OSCON talk: > http://pugscode.org/dist/Perl6-Pugs-6.2.9.tar.gz > SIZE = 1439642 > SHA1 = efd32419dcddba596044a42564936888a28b3c69 > Following last month's plan, this release features a Perl6/PIL to javascript > code generator,