Re: PERL6STORM - tchrist's brainstorm list for perl6
I think the octal number representation should not be accepted... Adam Krolnik Verification Mgr. LSI Logic Corp. Plano TX. 75074
Re: PERL6STORM - tchrist's brainstorm list for perl6
Yes, while still allowing an explicit A()-B(), of course. I just meant that A-B means A::-B(), or, if you would, "A"-B(). But A()-B would not change in meaning. --tom, posting blind(ly) Visit our website at http://www.ubswarburg.com This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. E-mail transmission cannot be guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses. The sender therefore does not accept liability for any errors or omissions in the contents of this message which arise as a result of e-mail transmission. If verification is required please request a hard-copy version. This message is provided for informational purposes and should not be construed as a solicitation or offer to buy or sell any securities or related financial instruments.
Re: PERL6STORM - tchrist's brainstorm list for perl6
On Sat, 23 Sep 2000 04:20:37 -0400 (EDT), Philip Newton wrote: On Thu, 21 Sep 2000, Tom Christiansen wrote: =item perl6storm #0035 Make A-B place A in string context, like = does. That way no A()-B naughtiness. While still allowing explicit A()-B? Of course. You can still have A() = 'B' too, can't you? The rules would be the same. -- Bart.
RE: PERL6STORM - tchrist's brainstorm list for perl6
=item perl6storm #0064 Do something about microsoft's CRLF abomination. I think for the case of Microsoft C++ used for the Win32 port, everyone would be happy if Perl's sysopen, sysread, etc. did not require binmode. Unfortunately, Microsoft made the decision very early on in its C/C++ development to make open, read, etc. do CRLF/NL conversions. To do this I think that you need to substitute the Win32 API calls like OpenFile for the calls to open, read, etc. Unfortunately, I'm too backed up right now to even come close to making this change. Umm... Isn't it possible already, via use of the input record seperator, $/ ? Though use of this means you need to figure out whether or not it includes Windows text before reading in... Granted I've never tried it this way, I usually use the (evil): while (FH) { s/^M$//; # Process $_ } Perhaps somehow allowing $/ to take multiple input delimeters (perhaps in a fashion similar to egrep)... How about: $/ = "seperator1|seperator2"; might be a possible way of doing it... granted it looks a little nasty... And if you want to have '|' as a delimitor, escaping it with a \ would be required, etc. so you could conceivably end up with code like: $/ = "\||\\"; to delimit on '|' or '\'... Hmm... I'm defeating my own idea... Perhaps I should just shut up and let others do it as well... :) Greg
RE: PERL6STORM - tchrist's brainstorm list for perl6
while (FH) { s/^M$//; # Process $_ } Cute psuedocode. I don't like CRLF at all, it makes me feel like I'm dealing with a typewritter. But, giving multiple values to $/ seems more painful to me that to just tr/\r//d; on any suspected M$ strings. I guess not always M$... the chess server I have to deal with likes to spit out that trash, and it's unix based... but of course this is covered by RFC 69. what frightens me is the potential here to make things a lot worse. It's bad enough I have to translate out the "carriage returns" by hand, but I don't want to have to start worrying about when I need to add them back in when I didn't want to take them out in the first place. Paris Sinclair|4a75737420416e6f74686572 [EMAIL PROTECTED]|205065726c204861636b6572 www.sinclairinternetwork.com
RE: PERL6STORM - tchrist's brainstorm list for perl6
On Fri, 22 Sep 2000, Greg Boug wrote: =item perl6storm #0064 Do something about microsoft's CRLF abomination. Perhaps somehow allowing $/ to take multiple input delimeters (perhaps in a fashion similar to egrep)... How about: [snip] $/ = "seperator1|seperator2"; [snip] so you could conceivably end up with code like: $/ = "\||\\"; to delimit on '|' or '\'... Alternatively, we make it work like '-' in a character class...if it's the first character, the RE knows that you want it to a literal hyphen. If used between two characters, you want a range (or, in this case, an alternative). So: $/ = "||foo" would mean 'delimited by a pile for by the sequence foo' Similarly (although this one might be a lot nastier from an -internals viewpoint), we could say that, if the final " is immediately preceded by an '\', then clearly what you wanted was a literal backslash. (That is, "\" would not produce a runaway string...hmmm, that's a good idea all by itself, actually.) Assuming that both of these ideas were implemented, then you could write: $/ = "||\" and it would DWYM. Dave
PERL6STORM - tchrist's brainstorm list for perl6
=head1 NAME perl6storm - tchrist's brainstorm list for perl6 =head1 DESCRIPTION I'm going away for a long, long time, way past the RFC deadline. Here is my file of notions I've brainstormed over the last few weeks. Some have been covered in other RFCs. Many haven't. Most could use some kicking around for eventual immuration. When following up, you should probably start new threads for each numbered perlstorm notion below. =over =item perl6storm # This: ($a,$b) = FH; should not drain whole ahndle on known LHS count, to rescue my($x) = FH; =item perl6storm #0001 The way that you need to use \z instead of \Z. Or that even with /s, $ doesn't mean that. Too many programming errors because of this. =item perl6storm #0002 This is our only chance to add more defaults to use strict. What can we can that is sane, safe, and prudent? =item perl6storm #0003 Make parens "optionally mandatory" on function calls. use strict 'functions'; This solves once and for all the annoying precedence problems that have spawned a million bugs since time immemorial, such as writing rand +3 but meaning rand() + 3 It also obviates the hard-to-read and/or fiaschetti. Actually, this could go the other way: no strict 'parenthification'; =item perl6storm #0004 Need perl to spit out pod/non-pod, like cc -E. Pod is too hard to parse. This would make catpod trivially implemented as a compiler filter. =item perl6storm #0005 Functions with packed data, like gethostbywhatever, should die die die. They should never take nor return binary. the netent functions are busted. =item perl6storm #0006 How can you have perl --novice be perl -MDevel::Novice yet this propagate to caller's lexical context a use strict and a use warnings? Hm... Should perl have long opts? =item perl6storm #0007 Warnings on void syscalls. including implicit ones. =item perl6storm #0010 Allow a way to kill *all* defaults at compile time. Or warn about them. no defaults; use defaults 'none'; use warnings 'defaults'; this is for anal python folks. =item perl6storm #0011 perl w/o args with stdin and out ttys should be perl -de 0. saves novices from typing "perlCR" and getting confuddled. =item perl6storm #0012 local()izing a my() lexical? chip wanted this. annoying that you can do it on partials: my @a; local $a[1]; but not entires: my @a; local @a; =item perl6storm #0013 perldata reads: To find out whether a given string is a valid nonzero number, it's usually enough to test it against both numeric 0 and also lexical "0" (although this will cause -w noises). That's because strings that aren't numbers count as 0, just as they do in awk: if ($str == 0 $str ne "0") { warn "That doesn't look like a number"; } That's usually preferable because otherwise you won't treat IEEE notations like NaN or Infinity properly. At other times you might prefer to use the POSIX::strtod function or a regular expression to check whether data is numeric. See the perlre manpage for details on regular expressions. warn "has nondigits"if /\D/; warn "not a natural number" unless /^\d+$/; # rejects -3 warn "not an integer" unless /^-?\d+$/; # rejects +3 warn "not an integer" unless /^[+-]?\d+$/; warn "not a decimal number" unless /^-?\d+\.?\d*$/; # rejects .2 warn "not a decimal number" unless /^-?(?:\d+(?:\.\d*)?|\.\d+)$/; warn "not a C float" unless /^([+-]?)(?=\d|\.\d)\d*(\.\d*)?([Ee]([+-]?\d+))?$/; shouldn't this be in a module? people always want this. even the C core has looks_like_a_number. use Some_Core_Module if (has_all_digits(...)) if (is_natural_number(...)) if (is_integer(...)) if (isn't_integer(...)) :-) if (is_decimal(...)) if (is_float(...)) See Ram:2 for more, where it reads: If you're on a POSIX system, Perl's supports the CPOSIX::strtod function. Its semantics are somewhat cumbersome, so here's a Cgetnum wrapper function for more convenient access. This function takes a string and returns the number it found, or Cundef for input that isn't a C float. The Cis_numeric function is a front end to Cgetnum if you just want to say, ``Is this a float?'' sub getnum { use POSIX qw(strtod); my $str = shift; $str =~ s/^\s+//; $str =~ s/\s+$//; $! = 0; my($num, $unparsed) = strtod($str); if (($str eq '') || ($unparsed != 0) || $!) { return undef; } else { return $num; } } sub is_numeric { defined getnum } =item perl6storm #0014 make it easy to have an
Re: PERL6STORM - tchrist's brainstorm list for perl6
=item perl6storm #0106 Safe "signals"! (not syssigs,really)
RE: PERL6STORM - tchrist's brainstorm list for perl6
=item perl6storm #0064 Do something about microsoft's CRLF abomination. I think for the case of Microsoft C++ used for the Win32 port, everyone would be happy if Perl's sysopen, sysread, etc. did not require binmode. Unfortunately, Microsoft made the decision very early on in its C/C++ development to make open, read, etc. do CRLF/NL conversions. To do this I think that you need to substitute the Win32 API calls like OpenFile for the calls to open, read, etc. Unfortunately, I'm too backed up right now to even come close to making this change. Mark Leighton FisherThomson Consumer Electronics [EMAIL PROTECTED] Indianapolis, IN, USA "Display some adaptability." -- Doug Shaftoe, _Cryptonomicon_
Re: PERL6STORM - tchrist's brainstorm list for perl6
Tom Christiansen [EMAIL PROTECTED] wrote: =item perl6storm #0016 object as scope/namespace? see python. it's danged clean there in that you can now implement safe trivially. don't have to keep inventing crazy overloads. Yes, this would be great! =item perl6storm #0025 Make -T the default when operating in a CGI env. That is, taintmode. Will this kill us? Close to it. Tough. Insecurity through idiocy is a problem. Make them *add* a switch to make it insecure, like -U, if that's what they mean, to disable tainting instead. One combination of #16 and #25 that would be useful is a way to turn on tainting in a Safe partition (i.e, a trusted 'driver' running suspect code -T in Safe::). -- Drexel University \V--Chuck Lane ==]--*---[=== (215) 895-1545 _/ \ Particle Physics FAX: (215) 895-5934 /\ /~~~[EMAIL PROTECTED]
Re: async I/O (was Re: PERL6STORM - tchrist's brainstorm list for perl6)
"DS" == Dan Sugalski [EMAIL PROTECTED] writes: DS At 05:35 PM 9/21/00 -0400, Uri Guttman wrote: i proposed some of that in my rfc47 (universal async i/o). at the perl level you need a delivery interface as with events. DS I'm not really worried about the perl level for this. I'm more DS concerned with the low-level internal implementation. but i am concerned about the language level. this is the language list and not the internals one. we can deal with how to implement it later. and saying that perl will do async i/o on files for you is still a language level issue as the coder may not want that (random access files, etc.). i think the coder has to be able to request this and not have it happen automagically. internally i see it being useful too for the speedup of sequential files. but how do you know a file is sequential? DS Who cares? If the filehandle's read within a while(), or in list DS context, we can use a big readahead buffer and issue a lot of DS async I/O requests. For filehandles read with a plain scalar DS fetch off a filehandle we can use a smaller readahead buffer. this again is a language issue. are all filehandles in while loops going to do this? i think the user need to control it and not let perl guess how to handle it. DS Async writes are a win in any case. true. most unix kernels do readahead blocks anyway but if you seek, you waste that. DS So? We lose in that case, but not by much. If we give full control DS to the user programs (and I'd like to) then the user can get fancy DS and we'll leave the decision to the program. that is my point. i don't think we should do any of this withour user control. it reminds me of the transactions wars we have had. how can perl figure out the right thing to do in all cases. IMO only the coder must have the choice. uri -- Uri Guttman - [EMAIL PROTECTED] -- http://www.sysarch.com SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX Consulting The Perl Books Page --- http://www.sysarch.com/cgi-bin/perl_books The Best Search Engine on the Net -- http://www.northernlight.com