Explicit bracketing of curried expressions

2000-08-09 Thread Jeremy Howard
In trying to write some algorithms using the proposed higher-order function notation, I keep finding myself wanting to explicitly bracket parts of the curried expression: $sum_xy = sub {reduce ^last+^x*^y, zip($_[0], $_[1])}; Sure, in this case reduce() would probably be written such that its

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

2000-08-09 Thread Damian Conway
> >> An object that has many different -ify methods: > >> stringify > >> numify > >> hashify > >> listify > >> objectify (!) > > > > Possible, but blech. > > Why is that more blech? Because it's "heavy". However, if Dan assures me

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: 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 67 (v1) Deep Copying, aka, cloning around.

2000-08-09 Thread Damian Conway
> > > Why would it be necessary to deep copy a CODE reference? > > > > It might not be necessary. I'm still learning how to write kosher Perl... > > elegance is a long way off for me. > > Imagine storing your code along with your data in a database for use > later (persist

Re: RFC 67 (v1) Deep Copying, aka, cloning around.

2000-08-09 Thread Jonathan Scott Duff
On Wed, Aug 09, 2000 at 11:46:12AM -0500, Garrett Goebel wrote: > From: Peter Scott [mailto:[EMAIL PROTECTED]] > > > > >I would like deep copying to include copying CODE. It would > > >be useful for implementing object methods... > > > > Why would it be necessary to deep copy a CODE reference? >

Re: AGAINST RFC 48 (v1) Replace localtime() and gmtime() with da

2000-08-09 Thread Jonathan Scott Duff
On Wed, Aug 09, 2000 at 10:10:29AM -0700, Nathan Wiger wrote: > Agreed. General-purpose timezone support is scheduled for a swift and > painless death in the next version of RFC 48. Only the local timezone > and GMT will be included in the RFC, same as now. By "local timezone" do you mean that so

Re: Overloading && ||

2000-08-09 Thread Bryan C . Warnock
On Wed, 09 Aug 2000, Dan Sugalski wrote: > I've not seen a pragma yet that affects lexing, though I may have missed > some. (I don't consider the lexical/package thing a lexer issue, since it's > not) They change the behaviour of the generated code, yes, but not the > lexing/parsing/whatever of

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

2000-08-09 Thread Damian Conway
> DC> Urgh. If you want lazy eval, say so explicitly: > > DC> sub somesub (?@) { > DC> my @foo = @_; > DC> } > > Where do you want the lazy specified -- on the caller or the callee? > Or should it be available to both? (and of course the opposite >

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

2000-08-09 Thread Chaim Frenkel
> "DC" == Damian Conway <[EMAIL PROTECTED]> writes: DC> Urgh. If you want lazy eval, say so explicitly: DC> sub somesub (?@) { DC> my @foo = @_; DC> } Where do you want the lazy specified on the caller or the callee? Or should it be available to both? (and of course the

Re: Overloading && ||

2000-08-09 Thread Chaim Frenkel
> "BCW" == Bryan C Warnock <[EMAIL PROTECTED]> writes: BCW> It seems to me the generally inability to influence the lexer is the BCW> one general weakness in Perl. Well, what's wrong with a builtin macro capablity that is allowed to read the rest of the input stream. Some parsing would be do

Re: Overloading && ||

2000-08-09 Thread Dan Sugalski
At 09:22 PM 8/9/00 -0400, Bryan C. Warnock wrote: >But. > >It seems to me the generally inability to influence the lexer is the >one general weakness in Perl. A weakness shared by pretty much every language I can think of. (Actually I can't think of one that doesn't have it, but I may be ove

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

2000-08-09 Thread Dan Sugalski
At 07:54 PM 8/9/00 -0600, Nathan Torkington wrote: >Damian Conway writes: > > With extra contexts I can be surer: > > > > my $yesterday = date() - 86400; # reasonable to expect epoch integer > > my $today = "today is " . date(); # reasonable to expect date string > > my $tomorrow = date()->{

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

2000-08-09 Thread Damian Conway
> 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 > objectify (!) Possible, but blech.

Re: RFC 76 (v1) Builtin: reduce

2000-08-09 Thread Damian Conway
> While we are here, can reduce itself generate an average? I.e. something > cuter than: > >$avg = reduce { $_[0] + $_[1] } @numbers / @numbers; Of course. This is about as cute as it gets: $ave = ${reduce( bless( \(((ref(^x)?$^x*ref(^x):^x)+^y)/((ref(^x)||1)+1)),

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

2000-08-09 Thread Nathan Torkington
Damian Conway writes: > With extra contexts I can be surer: > > my $yesterday = date() - 86400; # reasonable to expect epoch integer > my $today = "today is " . date(); # reasonable to expect date string > my $tomorrow = date()->{DoY} + 1; # reasonable to expect hash ref (please hold, th

Re: Overloading && ||

2000-08-09 Thread Bryan C . Warnock
On Wed, 09 Aug 2000, Peter Scott wrote: > I guess it's getting too incestuous with the lexer. On Wed, 09 Aug 2000, Nick Ing-Simmons wrote: > That is the root of the problem. On Wed, 09 Aug 2000, Damian Conway wrote: > User-defined operators are a can of rattle-snakes that I *seriously* > recomme

Re: Overloading && ||

2000-08-09 Thread Nathan Torkington
Joke time on this thread is over, back to work you all! Nat (cracking the whip :-)

RE: RFC 58 (v1) C changes.

2000-08-09 Thread Bryan C . Warnock
On Wed, 09 Aug 2000, Brust, Corwin wrote: > So, kids, whatcha doing with that return value? (the number of characters > removed by the operation)? Store it (in paragraph mode) so I know how many \n's to append back on when spitting the output back. (Provided that matters. Otherwise, I just ign

Re: RFC 76 (v1) Builtin: reduce

2000-08-09 Thread Chaim Frenkel
> "DC" == Damian Conway <[EMAIL PROTECTED]> writes: >> And for the N case, it gets even uglier. So reduce should be able >> to supply the next N-1 defined() values. DC> $def_sum = reduce { $_[0]+$_[1] } grep {defined} @numbers; Fine. Even better if the optimizer could recognize the id

Re: RFC 78 (v1) Improved Module Versioning And Searching

2000-08-09 Thread Chaim Frenkel
Let's not throw this out completely. Let's explore the possiblities. Making a module local to the using package, might have interesting properties. The only items of interest are the globals. And by making them visible (or a version visible) to the use-ing module, two modules can get different b

Re: vector and matrix calculations in core? (was: Re: Ramblings on "base class" for SV etc.)

2000-08-09 Thread Jeremy Howard
Bryan C.Warnock wrote: > On Wed, 09 Aug 2000, Jeremy Howard wrote: > > Of course, if the user wants to overload this behaviour, we should let them. > > In the multiplication example, however, I would have thought that 'x' is a > > more suitable inner product operator... > > And that seems to be wh

Re: vector and matrix calculations in core? (was: Re: Ramblings on "base class" for SV etc.)

2000-08-09 Thread Bryan C . Warnock
On Wed, 09 Aug 2000, Jeremy Howard wrote: > Of course, if the user wants to overload this behaviour, we should let them. > In the multiplication example, however, I would have thought that 'x' is a > more suitable inner product operator... And that seems to be where most of the critics of non-sca

Re: access to pod/doc text by code

2000-08-09 Thread Brad Appleton
[re Pod::Usage and pod2usage] > i think reading the file may have issues like finding it. Not a problem. You can tell pod2usage where to look or give it a search path > have to read that file for stuff that was in the source. so some better > syntax to make that accessible to the code seems like

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: RFC 78 (v1) Improved Module Versioning And Searching

2000-08-09 Thread Bart Lateur
On 9 Aug 2000 15:03:40 -, Perl6 RFC Librarian wrote: >Improved Module Versioning And Searching [About loading different versions of a module at the same time] The whole thing sounds whacky to me. I don't really mind that @INC is searched for the most recent version of a module, but otherwi

Re: overloading assignment operators

2000-08-09 Thread Dan Sugalski
At 10:33 PM 8/9/00 +, David L. Nicol wrote: >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. Sure, and using the rvalue makes sense

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: Infinite lists (was Re: RFC 24 (v1) Semi-finite (lazy) lists)

2000-08-09 Thread Damian Conway
> > I'm thinking of recanting the whole RFC! :-) > > <*checking etymology*> hmmm . . . "recant" . . . "recant" . . . > doesn't that mean to sing the whole thing over again? Literally: "to sing a different tune". :-) > Seems to me that while putting hooks in the core to allow thi

Re: Infinite lists (was Re: RFC 24 (v1) Semi-finite (lazy) lists)

2000-08-09 Thread Ted Ashton
Thus it was written in the epistle of Damian Conway, >> I'm looking forward to the upcoming writeup :-). > > I'm thinking of recanting the whole RFC! :-) <*checking etymology*> hmmm . . . "recant" . . . "recant" . . . doesn't that mean to sing the whole thing over again? :-), Ted P.S. Se

Re: Infinite lists (was Re: RFC 24 (v1) Semi-finite (lazy) lists)

2000-08-09 Thread Damian Conway
> I'm looking forward to the upcoming writeup :-). I'm thinking of recanting the whole RFC! :-) Damian

Re: vector and matrix calculations in core? (was: Re: Ramblings on "base class" for SV etc.)

2000-08-09 Thread Jeremy Howard
Bart Lateur wrote: > If you're talking about matrix manipulations, I should immediately hold > you back. Perl arrays are pretty bad as is for representing matrices. > Don't let anybody tell you otherwise: Perl data structures are > one-dimensionaly by nature. > A lazily evaluated slicing operator

Re: Infinite lists (was Re: RFC 24 (v1) Semi-finite (lazy) lists)

2000-08-09 Thread Ted Ashton
Thus it was written in the epistle of Jeremy Howard, > The reason that having (1..) implies having (..-1) is that if you allow > (1..), then this is a valid construct: > > @dot_dot_neg_one = reverse (map {-$_} (1..)); > > which is identical to (..-1)! So scrapping (..-1) doesn't actually win y

Re: RFC: Higher resolution time values

2000-08-09 Thread Dan Sugalski
At 08:18 PM 8/9/00 +, Nick Ing-Simmons wrote: >Dan Sugalski <[EMAIL PROTECTED]> writes: > >At 06:16 PM 8/9/00 +, Nick Ing-Simmons wrote: > >>Dan Sugalski <[EMAIL PROTECTED]> writes: > >> >> > >> >>As an engineer I would really like to know when you are going to > >> >>run out of precision

Re: RFC 76 (v1) Builtin: reduce

2000-08-09 Thread Randal L. Schwartz
> "Chaim" == Chaim Frenkel <[EMAIL PROTECTED]> writes: DC> For example, to short-circuit if the reduction ever becomes undef: DC> $sum = { defined $_[0] or last; $_[0]+$_[1] } 0, @numbers; Chaim> Actually, it would be easier to do in reduce, the undefs should Chaim> simply be ignored. If I

Re: RFC 78 (v1) Improved Module Versioning And Searching

2000-08-09 Thread Ted Ashton
Thus it was written in the epistle of Steve Simmons, > > > . . . but I already promised the CPAN > > workers that I'd make that last statement false. There's no reason in > > principle why two modules shouldn't be allowed to have their own view > > of reality. Just because you write Foo::bar in

Re: RFC 76 (v1) Builtin: reduce

2000-08-09 Thread Damian Conway
> Actually, it would be easier to do in reduce, the undefs should > simply be ignored. > > Otherwise having the user code it, becomes > >{ defined $_[0] && defined $_[1] ? $_[0] + $_[1] >: defined $[0] ? $_[0] : $_[1] } > > Pretty ugly. > > And

Re: RFC 78 (v1) Improved Module Versioning And Searching

2000-08-09 Thread Dan Sugalski
At 01:50 PM 8/9/00 -0700, Larry Wall wrote: >Dan Sugalski writes: >: At 11:11 AM 8/9/00 -0700, Larry Wall wrote: >: >Dan Sugalski writes: >: >: Does that mean, then, that when module A does a "$C::bar = 1" it >affects a >: >: different package namespace than module B doing a "$C::bar = 2"? >: > >

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

2000-08-09 Thread Dan Sugalski
At 09:16 PM 8/9/00 +, David L. Nicol wrote: >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 ha

Re: vector and matrix calculations in core? (was: Re: Ramblings on "base class" for SV etc.)

2000-08-09 Thread Dan Sugalski
At 11:13 PM 8/9/00 +0200, Bart Lateur wrote: >On Wed, 09 Aug 2000 12:46:32 -0400, Dan Sugalski wrote: > > >> > @foo = @bar * @baz; > > >Given that the default action of the multiply routine for an array in > >non-scalar context would be to die, allowing user-overrides of the > >functions would p

Re: Infinite lists (was Re: RFC 24 (v1) Semi-finite (lazy) lists)

2000-08-09 Thread Jeremy Howard
Ted Ashton wrote: > I understand very well the concern. I, for one, don't agree that having > (1..) in the language implies that having (..-1) is possible (though it does > make sense to me that having (1..) and (..-1) would imply having (..)). After > all, if I were to write > > for (1..) { >

Re: RFC 54 (v1) Operators: Polymorphic comparisons

2000-08-09 Thread Damian Conway
> > 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. Huh??? I draw exactly the opposite

Re: RFC 76 (v1) Builtin: reduce

2000-08-09 Thread Chaim Frenkel
> "DC" == Damian Conway <[EMAIL PROTECTED]> writes: DC> I'm not sure how this would affect the proposal. If an item in the DC> list being reduced is undef, it appears in the reduction DC> subroutines arg list as undef. The reduction subroutine can then DC> handle it (or not) as it chooses.

Re: Infinite lists (was Re: RFC 24 (v1) Semi-finite (lazy) lists)

2000-08-09 Thread Jeremy Howard
Ted Ashton wrote: > Thus it was written in the epistle of John Porter, > > Ken Fox wrote: > > > > > > Both of those expressions are the infinite list (-infinity..-1). I have > > > no idea how to write that properly 'cause I'm not a math guy. These > > > things aren't streams (infinite queues) -- t

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

Re: Overloading && ||

2000-08-09 Thread Randal L. Schwartz
> "Damian" == Damian Conway <[EMAIL PROTECTED]> writes: Damian> Actually, the plan is exactly the opposite. By the time I'm finished Damian> everything will be done...in constant time! What he keeps failing to mention is that the "constant time" of which he speaks is greater than the MTBF...

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

2000-08-09 Thread Steve Simmons
I'm pretty much opposed to this idea. It's pushing OO too far onto perl.

Re: RFC 78 (v1) Improved Module Versioning And Searching

2000-08-09 Thread Steve Simmons
On Wed, Aug 09, 2000 at 10:44:03AM -0700, Larry Wall wrote: > : Note that it may not be possible to satisfy conflicting requests. If > : module C and module C demand two different versions of the same > : module C, the compiler should halt and state the module conflicts. > > Pardon me for snipin

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: vector and matrix calculations in core? (was: Re: Ramblings on "base class" for SV etc.)

2000-08-09 Thread Bart Lateur
On Wed, 09 Aug 2000 12:46:32 -0400, Dan Sugalski wrote: >> > @foo = @bar * @baz; >Given that the default action of the multiply routine for an array in >non-scalar context would be to die, allowing user-overrides of the >functions would probably be a good idea... :) [Is this still -internal

Re: RFC 78 (v1) Improved Module Versioning And Searching

2000-08-09 Thread Larry Wall
Dan Sugalski writes: : At 11:11 AM 8/9/00 -0700, Larry Wall wrote: : >Dan Sugalski writes: : >: Does that mean, then, that when module A does a "$C::bar = 1" it affects a : >: different package namespace than module B doing a "$C::bar = 2"? : > : >Presumably. : : H. That brings up some issues

Re: RFC 79 (v1) Code which is both executable and POD.

2000-08-09 Thread Michael Mathews
Larry Wall said: > John Porter writes: > : So, are you saying that if this RFC is implemented, POD would be > : an good way to comment code? > It already is, as far as I'm concerned. Please, if I'm missing something specific please explain it to me. But here's what I can tell from the documentati

Re: Things to remove

2000-08-09 Thread Bart Lateur
On Tue, 8 Aug 2000 11:25:56 -0500, Jonathan Scott Duff wrote: >Someone proposed (I think I deleted that email) to make > > while () { ... } > >work like > > while () { chomp; ... } Guilty. I've benchmarked the above codes, with '...' replaced by nothing, chomp vs. the -l command

Re: RFC 76 (v1) Builtin: reduce

2000-08-09 Thread Damian Conway
> >Builtin: reduce > > There are some things unspecified. Specifically 'special' reduce variables. > You've got: > > > $sum = reduce {$_[0]+$_[1]} 0, @numbers; > > $sum = reduce ^_+^_,0, @numbers; > > $min = reduce ^x <= ^y ? ^x :

Re: RFC 76 (v1) Builtin: reduce

2000-08-09 Thread Dan Sugalski
At 02:46 PM 8/9/00 +, Perl6 RFC Librarian wrote: >=head1 TITLE > >Builtin: reduce There are some things unspecified. Specifically 'special' reduce variables. You've got: > $sum = reduce {$_[0]+$_[1]} 0, @numbers; > $sum = reduce ^_+^_,0, @numbers; > $

Re: RFC 79 (v1) Code which is both executable and POD.

2000-08-09 Thread Chaim Frenkel
Doesn't that put the formating for a target within the document. Shouldn't that be external to the actual markup? How about backing up a bit, and adding a style sheet to POD? Then only markup will be in pod, then making things disappear would be the job of the stylesheet. > "LW" == Larry W

Re: Overloading && ||

2000-08-09 Thread Nick Ing-Simmons
Dan Sugalski <[EMAIL PROTECTED]> writes: >>I have often wondered whether a language could allow user-defined >>operators. The fact that none have done it should be a clue :-) > >What, like C++? ("I don't believe in it?" "What, C++? Just a conspiracy of >computer programmers?") You cannot as fa

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 Chaim Frenkel
> "NT" == Nathan Torkington <[EMAIL PROTECTED]> writes: NT> 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

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

2000-08-09 Thread John Porter
Johan Vromans wrote: > > Be reminded that Perl++ will increment Perl, but return the _current_ > value. Heh, at least we're not python = python + 1 -- John Porter

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

2000-08-09 Thread Chaim Frenkel
> "DS" == Dan Sugalski <[EMAIL PROTECTED]> writes: DS> At 01:33 PM 8/9/00 -0400, Chaim Frenkel wrote: >> I don't think it will be a half million objects. >> >> Let's take stat (and all the other long list returns). The underlying >> implementation object could be a packed structure psuedohas

Re: RFC: Higher resolution time values

2000-08-09 Thread Nick Ing-Simmons
Dan Sugalski <[EMAIL PROTECTED]> writes: >At 06:16 PM 8/9/00 +, Nick Ing-Simmons wrote: >>Dan Sugalski <[EMAIL PROTECTED]> writes: >> >> >> >>As an engineer I would really like to know when you are going to >> >>run out of precision in double - that is forty something bits of mantissa. >> >>Th

Re: RFC 79 (v1) Code which is both executable and POD.

2000-08-09 Thread John Porter
Uri Guttman wrote: > > "JP" == John Porter <[EMAIL PROTECTED]> writes: > > JP> Maybe what's needed is two distinct perl pod processor types, one > JP> which passes on the text literally to the compiler, and one which > JP> wraps it up like a string literal. > > JP> print > >

Re: RFC 76 (v1) Builtin: reduce

2000-08-09 Thread Bart Lateur
On 09 Aug 2000 13:49:24 -0400, Chaim Frenkel wrote: >Assuming a "use tristate", undef + number = undef > >This might require that the reduce function be able to ignore undefs. >Either always under the tristate pragma. Or on a case by case basis. grep defined, LIST -- Bart.

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

2000-08-09 Thread Damian Conway
> I'm nervous about these different contexts. I thought scalar vs list > was confusion enough. Now we're talking about overloading even > further? We need to think VERY long and VERY hard about this before > thinking it's a good thing. Well, I have, and I do. (Though I'm no longer

Re: Overloading && ||

2000-08-09 Thread Peter Scott
At 07:45 PM 8/9/00 +, Nick Ing-Simmons wrote: >Peter Scott <[EMAIL PROTECTED]> writes: > >At 06:23 PM 8/9/00 +, Nick Ing-Simmons wrote: > >>While I remember - it would be good if overload mechansim > >>could be extended to cover && and || as well as & and | > >>with the class deciding if s

Re: chomp & unchomp

2000-08-09 Thread Bart Lateur
On Wed, 9 Aug 2000 15:42:24 -0400, John Porter wrote: >Bryan C. Warnock wrote: >> >> Chomp removes one or more line separators from the end. > >It does? You're using a different version of Perl than I am. Try setting $/ to the empty string. (not undef!) -- Bart.

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

2000-08-09 Thread Johan Vromans
Mike Pastore <[EMAIL PROTECTED]> writes: > Which is the reason I suggest Perl++ as a name for the language, instead > of Perl6. :) Be reminded that Perl++ will increment Perl, but return the _current_ value. -- Johan

Re: Overloading && ||

2000-08-09 Thread Nathan Torkington
Peter Scott writes: > I have often wondered whether a language could allow user-defined > operators. The fact that none have done it should be a clue :-) I guess > it's getting too incestuous with the lexer. Ilya sent in a patch for user-defined operators. It was rejected, not least because

Re: chomp & unchomp

2000-08-09 Thread Bryan C . Warnock
On Wed, 09 Aug 2000, John Porter wrote: > Bryan C. Warnock wrote: > > > > Chomp removes one or more line separators from the end. > > It does? You're using a different version of Perl than I am. Sorry. You're correct. I was rolling the string, list, and paragraph mode removals all into one a

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

2000-08-09 Thread Nathan Torkington
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) Of course, we're trying to kill $!

Re: RFC 79 (v1) Code which is both executable and POD.

2000-08-09 Thread Uri Guttman
> "JP" == John Porter <[EMAIL PROTECTED]> writes: JP> Maybe what's needed is two distinct perl pod processor types, one JP> which passes on the text literally to the compiler, and one which JP> wraps it up like a string literal. JP> print JP> =for perl-string pod JP> Help

Re: RFC 54 (v1) Operators: Polymorphic comparisons

2000-08-09 Thread Clayton Scott
Dan Sugalski wrote: > > At 05:12 PM 8/7/00 -0400, Chaim Frenkel wrote: > > > "DC" == Damian Conway <[EMAIL PROTECTED]> writes: > > > > >> I currently fail to switch to 'eq' many times when I should, but the > > >> failure mode is obvious. Her the failure mode will be really strange. > > > >DC

Re: Overloading && ||

2000-08-09 Thread Nick Ing-Simmons
Peter Scott <[EMAIL PROTECTED]> writes: >At 06:23 PM 8/9/00 +, Nick Ing-Simmons wrote: >>Damian Conway <[EMAIL PROTECTED]> writes: >> >Operator overloading is scheduled to be revamped. >> >>While I remember - it would be good if overload mechansim >>could be extended to cover && and || > >Yes.

Re: RFC 48 (v2) Objects should have builtin stringifying

2000-08-09 Thread Michael Fowler
On Wed, Aug 09, 2000 at 08:37:35AM -0700, Nathan Wiger wrote: > > I think a stringified reference is worth seeing, moreso than a simple undef, > > for debugging purposes if nothing else. > > Debugging is great, but I don't think this is the way to do it. The > reason is some objects might have a

Re: chomp & unchomp

2000-08-09 Thread Dan Sugalski
At 03:36 PM 8/9/00 -0400, Bryan C. Warnock wrote: >On Wed, 09 Aug 2000, Ed Mills wrote: > > Here is the argument- > > > > Perl has (had?) chomp(). It removes \n at the end of a line. That's > > something we often need to do. We ALSO often need to ADD \n to the end > of a > > line. This usually lo

Re: chomp & unchomp

2000-08-09 Thread John Porter
Bryan C. Warnock wrote: > > Chomp removes one or more line separators from the end. It does? You're using a different version of Perl than I am. -- John Porter

Re: RFC 79 (v1) Code which is both executable and POD.

2000-08-09 Thread John Porter
Uri Guttman wrote: > > but how will perl access that text? what perl var get the text in that > =for block? Well, the proposal was more about getting perl code into doco than getting doco into perl. > the proposal for a special here doc notation is possible but > that can be hard for pod to p

Re: chomp & unchomp

2000-08-09 Thread Bryan C . Warnock
On Wed, 09 Aug 2000, Ed Mills wrote: > Here is the argument- > > Perl has (had?) chomp(). It removes \n at the end of a line. That's > something we often need to do. We ALSO often need to ADD \n to the end of a > line. This usually looks something like: > > print "$kitty\n"; Chomp removes o

Re: DRAFT RFC: Enhanced Pack/Unpack

2000-08-09 Thread Dan Sugalski
At 07:26 PM 8/7/00 +0100, Tom Hughes wrote: > From /usr/include/endian.h on my linux box: > >#define __LITTLE_ENDIAN 1234 >#define __BIG_ENDIAN4321 >#define __PDP_ENDIAN3412 > >Basically PDP or middle endian is low byte first within each word >but high word first in the overall longword.

Re: DRAFT RFC: Enhanced Pack/Unpack

2000-08-09 Thread Dan Sugalski
At 10:53 PM 8/7/00 +0200, Bart Lateur wrote: >Right. Why you people don't call it "Intel" vs. "Motorola", like the >rest of the civilised world, I don't know. ;-) See the TIFF spec, for >example. > >Er, in case you were in any doubt: Motorola (from the 68k processors) is >BigEndian, Intel (x86)

Re: Overloading && ||

2000-08-09 Thread Dan Sugalski
At 05:23 AM 8/10/00 +1000, Damian Conway wrote: >> Of course, by the time Damian's done, perl won't actually *do* >> anything--you'll need to fire off another window and do a "kill >> -HEYYOUGETMOVING 23442" to actually make something happen... > >Actually, the plan is exactly the oppo

Re: RFC 54 (v1) Operators: Polymorphic comparisons

2000-08-09 Thread Dan Sugalski
At 05:12 PM 8/7/00 -0400, Chaim Frenkel wrote: > > "DC" == Damian Conway <[EMAIL PROTECTED]> writes: > > >> I currently fail to switch to 'eq' many times when I should, but the > >> failure mode is obvious. Her the failure mode will be really strange. > >DC> I would claim that the failure mode

Re: Overloading && ||

2000-08-09 Thread Damian Conway
> Of course, by the time Damian's done, perl won't actually *do* > anything--you'll need to fire off another window and do a "kill > -HEYYOUGETMOVING 23442" to actually make something happen... Actually, the plan is exactly the opposite. By the time I'm finished everything will be done

Re: Overloading && ||

2000-08-09 Thread Damian Conway
> >What if I want to overload && and || so that they help built an expression > >tree, rather than immediately evaluating? > > Is it worth the damage it will cause to fragile brains like mine? "Pain is the weakness leaving your body!" ;-) > I have often wondered whether a langua

Re: RFC 79 (v1) Code which is both executable and POD.

2000-08-09 Thread Uri Guttman
> "JP" == John Porter <[EMAIL PROTECTED]> writes: JP> =for pod perl JP> # this line goes to both the default pod processor AND the perl parser. but how will perl access that text? what perl var get the text in that =for block? the proposal for a special here doc notation is possible

Re: Overloading && ||

2000-08-09 Thread Dan Sugalski
At 12:04 PM 8/9/00 -0700, Peter Scott wrote: >At 04:58 AM 8/10/00 +1000, Damian Conway wrote: >>> No. I don't want to see && or || and not know whether it >> short-circuits >>> without looking in the class interface. My brain is conditioned >> through >>> years of C and Perl to exp

Re: RFC 79 (v1) Code which is both executable and POD.

2000-08-09 Thread John Porter
Larry Wall wrote: > : So, are you saying that if this RFC is implemented, POD would be > : an good way to comment code? > > It already is, as far as I'm concerned. I do too. RFC 79 presumes that POD continues in its state of grace. > Seems like all we're discussing now is how much those indep

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

2000-08-09 Thread Dan Sugalski
At 12:09 PM 8/9/00 -0600, Nathan Torkington wrote: >I want the core to stay useful but not complex. If localtime returned >a hashref in scalar context, that'd be enough for me: > > $now = localtime; > print $now->{MONTH}; > print $now->{YEAR}; # already has 1900 added onto it :-)

Re: Overloading && ||

2000-08-09 Thread Peter Scott
At 04:58 AM 8/10/00 +1000, Damian Conway wrote: >> No. I don't want to see && or || and not know whether it short-circuits >> without looking in the class interface. My brain is conditioned through >> years of C and Perl to expect that they always short-circuit. This > is too > >

Re: RFC 78 (v1) Improved Module Versioning And Searching

2000-08-09 Thread Dan Sugalski
At 11:11 AM 8/9/00 -0700, Larry Wall wrote: >Dan Sugalski writes: >: Does that mean, then, that when module A does a "$C::bar = 1" it affects a >: different package namespace than module B doing a "$C::bar = 2"? > >Presumably. H. That brings up some issues of ambiguity, then. If you use C in

Re: RFC: Higher resolution time values

2000-08-09 Thread Dan Sugalski
At 06:16 PM 8/9/00 +, Nick Ing-Simmons wrote: >Dan Sugalski <[EMAIL PROTECTED]> writes: > >> > >>As an engineer I would really like to know when you are going to > >>run out of precision in double - that is forty something bits of mantissa. > >>That is more precision than you have in the real

Re: Overloading && ||

2000-08-09 Thread Damian Conway
> No. I don't want to see && or || and not know whether it short-circuits > without looking in the class interface. My brain is conditioned through > years of C and Perl to expect that they always short-circuit. This is too > venerable a semantic to change. Please. What if I want t

Re: RFC 79 (v1) Code which is both executable and POD.

2000-08-09 Thread John Porter
Andy Dougherty wrote: > > This is another instance where a macro preprocessor might be useful. > ... > Just hoping that looking at it from another skewed viewpoint may inspire > someone, Fine; but I hope people only see RFC 79 as an extension to POD, because that's all it really is. It does not

Re: RFC 79 (v1) Code which is both executable and POD.

2000-08-09 Thread John Porter
Michael Mathews wrote: > > I do consider this a potential alternative to the MLC RFC ... I don't. This RFC deals strictly with POD. If a good in-line comment solution is also implemented, so much the better; but orthogonal to this. > but to my mind it > addresses the opposite problem: how to

Re: RFC 76 (v1) Builtin: reduce

2000-08-09 Thread Damian Conway
> Please consider the possiblity of tristate logic (RFC TBD.) ala, SQL. > > Assuming a "use tristate", undef + number = undef > > This might require that the reduce function be able to ignore undefs. > Either always under the tristate pragma. Or on a case by case basis. I'm no

Re: Ramblings on "base class" for SV etc.

2000-08-09 Thread Nick Ing-Simmons
Dan Sugalski <[EMAIL PROTECTED]> writes: > >Well, compactness for one. With a scalar on one side it's less odd (it was >a bad example). When funkier, though: > > @foo = @bar * @baz; > >the expansion becomes less obvious It is "obviously" a cross-product ;-) With perl's $s and @s we can actual

Re: RFC 79 (v1) Code which is both executable and POD.

2000-08-09 Thread Andy Dougherty
On Wed, 9 Aug 2000, Michael Mathews wrote: > To be fair, neither of these are examples of using a comment function for > "comments" though, but rather using a comment function to disable sections > of code and I suppose that makes as much sense as using POD to disable code. This is another insta

Re: Overloading && ||

2000-08-09 Thread Peter Scott
At 06:23 PM 8/9/00 +, Nick Ing-Simmons wrote: >Damian Conway <[EMAIL PROTECTED]> writes: > >Operator overloading is scheduled to be revamped. > >While I remember - it would be good if overload mechansim >could be extended to cover && and || Yes. >as well as & and | >with the class deciding i

Re: Overloading && ||

2000-08-09 Thread Damian Conway
> Damian Conway <[EMAIL PROTECTED]> writes: > >Operator overloading is scheduled to be revamped. > > While I remember - it would be good if overload mechansim > could be extended to cover && and || as well as & and | > with the class deciding if short-circuit happens. Oh, defi

  1   2   >