Re: chomp & unchomp

2000-08-09 Thread David L. Nicol
With a regex you can get much finer control; with a "r" modifier for the regexen indicating that it should start at the end of the string instead of the beginning the speed issue is gone; i think unchop and unchomp is silly; that's what .= is for -- David Nicol 816.

Re: RFC 73 (v1) All Perl core functions should return ob

2000-08-09 Thread David L. Nicol
Nathan Torkington wrote: > > Dan Sugalski writes: > > Which sort of argues for localtime in a numeric scalar context to return > > epoch seconds, in a string scalar context to return a time string, and in a > > plain scalar context a hashref. (or mini-object, or tied thingamabob, or > > whatever)

Re: RFC 54 (v1) Operators: Polymorphic comparisons

2000-08-09 Thread David L. Nicol
Clayton Scott wrote: > I first thought that "==" and "eq" were cut from the same cloth as > "||" and "or" that is the difference was precedence. Then I learned. Mr. Scott's experience is evidence for a strong argument AGAINST operator overloading. If we allow object types, and allow o

overloading assignment operators

2000-08-09 Thread David L. Nicol
Dan Sugalski wrote: > Both the l and rvalues will need to participate. Sorry. Quick review of how C++ does it indicates that selecting an assignment operator from the lvalue's methods makes sense. Since we have dynamic typing, there's nothing keeping an assignment method from running through

Re: RFC: Higher resolution time values

2000-08-09 Thread David L. Nicol
Dan Sugalski wrote: > While it may not be correct, at least it's exact. If we go with an inexact > representation, we run the risk of accumulating errors and eventually > ending up with a number that's both inexact and incorrect. > > Dan Sugalski the even samurai Why n

Re: Overloading && ||

2000-08-09 Thread David L. Nicol
"Bryan C. Warnock" wrote: > This was the ass that I never found the gall to scratch, because I've > identified no solutions, and have found only problems. > > -- > Bryan C. Warnock > ([EMAIL PROTECTED]) Let me see if I can paraphrase you accurately: Defining a framework for modifying compil

Re: RFC 73 (v1) All Perl core functions should return ob

2000-08-09 Thread David L. Nicol
Damian Conway wrote: > >> What is: >> >> $x = date(); >> >> going to return? > > Probably the current scalar context result (i.e. a date string) > >> An object that has many different -ify methods: >> stringify >> numify >> hashify >> listify >

Re: And A Parser In A Pared Tree (was Re: Overloading && ||)

2000-08-10 Thread David L. Nicol
perl parser compiles perl language into perl op-code tree. Larry ("the" Larry) has said that a new parser might parse other languages into perl op-code trees too. If the parts of the language are well organized, a LanguageSwitch (the computer equivalent of a "context switch" in a conversation

Self-Sorting Containers

2000-08-11 Thread David L. Nicol
I've started talking about "containers" instead of arrays and hashes since those both tie directly to implementation details, and containers are abstractions. A self-sorting container would be easy enough to tie to, most methods would inherit from an underlying numbered array, except the ins

Re: Portable upper/lower case regexp matches

2000-08-11 Thread David L. Nicol
Peter Scott wrote: > >Perl 5.6.0 has [[:lower:]] and [[:upper:]]. > > Yes, but this one is worth a digraph. Question is, which one? Currently > the free ones are: > > \F \h \H \i \I \j \J \k \K \m \M \o \O \q \R \T \v \V \y \Y > > \v \V are being debated on p5p currently. > > I s

Re: Self-Sorting Containers

2000-08-11 Thread David L. Nicol
Damian Conway wrote: > >> methodoverloadoperator(%thehashinquestion, 'sort', {$a flubber $b}) >> >> What is a better syntax for this? > > tie %thehashinquestion, 'Sorted', flubber(^a,^b); > > ??? > > Damian Compiler will know to pass flubber as ref-to-code instead of intant eval

Re: we might as well give up now: CobolScript(R)

2000-08-11 Thread David L. Nicol
It's a vast and contrived joke, right? I like the way the "check out the (xx) page" links tend to link to exactly the page you are looking at Jarkko Hietaniemi wrote: > > We will never conquer the world with Perl 6: > CobolScript(R) got there before us. > > http://www.cobolscript.com/

Re: re rfc 15 typing

2000-08-10 Thread David L. Nicol
Michael Fowler wrote: > > > Which then raises a few more problems (whew): how do you coax user input > > > (which is an SV) into a value $foo can accept with very-strict on? > > > > You run it through an explicit conversion process, like using C in > > a C program > > Unfortunately, this involv

errors and their keywords and where catch can return to and stuff like that

2000-08-13 Thread David L. Nicol
Whose RFC deals with this? Why not call them throw and catch, like everywhere else, and reccomend them over die? In fact Die could be defined in terms of throw sub die(@){ throw(generic_fatal,$!,@_) } * Further discussion in the thread discussed the idea of returning to the point

Re: Self-Sorting Containers

2000-08-13 Thread David L. Nicol
Dave Storrs wrote: > > On Fri, 11 Aug 2000, David L. Nicol wrote: > > > I've started talking about "containers" instead of arrays and hashes > > since those both tie directly to implementation details, and containers > > are abstractions. > [...] &g

English language basis for "throw"

2000-08-14 Thread David L. Nicol
Dan Sugalski wrote: > > perl cribs from english as much as > any other language, spending some time to get names that fit well makes > perfect sense, especially since most of the perl programmers that start > using this won't be coming with huge gobs of experience from languages that > already do

draft RFC: example of C keyword affecting a list context

2000-08-14 Thread David L. Nicol
azy list to be passed to our filter function C, saving us from allocating the entire C array. C is still in the default busy context, so it returns a busy array, which C can iterate over safely. Tom Hughes wrote: > > In article <[EMAIL PROTECTED]>, "David L. Nicol"

Re: RFC 90 (v1) Builtins: zip() and unzip()

2000-08-14 Thread David L. Nicol
These things sound like perfectly reasonable CPAN modules. What's the block prevenenting their implementation w/in the perl5 framework? Ariel Scolnicov wrote: > > Damian Conway <[EMAIL PROTECTED]> writes: > > > Just to point out that the standard CS term is "merge". > > `merge' produces a

Re: MATRIX implementation (and context-based overloading)

2000-08-15 Thread David L. Nicol
This sort of thing is an excellent example of how method selection based on calling context can help. When somebody wants to overload existing keywords for their slick new type, with overloading based on context they don't have to touch the internals of the current methods at all. rapt

subroutines ==? methods

2000-08-15 Thread David L. Nicol
Jonathan Scott Duff wrote: > > On Mon, Aug 14, 2000 at 09:40:07PM -0500, David L. Nicol wrote: > > Jonathan Scott Duff wrote: > > > > > > > context-based method overloading > > > > > > I think you should s/method/subroutine/ everywhere in this

error handling and syntax extension

2000-08-16 Thread David L. Nicol
If "catch" can be defined DURING PARSING and SYNTAX ERRORS are catchable error handling can be used to define otherwise undefined syntax, becoming a macro language. This would be similar to the RFC18 immediate subroutines, as it would be another way to change the language of the remainder o

Re: subroutines ==? methods

2000-08-16 Thread David L. Nicol
Say we allow instantly tied lazy subroutine definitions like so: @naturals = (? { my $x=1; yield $x++ while 1 }) Is the code block in there a subroutine or a method? And why? How about using the eminently deprecatable "reset" operator to start a tied lazy array back at it's "original"

pascal-like "with" was Re: Default filehandles(was Re: command line option: $|++)

2000-08-16 Thread David L. Nicol
The poll can't have been exhaustive. I like these magic variables that depend on currently selected fie handles, they remind me of Pascal's C construction for entering the name space of a record structure. Anyone for generalizing "select" to a more general "with" keyword which would operate

Re: English language basis for "throw"

2000-08-16 Thread David L. Nicol
Bart Lateur wrote: > > To me, a program is much like a maze, a > multilevel walk in an old castle. And if you commit a faux pas of some kind, the guards show up and "throw" you off the north tower. -- David Nicol 816.235.1187 [EMAIL PROTECTED]

remember the "penguin" module?

2000-08-16 Thread David L. Nicol
The penguin module, as written about in an early TPJ http://cpan.valueclick.com/authors/id/F/FS/FSG/ is a way to mask off part of the functionality of your perl in order to "sandbox" with very fine grained control. Let's put that into the core of perl6, the ability to turn features off, part

Re: RFC 112 (v1) Assignment within a regex

2000-08-16 Thread David L. Nicol
Glenn Linderman wrote: > > This deserves a "me too". > > Perl6 RFC Librarian wrote: > > > The camel and the docs include this example: > > >if (/Time: (..):(..):(..)/) { > > $hours = $1; > > $minutes = $2; > > $seconds = $3; > > } > > > > This then becomes: > >

Re: RFC 17 (v2) Organization and Rationalization of Perl

2000-08-16 Thread David L. Nicol
s/PSEUDO\S?HASH/STRUCT/g

Re: RFC 81 (v2) Lazily evaluated list generation functions

2000-08-17 Thread David L. Nicol
> This RFC proposes that the existing C<..> operator produce a lazily > evaluated list. In addition, a new operation C<:> is proposed that allows > for the generation of lazily evaluated lists based on any Perl expression. Llama 2nd ed. calls ? the "lazy operator" w/in regexes, in my lazy props

Re: RFC 124 (v1) Sort order for any hash

2000-08-17 Thread David L. Nicol
Damian Conway wrote: > >>%professors{ $a->name cmp $b->name }; >> >>%students{ $$students{$b}{GPA} <=> $$students{$a}{GPA} }; > > These already mean something. Please don't "special-case" them. No they don't. [david@nicol1 perl]$ perl -le '%nums = (1..20); print %nums{1}' C

McNamara's C<$#> as a property of any array element

2000-08-17 Thread David L. Nicol
What if its a method of anything in an array? $_ is already a reference to the object on the array in for loops rather than a copy of it. What if we make change be not something about for loops, but about anything in an array? print "The index, in its array, of <<$_>> is $CORE::ARRAY

implied pascal-like "with" or "express"

2000-08-17 Thread David L. Nicol
_new = 3; # just set $record{something_new} to 3 }; Dave Storrs wrote: > > On Wed, 16 Aug 2000, David L. Nicol wrote: > > > a more general "with" keyword > > which would operate on a hash and be syntactic sugar for > > replacing all appearances of

Re: RFC 104 (v1) Backtracking

2000-08-17 Thread David L. Nicol
Jonathan Scott Duff wrote: > > On Tue, Aug 15, 2000 at 05:47:53PM -0600, Nathan Torkington wrote: > > I want > > @result = @a || @b; > > to be like: > > (@result = @a) or (@result = @b); > > > > That's what all my students keep expecting it to mean. > > And that's what I keep wishing it mea

Re: implied pascal-like "with" or "express"

2000-08-17 Thread David L. Nicol
Jeremy Howard wrote: > > This is one of those > few cases where VB has nicer syntax--within a 'with' block you have to > precede a property name with '.' to get the with block scope: > > dim height as double > dim ws as new Excel.worksheet // 'worksheet' has a 'height' property > > with

immediate "with" syntax and Sort order for any hash

2000-08-17 Thread David L. Nicol
Damian Conway wrote: > Actually, no I wouldn't. > I'd be happier if it were more explicit. > > How about: > > keys %professors = ^a->name cmp ^b->name; > > keys %students = $$students{^1}{GPA} <=> $$students{^0}{GPA} }; > > ;-) > > Damian Okay, let's see what you've got here

Re: implied pascal-like "with" or "express"

2000-08-17 Thread David L. Nicol
Jonathan Scott Duff wrote: > But no $ for the keys of %ws. > > %ws { > print ^height; # prints $ws{height} > print $height; # prints $height > } I'm thinking that ^name is short for $^name is short for ${^name} and the longer version is what you

Re: RFC 105 (v1) Downgrade or remove "In string @ must be \@"error

2000-08-17 Thread David L. Nicol
Glenn Linderman wrote: > > Peter Scott wrote: > > > I have often wished that digraphs were not bundled with variables in this > > respect, i.e., I wanted to put a string containing \n inside single quotes > > just 'cuz it didn't contain variables to be interpolated. Whether there's > > a way of

Re: RFC 115 (v1) Default methods for objects

2000-08-17 Thread David L. Nicol
Perl6 RFC Librarian wrote: > =head1 TITLE > > Default methods for objects > > =head1 ABSTRACT > > This RFC proposes syntactic support for default methods > that can be defined for blessed references. This would > allow the brackets C<()>, C<{}> and C<[]> to be used > for a variety of convenien

Re: McNamara's C<$#> as a property of any array element

2000-08-18 Thread David L. Nicol
Mike Pastore wrote: > > Any thoughts on this? Attributes. ($item : arrayposition) would tell us what the position is. -- David Nicol 816.235.1187 [EMAIL PROTECTED] Does despair.com sell a discordian calendar?

Re: RFC 124 (v1) Sort order for any hash : syntax as a macro, more laziness

2000-08-18 Thread David L. Nicol
Jonathan Scott Duff wrote: > > Does the presence of an ordering subroutine cause perl to generate a > linked list of all the elements of the %hash in the proper sequence > prior to iteration (and somehow attach it to the iterator)? Seems > like everytime we did that it would generate a new oper

Re: McNamara's C<$#> as a property of any array element

2000-08-18 Thread David L. Nicol
Jarkko Hietaniemi wrote: > > $item:n would be the position $item had in the last container it was in > > $item:i, you surely meant? $item:n would be the size of the list... The size of the list would be something like $#{$item:contained_in} the size of the list is not a property of the item, s

Re: RFC 126 (v1) Ensuring Perl's object-oriented future

2000-08-18 Thread David L. Nicol
Peter Scott wrote: > > At 05:12 AM 8/19/00 +1000, Damian Conway wrote: > >> The main downside of accessors is that you can't (currently) say > >> > >> local $obj->attribute = 2; > > > >Even if C returns an lvalue??? > > If it does, how do you localize it? What would that mean?

Re: RFCs (Re: Ideas that need RFCs?)

2000-08-18 Thread David L. Nicol
Here's my RFC todo list which I am dropping like a good mensch on the occasion of Friday Evening. RFC: Perl6 is Final. There will Be No Perl7 We declare that our framework willbe so flexiblke that anything can be done with it and there will be no penalty for something being in-

Re: RFCs (Re: Ideas that need RFCs?)

2000-08-21 Thread David L. Nicol
"Bryan C. Warnock" wrote: > > On Fri, 18 Aug 2000, David L. Nicol wrote: > > There will Be No Perl7 > > Of course not. Odd numbers are the development releases. The next > Perl after 6 will be 8. So maybe the reference implementation should be written in per

hype for upcoming top level parser draft

2000-08-21 Thread David L. Nicol
Larry Wall wrote: > > Ed Mills writes: > : But don't {} or {1} sort of do the same thing? > > Well, { warn "Encountered stub"; (); } would be more like it. But the > biggest problem with {} or {1} is that they don't resemble an ellipsis. > > Larry dot operator selection: The token clarifie

RFC: extend "study" to produce a fast grep through many regexes

2000-08-21 Thread David L. Nicol
title: study a list of regexes David Nicol. Aug 21 version 1 [EMAIL PROTECTED] Sometimes I have a group of regexen, and I would like to know which ones will match. Current practice is to "study" $situation and then grep them: example a: study $situation; @matches = @rules{

Re: implied pascal-like "with" or "express"

2000-08-21 Thread David L. Nicol
Ken Fox wrote: > IMHO, curries have nothing to do with this. All "with" really does is > create a dynamic scope from the contents of the hash and evaluate its > block in that scope. Right, the "with" people are using ^hats because its an available operator, just the same way the "curry" people

RFC: LAZY in scalar context resolves to ...

2000-08-21 Thread David L. Nicol
Some have been frustrated at the fact that after @ott = (1,2,3); $x = @ott $x == 3. What if one of the things that lazy arrays did differently from normal arrays was shifting on assignment, instead of counting themselves? This would solve several problems at once, including:

Re: New syntactic sugar builtin: in

2000-08-22 Thread David L. Nicol
This sounds like another job for the macro language. Anyone have any idea what the macro language should look like, aside from that the variables in it which will get replaced might wear hats? defining -language-macro might be premature because identifying what suggestions and shortcuts make

Re: RFC 133 (v1) Alternate Syntax for variable names

2000-08-22 Thread David L. Nicol
> > Consider the following syntax: > > my var; # declaring a scalar > my array[]; # declaring an array > my hash{};# declaring a hash For the remainder of the enclosing block, the barewords var, array and hash are to be interpreted as references to a scalar, an array, and a ha

Re: RFC 133 (v1) Alternate Syntax for variable names

2000-08-23 Thread David L. Nicol
David Corbin wrote: > > > > For the remainder of the enclosing block, the barewords var, > > array and hash are to be interpreted as references to a scalar, an > > array, and a hash. > > I'm confused by this statement. Are you suggesting an alternative to > the original RFC? No, I was trying

perl6-language@perl.org

2000-08-23 Thread David L. Nicol
Buddha Buck wrote: > Perhaps someone should RFC the new special variable &ME, which is > predefined to be the whole program. Who knows? Perhaps it would then make > sense to use @_ at the top level, as if the program was invoked as > "&ME(@ARGV);"... on -objects it has been proposed that &ME i

Re: RFC 143 (v1) Case ignoring eq and cmp operators

2000-08-25 Thread David L. Nicol
Perl6 RFC Librarian wrote: > =head1 IMPLEMENTATION > > Probably has to be added to perl internals... > > I wonder what will happen with overloads though - is eq/i a new operator > to overload or is the case-insensitivity somehow magically done by the > Perl interpreter even though eq was overl

infix functions

2000-08-25 Thread David L. Nicol
Jarkko Hietaniemi wrote: > " e q " that breaks our long and glorious tradition of splitting tokens on whitespace. How about e_q for this one? > That is, an operator that ignores any leading, any trailing, and treats > all intraspace as equivalent. If the embedded space is confusing,

Re: RFC 143 (v1) Case ignoring eq and cmp operators

2000-08-25 Thread David L. Nicol
Last week when I wrote "everything is an exception" this is what I was talking about. Nathan Torkington wrote: > This raises another issue, though: > > You'd obviously want to have a module that collected together your > favourite new operators. But if they were lexically scoped, they'd >

Re: RFC 157 (v1) Delete C and C commands.

2000-08-25 Thread David L. Nicol
Michael G Schwern wrote: > Compare: > > dbmopen(%foo, 'somefile', 0644); > > with: > %foo:persistent(file=>somefile);

Re: Something akin to ksh's <() and >() syntax

2000-08-25 Thread David L. Nicol
My largely ignored RFC about "shell style redirection" suggested pretty much this. perl5 has it as a feature hidden on the fourth page of the perldoc for "open" It also lets < neatly double as a compact print operator Chaim Frenkel wrote: > > With threading coming, would having a >() and

Re: What makes Perl Perl?

2000-08-25 Thread David L. Nicol
David Corbin wrote: > In addition to the four I posted, originally, I've added two. Here's my > working list. > > native pattern matching; > list manipulation > aweswome text processing. > It's application glue (thanks Tim) > Ability to write powerful 1-line programs. > Make easy things easy a

Re: Do we really need eq?

2000-08-29 Thread David L. Nicol
Steve Simmons wrote: > IMHO the code > > $a = '3.14'; # from reading a file > $b = '3.1400'; # from user input > if ($a == $b) { ... } > > should see the two args being tested in numeric context, do the numeric > casting, get floats, and do a floating compare. Durned if I know what

Re: Multiple for loop variables

2000-08-29 Thread David L. Nicol
Exactly. We need a nondestructive slice. Some short piece of syntax which expands for [my](list of vars) (big list){ ... } to my @uniquelynamedcopy = (big list); while ( [my](list of vars) = splice(@u15y,0,(length of list of vars))){ ... } I think the absence o

attributes definable as well as values Re: Do we really need eq?

2000-08-29 Thread David L. Nicol
Andy Dougherty wrote: > > On Tue, 29 Aug 2000, David L. Nicol wrote: > > > I'd like to see every number bundled with a "precision" attribute. > > While that might be useful for simple calculations, I expect it would > simply get in the way and sl

Re: RFC 111 (v2) Here Docs Terminators (Was Whitespace and Here Docs)

2000-08-29 Thread David L. Nicol
the semicolon after the hereis terminator thing might only work if the beginning of the hereis was the last thing on the line it appears on, that way there's no ambiguity $Goodone = < > I like it... I think I will add this to the next version. > > Richard > > -- > > [EMAIL PROTECTE

Re: RFC 122 (v1) types and structures

2000-08-29 Thread David L. Nicol
John Porter wrote: > > we should also support recursive data structures, > as in some functional languages. E.g. (pseudocode): > > define foo as { > short a; > foo b; # exists at first only "in potential". > long c; > }; > h

Re: RFC 162 (v1) Filtering Here Docs

2000-08-29 Thread David L. Nicol
Richard Proctor wrote: > > This leads back to my original "remove all whitespace". Somehow there is a > compromise to extracted from this. Have we explored using a subset of regex for end-markers? $long_string_possibly_indented_later = <<\w*##ENDEND##\w*; .

Re: RFC 168 (v1) Built-in functions should be functions

2000-08-29 Thread David L. Nicol
One function that takes an optional leading commaless arg: sub print(handle? $FH, @) or Two functions differentiated by their prototypes sub print(@); sub print(handle,@); I'm always forgetting the comma after the handlename in C statements because I learned "no c

Re: RFC 2 (v3) Request For New Pragma: Implicit

2000-08-29 Thread David L. Nicol
> > I am lazy. I am spoiled by the implicit $_. I like the implicit > $_. Implicit $_ good. Ugh. (Conversely, some people abhor the I believe you mean "Ug." "Ug" means you are speaking pidgin, while "Ugh" indicates disgust. > =head1 IMPLEMENTATION > > The front-end would have to detect v

Re: RFC 33 (v2) Eliminate bareword filehandles.

2000-08-29 Thread David L. Nicol
How about ALLOWING bareword everything-else? Start having filehandles work the way everyone expects them to at first, passing as arguments and so forth, without any special treatment? -- David Nicol 816.235.1187 [EMAIL PROTECTED] Subroutine one-arg, him c

Re: RFC 132 (v3) Subroutines should be able to return an lvalue

2000-08-30 Thread David L. Nicol
Johan Vromans wrote: > > Hi David, > > [Quoting David L. Nicol, on August 29 2000, 19:27, in "Re: RFC 132 (v3) Sub"] > > > With the enhanced C operator, subroutines can dynamically decide > > > what to return. > > > > With context-b

Re: Do we really need eq?

2000-08-30 Thread David L. Nicol
Fisher Mark wrote: > * Units of measure are optional; > * Units of measure are fast; and > * Implementing units of measure don't appreciably slow down computations > that don't use units of measure. enforced types without automatic conversions does all this, the matches are made once at compile-

Re: the C JIT

2000-08-31 Thread David L. Nicol
Sam Tregar wrote: > > On Thu, 31 Aug 2000, David L. Nicol wrote: > > run-time efficiency > > C doesn't get run-time efficiency from its syntax, so we can't really > expect to get anything here. It gets it from its compilation > architecture. If you wan

Re: the C JIT

2000-09-01 Thread David L. Nicol
Nathan Wiger wrote: > > "David L. Nicol" wrote: > > > > my dog $spot; > > to > > dog spot; > > > > If we only allow this where enough info is available to allocate dog-sized > > pieces of memory directly, Perl can blaze t

Re: the C JIT

2000-09-01 Thread David L. Nicol
Sam Tregar wrote: > > On Thu, 31 Aug 2000, David L. Nicol wrote: > > > We're talking about making a faster Perl. C's syntax requires enough > > clarity to compile to something quick. it is a very short hop from > > my dog $spot; > > to >

Re: the C JIT

2000-09-01 Thread David L. Nicol
Nathan Wiger wrote: > > "David L. Nicol" wrote: > > > > They gain us compliance with the whims of the people who like barewords > > for variable names. You may or may not find that to be a good thing. > > It's not just that I don't think drop

Re: RFC 177 (v1) A Natural Syntax Extension For Chained References

2000-08-31 Thread David L. Nicol
Perl6 RFC Librarian wrote: > arsenal. The constructs are: > > $ref->[[LIST]] > $ref->{{LIST}} > > The proposed respective meanings: > > $ref->[$elem[0]]->[$elem[1]}->[...]->[$elem[-1]] > $ref->{$elem[0]}->{$elem[1]}->{...}->{$elem[-1]} why not just use single

the C JIT

2000-08-30 Thread David L. Nicol
Dan Sugalski wrote: > I do want to have a set of C/XS/whatever sources as part of the test suite > as well--right now perl's test suite only tests the language, and I think > we should also test the HLL interface we present, as it's just as > important in some ways. I want to see Perl become a f

Re: the C JIT

2000-08-31 Thread David L. Nicol
David Corbin wrote: > A C JIT is an interesting idea. > > I think that a project works best when it has a set of goals (I haven't > seen one yet really for Perl 6). Unless this is one of the goals, I can > easily see how this could become a serious distraction to what I > perceive as the like

Re: RFC 177 (v1) A Natural Syntax Extension For ChainedReferences

2000-08-31 Thread David L. Nicol
Peter Scott wrote: > > >Having the > >indices in one place saves a lot of characters. Compare > > > > $r->{{qw(a b c d e f g h)}} > > > >versus > > > > $r->{a}->{b}->{c}->{d}->{e}->{f}->{g}->{h} > > But I would compare it to > > $r->{a}{b}{c}{d}{e}{f}{g}{h} > > which is

Re: Change "($one, $two)=" behavior for optimization? (was Re:RFC 175 (v1) Add C keyword to force list context (likeC))

2000-09-05 Thread David L. Nicol
Peter Scott wrote: > > At 11:48 AM 9/3/00 +1100, Damian Conway wrote: > >> Ever consider then having > >> > >> ($a, $b, $c) = ; > >> or > >> @a[4,1,5] = ; > >> > >> only read three lines? > > > >I think this is a superb idea, and look forward to someone's RFC'i

Re: RFC 179 (v1) More functions from set theory to manipulate arrays

2000-09-05 Thread David L. Nicol
> > =head1 ABSTRACT > > When programming in perl we need really often to calculate > union, intersection, difference between arrays. It will be > cool if such functions could be part of the perl6 language. Arrays/Lists are ordered, sets are not. For sets, hashes are a better perl representati

Re: the C JIT

2000-09-06 Thread David L. Nicol
) by mercury.Sun.COM (8.9.3+Sun/8.9.3) with ESMTP id OAA27600; Fri, 1 Sep 2000 14:52 Nathan Wiger wrote: > > "David L. Nicol" wrote: > > > > No, that would be > > > > dog $spot; > > No, it wouldn't: > > $r = new

Re: RFC 33 (v2) Eliminate bareword filehandles.

2000-09-06 Thread David L. Nicol
John Porter wrote: > > David L. Nicol wrote: > > > > > > How about ALLOWING bareword everything-else? Start having > > filehandles work the way everyone expects them to at first, > > passing as arguments and so forth, without any special treatment?

Re: $a in @b

2000-09-06 Thread David L. Nicol
Garrett Goebel wrote: > grep { ref($a) eq ref($b) } @b) # Same type? > grep { $a == $_ } @b) > grep { $a eq $_ } @b) > grep { $a > $_ } @b) > > Garrett grep doesn't short-circuit; you can't return or exit or last out of the thing. Maybe we could add support for C to C

Re: RFC 33 (v2) Eliminate bareword filehandles.

2000-09-06 Thread David L. Nicol
Buddha Buck wrote: > What advantage does this give None whatsoever. I should have selected a less contentious example that file handles to demonstrate my opinion that tagged barewords should be allowed to do anything, not in exclusion of, but in addition to, the syntactically tagged scalar

Re: the C JIT

2000-09-06 Thread David L. Nicol
Nathan Wiger wrote: > Intermingling it freely: > >my Dog $spot; >int x; >my int $y; >#include >char * name; >#do some regexp matching >s/x/5/;/* match the C value of x defined above */ > > Is really confusing, even for us humans. :-) > > -Nate Is it confusing?

we already have barewords as variables if we want them Re: the C JIT

2000-09-06 Thread David L. Nicol
Nathan Wiger wrote: > > "David L. Nicol" wrote: > > > > s/x/5/; # this is still going to replace > > # all the eckses in $_ with fives. > > Why? This is an arbitrary decision if you've declared variables to be > barewords.

Re: the C JIT

2000-09-06 Thread David L. Nicol
"Myers, Dirk" wrote: > I still find this whole idea confusing, though. Just out of curiosity, > though, would: > > #include a way for users to bail out gracefully > > be a syntax error? It is clear to us that that is a comment and not a preprocessor directive. The #include preprocesso

Re: the C JIT

2000-09-07 Thread David L. Nicol
"Myers, Dirk" wrote: > $mode = 0755 ; > $file = "Foobar" ; > > #include > #include > > chmod($mode, $file) ; > > Which chmod gets called, perl or C? What are the rules for figuring this > out? > > Dirk Following the documentation at http://www.pe

Re: we already have barewords as variables if we want them Re: the C JIT

2000-09-07 Thread David L. Nicol
John Porter wrote: > > David L. Nicol wrote: > > > > A bareword inside doublequotes is not interpreted, in Perl or C. > > No; a "bareword" in quotes (any kind) is not a bareword. > > -- > John Porter huh? --

Re: RFC 181 (v1) Formats out of core / New format syntax

2000-09-07 Thread David L. Nicol
Johan Vromans wrote: > my $file_format = qf( > @<: @ > $name, $ssn > ); > > Now, $file_format would be a Format object (compare this with qr//, > that produces a Regex object). or the proposed qs// which would produce a packed structure definition

Re: RFC 199 (v1) Short-circuiting C and C with C

2000-09-07 Thread David L. Nicol
The "assignment from a lazy list" section of RFC 123 suggests a system for requesting the first however many items out of a map or grep by making it lazy and then assigning it to an array of that size. "last" is more flexible, if you are looking for a condition more complex than the first one,

Re: $a in @b

2000-09-07 Thread David L. Nicol
John Porter wrote: > heh. for a normal sub, > > sub foo { > return( 42 ); > } > > finds OMWTDI as > > sub foo { > 42; > last; > } > > Somehow, this seems like very natural perl to me. > > -- > John Porter I'd

Re: $a in @b

2000-09-07 Thread David L. Nicol
Damian Conway wrote: > A C such as: > > @array = grep BLOCK LIST > > is equivalent to: > > @tmp = (); > foreach (LIST) { push @tmp, $_ if do BLOCK } > @array = @tmp; > > That similarity would not change in any way under the proposal > (except to be made stronge

Re: we already have barewords as variables if we want them Re: the C JIT

2000-09-08 Thread David L. Nicol
John Porter wrote: > undecorated variable names suffer from this showstopping weakness: > they can't be interpolated. Unless we change other aspects of perl's > syntax to support it, that is -- maybe s/${x}/5/. Now, maybe we can > live without variable interpolation; but I'd bet most perl progr

labels within expressions?

2000-09-11 Thread David L. Nicol
John Porter wrote: > > Randal L. Schwartz wrote: > > > > Yes, I'd be in favor of making return() in a valued block (as opposed > > to a looping block) abort the block early and return the value. > > Imho, it should return the value, but not abort the block. That's > not very dwimmy. Loop block

Re: $a in @b

2000-09-12 Thread David L. Nicol
"Randal L. Schwartz" wrote: > how do you indicate with 'last' that you > want a false return, or a true return? This never comes up with a do > {} block, or a subroutine block, because while those are being > evaluated for a value, they don't respect last/next/redo. if "last" means, return the

C in RFC 31

2000-09-12 Thread David L. Nicol
Damian Conway wrote: > :-) > > I did consider that too, but the problem is that according to RFC 31 a > C leaves the future entry point of a block at the next statement > after the C, whereas the block needs to start from the beginning on > each iteration. > > Damian Have you considered addin

more yield tricks ((was Re: C in RFC 31

2000-09-13 Thread David L. Nicol
Damian Conway wrote: > > What you want is: > > %newhash = map {yield $_; transform($_)} %oldhash; > > This flattens the %oldhash to a sequence of key/value pairs. Then the > first time the map block is called (i.e. on a key) it immediately > returns the key. The second time, it resumes

Re: $a in @b (RFC 199)

2000-09-13 Thread David L. Nicol
"Randal L. Schwartz" wrote: > > I think we need a distinction between "looping" blocks and > "non-looping" blocks. And further, it still makes sense to > distinguish "blocks that return values" (like subroutines and map/grep > blocks) from either of those. But I'll need further time to process

Re: 'eval' odd thought

2000-09-14 Thread David L. Nicol
Mark-Jason Dominus wrote: > > The perl 5 -> perl 6 translator should replace calls to 'eval' with > calls to 'perl5_eval', which will recursively call the 5->6 translator > to translate the eval'ed string into perl 6, and will then eval the > result. And that gives us a convenient name space for

Re: RFC 199 (v3) Short-circuiting built-in functions and user-definedsubroutines

2000-09-15 Thread David L. Nicol
> The current ideas tend to converge around While reading the current rfc199.2 version I imagined another way to do this. Instead of adding a new escape, what if we could fiddle with the looping condition? Given a grep that works like so: sub mygrep(&@){ local $inde

Re: $a in @b (RFC 199)

2000-09-14 Thread David L. Nicol
'John Porter' wrote: > > David L. Nicol wrote: > > "Randal L. Schwartz" wrote: > > > > > > I think we need a distinction between "looping" blocks and > > > "non-looping" blocks. And further, it still makes sense

  1   2   3   >