Re: Unify cwd() [was: Re: $*CWD instead of chdir() and cwd()]

2005-04-16 Thread Dave Whipp
Chip Salzenberg wrote: As you know, under Unix, there's no such thing as "the current directory" as a string. The only durable current directory is the device and inode of C. It's not wise to conflate the current directory with a name that at some point in the past could have been used to reach i

Re: Comparing rationals/floats

2005-04-16 Thread Larry Wall
On Fri, Apr 15, 2005 at 04:18:51PM -0700, gcomnz wrote: : More questions stemming from cookbook work... Decimal Comparisons: : : The most common recipe around for comparisons is to use sprintf to cut : the decimals to size and then compare strings. Seems ugly. Certainly, but I don't think the sit

Re: Unify cwd() [was: Re: $*CWD instead of chdir() and cwd()]

2005-04-16 Thread Chip Salzenberg
According to Michael G Schwern: > Yes, there are lots of ways to check the cwd each filling in one edge > case or another. However I'd like to believe its possible to come up with > one simple, safe cwd() that works for 99.9% of the cases and call that cwd(). Well, it's certainly possible ... and

Re: <[]> ugly and hard to type

2005-04-16 Thread Larry Wall
On Sat, Apr 16, 2005 at 10:01:44PM +0200, Juerd wrote: : Larry Wall skribis 2005-04-16 11:08 (-0700): : > : $foo ~~ /@{< [ ] { } < > : ++ $ . ? / +| +& ?| ?& >}/ : > Not unless you backwhack that internal > there. : > [...] : > @myfavoritepunctuations = < [ ] { } < \> : ++ $ . ? / +| +& ?| ?& >

Re: <[]> ugly and hard to type

2005-04-16 Thread Juerd
Larry Wall skribis 2005-04-16 11:08 (-0700): > : $foo ~~ /@{< [ ] { } < > : ++ $ . ? / +| +& ?| ?& >}/ > Not unless you backwhack that internal > there. > [...] > @myfavoritepunctuations = < [ ] { } < \> : ++ $ . ? / +| +& ?| ?& >; Why isn't nesting allowed there? I'd expect it to work a bit l

Re: Quoting interpolation in Perl5 vs. Perl6

2005-04-16 Thread Larry Wall
On Sat, Apr 16, 2005 at 10:16:43PM +0300, Roie Marianer wrote: : On Saturday 16 April 2005 10:10 pm, Larry Wall wrote: : > So : > this is a syntax error (of the runaway "" variety, presumably): : > : > " @foo::bar::baz::fee::fie::foe[ " : I was with you until that. What about : " @foo::bar::ba

Re: Quoting interpolation in Perl5 vs. Perl6

2005-04-16 Thread Roie Marianer
On Saturday 16 April 2005 10:10 pm, Larry Wall wrote: > So > this is a syntax error (of the runaway "" variety, presumably): > > " @foo::bar::baz::fee::fie::foe[ " I was with you until that. What about " @foo::bar::baz::fee::fie::foe[ "1" ] " Isn't that a valid index into the array? Or is that

Re: Quoting interpolation in Perl5 vs. Perl6

2005-04-16 Thread Larry Wall
On Sat, Apr 16, 2005 at 11:30:49AM -0700, Larry Wall wrote: : The basic rule of thumb is that we pretend we're a top-down parser : even if we aren't, and we only look for the trailing delimiter when : we're not trying to parse something embedded that would naturally : slurp up the trailing delimite

Re: Quoting interpolation in Perl5 vs. Perl6

2005-04-16 Thread Larry Wall
On Sat, Apr 16, 2005 at 06:28:37PM +0300, Roie Marianer wrote: : Hi all. : : I'm trying to get quoting interpolation to work, which means I first have to : understand it a little better. : : In Perl 5, as far as I can see, the delimiter of quoting constructs (whether : it's "", '' or qq ) is se

Re: <[]> ugly and hard to type

2005-04-16 Thread Larry Wall
On Sat, Apr 16, 2005 at 02:42:25AM -0700, Ashley Winters wrote: : I never liked character sets. They introduced yet another exception to : the parsing rules, and it irked me. If it weren't for the need to : optimize character sets, I'd prefer to be Pythonized into using @{'a' : .. 'z'} : : If I re

Re: nbsp in \s, and <>

2005-04-16 Thread Larry Wall
On Sat, Apr 16, 2005 at 10:22:45AM +0200, Leopold Toetsch wrote: : Well there are three different whitespace lists. The Parrot program [1] : below shows all, including space and blank. I suspect we'll end up with about as many whitespace definitions as there are computer languages, or maybe as man

Re: trim() and words() functions?

2005-04-16 Thread Terrence Brannon
[EMAIL PROTECTED] (Larry Wall) writes: > Of course, generations of Perl programmers have > made do with various forms of s///, I have found String::Strip on CPAN to work well for my needs in this area.

Re: Unify cwd() [was: Re: $*CWD instead of chdir() and cwd()]

2005-04-16 Thread John Macdonald
On Saturday 16 April 2005 01:53, Michael G Schwern wrote: > How cwd() is implemented is not so important as what happens when it hits > an edge case. So maybe we can try to come up with a best fit cwd(). I'd > start by listing out the edge cases and what the possible behaviors are. > Maybe we

Re: [pugs] Quoting constructs

2005-04-16 Thread Larry Wall
On Sat, Apr 16, 2005 at 03:14:50AM +0300, Roie Marianer wrote: : I actually knew that, but in my head $key_b and $value_b were single words. : But according to S02, the interpolation is protected by quotes. That is, if : $key_b is q0/printf "Hello, world\n" or die"/, that's four words, correct? O

Re: Quoting interpolation in Perl5 vs. Perl6

2005-04-16 Thread Juerd
Roie Marianer skribis 2005-04-16 18:28 (+0300): > My suggestion is to check for delimiters only when it's ambiguous: Inside a > variable name (qq x$varxy -> "$var"y), and at the beginning of every > subscript of a scalar, and every subscript after the first one of an array, > hash of sub (becaus

Quoting interpolation in Perl5 vs. Perl6

2005-04-16 Thread Roie Marianer
Hi all. I'm trying to get quoting interpolation to work, which means I first have to understand it a little better. In Perl 5, as far as I can see, the delimiter of quoting constructs (whether it's "", '' or qq ) is searched for before the string is parsed. This means that, for example, "%ha

Re: nbsp in \s, and <>

2005-04-16 Thread Leopold Toetsch
Larry Wall <[EMAIL PROTECTED]> wrote: > On Fri, Apr 15, 2005 at 11:44:03PM +0200, Juerd wrote: >: Is there a -like thingy that is always \s+? > Not currently, since \s+ is there. used to be that, but > currently is defined as the magical whitespace matcher used by :words. >: Do \s and match no

Re: <[]> ugly and hard to type

2005-04-16 Thread gcomnz
> I never liked character sets. They introduced yet another exception to > the parsing rules, and it irked me. If it weren't for the need to > optimize character sets, I'd prefer to be Pythonized into using @{'a' > .. 'z'} Isn't that just a digression into the bad old pre-internationalized days. U

Re: Unify cwd() [was: Re: $*CWD instead of chdir() and cwd()]

2005-04-16 Thread Michael G Schwern
On Fri, Apr 15, 2005 at 09:32:23PM -0400, Chip Salzenberg wrote: > > Perl 6 is going to have to decide on some sort of standard internal getcwd > > technique, $CWD or not. > > I don't think Perl 6 "has" to do anything of the kind. It would > be a mistake to try. Sorry, I had assumed that having

Re: Unify cwd() [was: Re: $*CWD instead of chdir() and cwd()]

2005-04-16 Thread Chip Salzenberg
According to Michael G Schwern: > On Fri, Apr 15, 2005 at 08:31:57PM -0400, Chip Salzenberg wrote: > > There are several methods to determine the current directory. > > Perl 6 is going to have to decide on some sort of standard internal getcwd > technique, $CWD or not. I don't think Perl 6 "has"

Re: <[]> ugly and hard to type

2005-04-16 Thread Ashley Winters
On 4/15/05, Juerd <[EMAIL PROTECTED]> wrote: > Am I the only one who thinks <[a-z]> is ugly and hard to type because of > the nested brackets? The same goes for <{...}>. The latter can't easily > be fixed, I think, but the former perhaps can. If there are more who > think it needs to, that is. And