Re: RFC 83 (v1) Make constants look like variables

2000-08-15 Thread Jeremy Howard
Jonathan Scott Duff wrote: > On Mon, Aug 14, 2000 at 06:28:23PM -0700, Nathan Wiger wrote: > > Well, just to counter argue, I feel exactly the opposite way. I'd like > > the keyword to be "constant" instead of "const". I've always thought > > "const" was a needless save of 3 characters. Constants

Re: RFC 83 (v1) Make constants look like variables

2000-08-15 Thread Jonathan Scott Duff
On Mon, Aug 14, 2000 at 06:28:23PM -0700, Nathan Wiger wrote: > Well, just to counter argue, I feel exactly the opposite way. I'd like > the keyword to be "constant" instead of "const". I've always thought > "const" was a needless save of 3 characters. Constants should be obvious > to pick out. Th

Re: RFC 83 (v1) Make constants look like variables

2000-08-14 Thread Nathan Wiger
Ed Mills wrote: > > I disagree with "const" as it's verbose; I'd rather see something like > $pi=|3.14128 or something similar. Well, just to counter argue, I feel exactly the opposite way. I'd like the keyword to be "constant" instead of "const". I've always thought "const" was a needless save

Re: RFC 83 (v1) Make constants look like variables

2000-08-14 Thread Nick Ing-Simmons
John Porter <[EMAIL PROTECTED]> writes: >Nick Ing-Simmons wrote: >> Ed Mills <[EMAIL PROTECTED]> writes: >> > >> >There are many logical reasons for and against the RFC's here, but saying >> >"it looks like c so it doesn't make it for me" is a weak argument at best. >> >> I don't think anyone ma

Re: RFC 83 (v1) Make constants look like variables

2000-08-14 Thread John Porter
Nick Ing-Simmons wrote: > Ed Mills <[EMAIL PROTECTED]> writes: > > > >There are many logical reasons for and against the RFC's here, but saying > >"it looks like c so it doesn't make it for me" is a weak argument at best. > > I don't think anyone made that argument - they have all been > "I hat

Re: RFC 83 (v1) Make constants look like variables

2000-08-14 Thread Nick Ing-Simmons
Ed Mills <[EMAIL PROTECTED]> writes: > >I've noted a few messages here with statements like "it looks like C++" and >"I hated that in Pascal" and so on. If we restricted ourselves to constructs >not found in other languages, there would be no Perl as we know it today. >Larry freely admits he bo

Re: RFC 83 (v1) Make constants look like variables

2000-08-14 Thread Larry Wall
Steve Simmons writes: : On Sat, Aug 12, 2000 at 06:18:08AM +1000, Damian Conway wrote: : : > Please, please, please, PLEASE, let us not replicate the debacle that is : > C++'s const modifier! : : It doesn't feel like a debacle to me, it feels like it put the control : in the programmers hands.

Re: RFC 83 (v1) Make constants look like variables

2000-08-14 Thread Ed Mills
ROTECTED]> >To: [EMAIL PROTECTED] >CC: [EMAIL PROTECTED], Steve Simmons <[EMAIL PROTECTED]>,Larry Wall ><[EMAIL PROTECTED]>, Mike Pastore <[EMAIL PROTECTED]>, Jeremy >Howard <[EMAIL PROTECTED]> >Subject: Re: RFC 83 (v1) Make constants look like

Re: RFC 83 (v1) Make constants look like variables

2000-08-14 Thread Steve Simmons
On Sat, Aug 12, 2000 at 06:18:08AM +1000, Damian Conway wrote: > Please, please, please, PLEASE, let us not replicate the debacle that is > C++'s const modifier! It doesn't feel like a debacle to me, it feels like it put the control in the programmers hands. Yes, the syntax is often unweildy --

Re: RFC 83 (v1) Make constants look like variables

2000-08-12 Thread Mike Pastore
Philip Newton wrote: > > > $'bar = 'unchanging'; # klingon? > > Has there ever been an RFC discussing retention or deletion of this > backwards-compatibility feature? Yes. :) RFC71, which caused much grief to Damian: Now he will never be able to port his new Klingon.pm to Perl 6. $pkg'var! $d

Re: RFC 83 (v1) Make constants look like variables

2000-08-12 Thread Philip Newton
On Fri, 11 Aug 2000, Mike Pastore wrote: > $'bar = 'unchanging'; # klingon? Of course, this is impossible unless Perl6 (finally?) drops compatibility with the old Perl4 package separator '. Now, $'bar eq $::bar, and package D'oh is package D::oh. Has there ever been an RFC discussing retention

Does Perl need true constants? (was Re: RFC 83 (v1) Make constants look like variables)

2000-08-11 Thread Nathan Wiger
> How about any variable created in UPPER case is a constant? Well, Perl does something similar now, just that they're not readonly. But as everyone knows messing with @ISA, %ENV, BEGIN, FETCH, etc, etc, etc will definitely alter your program. Do we really need constants in Perl? I've always won

Re: RFC 83 (v1) Make constants look like variables

2000-08-11 Thread Dan Sugalski
At 11:07 AM 8/12/00 +1000, Jeremy Howard wrote: >My current thinking is that a ref to a constant should only be possible >through creating a constant first, and then creating a reference to that >separately. What, like: $foo = \5' which you can do in perl 5 right now. (Basically a scalar's c

Re: RFC 83 (v1) Make constants look like variables

2000-08-11 Thread Jeremy Howard
Steve Simmons wrote: > I really like the idea of constants in perl, but think the RFC should > go a lot further. C/C++ has solved this problem; we should follow in > their footsteps. > <...> I desparately _don't_ want to follow the horrible mess that is const in C++. The enormous hassle in trying

Re: RFC 83 (v1) Make constants look like variables

2000-08-11 Thread James Mastros
From: "Nathan Wiger" <[EMAIL PROTECTED]> Sent: Friday, August 11, 2000 1:58 AM > How would this take into account stuff like this: > >sysopen(HANDLE, "/etc/motd", O_RDWR|O_CREAT, 0644); This is completely the problem of the module that exports O_RDWR. O_RDWR could still be defined as a sub tha

Re: RFC 83 (v1) Make constants look like variables

2000-08-11 Thread Damian Conway
Please, please, please, PLEASE, let us not replicate the debacle that is C++'s const modifier! Damian

Re: RFC 83 (v1) Make constants look like variables

2000-08-11 Thread Michael Fowler
On Fri, Aug 11, 2000 at 06:36:44PM +0100, Andy Wardley wrote: > How about any variable created in UPPER case is a constant? This involves Perl dictating style to the user. Very un-Perllike, IMHO. Michael -- Administrator www.shoebox.net Programmer, System Administrator

Re: RFC 83 (v1) Make constants look like variables

2000-08-11 Thread Mike Pastore
On Fri, 11 Aug 2000, Andy Wardley wrote: > > Spinning off from Larrys syntactic comment and Mike > > Pastores example, how about some of the following: > > How about any variable created in UPPER case is a constant? > > Quite restrictive, and likely to screw many things up, admittedly, > but

Re: RFC 83 (v1) Make constants look like variables

2000-08-11 Thread Andy Wardley
> Spinning off from Larrys syntactic comment and Mike > Pastores example, how about some of the following: How about any variable created in UPPER case is a constant? Quite restrictive, and likely to screw many things up, admittedly, but it's an easy rule to remember and one which is generally

Re: RFC 83 (v1) Make constants look like variables

2000-08-11 Thread Steve Simmons
I really like the idea of constants in perl, but think the RFC should go a lot further. C/C++ has solved this problem; we should follow in their footsteps. Spinning off from Larrys syntactic comment and Mike Pastores example, how about some of the following: A constant struct with constant val

Re: RFC 83 (v1) Make constants look like variables

2000-08-10 Thread Nathan Wiger
How would this take into account stuff like this: sysopen(HANDLE, "/etc/motd", O_RDWR|O_CREAT, 0644); The "O_RDWR|O_CREAT" part is what I'm talking about here. This is a constant w/o suffix. We'll either have to: 1. Change it to $O_RDWR|$O_CREAT or $O{RDWR}|$O{CREAT} Maybe for error

Re: RFC 83 (v1) Make constants look like variables

2000-08-10 Thread Bryan C . Warnock
On Thu, 10 Aug 2000, Perl6 RFC Librarian wrote: > This method of creating constants has three serious drawbacks: They're also quite heavy, although I think that CONSTSUB was to take care of that. What I never understood, although I'm sure there's a very simple reason, is why it wasn't simply mad

Re: RFC 83 (v1) Make constants look like variables

2000-08-10 Thread James Mastros
A semantic definition of "constant" would be nice. I'd like to propose the following definition: A constant value cannot be assigned to, deleted, or used as the argument to a mutating function/operator. Doing any of these would be a catchable error. (However, it can be deleted by the GC, and th

Re: RFC 83 (v1) Make constants look like variables

2000-08-10 Thread Simply Hao
> my %STRUCT : constant = ( > Name =>str 'Jane', Isn't this ambiguous, considering that the => operator quotes the left side? -Hao

Re: RFC 83 (v1) Make constants look like variables

2000-08-10 Thread Mike Pastore
On Thu, 10 Aug 2000, Larry Wall wrote: > Can't put a modifier like "constant" in the type slot. The syntax for > variable attributes will look more like this: > > my num $PI : constant = 3.1415926; > my int @FIB : constant = (1,1,2,3,5,8,13,21); > my str %ENG_ERRORS : constant = (E_

Re: RFC 83 (v1) Make constants look like variables

2000-08-10 Thread Glenn Linderman
Perl6 RFC Librarian wrote: > It is proposed that a new syntax for declaring constants be introduced: > > my constant $PI = 3.1415926; > my constant @FIB = (1,1,2,3,5,8,13,21); > my constant %ENG_ERRORS = (E_UNDEF=>'undefined', E_FAILED=>'failed'); I like this. Implementation wise, it coul

Re: RFC 83 (v1) Make constants look like variables

2000-08-10 Thread Larry Wall
[EMAIL PROTECTED] writes: : It is proposed that a new syntax for declaring constants be introduced: : : my constant $PI = 3.1415926; : my constant @FIB = (1,1,2,3,5,8,13,21); : my constant %ENG_ERRORS = (E_UNDEF=>'undefined', E_FAILED=>'failed'); Can't put a modifier like "constant" in the

RFC 83 (v1) Make constants look like variables

2000-08-10 Thread Perl6 RFC Librarian
This and other RFCs are available on the web at http://dev.perl.org/rfc/ =head1 TITLE Make constants look like variables =head1 VERSION Maintainer: Jeremy Howard <[EMAIL PROTECTED]> Date: 10 August 2000 Version: 1 Mailing List: [EMAIL PROTECTED] Number: 83 =head1 ABSTRACT This RF