RE: handling undef better

2005-12-17 Thread Darren Duncan
At 2:27 AM -0500 12/17/05, Gordon Henriksen wrote: I find it useful to distinguish between unassigned and undefined (null). I think that the whole point of having "undef" in the first place was to indicate when a container wasn't assigned to yet, and hence has no useable value. Also, that ex

Re: Three more shoot outs

2005-12-17 Thread Joshua Isom
I applied the changes to the code, using capture for the initial strip. I did use \> instead of but I didn't notice any real difference, even when I profiled it. For the matching, using a capturing regex didn't work well because it'd have to backtrace, which slowed it down too much for the s

Re: handling undef better

2005-12-17 Thread Luke Palmer
On 12/17/05, Darren Duncan <[EMAIL PROTECTED]> wrote: > An undefined value is NOT the same as zero or an empty string > respectively; the latter two are very specific and defined values, > just like 7 or 'foo'. I definitely agree with you in principle. This is something that has been bugging me,

imcc, macros, and tcl

2005-12-17 Thread Leopold Toetsch
We were struggling with some memory corruption seen mainly in tcl [1] since quite a time. I think, I've found it now, thanks to an example Matt has pasted this morning. The reason is: - there is a hard limit of 256 macros - this was marked with XXX but *not checked* - each .include 'foo' with

Re: handling undef better

2005-12-17 Thread Darren Duncan
At 9:30 AM + 12/17/05, Luke Palmer wrote: On 12/17/05, Darren Duncan <[EMAIL PROTECTED]> wrote: > Undef, by definition, is different from and non-equal to everything else, both any defined value, and other undefs. You said "by definition", but where is this definition? Maybe "definitio

RE: handling undef better

2005-12-17 Thread Gordon Henriksen
I find it useful to distinguish between unassigned and undefined (null). "None" is very often a valid value, especially for primitive types, and especially where databases are involved. i.e., the range of a variable might be {undef, -2^31..2^31-1}. In my experience: 99 + undef -> 99 #

Re: handling undef better

2005-12-17 Thread Ruud H.G. van Tol
Darren Duncan schreef: > A variable whose value is undefined is still a typed container; eg: > > my Int $z; # undef since not assigned to > my Str $y; # undef since not assigned to If 'undef' becomes 'fail' at the same time that those base types don't have default start-values such as 0 and '

Re: handling undef better

2005-12-17 Thread Ruud H.G. van Tol
Gordon Henriksen schreef: > I find it useful to distinguish between unassigned and undefined > (null). I am not sure that you need this distinction, but it should be no problem to have it, just like 'tainted' and 'NaN' and 'zero/empty' and 'error'. > I find null propagation frustrating; it's mo

Re: handling undef better

2005-12-17 Thread David Green
On 12/16/05, Darren Duncan wrote: The root question of the matter is, what does "undef" mean to you? To me it means nothing. (I'm so callous.) The fact is, that in any normal program, using an undefined value as if it were a defined one is a bug. Normally there will be a point where such

Re: handling undef better

2005-12-17 Thread Rob Kinyon
On 12/17/05, Darren Duncan <[EMAIL PROTECTED]> wrote: [snip] > 2. Until a value is put in a container, the container has the > POTENTIAL to store any value from its domain, so with respect to that > container, there are as many undefs as there are values in its > domain; with some container types,

Re: Three more shoot outs

2005-12-17 Thread Leopold Toetsch
Joshua Isom wrote: Commented out is code to use capturing regex to do it for the final substitution. PGE seems faster with the coroutine. Doesn't it now substitute on wrong positions after the first replacement? leo

Re: handling undef better

2005-12-17 Thread Uri Guttman
> "LP" == Luke Palmer <[EMAIL PROTECTED]> writes: LP> Actually, you can think of undef pretty much as defining LP> autovivification. "If you use it as a number, it becomes a number; if LP> you use it as a string, it becomes a string; if you use it as a hash, LP> it becomes a hash; ...

Re: Three more shoot outs

2005-12-17 Thread Joshua Isom
Not that I can tell from the code... Starting from the beginning, push the substr location onto the end, then in another loop, pop off that ending and use it for replacement. Only the locations at the end are affected which is why it starts at the end. An iterator is used to provide a wrappe

Re: Test::Harness spitting an error

2005-12-17 Thread Ian Langworth
No one else has replied, so here's a shot in the dark: Try setting the PERLIO environment variable to "crlf" (without quotes). -- Ian Langworth

Re: Change 26165 broke ext/threads/t/stress_re.t test on Win32 (and patch to t/test.pl and/or Test::Harness)

2005-12-17 Thread demerphq
On 12/16/05, Steve Hay <[EMAIL PROTECTED]> wrote: > The real bummer, though, is that I'm now away until Jan 3rd and I'm > switching my machine off now, so you can't see the fruits of your > efforts in my overnight smokes until next year :-( If its any help to you guys I built and tested just now o

Re: handling undef better

2005-12-17 Thread Sebastian
I still think it'd be neat to have a special Undef class of some sort which can be subclassed and further defined to really DWIM rather than be stuck with whatever pragmas Perl has graciously built in. Something like this would require more thinking and speculation -- and it may hurt performance to

Re: [perl #37969] make svnclobber is not working properly

2005-12-17 Thread Joshua Hoblitt
Perhaps the svnclobber target should just invoke `svn revert -R .`? -J -- On Sat, Dec 17, 2005 at 08:09:45AM -0800, Alberto Simoes wrote: > # New Ticket Created by Alberto Simoes > # Please include the string: [perl #37969] > # in the subject line of all future correspondence about this issue.

[perl #37969] make svnclobber is not working properly

2005-12-17 Thread via RT
# New Ticket Created by Alberto Simoes # Please include the string: [perl #37969] # in the subject line of all future correspondence about this issue. # https://rt.perl.org/rt3/Ticket/Display.html?id=37969 > Basically, done: $ svn up At revision 10568. $ make svnclobber perl "-M

Re: handling undef better

2005-12-17 Thread Ashley Winters
On 12/17/05, Sebastian <[EMAIL PROTECTED]> wrote: > > Obviously there are mixed opinions of how undef should be treated and > some won't be happy with what becomes final, so implementing some > intelligent defaults and simple pragmas, but not excluding the ability > to *really* control your undefs,

Re: handling undef better

2005-12-17 Thread chromatic
On Friday 16 December 2005 22:25, Darren Duncan wrote: > At 10:07 PM -0800 12/16/05, chromatic wrote: > >This is fairly well at odds with the principle that users shouldn't have > > to bear the burden of static typing if they don't want it. > This matter is unrelated to static typing. The state

Re: Three more shoot outs

2005-12-17 Thread Leopold Toetsch
On Dec 17, 2005, at 18:48, Joshua Isom wrote: If I make my version and the perl version print out the final sequence, they're identical. Ah. Sorry. I missed that it replaces from the end. leo

Re: Change 26165 broke ext/threads/t/stress_re.t test on Win32 (and patch to t/test.pl and/or Test::Harness)

2005-12-17 Thread chromatic
On Saturday 17 December 2005 08:23, demerphq wrote: > It seemed to me that > a better patch would be to change the way harness handles directives > so it recognizes TODO & SKIP as being a valid directive. What would that mean? SKIP tests don't run. TODO tests do. If the test doesn't run, I thi

load_bytecode now insists on ASCII.

2005-12-17 Thread Bob Rogers
This looks like consequence of r10458, is still present in r10568, and is easy to reproduce: [EMAIL PROTECTED]> cat load-test.pir .sub _main :main .local string file_name file_name = iso-8859-1:"foo.pbc" load_bytecode file_name

Re: Change 26165 broke ext/threads/t/stress_re.t test on Win32 (and patch to t/test.pl and/or Test::Harness)

2005-12-17 Thread demerphq
On 12/17/05, chromatic <[EMAIL PROTECTED]> wrote: > On Saturday 17 December 2005 08:23, demerphq wrote: > > > It seemed to me that > > a better patch would be to change the way harness handles directives > > so it recognizes TODO & SKIP as being a valid directive. > > What would that mean? SKIP te

handling undef - second draft

2005-12-17 Thread Darren Duncan
Considering all the feedback and discussion I've seen so far, I hereby retract my earlier proposals in the 'handling undef better' messages and offer new ones instead, which hopefully address the issues you collectively have raised. At the root of the issues I see here is that the meaning of '

Re: handling undef better

2005-12-17 Thread Uri Guttman
> "DD" == Darren Duncan <[EMAIL PROTECTED]> writes: DD> At 9:30 AM + 12/17/05, Luke Palmer wrote: >> >> You're actually saying that undef either compares less than or greater >> than all other objects, which contradicts your earlier point. I'd say >> it just fails. DD> At th

Re: handling undef better

2005-12-17 Thread Larry Wall
On Sat, Dec 17, 2005 at 12:12:15PM -0800, Ashley Winters wrote: : Explicitly nil values wouldn't warn or fail on activities which undef : does. nil is basically a value which is simultaneously '' and 0 and : 0.0 and false *and* defined, and allows itself to be coerced with the : same rules as perl5