Re: Return with no expression

2004-08-24 Thread Jonadab the Unsightly One
Alexey Trofimenko [EMAIL PROTECTED] writes: I wanna ask, could be there in perl6 any difficulties with recognizing C:: as part of C... ?? ... :: ... and C:: as module sigil? Does it involve some DWIM? Among other things, the ?? will tip off the parser that it's looking for an expression

Re: Need some opinions on base behavior

2004-08-24 Thread chromatic
On Mon, 2004-08-23 at 18:13, Dan Sugalski wrote: The unary behavior of the types is reasonably straightforward. What I'm puzzling over right now is the binary behavior. It's the edge cases that are troublesome, of course -- what to do on overflow, and what to do with fractional results.

Re: GC/DOD API

2004-08-24 Thread Leopold Toetsch
Dan Sugalski [EMAIL PROTECTED] wrote: So, being clear here (I hope, though recent history suggests otherwise) what I want is the API that the GC/DOD system presents to the rest of the engine. This includes the functions you call to trigger a DOD or GC sweep, any functions or macros that need

Re: NCI and callback functions

2004-08-24 Thread Leopold Toetsch
Stephane Peiry wrote: dlfunc P2, P1, 'g_signal_connect_object', 'lptppi' Whatever you'll try the current scheme is not compatible with this GTK callback. Parrot needs a PMC as user_data. GTK awaits a GObject. Parrot stuffs the interpreter and the Sub PMC into user_data and unpacks that when

Re: Need some opinions on base behavior

2004-08-24 Thread Leopold Toetsch
Dan Sugalski [EMAIL PROTECTED] wrote: I'm up for some discussion on this one. I'm tempted to leave integer binary ops integers, I've already outlined that Python as well as Perl6 silently promote to BigInt. I'd rather have Integer as the common base type that implements most of these two

Re: Instantiation

2004-08-24 Thread Simon Cozens
[EMAIL PROTECTED] (Aaron Sherman) writes: my $x = Some::Module::That::Defines::A::Class.AUTOLOAD.new(blah); Wow, that's pretty amazing... uh... I think I'd just prefer to do it the old fashioned way. If my suggestion was really that horrific, I withdraw the question. These days, to me,

Re: Return with no expression

2004-08-24 Thread Brent 'Dax' Royal-Gordon
Aaron Sherman [EMAIL PROTECTED] wrote: I've always thought that particular bit of sugar was rather dangerous. I'd even prefer a longhand: $foo either 0 or split(); The overloading of 'or' there is (IMHO) far more dangerous than the overloading of '::' being discussed in this thread. --

Re: Progressively Overhauling Documentation

2004-08-24 Thread Mark Overmeer
* Juerd ([EMAIL PROTECTED]) [040823 19:46]: David Green skribis 2004-08-23 11:30 (-0600): One of the selling features (or one of the features that is always sold) of POD is that you can mix it with your code. Except nobody does, at least I can't recall that last time I saw a module that

Re: Progressively Overhauling Documentation

2004-08-24 Thread Clayton Scott
David Green wrote: In [EMAIL PROTECTED], [EMAIL PROTECTED] (Aaron Sherman) wrote: This bit of POD made me think about POD's lack of tabular formatting, a common idiom in technical documentation. I know POD is still in the wings, as it were, but I wanted to say this before I forget /me

Test::DoubleQuotedEntities

2004-08-24 Thread Mark Fowler
I released another testing module yesterday: http://search.cpan.org/dist/Test-DoubleEncodedEntities/ It detects strings like 'amp;eacute;' in your HTML, meaning it can detect the case when you've double encoded your entities. Anyone who spots any errors - please chuck 'em into RT. Patches

Re: Return with no expression

2004-08-24 Thread Aaron Sherman
Luke Palmer wrote: Aaron Sherman writes: $foo??0::split() ouch! Yeah, seriously. I mean, what a subtle bug! It would take him hours to figure out went wrong! Sarcasm is an ugly thing. One thing that I just thought of that could be intersting: $foo = 'a' or 'b' My thought was that

Re: cvs commit: parrot/build_tools build_nativecall.pl

2004-08-24 Thread Leopold Toetsch
Dan Sugalski [EMAIL PROTECTED] wrote: cvsuser 04/08/23 13:24:37 Modified:build_tools build_nativecall.pl Log: Due to an amazing amount of ineffable evil in hash.c, build_nativecall got redone to use a PerlHash and PMCs instead of the lower-level access system it had, since

Concat, Cows Basil

2004-08-24 Thread Sam Phillips
/lurk Hello, I am currently in the early stages of writing a (parrot targeting) compiler for an interpreted language I have been working on/with for the past 4 years. Background: The language (Basil) is basically a functional (ish) language with a C-like syntax that has an implicit

Re: cvs commit: parrot/build_tools build_nativecall.pl

2004-08-24 Thread Dan Sugalski
At 12:03 PM +0200 8/24/04, Leopold Toetsch wrote: Dan Sugalski [EMAIL PROTECTED] wrote: cvsuser 04/08/23 13:24:37 Modified:build_tools build_nativecall.pl Log: Due to an amazing amount of ineffable evil in hash.c, build_nativecall got redone to use a PerlHash and PMCs instead

Re: Need some opinions on base behavior

2004-08-24 Thread Dan Sugalski
At 11:05 AM +0200 8/24/04, Leopold Toetsch wrote: Dan Sugalski [EMAIL PROTECTED] wrote: I'm up for some discussion on this one. I'm tempted to leave integer binary ops integers, I've already outlined that Python as well as Perl6 silently promote to BigInt. I'd rather have Integer as the common

Re: Need some opinions on base behavior

2004-08-24 Thread Matt Fowles
Dan~ I'm thinking now that multiplication of integers should upgrade to a float (which is large enough to hold the result with no loss of precision), division of integers should return a bignum (or a bigrat), and all float operations should produce floats. The destination PMC type can

Low-level math op behavior

2004-08-24 Thread Dan Sugalski
Okay, since we're finally talking defined math semantics, lets talk the low-level ops. All our math ops right now just quietly do their thing. If values wrap, truncate, or otherwise fuzz out, we don't do anything special. This is fine, and fast, and what many languages want. It is, however,

Re: Need some opinions on base behavior

2004-08-24 Thread Dan Sugalski
At 11:29 AM -0400 8/24/04, Matt Fowles wrote: Dan~ I'm thinking now that multiplication of integers should upgrade to a float (which is large enough to hold the result with no loss of precision), division of integers should return a bignum (or a bigrat), and all float operations should produce

Re: Return with no expression

2004-08-24 Thread Dave Whipp
Brent 'Dax' Royal-Gordon [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Aaron Sherman [EMAIL PROTECTED] wrote: I've always thought that particular bit of sugar was rather dangerous. I'd even prefer a longhand: $foo either 0 or split(); The overloading of 'or' there is

Re: Need some opinions on base behavior

2004-08-24 Thread Dan Sugalski
At 4:26 PM +0100 8/24/04, Nicholas Clark wrote: On Tue, Aug 24, 2004 at 10:49:37AM -0400, Dan Sugalski wrote: As for rounding, I'm open to changes there too. Standard for computing is round-to-zero, since it's easy (drop the fractional part) but I was always taught round-to-closest-int. Too

Re: Concat, Cows Basil

2004-08-24 Thread Leopold Toetsch
Sam Phillips [EMAIL PROTECTED] wrote: Problem: 1) To create an efficient implementation of Basil I'll need a big PerlArray that is formed by expressions that create PerlStrings or more PerlArrays. How big is big? So my main question is this: Are PerlArrays and PerlStrings an efficient way

Re: Low-level math op behavior

2004-08-24 Thread Doug McNutt
At 11:29 -0400 8/24/04, Dan Sugalski wrote: What I'm thinking is that we add an O or X (or E, I don't care. I suppose we could get more verbose there too) variant to the basic math ops which checks the result for validity and throws an exception on something exceptional happening. For floating

RE: Low-level math op behavior

2004-08-24 Thread Butler, Gerald
So, would it have things like $i = $j /E $k $i = $j %E $k which would both throw and exception if $k == 0 whereas $i = $j / $k $i = $j % %k would not throw an exception and would instead return NaN -Original Message- From: Dan Sugalski [mailto:[EMAIL PROTECTED] Sent:

Test::Harness with modules that output to STDOUT

2004-08-24 Thread Peter Kay
I am attempting to write tests (using whichever Tests::...) for a module that will use Test::Harness. The module outputs to STDOUT (it just does). Now, in theory, Test::Harness currently ignores anything that doesn't start with ok or not ok, but for whatever reason, when I have no_plan, it

RE: Low-level math op behavior

2004-08-24 Thread Dan Sugalski
At 11:34 AM -0400 8/24/04, Butler, Gerald wrote: So, would it have things like $i = $j /E $k $i = $j %E $k which would both throw and exception if $k == 0 whereas $i = $j / $k $i = $j % %k would not throw an exception and would instead return NaN That'd be the plan, yeah. $i

Re: Numeric semantics for base pmcs

2004-08-24 Thread Simon Glover
On Tue, 24 Aug 2004, Dan Sugalski wrote: 6) Division of two ints produces a bignum Surely it should only produce a bignum as a last resort. For instance, shouldn't: 4 / 3 produce a float? Also, what about a case like: 4 / 2 Does that produce an int, a float or a bignum? 9) Any

RE: Numeric semantics for base pmcs

2004-08-24 Thread Dan Sugalski
At 1:42 PM -0400 8/24/04, Butler, Gerald wrote: Shouldn't 4 also have potential to produce BigInt? Nope -- we don't have bigints. :) -Original Message- From: Dan Sugalski [mailto:[EMAIL PROTECTED] Sent: Tuesday, August 24, 2004 1:34 PM To: [EMAIL PROTECTED] Subject: Numeric semantics for

Re: Test::DoubleQuotedEntities

2004-08-24 Thread David H. Adler
On Tue, Aug 24, 2004 at 10:38:50AM +0100, Mark Fowler wrote: I released another testing module yesterday: http://search.cpan.org/dist/Test-DoubleEncodedEntities/ I note that that's not the name in the subject of your mail. I hope this is the right one. :-) (oh, and as an aside I

Re: Numeric semantics for base pmcs

2004-08-24 Thread Matt Fowles
Dan~ -Original Message- From: Dan Sugalski [mailto:[EMAIL PROTECTED] Sent: Tuesday, August 24, 2004 1:34 PM To: [EMAIL PROTECTED] Subject: Numeric semantics for base pmcs 10) The destination PMC is responsible for final conversion of the inbound value I know there has been a

RE: Numeric semantics for base pmcs

2004-08-24 Thread Butler, Gerald
Shouldn't 4 also have potential to produce BigInt? -Original Message- From: Dan Sugalski [mailto:[EMAIL PROTECTED] Sent: Tuesday, August 24, 2004 1:34 PM To: [EMAIL PROTECTED] Subject: Numeric semantics for base pmcs Okay, so: 1) We round to zero when going from float to int 2)

RE: Numeric semantics for base pmcs

2004-08-24 Thread Butler, Gerald
Oops. I meant BigNum. -Original Message- From: Dan Sugalski [mailto:[EMAIL PROTECTED] Sent: Tuesday, August 24, 2004 1:47 PM To: Butler, Gerald; '[EMAIL PROTECTED]' Subject: RE: Numeric semantics for base pmcs At 1:42 PM -0400 8/24/04, Butler, Gerald wrote: Shouldn't 4 also have

Re: Benchmark Stuff

2004-08-24 Thread Joshua Gatcomb
--- Sebastian Riedel [EMAIL PROTECTED] wrote: Take a look at tools/dev/parrotbench.pl It already does most of the things you want, you just have to parse it's output and feed it to your database. Cheers, Sebastian parrotbench.pl didn't correctly handle hyphens in names (it was using

Re: Benchmark Stuff

2004-08-24 Thread Joshua Gatcomb
--- Joshua Gatcomb [EMAIL PROTECTED] wrote: Here is the modified parrotbench script along with the new data collection script and the script to make it into a web page. I don't know what kind of layout/data would be useful to people so let me know if you want something else. I will

Re: Test::DoubleQuotedEntities

2004-08-24 Thread Kirrily Skud Robert
On Tue, Aug 24, 2004 at 01:51:12PM -0400, David H. Adler wrote: (oh, and as an aside I released a new Acme::Test::Buffy, with slightly improved documentation and spelling too - but no one cares about that) Says who? *I* care. And you have no idea how stupid I felt submitting an RT on

How to build ??/:: without ::

2004-08-24 Thread Aaron Sherman
On Tue, 2004-08-24 at 08:24, Aaron Sherman wrote: $foo = 'a' or 'b' I was too focused on the idea of C??/C:: as a pair-like construct, and I missed what should have been obvious: a ?? b :: c IS given a { when true { b } default { c } } Which S4 tells us is: a -

Re: Numeric semantics for base pmcs

2004-08-24 Thread Dan Sugalski
At 1:39 PM -0400 8/24/04, Simon Glover wrote: On Tue, 24 Aug 2004, Dan Sugalski wrote: 6) Division of two ints produces a bignum Surely it should only produce a bignum as a last resort. For instance, shouldn't: 4 / 3 produce a float? A float or a bignum, both are reasonable. There's that

Re: Numeric semantics for base pmcs

2004-08-24 Thread John Siracusa
On Tue, 24 Aug 2004 14:46:53 -0400, Dan Sugalski [EMAIL PROTECTED] wrote: The big question is whether being clever and producing the tightest type is worth the time to figure out what that type is, as well as the potentially uncertain output type. Tangentially related: will promotion be

RE: Benchmark Stuff

2004-08-24 Thread Gay, Jerry
Here is the modified parrotbench script along with the new data collection script and the script to make it into a web page. I don't know what kind of layout/data would be useful to people so let me know if you want something else. I will update every Tuesday morning. I

Re: Numeric semantics for base pmcs

2004-08-24 Thread Sean O'Rourke
At Tue, 24 Aug 2004 13:33:45 -0400, Dan Sugalski wrote: 6) Division of two ints produces a bignum Where bignum means both bigger than 32-bit integer and rational number? So 4 / 2 == Bignum(2/1) which doesn't get automatically downgraded to a normal int. Ok. 7) Strings are treated as

Re: Numeric semantics for base pmcs

2004-08-24 Thread Leopold Toetsch
Dan Sugalski [EMAIL PROTECTED] wrote: At 1:42 PM -0400 8/24/04, Butler, Gerald wrote: Shouldn't 4 also have potential to produce BigInt? Nope -- we don't have bigints. :) Pardon, sir? leo

Re: Numeric semantics for base pmcs

2004-08-24 Thread Leopold Toetsch
Dan Sugalski [EMAIL PROTECTED] wrote: Okay, so: 4) Addition and subtraction of ints produces an int ??? 5) Multiplication of two ints produces a bignum or an int, depending on the result Why that difference? Int op Int gives Bigint or Int (whatever fits) for op in (abs, neg, add, sub,

Re: Numeric semantics for base pmcs

2004-08-24 Thread Dan Sugalski
At 8:45 PM +0200 8/24/04, Leopold Toetsch wrote: Dan Sugalski [EMAIL PROTECTED] wrote: At 1:42 PM -0400 8/24/04, Butler, Gerald wrote: Shouldn't 4 also have potential to produce BigInt? Nope -- we don't have bigints. :) Pardon, sir? We've got the big number code, but I don't see much reason to

Re: Numeric semantics for base pmcs

2004-08-24 Thread Dan Sugalski
At 8:56 PM +0200 8/24/04, Leopold Toetsch wrote: Dan Sugalski [EMAIL PROTECTED] wrote: Okay, so: 4) Addition and subtraction of ints produces an int ??? Yeah, that was wrong. Later fixed. :) 5) Multiplication of two ints produces a bignum or an int, depending on the result Why that

Re: Numeric semantics for base pmcs

2004-08-24 Thread Dan Sugalski
At 11:47 AM -0700 8/24/04, Sean O'Rourke wrote: At Tue, 24 Aug 2004 13:33:45 -0400, Dan Sugalski wrote: 6) Division of two ints produces a bignum Where bignum means both bigger than 32-bit integer and rational number? So Yes. 4 / 2 == Bignum(2/1) which doesn't get automatically downgraded to

Re: Return with no expression

2004-08-24 Thread Aaron Sherman
On Tue, 2004-08-24 at 11:50, Dave Whipp wrote: You're assuming that Ceither in a ternary operator. It could be a binary operator, defined as {eval $RHS if $LHS; return $LHS}. For that interpretation, one might choose a different name (e.g. Cimplies). We could actually define ?? as a binary

Re: Return with no expression

2004-08-24 Thread Brent 'Dax' Royal-Gordon
Dave Whipp [EMAIL PROTECTED] wrote: Brent 'Dax' Royal-Gordon [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] The overloading of 'or' there is (IMHO) far more dangerous than the overloading of '::' being discussed in this thread. Not necessarily. You're assuming that Ceither in a

Re: Numeric semantics for base pmcs

2004-08-24 Thread Nicholas Clark
On Tue, Aug 24, 2004 at 03:08:21PM -0400, Dan Sugalski wrote: At 8:56 PM +0200 8/24/04, Leopold Toetsch wrote: Dan Sugalski [EMAIL PROTECTED] wrote: 5) Multiplication of two ints produces a bignum or an int, depending on the result Why that difference? At this point I'm tempted to not

Re: Numeric semantics for base pmcs

2004-08-24 Thread Felix Gallo
Nick writes: 2 * 3 give a bignum. That feels evil. Except that the way that $a = 2 * 3 will work is that the assignment of the bignum temporary to $a will cause $a to drop it back to an int (for most languages' choice of target PMC) ? Dan, any feeling about RISC vs. CISC? Because to me, this

Re: Return with no expression

2004-08-24 Thread Aaron Sherman
On Tue, 2004-08-24 at 15:55, Adam D. Lopresto wrote: On Tue, 24 Aug 2004, Aaron Sherman wrote: Yep, and since ~~ auto-topicalizes its lhs for its rhs, your binary ?? is all you need. I wish I'd seen your message before I sent my recent one, as I would have just started from there.

OT: SPF problem with the list?

2004-08-24 Thread Aaron Sherman
Please let me know who is appropriate for this, and whatever you do, please don't reply to / CC the list. We don't need to bog down the works with discussion of spam filtering. I'm noticing that mail from perl6-* is showing up with this header: Received-SPF: softfail (mail.ajs.com: transitioning

Re: Numeric semantics for base pmcs

2004-08-24 Thread Sean O'Rourke
At Tue, 24 Aug 2004 15:19:52 -0400, Dan Sugalski wrote: At 11:47 AM -0700 8/24/04, Sean O'Rourke wrote: At Tue, 24 Aug 2004 13:33:45 -0400, Dan Sugalski wrote: 7) Strings are treated as floats for math operations I think we can do better than this by first converting a string to the

Re: OT: SPF problem with the list?

2004-08-24 Thread Ask Bjørn Hansen
On Aug 24, 2004, at 2:45 PM, Aaron Sherman wrote: Please let me know who is appropriate for this, and whatever you do, please don't reply to / CC the list. We don't need to bog down the works with discussion of spam filtering. I don't think your SPF implementation is doing the right thing. I'll

Re: Return with no expression

2004-08-24 Thread Graham Barr
On 24 Aug 2004, at 22:14, Aaron Sherman wrote: You don't HAVE to use auto-topicalization. You CAN always write it long-hand if you find that confusing: for @words - $word { given ($chars($word) 70) - $toolong { say abbreviate($word) ?? $word;

Re: Return with no expression

2004-08-24 Thread Adam D. Lopresto
On Tue, 24 Aug 2004, Aaron Sherman wrote: On Tue, 2004-08-24 at 11:50, Dave Whipp wrote: You're assuming that Ceither in a ternary operator. It could be a binary operator, defined as {eval $RHS if $LHS; return $LHS}. For that interpretation, one might choose a different name (e.g.

Re: Test::Harness with modules that output to STDOUT

2004-08-24 Thread Adrian Howard
On 24 Aug 2004, at 16:04, Peter Kay wrote: I am attempting to write tests (using whichever Tests::...) for a module that will use Test::Harness. The module outputs to STDOUT (it just does). You might find http://www.mail-archive.com/[EMAIL PROTECTED]/msg01690.html of interest. [snip] So far,

Re: Test::Harness with modules that output to STDOUT

2004-08-24 Thread Ovid
--- Peter Kay [EMAIL PROTECTED] wrote: Ok, what's the elegent way to ignore/dispose of the output the tested module produces? What I do whenever this happens is to move the printing code to a subroutine or method and override that to capture the output. So if I have something like this: