From tran_fors at yahoo.com Thu Apr 1 19:00:22 2004 From: tran_fors at yahoo.com (Tran Forsythe) Date: Thu Aug 5 00:17:18 2004 Subject: Phoenix.pm: Meeting 04/01/2004 (This is not a joke!) References: <20040331180546.ZBPZ2428.fed1mtao03.cox.net@smtp.west.cox.net> Message-ID: <009d01c4184d$e96efd10$b3affea9@dario> Sorry, I can't attend... I'm feeling under the weather. Odds are, I'll be asleep by 7.. :p -Kurt ----- Original Message ----- From: To: Sent: Wednesday, March 31, 2004 11:05 AM Subject: Re: Phoenix.pm: Meeting 04/01/2004 (This is not a joke!) > Hi Douglas, > > I'm new to the group and will be there on Thusday. > > Mark Steele > > > > > > From: "Douglas E. Miles" > > Date: 2004/03/31 Wed PM 12:32:11 EST > > To: "Phoenix.pm" > > Subject: Phoenix.pm: Meeting 04/01/2004 (This is not a joke!) > > > > Please RSVP... > > > > We'll be having a Phoenix.pm meeting Thursday, April 1st at 7:00PM. > > It will be held at Bowne, which is located at 1500 N. Central Avenue, > > which is on the Southwest corner of Central and McDowell. The parking > > lot is gated, so just press the button on the intercom, and tell the > > receptionist that you are there for the Perl meeting. Park in the lot > > that is straight ahead from the entrance on the South side of McDowell. > > Park in any uncovered, non-reserved space. Proceed to the main lobby, > > which is on the Northeast side of the parking lot. > > > > If I can get in touch with Tim or Scott, one or both of them will be > > presenting. Otherwise, I'll be presenting "Adventures in Web Automation" > > > > > > From m at phxlinux.org Mon Apr 12 13:49:35 2004 From: m at phxlinux.org (Matt Alexander) Date: Thu Aug 5 00:17:18 2004 Subject: Phoenix.pm: Perl and utf8 on Windows Message-ID: I have a Perl script that reads data in a SQLite file. On Linux everything works great. When I move the script and SQLite file to Windows, I get garbage characters in my output where the characters should have been something like an accented e (??) or accented i (??). The original text file was in utf8 and was then imported into SQLite. I'm using ActiveState Perl 5.8.3 on Win2K. Any suggestions on how to get Windows to display the characters correctly? Thanks, ~M From eden.li at asu.edu Mon Apr 12 14:23:00 2004 From: eden.li at asu.edu (eden li) Date: Thu Aug 5 00:17:18 2004 Subject: Phoenix.pm: Perl and utf8 on Windows In-Reply-To: References: Message-ID: <407AEC94.9020307@asu.edu> Where are you trying to output these characters? Matt Alexander wrote: > I get garbage characters in my output where the characters should > have been something like an accented e (??) or accented i (??). From scott at illogics.org Mon Apr 12 14:28:08 2004 From: scott at illogics.org (Scott Walters) Date: Thu Aug 5 00:17:18 2004 Subject: Phoenix.pm: Perl and utf8 on Windows Message-ID: <20040412192808.GV13790@illogics.org> You're asking about two things I know nothing of. The best I can do is suggest 'perldoc perllocale' and 'perldoc perlopentut'. You were probably running RedHat - or another Linux brave enough to make the jump to LC_ALL=en_US.ISO8859-1. This has actually caused a lot of bugs in perl and they're backpeddling from the current handling to something more Java-like where you have to specify the character encoding if it is something other than binary when you open a file for read or write. Hence the mention of perldoc perlopentut. But the solution will probably come in the form of a 'use locale "en_US.ISO8859-1";' pragma. Good luck and feel free to report back with your success/failure =) -scott On 0, Matt Alexander wrote: > > I have a Perl script that reads data in a SQLite file. On Linux > everything works great. When I move the script and SQLite file to > Windows, I get garbage characters in my output where the characters should > have been something like an accented e (é) or accented i (í). > > The original text file was in utf8 and was then imported into SQLite. > > I'm using ActiveState Perl 5.8.3 on Win2K. > > Any suggestions on how to get Windows to display the characters correctly? > Thanks, > ~M > > > From scott at illogics.org Mon Apr 12 14:29:13 2004 From: scott at illogics.org (Scott Walters) Date: Thu Aug 5 00:17:18 2004 Subject: Phoenix.pm: Perl and utf8 on Windows Message-ID: <20040412192913.GW13790@illogics.org> That's another thought - it is doubtful that COMMAND.COM knows how to handle Unicode, and if the output is a webbrowser, you'll have to specify the charset in the Content-Type. perldoc CGI has some examples. Somewhere in there. -scott On 0, eden li wrote: > > Where are you trying to output these characters? > > Matt Alexander wrote: > > I get garbage characters in my output where the characters should > > have been something like an accented e (é) or accented i (í). > From m at phxlinux.org Mon Apr 12 14:31:04 2004 From: m at phxlinux.org (Matt Alexander) Date: Thu Aug 5 00:17:18 2004 Subject: Phoenix.pm: Perl and utf8 on Windows In-Reply-To: <407AEC94.9020307@asu.edu> Message-ID: On Mon, 12 Apr 2004, eden li wrote: > Where are you trying to output these characters? I've tested outputting to the console and also in Mozilla and IE. From m at phxlinux.org Mon Apr 12 14:44:28 2004 From: m at phxlinux.org (Matt Alexander) Date: Thu Aug 5 00:17:18 2004 Subject: Phoenix.pm: Perl and utf8 on Windows In-Reply-To: <20040412192913.GW13790@illogics.org> Message-ID: On Mon, 12 Apr 2004, Scott Walters wrote: > That's another thought - it is doubtful that COMMAND.COM knows how to handle Unicode, > and if the output is a webbrowser, you'll have to specify the charset in the Content-Type. > perldoc CGI has some examples. Somewhere in there. Voila! I set "Content-type: text/html; charset=UTF-8\n\n" and everything works beautifully. Thanks for the suggestions. ~M From eden.li at asu.edu Mon Apr 12 15:06:30 2004 From: eden.li at asu.edu (eden li) Date: Thu Aug 5 00:17:18 2004 Subject: Phoenix.pm: Perl and utf8 on Windows In-Reply-To: <20040412192913.GW13790@illogics.org> References: <20040412192913.GW13790@illogics.org> Message-ID: <407AF6C6.6040401@asu.edu> actually CMD.COM (>=Windows 2000) handles Unicode quite well. You can even refer to files written in different charsets on the cmd line. I was quite surprised the first time I chdir'ed to a directory written in Chinese. M$ has done a lot to ensure its role in other countries' economies... Scott Walters wrote: > it is doubtful that COMMAND.COM knows how to handle Unicode, From scott at illogics.org Fri Apr 16 20:30:41 2004 From: scott at illogics.org (Scott Walters) Date: Thu Aug 5 00:17:18 2004 Subject: Phoenix.pm: quoting constant hash keys survey Message-ID: <20040417013040.GH938@illogics.org> Hi folks, I'm soliciting opinions - no experience with Perl beyond the basics are required so this isn't for experts only. I want as many opinions as I can get. It was recently proposed in Perl 6 that %foo{bar} would now always mean %foo{bar()} rather than %foo{'bar'}. This is part of the general move away from barewords. This also surprises some people as things like my $foo = shift; means shift(), not 'shift', so Perl's generally tendencies are reversed in hash subscripts. This is usually the right thing to do but requires programmers to be aware of it. So %foo<> and a difficult to type UNICODE version with gulimets where the << and >> are each one character does the same thing as %foo{'bar'} - So... %foo{'bar'} is the same as %foo<> and %foo{bar} is the same as %foo{bar()} The discussion became interesting when people complaiend that %foo<> really doesn't save any characters and both are optimized towards the uncommon case of allowing slices. In P6, slices happen when multiple keys are fed to a hash, not when the $ is swapped for a % as in Perl 5. Hence all of these examples are non-slice hash lookups. Someone proposed that %foo`bar be offered to optimize the common case of %foo<> where no slice is being taken and the subscript is a variable or constant. So %foo`$bar would be valid as well, but that would probabaly tend to be written as %foo{$bar} for clarity. So... %foo{'bar'} is the same as %foo<> is the same as %foo`bar and %foo{bar} is the same as %foo{bar()} Tick, `, was selected because it doesn't currently have any meaning in that context - %foo `ls` isn't valid Perl. Other characters that also don't have an operator state meaning were rejected for other reasons. So, the survey question is, should this meaning of ` be or not be included in Perl 6? Pros: * Mismatched bracket characters often generate typos and syntax errors - matching bracketing characters is tedious * 2 keystrokes plus variable and subcript names versus 5 * Caters to JavaScript programmers who are used to writing things like document.forms.myform.submit(), bluring the distinction between hash subscripts and method calls (in Perl 6, that might be %document`forms`myform.submit(), or in Perl 5, $document{forms}{myform}->submit() ) * ` might generalize to quoting single words, making the removal of barewords less painful Cons: * %foo`bar doesn't look like a hash subscript if you're used to %foo{'bar'} * Could be used to write really terse code * Ugly * Perl 6 already has 2 ways to subscript hashes now, 3 is too many * People who really want something like that can extend the language using Perl 6's equivilent to source filters Okey, everyone run and vote - yea or nay. Let's hear it. Even if your reasons are unfounded, vote. -scott From intertwingled at qwest.net Sat Apr 17 02:03:11 2004 From: intertwingled at qwest.net (Anthony Nemmer) Date: Thu Aug 5 00:17:18 2004 Subject: Phoenix.pm: quoting constant hash keys survey In-Reply-To: <20040417013040.GH938@illogics.org> References: <20040417013040.GH938@illogics.org> Message-ID: <4080D6AF.1040205@qwest.net> Rename Perl 6 to something else. Scott Walters wrote: >Hi folks, > >I'm soliciting opinions - no experience with Perl beyond the basics are required >so this isn't for experts only. I want as many opinions as I can get. > >It was recently proposed in Perl 6 that %foo{bar} would now always mean %foo{bar()} >rather than %foo{'bar'}. This is part of the general move away from barewords. >This also surprises some people as things like my $foo = shift; means shift(), >not 'shift', so Perl's generally tendencies are reversed in hash subscripts. This >is usually the right thing to do but requires programmers to be aware of it. >So %foo<> and a difficult to type UNICODE version with gulimets where the ><< and >> are each one character does the same thing as %foo{'bar'} - > >So... > > %foo{'bar'} is the same as %foo<> > >and > > %foo{bar} is the same as %foo{bar()} > >The discussion became interesting when people complaiend that %foo<> really >doesn't save any characters and both are optimized towards the uncommon case >of allowing slices. In P6, slices happen when multiple keys are fed to a hash, >not when the $ is swapped for a % as in Perl 5. Hence all of these examples are >non-slice hash lookups. > >Someone proposed that %foo`bar be offered to optimize the common case of >%foo<> where no slice is being taken and the subscript is a variable or >constant. So %foo`$bar would be valid as well, but that would probabaly >tend to be written as %foo{$bar} for clarity. So... > > > %foo{'bar'} is the same as %foo<> is the same as %foo`bar > >and > > %foo{bar} is the same as %foo{bar()} > >Tick, `, was selected because it doesn't currently have any meaning in that >context - %foo `ls` isn't valid Perl. Other characters that also don't have an >operator state meaning were rejected for other reasons. > >So, the survey question is, should this meaning of ` be or not be included >in Perl 6? > >Pros: > >* Mismatched bracket characters often generate typos and syntax errors - matching >bracketing characters is tedious > >* 2 keystrokes plus variable and subcript names versus 5 > >* Caters to JavaScript programmers who are used to writing things like >document.forms.myform.submit(), bluring the distinction between hash subscripts >and method calls (in Perl 6, that might be %document`forms`myform.submit(), or >in Perl 5, $document{forms}{myform}->submit() ) > >* ` might generalize to quoting single words, making the removal of barewords >less painful > >Cons: > >* %foo`bar doesn't look like a hash subscript if you're used to %foo{'bar'} > >* Could be used to write really terse code > >* Ugly > >* Perl 6 already has 2 ways to subscript hashes now, 3 is too many > >* People who really want something like that can extend the language using Perl 6's >equivilent to source filters > >Okey, everyone run and vote - yea or nay. Let's hear it. Even if your reasons are >unfounded, vote. > >-scott > > > > > > -- SKYKING, SKYKING, DO NOT ANSWER. From eden.li at asu.edu Sat Apr 17 09:51:21 2004 From: eden.li at asu.edu (eden li) Date: Thu Aug 5 00:17:18 2004 Subject: Phoenix.pm: quoting constant hash keys survey In-Reply-To: <20040417013040.GH938@illogics.org> References: <20040417013040.GH938@illogics.org> Message-ID: <40814469.2060406@asu.edu> I like it, but I don't see why perl can't just adopt the dot like Java and C. %foo.bar -> %foo{'bar'} I guess could be ambiguously parsed as a string concat operator: (%foo) . bar() But I'm wondering if %foo can exist in that context all by itself in Perl6. Anyway, either way, I'm all for typing less. Besides, gullimets seem to stand out more than they should, especially for every hash access in which you don't feel like typing quotes. Scott Walters wrote: > Okey, everyone run and vote - yea or nay. Let's hear it. Even if your > reasons are unfounded, vote. From intertwingled at qwest.net Sat Apr 17 10:12:32 2004 From: intertwingled at qwest.net (Anthony Nemmer) Date: Thu Aug 5 00:17:18 2004 Subject: Phoenix.pm: quoting constant hash keys survey In-Reply-To: <40814469.2060406@asu.edu> References: <20040417013040.GH938@illogics.org> <40814469.2060406@asu.edu> Message-ID: <40814960.9020500@qwest.net> No, in a case like this, Perl 6 will recursively walk %foo.bar, concatenate it together into a string and concatenate that to whatever bar() returns. =) Tony eden li wrote: > I like it, but I don't see why perl can't just adopt the dot like Java > and C. > > %foo.bar -> %foo{'bar'} > > I guess could be ambiguously parsed as a string concat operator: > > (%foo) . bar() > > But I'm wondering if %foo can exist in that context all by itself in > Perl6. Anyway, either way, I'm all for typing less. Besides, > gullimets seem to stand out more than they should, especially for > every hash access in which you don't feel like typing quotes. > > Scott Walters wrote: > >> Okey, everyone run and vote - yea or nay. Let's hear it. Even if your >> reasons are unfounded, vote. > > > > -- SKYKING, SKYKING, DO NOT ANSWER. From scott at illogics.org Sat Apr 17 11:54:37 2004 From: scott at illogics.org (Scott Walters) Date: Thu Aug 5 00:17:18 2004 Subject: Phoenix.pm: quoting constant hash keys survey Message-ID: <20040417165437.GI938@illogics.org> String concat has been renamed ~ from _. . is method call. Primitive types "autobox" now, so you can ask an array for a length or a hash for its keys: %hash.keys # method call So, people have adopted the dot for method calls, and JavaScript uses the dot for both method calls and hash subscripts (as well as array indices), but since we could be either calling a method or subscripting a primitive, we have to tell perl which it is or risk confusion when we can't access hash subscripts with the same name as methods. -scott On 0, eden li wrote: > > I like it, but I don't see why perl can't just adopt the dot like Java and C. > > %foo.bar -> %foo{'bar'} > > I guess could be ambiguously parsed as a string concat operator: > > (%foo) . bar() > > But I'm wondering if %foo can exist in that context all by itself in Perl6. Anyway, either way, I'm all for typing less. Besides, gullimets seem to stand out more than they should, especially for every hash access in which you don't feel like typing quotes. > > Scott Walters wrote: > > Okey, everyone run and vote - yea or nay. Let's hear it. Even if your > > reasons are unfounded, vote. > From intertwingled at qwest.net Sat Apr 17 12:04:37 2004 From: intertwingled at qwest.net (Anthony Nemmer) Date: Thu Aug 5 00:17:18 2004 Subject: Phoenix.pm: quoting constant hash keys survey In-Reply-To: <20040417165437.GI938@illogics.org> References: <20040417165437.GI938@illogics.org> Message-ID: <408163A5.2040004@qwest.net> Perl 6 i going to end up looking like Morse Code. =) Tony Scott Walters wrote: >String concat has been renamed ~ from _. . is method call. Primitive >types "autobox" now, so you can ask an array for a length or a hash >for its keys: > > %hash.keys # method call > >So, people have adopted the dot for method calls, and JavaScript uses the >dot for both method calls and hash subscripts (as well as array indices), >but since we could be either calling a method or subscripting a primitive, >we have to tell perl which it is or risk confusion when we can't access >hash subscripts with the same name as methods. > >-scott > >On 0, eden li wrote: > > >>I like it, but I don't see why perl can't just adopt the dot like Java and C. >> >>%foo.bar -> %foo{'bar'} >> >>I guess could be ambiguously parsed as a string concat operator: >> >>(%foo) . bar() >> >>But I'm wondering if %foo can exist in that context all by itself in Perl6. Anyway, either way, I'm all for typing less. Besides, gullimets seem to stand out more than they should, especially for every hash access in which you don't feel like typing quotes. >> >>Scott Walters wrote: >> >> >>>Okey, everyone run and vote - yea or nay. Let's hear it. Even if your >>>reasons are unfounded, vote. >>> >>> > > > > -- SKYKING, SKYKING, DO NOT ANSWER. From scott at illogics.org Sat Apr 17 12:04:06 2004 From: scott at illogics.org (Scott Walters) Date: Thu Aug 5 00:17:18 2004 Subject: Phoenix.pm: quoting constant hash keys survey Message-ID: <20040417170406.GN938@illogics.org> No, morse code has dots and dashes, Perl 6 uses UNICODE for operators, unsatisified with ASCII. The trendy thing to compare it to is Ada. All I can say is there is a nitch for a language that tolerates barewords. Bourne shell sucks too much. I'm thinking about resurrecting SNOBOL and hacking closures and iterators and such onto it =) It would be ironic since one of the most requsted features for Perl 6 was SNOBOL like pattern matching, which Larry denied (communities rewrite my ass). -scott On 0, Anthony Nemmer wrote: > > Perl 6 i going to end up looking like Morse Code. =) > > Tony > > Scott Walters wrote: > > >String concat has been renamed ~ from _. . is method call. Primitive > >types "autobox" now, so you can ask an array for a length or a hash > >for its keys: > > > > %hash.keys # method call > > > >So, people have adopted the dot for method calls, and JavaScript uses the > >dot for both method calls and hash subscripts (as well as array indices), > >but since we could be either calling a method or subscripting a primitive, > >we have to tell perl which it is or risk confusion when we can't access > >hash subscripts with the same name as methods. > > > >-scott > > > >On 0, eden li wrote: > > > > > >>I like it, but I don't see why perl can't just adopt the dot like Java and C. > >> > >>%foo.bar -> %foo{'bar'} > >> > >>I guess could be ambiguously parsed as a string concat operator: > >> > >>(%foo) . bar() > >> > >>But I'm wondering if %foo can exist in that context all by itself in Perl6. Anyway, either way, I'm all for typing less. Besides, gullimets seem to stand out more than they should, especially for every hash access in which you don't feel like typing quotes. > >> > >>Scott Walters wrote: > >> > >> > >>>Okey, everyone run and vote - yea or nay. Let's hear it. Even if your > >>>reasons are unfounded, vote. > >>> > >>> > > > > > > > > > > > -- > > SKYKING, SKYKING, DO NOT ANSWER. > > From scott at illogics.org Sat Apr 17 12:06:37 2004 From: scott at illogics.org (Scott Walters) Date: Thu Aug 5 00:17:18 2004 Subject: Phoenix.pm: quoting constant hash keys survey Message-ID: <20040417170637.GO938@illogics.org> Okey, that's two opinions (in favor, no vote). Can do manage, oh, say, 8? What's the matter, don't you people crawl out of bed on a gorgeous Saturday morning at the break of dawn and read your email? -scott On 0, Anthony Nemmer wrote: > > Perl 6 i going to end up looking like Morse Code. =) > > Tony > > Scott Walters wrote: > > >String concat has been renamed ~ from _. . is method call. Primitive > >types "autobox" now, so you can ask an array for a length or a hash > >for its keys: > > > > %hash.keys # method call > > > >So, people have adopted the dot for method calls, and JavaScript uses the > >dot for both method calls and hash subscripts (as well as array indices), > >but since we could be either calling a method or subscripting a primitive, > >we have to tell perl which it is or risk confusion when we can't access > >hash subscripts with the same name as methods. > > > >-scott > > > >On 0, eden li wrote: > > > > > >>I like it, but I don't see why perl can't just adopt the dot like Java and C. > >> > >>%foo.bar -> %foo{'bar'} > >> > >>I guess could be ambiguously parsed as a string concat operator: > >> > >>(%foo) . bar() > >> > >>But I'm wondering if %foo can exist in that context all by itself in Perl6. Anyway, either way, I'm all for typing less. Besides, gullimets seem to stand out more than they should, especially for every hash access in which you don't feel like typing quotes. > >> > >>Scott Walters wrote: > >> > >> > >>>Okey, everyone run and vote - yea or nay. Let's hear it. Even if your > >>>reasons are unfounded, vote. > >>> > >>> > > > > > > > > > > > -- > > SKYKING, SKYKING, DO NOT ANSWER. > > From scott at illogics.org Sat Apr 17 12:25:52 2004 From: scott at illogics.org (Scott Walters) Date: Thu Aug 5 00:17:18 2004 Subject: Phoenix.pm: quoting constant hash keys survey Message-ID: <20040417172552.GP938@illogics.org> Originally it was proposed that currying happen automatically in codereference context (Perl 6 has numerous contexts, rather than just void, scalar and list) and a routine could accept more named parameters than it was given, but it was decided that this was too automatic (though very cool), so the current plan is that code references have a curry method: sub ($foo, $bar) { $foo + $bar }.curry(15).(30); # 45 That's position parameters. sub ($foo, $bar) { $foo + $bar }.curry(foo => 15).(bar => 30); # 45 That's using named parameters. Come to think of it, named parameters and currying aren't as automatic as currying should be, but this works well with placeholders: sub { $^a + $^b }.curry(15).(30); # 45 Of course, this all works on code references, too, which look like &foo (rather than \&foo as in P5). -scott On 0, eden li wrote: > > Ooo nice. I should pay more attention to Perl6's development. I wonder if they're gonna implement any of the currying features we had discussed at PM before. (i.e. defining a unary function that can be applied to any number of arguments ala lambda calculus). > > Anyway, back to the vote, in case it wasn't clear. My vote is a yea for `. > > Scott Walters wrote: > > String concat has been renamed ~ from _. . is method call. Primitive > > types "autobox" now, so you can ask an array for a length or a hash > > for its keys: > > > > %hash.keys # method call > > > > So, people have adopted the dot for method calls, and JavaScript uses the > > dot for both method calls and hash subscripts (as well as array indices), > > but since we could be either calling a method or subscripting a primitive, > > we have to tell perl which it is or risk confusion when we can't access > > hash subscripts with the same name as methods. > From intertwingled at qwest.net Sat Apr 17 12:45:54 2004 From: intertwingled at qwest.net (Anthony Nemmer) Date: Thu Aug 5 00:17:18 2004 Subject: Phoenix.pm: quoting constant hash keys survey In-Reply-To: <20040417170406.GN938@illogics.org> References: <20040417170406.GN938@illogics.org> Message-ID: <40816D52.6030202@qwest.net> Funny you should mention ADA. I still have the ADA Strawman Spec buried under a load of other books in my apartment. I got it when I was stationed at the Pentagon. And there are many military and defense contractors who simply refuse to use it. They swear by a computer language called Jovial instead, which as far as I can tell is Algol with some form of multi-threading built in to the core syntax of the language. There's even a Jovial fan site! http://www.jovial.hill.af.mil/ From the web site: "Some of the more notable weapon systems using JOVIAL include (but are not limited too) the Advanced Cruise Missile, B-52, B-1, and B-2 Bombers, C-130, C-141, and C-17 Transport Aircraft, F-15, F-16, F-18, and F-117 Fighter Aircraft, LANTIRN, U-2 Aircraft, E-3 AWACS Aircraft, Special Operations Forces, Navy AEGIS Cruisers, Army Multiple Launch Rocket System, Army Blackhawk Helicopters, F100, F117, F119 Jet Engines, and RL-10 Rocket Engines." Not too shabby for a computer language that was developed in the early 1960's. As for Snobol, you may be interested to know that the developers of Snobol have created a new language named Icon: http://www.cs.arizona.edu/icon/index.htm Looks like it has a lot of promise, wonder if it will catch on as a general purpose scripting language? Tony Scott Walters wrote: >No, morse code has dots and dashes, Perl 6 uses UNICODE for operators, >unsatisified with ASCII. The trendy thing to compare it to is Ada. > >All I can say is there is a nitch for a language that tolerates barewords. >Bourne shell sucks too much. I'm thinking about resurrecting SNOBOL and >hacking closures and iterators and such onto it =) > >It would be ironic since one of the most requsted features for Perl 6 >was SNOBOL like pattern matching, which Larry denied (communities >rewrite my ass). > >-scott > >On 0, Anthony Nemmer wrote: > > >>Perl 6 i going to end up looking like Morse Code. =) >> >>Tony >> >>Scott Walters wrote: >> >> >> >>>String concat has been renamed ~ from _. . is method call. Primitive >>>types "autobox" now, so you can ask an array for a length or a hash >>>for its keys: >>> >>> %hash.keys # method call >>> >>>So, people have adopted the dot for method calls, and JavaScript uses the >>>dot for both method calls and hash subscripts (as well as array indices), >>>but since we could be either calling a method or subscripting a primitive, >>>we have to tell perl which it is or risk confusion when we can't access >>>hash subscripts with the same name as methods. >>> >>>-scott >>> >>>On 0, eden li wrote: >>> >>> >>> >>> >>>>I like it, but I don't see why perl can't just adopt the dot like Java and C. >>>> >>>>%foo.bar -> %foo{'bar'} >>>> >>>>I guess could be ambiguously parsed as a string concat operator: >>>> >>>>(%foo) . bar() >>>> >>>>But I'm wondering if %foo can exist in that context all by itself in Perl6. Anyway, either way, I'm all for typing less. Besides, gullimets seem to stand out more than they should, especially for every hash access in which you don't feel like typing quotes. >>>> >>>>Scott Walters wrote: >>>> >>>> >>>> >>>> >>>>>Okey, everyone run and vote - yea or nay. Let's hear it. Even if your >>>>>reasons are unfounded, vote. >>>>> >>>>> >>>>> >>>>> >>> >>> >>> >>> >>-- >> >>SKYKING, SKYKING, DO NOT ANSWER. >> >> >> >> > > > > -- SKYKING, SKYKING, DO NOT ANSWER. From scott at illogics.org Sat Apr 17 12:41:52 2004 From: scott at illogics.org (Scott Walters) Date: Thu Aug 5 00:17:18 2004 Subject: Phoenix.pm: quoting constant hash keys survey Message-ID: <20040417174152.GQ938@illogics.org> By the way, as part of my little project, I wrote autobox::Core to compliment autobox on CPAN, so you can do something a lot like this, minus named parameters and placeholders, in Perl 5: use autobox; use autobox::Core; sub { $_[0] + $_[1] }->curry(15)->(30); # 45 autobox::Core just provides wrappers for things that are already built into core so they can be used as methods on primitive types (as well as a few things that *will* be in core, such as curry). autobox::Core, among other Perl 6isms, was the subject of a PM presentation recently by the way ;) -scott On 0, Scott Walters wrote: > > Originally it was proposed that currying happen automatically in codereference > context (Perl 6 has numerous contexts, rather than just void, scalar and list) > and a routine could accept more named parameters than it was given, but it was > decided that this was too automatic (though very cool), so the current plan is > that code references have a curry method: > > sub ($foo, $bar) { $foo + $bar }.curry(15).(30); # 45 > > That's position parameters. > > sub ($foo, $bar) { $foo + $bar }.curry(foo => 15).(bar => 30); # 45 > > That's using named parameters. Come to think of it, named parameters and currying > aren't as automatic as currying should be, but this works well with placeholders: > > sub { $^a + $^b }.curry(15).(30); # 45 > > Of course, this all works on code references, too, which look like &foo > (rather than \&foo as in P5). > > -scott > > > > On 0, eden li wrote: > > > > Ooo nice. I should pay more attention to Perl6's development. I wonder if they're gonna implement any of the currying features we had discussed at PM before. (i.e. defining a unary function that can be applied to any number of arguments ala lambda calculus). > > > > Anyway, back to the vote, in case it wasn't clear. My vote is a yea for `. > > > > Scott Walters wrote: > > > String concat has been renamed ~ from _. . is method call. Primitive > > > types "autobox" now, so you can ask an array for a length or a hash > > > for its keys: > > > > > > %hash.keys # method call > > > > > > So, people have adopted the dot for method calls, and JavaScript uses the > > > dot for both method calls and hash subscripts (as well as array indices), > > > but since we could be either calling a method or subscripting a primitive, > > > we have to tell perl which it is or risk confusion when we can't access > > > hash subscripts with the same name as methods. > > From intertwingled at qwest.net Sat Apr 17 12:48:21 2004 From: intertwingled at qwest.net (Anthony Nemmer) Date: Thu Aug 5 00:17:18 2004 Subject: Phoenix.pm: quoting constant hash keys survey In-Reply-To: <20040417172552.GP938@illogics.org> References: <20040417172552.GP938@illogics.org> Message-ID: <40816DE5.7010301@qwest.net> Oh, those outsourcing programmers in India who are taking all of our jobs are gonna LOVE this. =P Tony Scott Walters wrote: >Originally it was proposed that currying happen automatically in codereference >context (Perl 6 has numerous contexts, rather than just void, scalar and list) >and a routine could accept more named parameters than it was given, but it was >decided that this was too automatic (though very cool), so the current plan is >that code references have a curry method: > > sub ($foo, $bar) { $foo + $bar }.curry(15).(30); # 45 > >That's position parameters. > > sub ($foo, $bar) { $foo + $bar }.curry(foo => 15).(bar => 30); # 45 > >That's using named parameters. Come to think of it, named parameters and currying >aren't as automatic as currying should be, but this works well with placeholders: > > sub { $^a + $^b }.curry(15).(30); # 45 > >Of course, this all works on code references, too, which look like &foo >(rather than \&foo as in P5). > >-scott > > > >On 0, eden li wrote: > > >>Ooo nice. I should pay more attention to Perl6's development. I wonder if they're gonna implement any of the currying features we had discussed at PM before. (i.e. defining a unary function that can be applied to any number of arguments ala lambda calculus). >> >>Anyway, back to the vote, in case it wasn't clear. My vote is a yea for `. >> >>Scott Walters wrote: >> >> >>>String concat has been renamed ~ from _. . is method call. Primitive >>>types "autobox" now, so you can ask an array for a length or a hash >>>for its keys: >>> >>> %hash.keys # method call >>> >>>So, people have adopted the dot for method calls, and JavaScript uses the >>>dot for both method calls and hash subscripts (as well as array indices), >>>but since we could be either calling a method or subscripting a primitive, >>>we have to tell perl which it is or risk confusion when we can't access >>>hash subscripts with the same name as methods. >>> >>> > > > > -- SKYKING, SKYKING, DO NOT ANSWER. From scott at illogics.org Sat Apr 17 12:47:17 2004 From: scott at illogics.org (Scott Walters) Date: Thu Aug 5 00:17:18 2004 Subject: Phoenix.pm: quoting constant hash keys survey Message-ID: <20040417174717.GR938@illogics.org> Actually, I have Icon on this machine ;) It has some neat things like goal directed evaluation, but it's very much a different language than SNOBOL. I moved to Arizona shortly before Ralph Griswold retired from UofA. Damn! I'll do a presentation on SNOBOL4 some time. Larry Wall cites SNOBOL as one of the many influences of Perl, and there are some interesting parallels. -scott On 0, Anthony Nemmer wrote: > > Funny you should mention ADA. I still have the ADA Strawman Spec buried > under a load of other books in my apartment. I got it when I was > stationed at the Pentagon. And there are many military and defense > contractors who simply refuse to use it. They swear by a computer > language called Jovial instead, which as far as I can tell is Algol with > some form of multi-threading built in to the core syntax of the > language. There's even a Jovial fan site! > > http://www.jovial.hill.af.mil/ > > From the web site: > > "Some of the more notable weapon systems using JOVIAL include (but are > not limited too) the Advanced Cruise Missile, B-52, B-1, and B-2 > Bombers, C-130, C-141, and C-17 Transport Aircraft, F-15, F-16, F-18, > and F-117 Fighter Aircraft, LANTIRN, U-2 Aircraft, E-3 AWACS Aircraft, > Special Operations Forces, Navy AEGIS Cruisers, Army Multiple Launch > Rocket System, Army Blackhawk Helicopters, F100, F117, F119 Jet Engines, > and RL-10 Rocket Engines." > > Not too shabby for a computer language that was developed in the early > 1960's. > > As for Snobol, you may be interested to know that the developers of > Snobol have created a new language named Icon: > > http://www.cs.arizona.edu/icon/index.htm > > Looks like it has a lot of promise, wonder if it will catch on as a > general purpose scripting language? > > Tony > > Scott Walters wrote: > > >No, morse code has dots and dashes, Perl 6 uses UNICODE for operators, > >unsatisified with ASCII. The trendy thing to compare it to is Ada. > > > >All I can say is there is a nitch for a language that tolerates barewords. > >Bourne shell sucks too much. I'm thinking about resurrecting SNOBOL and > >hacking closures and iterators and such onto it =) > > > >It would be ironic since one of the most requsted features for Perl 6 > >was SNOBOL like pattern matching, which Larry denied (communities > >rewrite my ass). > > > >-scott > > > >On 0, Anthony Nemmer wrote: > > > > > >>Perl 6 i going to end up looking like Morse Code. =) > >> > >>Tony > >> > >>Scott Walters wrote: > >> > >> > >> > >>>String concat has been renamed ~ from _. . is method call. Primitive > >>>types "autobox" now, so you can ask an array for a length or a hash > >>>for its keys: > >>> > >>> %hash.keys # method call > >>> > >>>So, people have adopted the dot for method calls, and JavaScript uses the > >>>dot for both method calls and hash subscripts (as well as array indices), > >>>but since we could be either calling a method or subscripting a primitive, > >>>we have to tell perl which it is or risk confusion when we can't access > >>>hash subscripts with the same name as methods. > >>> > >>>-scott > >>> > >>>On 0, eden li wrote: > >>> > >>> > >>> > >>> > >>>>I like it, but I don't see why perl can't just adopt the dot like Java and C. > >>>> > >>>>%foo.bar -> %foo{'bar'} > >>>> > >>>>I guess could be ambiguously parsed as a string concat operator: > >>>> > >>>>(%foo) . bar() > >>>> > >>>>But I'm wondering if %foo can exist in that context all by itself in Perl6. Anyway, either way, I'm all for typing less. Besides, gullimets seem to stand out more than they should, especially for every hash access in which you don't feel like typing quotes. > >>>> > >>>>Scott Walters wrote: > >>>> > >>>> > >>>> > >>>> > >>>>>Okey, everyone run and vote - yea or nay. Let's hear it. Even if your > >>>>>reasons are unfounded, vote. > >>>>> > >>>>> > >>>>> > >>>>> > >>> > >>> > >>> > >>> > >>-- > >> > >>SKYKING, SKYKING, DO NOT ANSWER. > >> > >> > >> > >> > > > > > > > > > > > -- > > SKYKING, SKYKING, DO NOT ANSWER. > > From Eden.Li at asu.edu Sat Apr 17 13:10:46 2004 From: Eden.Li at asu.edu (Eden Li) Date: Thu Aug 5 00:17:18 2004 Subject: Phoenix.pm: quoting constant hash keys survey In-Reply-To: <40816DE5.7010301@qwest.net> Message-ID: Haha!! Jokes aside, Curry happens to come from the name of the guy who developed the idea of 'currying.' Haskell B. Curry, methinks. On Sat, 17 Apr 2004, Anthony Nemmer wrote: > Oh, those outsourcing programmers in India who are taking all of our > jobs are gonna LOVE this. =P From Eden.Li at asu.edu Sat Apr 17 13:14:49 2004 From: Eden.Li at asu.edu (Eden Li) Date: Thu Aug 5 00:17:18 2004 Subject: Phoenix.pm: quoting constant hash keys survey In-Reply-To: <20040417174717.GR938@illogics.org> Message-ID: All this discussion of new Perl features. reminds me of what Paul Graham said in his essay about Lisp: Over time, the default language, embodied in a succession of popular languages, has gradually evolved toward Lisp. - http://www.paulgraham.com/diff.html Looking at currying and some other features heading into Perl6, I can't help but agree with him on that point. Any thoughts? From intertwingled at qwest.net Sat Apr 17 13:21:44 2004 From: intertwingled at qwest.net (Anthony Nemmer) Date: Thu Aug 5 00:17:19 2004 Subject: Phoenix.pm: quoting constant hash keys survey In-Reply-To: References: Message-ID: <408175B8.7050403@qwest.net> We shall have to syntactically sugar that curry, then. Eden Li wrote: >Haha!! > >Jokes aside, Curry happens to come from the name of the guy who developed the >idea of 'currying.' Haskell B. Curry, methinks. > >On Sat, 17 Apr 2004, Anthony Nemmer wrote: > > >>Oh, those outsourcing programmers in India who are taking all of our >>jobs are gonna LOVE this. =P >> >> > > > > > -- SKYKING, SKYKING, DO NOT ANSWER. From scott at illogics.org Sat Apr 17 13:40:37 2004 From: scott at illogics.org (Scott Walters) Date: Thu Aug 5 00:17:19 2004 Subject: Phoenix.pm: quoting constant hash keys survey Message-ID: <20040417184037.GS938@illogics.org> Yes, and there is a language, Haskell, named after Haskell Curry, too. Obviously it's a "functional" language, and quite a good one from what I hear. I haven't quite gotten around to taking a look at it. Hrm. Pascal, C, Perl, Java, PHP, C# ... I'd have to disagree with Paul. I think Lisp is something that is rediscovered over and over. Scheme, Perl, Ruby, Haskell, Ocaml have all rediscovered Lisp in various levels of purity and pragmatism. Allow me to introduce Scott's theory of language design. Most people buy their language from Walmart and throw the instruction manual away with the receipt. Any time one language is billed as "easier", people gravitate towards it. Visual Basic was probably the single most popular language until the announcement of C# and discontinuation of VB. Perl was popular while it was billed as easy. PHP is billed as making web programming very easy. I think this is an impossible ideal, due to Larry's law of cruft conservation (the language can sweep cruft under the rug by being pure and clean and making the programmer do more work, or the cruft can be conserved in the language itself), but just like perpetual motion, people won't stop trying to find the "easy" language and thinking you've found it. Functional programming is useful for logic-intensive applications - code that tries to solve hard problems. But people who know better don't describe function languages *or* VB as "easy". VB is very painful when you're trying to solve hard problems with it, even moderately hard ones, and functional programming has a learning curve. So the languages that are billed as "easy" are billed as "easy" by the ignorant, so they're usually bad languages. C is "easy" right now because the compiler is everywhere and a lot of people know it, but it isn't a good language for most of what people are trying to do now days - applications and daemons. A higher level language would be much more appropriate. So, if people weren't forever questing for the nonexistant "easy" language, I think we'd be migrating slowly towards different takes on functional languages, including bastardizations of them such as Perl. -scott On 0, Eden Li wrote: > > All this discussion of new Perl features. reminds me of what Paul Graham said > in his essay about Lisp: > > Over time, the default language, embodied in a succession of popular > languages, has gradually evolved toward Lisp. > - http://www.paulgraham.com/diff.html > > Looking at currying and some other features heading into Perl6, I can't help > but agree with him on that point. Any thoughts? > From aj at exiledplanet.org Sat Apr 17 15:33:13 2004 From: aj at exiledplanet.org (Andrew Johnson) Date: Thu Aug 5 00:17:19 2004 Subject: Phoenix.pm: quoting constant hash keys survey In-Reply-To: <20040417013040.GH938@illogics.org> References: <20040417013040.GH938@illogics.org> Message-ID: <40819489.9010106@exiledplanet.org> Scott Walters wrote: Scott, I can tell you without hesitation that I /hate/ this. Mostly for the cons you've already specified. [snip] >Cons: > >* %foo`bar doesn't look like a hash subscript if you're used to %foo{'bar'} > >* Could be used to write really terse code > >* Ugly > >* Perl 6 already has 2 ways to subscript hashes now, 3 is too many > > > I agree wholeheartedly here, and with the poster that said, "call it something besides Perl 6." One of the goals of Perl 6 was supposed to be a /decreased complexity/ in certain areas. Elimination of synonyms, removal of old cruft. Having the backtick suddenly be the hash subscript operator is bad because most people now see the backtick and think "shell command." With this, now they'll have to think, "shell command unless there's only one, then it's a hash key." And hash keys are everywhere in most large Perl 5, and my impression is they'll continue to be in Perl 6. This is too much alienation of the existing Perl programmer community. And it is very ugly, IMHO, the ` and the << >> syntax. And if Perl 6 does indeed already have 2 ways to subscript hashes, adding a third violates the simplification though synonym elimination. >* People who really want something like that can extend the language using Perl 6's >equivilent to source filters > > > Agreed. Don't get me wrong here: I like the idea of re-evaluating things in the language. But there are several things in Perl 6 I don't like because I think they go too far, and if this were implemented, I'd add it to the "don't like" list immediately. From scott at illogics.org Sat Apr 17 16:36:12 2004 From: scott at illogics.org (Scott Walters) Date: Thu Aug 5 00:17:19 2004 Subject: Phoenix.pm: quoting constant hash keys survey Message-ID: <20040417213612.GV938@illogics.org> In that case, I'm sorry to break the news to you that %hash<> is probably here to stay... that one I don't care for. Since subscripting with a constant is so much more common than subscriting with the return value of a function call, i think %foo{shift} should stay %foo{'shift'} and not be made into %foo{shift}. When you actually really do want to call a function, write %foo{shift()}. Better to require two extra characteres in the uncommon case compared with the two extra characters in the common case (%foo{'shift'} and %foo<> are the same number of characters, two more than %foo{shift}). I have to say that . in JavaScript is nifty - document.forms.myform.submit() is the same as document["forms"]["myform"].submit() So which one is simpler is argueable ;) Seriously, thanks for your opinion. And for the record, I haven't voiced my opinions on ` yet, other than agreeing that %hash<> kind of sucks. -scott On 0, Andrew Johnson wrote: > > Scott Walters wrote: > > Scott, I can tell you without hesitation that I /hate/ this. Mostly for > the cons you've already specified. > > [snip] > > >Cons: > > > >* %foo`bar doesn't look like a hash subscript if you're used to %foo{'bar'} > > > >* Could be used to write really terse code > > > >* Ugly > > > >* Perl 6 already has 2 ways to subscript hashes now, 3 is too many > > > > > > > I agree wholeheartedly here, and with the poster that said, "call it > something besides Perl 6." One of the goals of Perl 6 was supposed to > be a /decreased complexity/ in certain areas. Elimination of synonyms, > removal of old cruft. Having the backtick suddenly be the hash > subscript operator is bad because most people now see the backtick and > think "shell command." With this, now they'll have to think, "shell > command unless there's only one, then it's a hash key." And hash keys > are everywhere in most large Perl 5, and my impression is they'll > continue to be in Perl 6. This is too much alienation of the existing > Perl programmer community. > > And it is very ugly, IMHO, the ` and the << >> syntax. And if Perl 6 > does indeed already have 2 ways to subscript hashes, adding a third > violates the simplification though synonym elimination. > > >* People who really want something like that can extend the language using Perl 6's > >equivilent to source filters > > > > > > > Agreed. > > Don't get me wrong here: I like the idea of re-evaluating things in the > language. But there are several things in Perl 6 I don't like because I > think they go too far, and if this were implemented, I'd add it to the > "don't like" list immediately. > > From scott at illogics.org Sat Apr 17 16:43:49 2004 From: scott at illogics.org (Scott Walters) Date: Thu Aug 5 00:17:19 2004 Subject: Phoenix.pm: ` as hash subscript patch Message-ID: <20040417214349.GW938@illogics.org> For your perverse pleasure/pediantic pain: ----- Forwarded message from Matthijs van Duin ----- List: contact perl6-language-help@perl.org; run by ezmlm Subject: Re: backticks Date: Wed, 14 Apr 2004 20:57:57 +0200 From: Matthijs van Duin On Wed, Apr 14, 2004 at 02:18:48PM +0200, Juerd wrote: >I propose to use ` as a simple hash subscriptor, as an alternative to {} >and <<>>. It would only be useable for \w+ keys or perhaps -?\w+. As >with methods, a simple "atomic" (term exists only in perlreftut, afaix, >but I don't know another word to describe a simple scalar variable) >scalar should be usable too. > > %hash`key > $hashref`foo`bar`baz`quux > %hash`$key > $object.method`key I absolutely love it. Since hashes are used so much, I think it deserves this short syntax. Note btw that it's not even mutually exclusive with qx's use of backticks. To illustrate that, see: http://www.math.leidenuniv.nl/~xmath/perl/5.8.3-patches/tick-deref.patch It's a quick patch I made that adds the `-operator to perl 5.8.3, so you can try it how it "feels". >With some imagination, this can also be used for arrays. I like that too. (though not (yet) implemented in my patch) -- Matthijs van Duin -- May the Forth be with you! ----- End forwarded message ----- From wlindley at wlindley.com Sat Apr 17 18:02:55 2004 From: wlindley at wlindley.com (Bill Lindley) Date: Thu Aug 5 00:17:19 2004 Subject: Phoenix.pm: quoting constant hash keys survey In-Reply-To: <20040417184037.GS938@illogics.org> References: <20040417184037.GS938@illogics.org> Message-ID: <4081B79F.4060705@wlindley.com> Scott Walters wrote: > until the ... discontinuation of VB. Microsoft's website indicates they are selling "VB.NET 2003" and they talk about upcoming features in the 2005 version. From intertwingled at qwest.net Sat Apr 17 18:25:24 2004 From: intertwingled at qwest.net (Anthony Nemmer) Date: Thu Aug 5 00:17:19 2004 Subject: Phoenix.pm: quoting constant hash keys survey In-Reply-To: <4081B79F.4060705@wlindley.com> References: <20040417184037.GS938@illogics.org> <4081B79F.4060705@wlindley.com> Message-ID: <4081BCE4.9060608@qwest.net> QBasic was the last good language to ever come out of Microsoft. Bill Lindley wrote: > Scott Walters wrote: > >> until the ... discontinuation of VB. > > > Microsoft's website indicates they are selling "VB.NET 2003" and they > talk about upcoming features in the 2005 version. > > > -- SKYKING, SKYKING, DO NOT ANSWER. From wlindley at wlindley.com Sat Apr 17 18:35:59 2004 From: wlindley at wlindley.com (Bill Lindley) Date: Thu Aug 5 00:17:19 2004 Subject: Phoenix.pm: quoting constant hash keys survey In-Reply-To: <20040417170637.GO938@illogics.org> References: <20040417170637.GO938@illogics.org> Message-ID: <4081BF5F.7020908@wlindley.com> I vote NO... I also find the underline as concatenation befuddling, as being something new and inconsistent with any language I know... Why do I get the feeling perl6 will become perpetual vaporware? From perlguy at earthlink.net Mon Apr 19 19:23:25 2004 From: perlguy at earthlink.net (Douglas E. Miles) Date: Thu Aug 5 00:17:19 2004 Subject: Phoenix.pm: quoting constant hash keys survey In-Reply-To: <20040417013040.GH938@illogics.org> References: <20040417013040.GH938@illogics.org> Message-ID: <40846D7D.4060301@earthlink.net> Apparently, this didn't go through the first time. Scott Walters wrote: > Hi folks, > > I'm soliciting opinions - no experience with Perl beyond the basics are required > so this isn't for experts only. I want as many opinions as I can get. > I'm late here, but here's my vote... I don't like this: %foo`bar I think that %foo{bar} should mean %foo{'bar'} as this is the common case. Maybe %foo<> should mean %foo{bar()} unless this violates other uses of <<>>. Personally, I don't mind typing the (), so I don't particularly feel the need for extra syntax. That said, if ` is added and: %foo{'bar'} is the same as %foo<> and %foo{bar} is the same as %foo{bar()} I probably just won't use the new syntax. From scott at illogics.org Mon Apr 19 19:20:14 2004 From: scott at illogics.org (Scott Walters) Date: Thu Aug 5 00:17:19 2004 Subject: Phoenix.pm: quoting constant hash keys survey Message-ID: <20040420002013.GG120@illogics.org> Argh. Something must be done about this list. <> is qw{foo bar}, and %foo<> and %foo<> are extrapolations from that syntax. So it's either %foo<> or %foo{'foo'}... -scott On 0, "Douglas E. Miles" wrote: > > Apparently, this didn't go through the first time. > > Scott Walters wrote: > > Hi folks, > > > > I'm soliciting opinions - no experience with Perl beyond the basics are required > > so this isn't for experts only. I want as many opinions as I can get. > > > > > I'm late here, but here's my vote... > > I don't like this: > > %foo`bar > > I think that > > %foo{bar} should mean %foo{'bar'} > > as this is the common case. > > Maybe > > %foo<> should mean %foo{bar()} > > unless this violates other uses of <<>>. > > Personally, I don't mind typing the (), so I don't particularly feel the > need for extra syntax. That said, if ` is added and: > > %foo{'bar'} is the same as %foo<> > > and > > %foo{bar} is the same as %foo{bar()} > > I probably just won't use the new syntax. > > From vodhner at cox.net Mon Apr 19 22:43:15 2004 From: vodhner at cox.net (Victor Odhner) Date: Thu Aug 5 00:17:19 2004 Subject: Phoenix.pm: quoting constant hash keys survey In-Reply-To: <4080D6AF.1040205@qwest.net> References: <20040417013040.GH938@illogics.org> <4080D6AF.1040205@qwest.net> Message-ID: <40849C53.90606@cox.net> Anthony Nemmer wrote: > Rename Perl 6 to something else. I'm definitely wit'cha on that one, Tony. I've been coding in Perl for 10 years now. I came from a long background in ALGOL, COBOL, PL/I and C with forays into a few other languages -- Prolog, Lisp, APL in all its terse Greek glory, VB, Honeywell's proprietary "tex", Euler, ADA and yes, even JOVIAL. I never did anything in all those other languages that couldn't have been done more effectively in my little corner of Perl 5.8, except for the tiny set of problems that needed to be coded to the bare metal in ALGOL or C. And Perl might have even done better in those cases. Note that some people think like mathematicians and can say an enormous amount in a few symbols. They can fly spaceships to Neptune without error, but heaven help anyone who tries to read the stuff. Others are verbal types and, like me, think in prose. Besides that, I'm a little slow. So I like code that says exactly what it's doing, and doesn't take too much detective work to figure out what I'm looking at. I don't need to "use english" because I happen to know Perl and can tell $! from $|. I shun syntactic sugar in general because it just weighs down the language. I save intermediate variables so that my comments can explain what they are and why I needed them. I use lots of whitespace. I break statements into multiple lines if necessary, with continuations nicely indented, so I have no problem with $this_hash{'that_subscript'} or with $object->function(). I find that a *small* subset of Perl just does too much too well for me to stray into academic vortices, innovatio ad naseam. The proposed book cover says it all for me: I don't mind hashes of function references or fairly complex regexp code, but in general I take it one step at a time and don't need "more than one way to do it". I'll even dare to say that your way is *wrong* if you drag in Yet Another Library so you can code your program in some "language" other than Perl. Specifically, the << >> and backtick things are YOOgly, and I won't go there unless *ordered* to on pain of termination. I've worked in APL. Terse is *not good*. (Although having matrix inversion built into the language definitely rocks.) Sign me "stuck in the mud". If the mud is Perl 5.8, it's not half bad. Vic P.S. -- Oh, and I'll look at Ruby when I start seeing it in employment ads. ;-) From eden.li at asu.edu Mon Apr 19 23:03:05 2004 From: eden.li at asu.edu (eden li) Date: Thu Aug 5 00:17:19 2004 Subject: Phoenix.pm: quoting constant hash keys survey In-Reply-To: <20040420002013.GG120@illogics.org> References: <20040420002013.GG120@illogics.org> Message-ID: <4084A0F9.8040800@asu.edu> Did the perl gods finally come to a consensus? Is <<>> official for bareword hash lookups? Scott Walters wrote: > <> is qw{foo bar}, and %foo<> and %foo<> are > extrapolations from that syntax. So it's either %foo<> or > %foo{'foo'}... From friedman at highwire.stanford.edu Mon Apr 19 23:15:23 2004 From: friedman at highwire.stanford.edu (Michael Friedman) Date: Thu Aug 5 00:17:19 2004 Subject: Phoenix.pm: quoting constant hash keys survey In-Reply-To: <20040417013040.GH938@illogics.org> References: <20040417013040.GH938@illogics.org> Message-ID: <5815FBC4-9281-11D8-8643-000A956CAA2C@highwire.stanford.edu> Scott, Not knowing anything about the other uses of ` and << >> except for what's passed through the list lately, I'd vote against using backtick in this instance. For one thing, it'll throw my editor's syntax coloring off, because it assumes that you'll always have a matched pair. :-) In general, though, I'm with the group that says "there's nothing wrong with being verbose". I'd rather have a clear %foo{bar()} and %foo{'bar'} which fit my existing ideas of programming syntax* than something involving single quote marks. But, TMTOWTDI, and since I'll never use the single backtick in any related context, it really doesn't matter for my personal coding. Thanks for asking around, though! -- Mike * You know, the things that make all languages 'readable' by anyone with a solid programming background -- things in quotes are strings, parens mark functions, == vs. =, etc. Perl goes quite far in stretching that pardigm, as it probably should, given its background as an ad hoc scripting language, but so far it's still very readable to C, Java, or even VB programmers. And I thought Perl 6 was supposed to become *more* "standard" in syntax, with using . for method calls instead of ->, but maybe that's gone by the wayside now. On Apr 16, 2004, at 6:30 PM, Scott Walters wrote: > Tick, `, was selected because it doesn't currently have any meaning in > that > context - %foo `ls` isn't valid Perl. Other characters that also don't > have an > operator state meaning were rejected for other reasons. > > So, the survey question is, should this meaning of ` be or not be > included > in Perl 6? > --------------------------------------------------------------------- Michael Friedman HighWire Press, Stanford Southwest Phone: 480-456-0880 Tempe, Arizona FAX: 270-721-8034 --------------------------------------------------------------------- From scott at illogics.org Mon Apr 19 23:20:07 2004 From: scott at illogics.org (Scott Walters) Date: Thu Aug 5 00:17:19 2004 Subject: Phoenix.pm: quoting constant hash keys survey Message-ID: <20040420042007.GQ120@illogics.org> It's as solid as anything else in the Perl 6 specification... so, basically, yes. On 0, eden li wrote: > > Did the perl gods finally come to a consensus? Is <<>> official for bareword hash lookups? > > Scott Walters wrote: > > <> is qw{foo bar}, and %foo<> and %foo<> are > > extrapolations from that syntax. So it's either %foo<> or > > %foo{'foo'}... > From eden.li at asu.edu Mon Apr 19 23:23:33 2004 From: eden.li at asu.edu (eden li) Date: Thu Aug 5 00:17:19 2004 Subject: Phoenix.pm: quoting constant hash keys survey In-Reply-To: <20040420042007.GQ120@illogics.org> References: <20040420042007.GQ120@illogics.org> Message-ID: <4084A5C5.5000805@asu.edu> *groan* Maybe if they made gullimet keys standard on keyboards... Scott Walters wrote: > It's as solid as anything else in the Perl 6 specification... so, basically, > yes. From scott at illogics.org Mon Apr 19 23:58:55 2004 From: scott at illogics.org (Scott Walters) Date: Thu Aug 5 00:17:19 2004 Subject: Phoenix.pm: quoting constant hash keys survey Message-ID: <20040420045855.GR120@illogics.org> > Thanks for asking around, though! > -- Mike I really like how this went over. I might collect and summerize phoenix-pm-list comments for perl6-language in the future. Right now, comments on perl6-language are generally of a technical nature, and people tend not to speak up and say "I don't like that" because it would be out of place. Even when they do, they must be very politically sensitive - everyone has sacred cows, and if you want to keep your voice you must maintain the disposition of tolerence, respect, and professional apathy. In other words, it could use an injection of reality. Larry Wall is brilliant and insightful on language design, and he comes up with some great stuff, no one else is really tackling the hard problem of language design - they're contributing new suggestions and technical input, but that isn't the same thing. Case in point, "Perl 6 should be named something else" is a common observation *off* perl6-language but appears very rarely there and is quickly dismissed when it does appear. I find %foo<> ugly and think %foo{bar} should retain it's current meaning so that %foo<> isn't needed, but failing that, I like the idea of some sort of %foo`bar syntax. I find typing a lot of { }, ( ), [ ], etc tedious and I think constant hash keys are used often enough that it should benefit from Huffman coding (common things should be short sequences). I think this is a rare case where a feature is used often enough that shortening it to something obscenely short actually does more good than harm. But this is opinion =) Cleaning up the language so it would be all of easier to learn, easier to extend, and easier to evolve were the primary goals, but scope creep has set in, and there is a general feeling that Perl 6 will become obsolete before it is ever finished. The whole thing reminds me of the DEC Alpha - the chip was designed to have a 20 year (or some large number, I forget) life span. It was to be built future proof, designed to keep up with better fabrication technologies, increases in cache performance and RAM speed, and faster clock cycles. It was a good design, certainly, the future didn't agree. x86 continued to expand. Microsoft abandoned NT on MIPS, Alpha, and PowerPC. Peope became concerned with power consumption. Laptops continued to become more popular. Low end hardware was used as servers rather than high end RISC - everyone but IBM is floundering in the high end RISC server space. Even when people spend a lot on a server, they either want to run Windows or want hardware they're familiar with or they want to take advantage of x86 being Linux's primary and best supported platform. Or they know the horrors of OpenFirmware ;) Perl 6 won't be too little too late but it might be the wrong thing too late. I think Python and Ruby are doing really well right now because they're scrappy. Python runs on the JVM if you want it to. Ruby constantly compares itself to other languages and tries to do better in all arenas - readability, expressiveness, scalability, and so on. It seems to me like Perl has kind of decided they're big so they can do whatever they want and lost this scrappiness. But I tend to be a cynic =) Microsoft's C# is an interesting case - Microsoft has single handled kept BASIC alive decades longer than it would have lasted otherwise. Recently, Micorosoft has started getting scrappy again, faced with the threats of Open Source and Free Software. C# is a good little language. It isn't as expressive as I like, but all in all, it is a good response to what really want rather than ramming something down their throats. Hrm, sorry, this turned into something of a rant. > * You know, the things that make all languages 'readable' by anyone > with a solid programming background -- things in quotes are strings, > parens mark functions, == vs. =, etc. Perl goes quite far in stretching > that pardigm, as it probably should, given its background as an ad hoc > scripting language, but so far it's still very readable to C, Java, or > even VB programmers. And I thought Perl 6 was supposed to become *more* > "standard" in syntax, with using . for method calls instead of ->, but > maybe that's gone by the wayside now. Too many meanings for symbols make it hard to learn a language. { } subscripts hashes, constructs anonymous hashes, groups statements, and creates closures in Perl 6 ('sub' is optional in most cases). Every indication is that this problem is getting far worse in Perl 6 rather than better. Not only aren't symbols familiar, they aren't (apparently) consistent. I think . is the extend of the resolution to make Perl 6 more standard. I don't mean to bash Perl 6 - it's doing a lot of really cool things - but I'm bound to have opinions ;) -scott > > On 0, Michael Friedman wrote: > > Scott, > > Not knowing anything about the other uses of ` and << >> except for > what's passed through the list lately, I'd vote against using backtick > in this instance. For one thing, it'll throw my editor's syntax > coloring off, because it assumes that you'll always have a matched > pair. :-) > > In general, though, I'm with the group that says "there's nothing wrong > with being verbose". I'd rather have a clear %foo{bar()} and > %foo{'bar'} which fit my existing ideas of programming syntax* than > something involving single quote marks. > > But, TMTOWTDI, and since I'll never use the single backtick in any > related context, it really doesn't matter for my personal coding. > > Thanks for asking around, though! > -- Mike > > * You know, the things that make all languages 'readable' by anyone > with a solid programming background -- things in quotes are strings, > parens mark functions, == vs. =, etc. Perl goes quite far in stretching > that pardigm, as it probably should, given its background as an ad hoc > scripting language, but so far it's still very readable to C, Java, or > even VB programmers. And I thought Perl 6 was supposed to become *more* > "standard" in syntax, with using . for method calls instead of ->, but > maybe that's gone by the wayside now. > > From wlindley at wlindley.com Tue Apr 20 10:34:24 2004 From: wlindley at wlindley.com (Bill Lindley) Date: Thu Aug 5 00:17:19 2004 Subject: Phoenix.pm: quoting constant hash keys survey In-Reply-To: <4084A5C5.5000805@asu.edu> References: <20040420042007.GQ120@illogics.org> <4084A5C5.5000805@asu.edu> Message-ID: <40854300.40605@wlindley.com> Hey, let's totally use Unicode -- If ?these_puppies? aren't cool enough, then for starters, next we can replace the division operator, and have subroutines become sections. Forget underlines, string concatenation becomes dot (?) : ---begin--- #!/usr/bin/perl ?compute_profit { my ($name, $profit, $member_count) = @_; my $share = $profit ? $member_count; return $name ? "receives " ? $share; } ---end--- Repeat and fade. In fact let's call this new language "APL" instead of Perl 6... and switch to these keyboards: http://www.hypermaths.org/quadibloc/comp/images/typair.gif \\/ From intertwingled at qwest.net Tue Apr 20 11:01:52 2004 From: intertwingled at qwest.net (Anthony Nemmer) Date: Thu Aug 5 00:17:19 2004 Subject: Phoenix.pm: quoting constant hash keys survey In-Reply-To: <40854300.40605@wlindley.com> References: <20040420042007.GQ120@illogics.org> <4084A5C5.5000805@asu.edu> <40854300.40605@wlindley.com> Message-ID: <40854970.9090408@qwest.net> No. Everyone should learn to speak ENGLISH. Then we can use seven bit ASCII. At least, that is My Humble Opinion. Anthony Nemmer Bill Lindley wrote: > Hey, let's totally use Unicode -- If ?these_puppies? aren't cool > enough, then for starters, next we can replace the division operator, > and have subroutines become sections. Forget underlines, string > concatenation becomes dot (?) : > > ---begin--- > #!/usr/bin/perl > > ?compute_profit { > my ($name, $profit, $member_count) = @_; > my $share = $profit ? $member_count; > return $name ? "receives " ? $share; > } > ---end--- > > Repeat and fade. In fact let's call this new language "APL" instead > of Perl 6... and switch to these keyboards: > > http://www.hypermaths.org/quadibloc/comp/images/typair.gif > > \\/ > > > -- SKYKING, SKYKING, DO NOT ANSWER. From phx-pm-list at grueslayer.com Tue Apr 20 13:27:13 2004 From: phx-pm-list at grueslayer.com (David A. Sinck) Date: Thu Aug 5 00:17:19 2004 Subject: Phoenix.pm: quoting constant hash keys survey References: <20040420042007.GQ120@illogics.org> <4084A5C5.5000805@asu.edu> <40854300.40605@wlindley.com> <40854970.9090408@qwest.net> Message-ID: <16517.27521.266224.388727@magnitude.righthandgraphics.com> \_ SMTP quoth Anthony Nemmer on 4/20/2004 09:01 as having spake thusly: \_ \_ No. Everyone should learn to speak ENGLISH. Then we can use seven bit \_ ASCII. \_ \_ At least, that is My Humble Opinion. I've always thought about whack grammar files for assorted languages and converting them to another language. perl english -> perl spanish for -> para while -> mientras_que my -> mi and so on. :-) David From vodhner at cox.net Tue Apr 20 16:20:47 2004 From: vodhner at cox.net (Victor Odhner) Date: Thu Aug 5 00:17:19 2004 Subject: Phoenix.pm: quoting constant hash keys survey In-Reply-To: <40854970.9090408@qwest.net> References: <20040420042007.GQ120@illogics.org> <4084A5C5.5000805@asu.edu> <40854300.40605@wlindley.com> <40854970.9090408@qwest.net> Message-ID: <4085942F.3040800@cox.net> Seven bit? Hey, when I started programming in Burroughs ALGOL, their assignment operator was a left-pointing arrow. That was one of their 64 SIX-bit characters. I'd be all for using a richer character set. You wouldn't need Unicode to do that, just the full ASCII set. Vic Anthony Nemmer wrote: > No. Everyone should learn to speak ENGLISH. Then we can use seven bit > ASCII. > > At least, that is My Humble Opinion. > > Anthony Nemmer > > Bill Lindley wrote: > >> Hey, let's totally use Unicode -- If ?these_puppies? aren't cool >> enough, then for starters, next we can replace the division operator, >> and have subroutines become sections. Forget underlines, string >> concatenation becomes dot (?) : >> >> ---begin--- >> #!/usr/bin/perl >> >> ?compute_profit { >> my ($name, $profit, $member_count) = @_; >> my $share = $profit ? $member_count; >> return $name ? "receives " ? $share; >> } From intertwingled at qwest.net Tue Apr 20 16:51:33 2004 From: intertwingled at qwest.net (Anthony Nemmer) Date: Thu Aug 5 00:17:19 2004 Subject: Phoenix.pm: quoting constant hash keys survey In-Reply-To: <4085942F.3040800@cox.net> References: <20040420042007.GQ120@illogics.org> <4084A5C5.5000805@asu.edu> <40854300.40605@wlindley.com> <40854970.9090408@qwest.net> <4085942F.3040800@cox.net> Message-ID: <40859B65.6070904@qwest.net> Hey, wow. One of the things I collect is character sets. If you still have your old manuals, could you scan the character set table in for me (if there is one) and send it to me? Thanks, Tony Victor Odhner wrote: > Seven bit? Hey, when I started programming in > Burroughs ALGOL, their assignment operator was a > left-pointing arrow. That was one of their 64 > SIX-bit characters. > > I'd be all for using a richer character set. > You wouldn't need Unicode to do that, just > the full ASCII set. > > Vic > > Anthony Nemmer wrote: > >> No. Everyone should learn to speak ENGLISH. Then we can use seven >> bit ASCII. >> >> At least, that is My Humble Opinion. >> >> Anthony Nemmer >> >> Bill Lindley wrote: >> >>> Hey, let's totally use Unicode -- If ?these_puppies? aren't cool >>> enough, then for starters, next we can replace the division >>> operator, and have subroutines become sections. Forget underlines, >>> string concatenation becomes dot (?) : >>> >>> ---begin--- >>> #!/usr/bin/perl >>> >>> ?compute_profit { >>> my ($name, $profit, $member_count) = @_; >>> my $share = $profit ? $member_count; >>> return $name ? "receives " ? $share; >>> } >> > > > -- SKYKING, SKYKING, DO NOT ANSWER. From wlindley at wlindley.com Wed Apr 21 09:14:53 2004 From: wlindley at wlindley.com (Bill Lindley) Date: Thu Aug 5 00:17:19 2004 Subject: Phoenix.pm: "Why Not To Use Foreign Keys" ? Message-ID: <408681DD.7070905@wlindley.com> ...linked from a Slashdot thread, it's the MySQL developers eating humble pie... funny reading in a 'cvs commit' diff.. ---begin quote--- -@cindex foreign keys, reasons not to use +@cindex foreign keys, why not implemented -There are so many problems with foreign key constraints that we don't -know where to start: +Many database scholars and programmers feel very strongly that +referential integrity should be enforced inside the database server. ---end quote--- much more at http://lists.mysql.com/internals/1771 From eden.li at asu.edu Wed Apr 21 09:42:42 2004 From: eden.li at asu.edu (eden li) Date: Thu Aug 5 00:17:19 2004 Subject: Phoenix.pm: "Why Not To Use Foreign Keys" ? In-Reply-To: <408681DD.7070905@wlindley.com> References: <408681DD.7070905@wlindley.com> Message-ID: <40868862.4090004@asu.edu> I'm surprised they still haven't implemented it. Hell even Microsoft Access lets you do foreign keys. The reasons they give for not implementing them are kind of bogus. When you design a sufficiently complex schema, it's nice to be able to depend on the database to keep certain things about the schema correct. All the problems they mention with foreign keys can be taken care of by good design. It seems the MySQL developers don't trust us with being able to make the right decisions about using foreign keys in the right places. Maybe that's the reason I haven't touched mysql in so long... Bill Lindley wrote: > ...linked from a Slashdot thread, it's the MySQL developers eating > humble pie... funny reading in a 'cvs commit' diff.. > > much more at > http://lists.mysql.com/internals/1771 From scott at illogics.org Wed Apr 21 17:08:58 2004 From: scott at illogics.org (Scott Walters) Date: Thu Aug 5 00:17:19 2004 Subject: Phoenix.pm: "Why Not To Use Foreign Keys" ? Message-ID: <20040421220857.GB120@illogics.org> Interesting. And Larry Wall, the other day, put %foo`bar to rest. It won't be in Perl 6. %foo<> (and the Unicode version) will be the prefered method for subscripting with constants. -scott On 0, Bill Lindley wrote: > > ...linked from a Slashdot thread, it's the MySQL developers eating > humble pie... funny reading in a 'cvs commit' diff.. > > ---begin quote--- > -@cindex foreign keys, reasons not to use > +@cindex foreign keys, why not implemented > > -There are so many problems with foreign key constraints that we don't > -know where to start: > +Many database scholars and programmers feel very strongly that > +referential integrity should be enforced inside the database server. > ---end quote--- > > much more at > > http://lists.mysql.com/internals/1771 > From scott at illogics.org Wed Apr 21 17:13:16 2004 From: scott at illogics.org (Scott Walters) Date: Thu Aug 5 00:17:19 2004 Subject: Phoenix.pm: "Why Not To Use Foreign Keys" ? Message-ID: <20040421221315.GC120@illogics.org> Well, I'm on the Postgres bandwagon myself, but most people can't design a half way relationtional schema in the first place, so either their lone table has no foreign keys to relate to or their quagmire has so many problems that losing data is the tip of the iceberg. Continuing with the bad habit of using myself as anecdotal evidence, I've cleaned up a number of bad Access database *and* MySQL databases. The original story of MySQL is somewhat telling though. They just needed to do simple reports on vast amounts of data that chained weekly and only constituted a few tables. So that's what MySQL was built for ;) -scott On 0, eden li wrote: > > I'm surprised they still haven't implemented it. Hell even Microsoft Access lets you do foreign keys. The reasons they give for not implementing them are kind of bogus. When you design a sufficiently complex schema, it's nice to be able to depend on the database to keep certain things about the schema correct. All the problems they mention with foreign keys can be taken care of by good design. > > It seems the MySQL developers don't trust us with being able to make the right decisions about using foreign keys in the right places. Maybe that's the reason I haven't touched mysql in so long... > > > Bill Lindley wrote: > > ...linked from a Slashdot thread, it's the MySQL developers eating > > humble pie... funny reading in a 'cvs commit' diff.. > > > > much more at > > http://lists.mysql.com/internals/1771 > From intertwingled at qwest.net Wed Apr 21 17:18:41 2004 From: intertwingled at qwest.net (Anthony Nemmer) Date: Thu Aug 5 00:17:19 2004 Subject: Phoenix.pm: "Why Not To Use Foreign Keys" ? In-Reply-To: <20040421220857.GB120@illogics.org> References: <20040421220857.GB120@illogics.org> Message-ID: <4086F341.4080708@qwest.net> What about the APL character set? .... Let's FUSE Perl 6 with APL. That would be the ultimate computer language! =) Tony Scott Walters wrote: >Interesting. And Larry Wall, the other day, put %foo`bar to rest. It >won't be in Perl 6. %foo<> (and the Unicode version) will be the >prefered method for subscripting with constants. > >-scott > >On 0, Bill Lindley wrote: > > >>...linked from a Slashdot thread, it's the MySQL developers eating >>humble pie... funny reading in a 'cvs commit' diff.. >> >>---begin quote--- >>-@cindex foreign keys, reasons not to use >>+@cindex foreign keys, why not implemented >> >>-There are so many problems with foreign key constraints that we don't >>-know where to start: >>+Many database scholars and programmers feel very strongly that >>+referential integrity should be enforced inside the database server. >>---end quote--- >> >>much more at >> >>http://lists.mysql.com/internals/1771 >> >> >> > > > > -- SKYKING, SKYKING, DO NOT ANSWER. From intertwingled at qwest.net Wed Apr 21 17:46:05 2004 From: intertwingled at qwest.net (Anthony Nemmer) Date: Thu Aug 5 00:17:19 2004 Subject: Phoenix.pm: "Why Not To Use Foreign Keys" ? In-Reply-To: <20040421221315.GC120@illogics.org> References: <20040421221315.GC120@illogics.org> Message-ID: <4086F9AD.1090508@qwest.net> I'm on the Model 204 bandwagon myself. It was designed by a couple of hackers from MIT Tech Square 9th floor for an agency at Fort Meade, is written for the most part in IBM mainframe assembly language (accept for the pattern matcher, which is written in C), was designed from the get-go to perform FAST complicated queries against billion record databases. Records can consist of one or more fields, multiply occurring fields are allowed, there can even be records with NO fields. There are also "hidden fields", where the field index is stored, but the field=value pair is NOT stored. This database is non-relational. In fact, it ESCHEWS relational. It's called Model 204. I worked with it for six years at the Drug Enforcement Administration and it KICKS THE ASS of any relational database you can name. Unfortunately, it only runs on IBM mainframes or plug compatibles. =( On the other hand, it has a "User Language" that has many perl-like features plus built in 3270 screen control and pattern matching built into the core syntax of the language. It is one of two languages that I have known that makes programming IBM mainframes FUN. The other is REXX. That's all for now. This is Tony, Signing Off. Scott Walters wrote: >Well, I'm on the Postgres bandwagon myself, but most people can't design a >half way relationtional schema in the first place, so either their lone table >has no foreign keys to relate to or their quagmire has so many problems that >losing data is the tip of the iceberg. Continuing with the bad habit of using >myself as anecdotal evidence, I've cleaned up a number of bad Access database >*and* MySQL databases. > >The original story of MySQL is somewhat telling though. They just needed >to do simple reports on vast amounts of data that chained weekly and only >constituted a few tables. So that's what MySQL was built for ;) > >-scott > >On 0, eden li wrote: > > >>I'm surprised they still haven't implemented it. Hell even Microsoft Access lets you do foreign keys. The reasons they give for not implementing them are kind of bogus. When you design a sufficiently complex schema, it's nice to be able to depend on the database to keep certain things about the schema correct. All the problems they mention with foreign keys can be taken care of by good design. >> >>It seems the MySQL developers don't trust us with being able to make the right decisions about using foreign keys in the right places. Maybe that's the reason I haven't touched mysql in so long... >> >> >>Bill Lindley wrote: >> >> >>>...linked from a Slashdot thread, it's the MySQL developers eating >>>humble pie... funny reading in a 'cvs commit' diff.. >>> >>>much more at >>>http://lists.mysql.com/internals/1771 >>> >>> > > > > -- SKYKING, SKYKING, DO NOT ANSWER. From scott at illogics.org Wed Apr 21 18:00:01 2004 From: scott at illogics.org (Scott Walters) Date: Thu Aug 5 00:17:19 2004 Subject: Phoenix.pm: "Why Not To Use Foreign Keys" ? Message-ID: <20040421230001.GD120@illogics.org> Why don't you rewrite the 360 bits in C and give it a forms interfaces for HTML or vt100 or such? -scott On 0, Anthony Nemmer wrote: > > I'm on the Model 204 bandwagon myself. It was designed by a couple of > hackers from MIT Tech Square 9th floor for an agency at Fort Meade, is > written for the most part in IBM mainframe assembly language (accept for > the pattern matcher, which is written in C), was designed from the > get-go to perform FAST complicated queries against billion record > databases. Records can consist of one or more fields, multiply occurring > fields are allowed, there can even be records with NO fields. There are > also "hidden fields", where the field index is stored, but the > field=value pair is NOT stored. This database is non-relational. In > fact, it ESCHEWS relational. It's called Model 204. I worked with it for > six years at the Drug Enforcement Administration and it KICKS THE ASS of > any relational database you can name. Unfortunately, it only runs on IBM > mainframes or plug compatibles. =( On the other hand, it has a "User > Language" that has many perl-like features plus built in 3270 screen > control and pattern matching built into the core syntax of the language. > It is one of two languages that I have known that makes programming IBM > mainframes FUN. The other is REXX. > > That's all for now. > > This is Tony, Signing Off. > > Scott Walters wrote: > > >Well, I'm on the Postgres bandwagon myself, but most people can't design a > >half way relationtional schema in the first place, so either their lone table > >has no foreign keys to relate to or their quagmire has so many problems that > >losing data is the tip of the iceberg. Continuing with the bad habit of using > >myself as anecdotal evidence, I've cleaned up a number of bad Access database > >*and* MySQL databases. > > > >The original story of MySQL is somewhat telling though. They just needed > >to do simple reports on vast amounts of data that chained weekly and only > >constituted a few tables. So that's what MySQL was built for ;) > > > >-scott > > > >On 0, eden li wrote: > > > > > >>I'm surprised they still haven't implemented it. Hell even Microsoft Access lets you do foreign keys. The reasons they give for not implementing them are kind of bogus. When you design a sufficiently complex schema, it's nice to be able to depend on the database to keep certain things about the schema correct. All the problems they mention with foreign keys can be taken care of by good design. > >> > >>It seems the MySQL developers don't trust us with being able to make the right decisions about using foreign keys in the right places. Maybe that's the reason I haven't touched mysql in so long... > >> > >> > >>Bill Lindley wrote: > >> > >> > >>>...linked from a Slashdot thread, it's the MySQL developers eating > >>>humble pie... funny reading in a 'cvs commit' diff.. > >>> > >>>much more at > >>>http://lists.mysql.com/internals/1771 > >>> > >>> > > > > > > > > > > > -- > > SKYKING, SKYKING, DO NOT ANSWER. > > From scott at illogics.org Wed Apr 21 18:02:11 2004 From: scott at illogics.org (Scott Walters) Date: Thu Aug 5 00:17:19 2004 Subject: Phoenix.pm: "Why Not To Use Foreign Keys" ? Message-ID: <20040421230211.GE120@illogics.org> I guess there is a an emulator, Hurcules, that runs mainframe stuff. I think it's free but I've never really looked into it. That might help you with your C port. SNOBOL would be dead if Philip Budne hadn't rewritten the 360 bits in portable C 7 years back, but now, fools like me run it ;) -scott On 0, Anthony Nemmer wrote: > > I'm on the Model 204 bandwagon myself. It was designed by a couple of > hackers from MIT Tech Square 9th floor for an agency at Fort Meade, is > written for the most part in IBM mainframe assembly language (accept for > the pattern matcher, which is written in C), was designed from the > get-go to perform FAST complicated queries against billion record > databases. Records can consist of one or more fields, multiply occurring > fields are allowed, there can even be records with NO fields. There are > also "hidden fields", where the field index is stored, but the > field=value pair is NOT stored. This database is non-relational. In > fact, it ESCHEWS relational. It's called Model 204. I worked with it for > six years at the Drug Enforcement Administration and it KICKS THE ASS of > any relational database you can name. Unfortunately, it only runs on IBM > mainframes or plug compatibles. =( On the other hand, it has a "User > Language" that has many perl-like features plus built in 3270 screen > control and pattern matching built into the core syntax of the language. > It is one of two languages that I have known that makes programming IBM > mainframes FUN. The other is REXX. > > That's all for now. > > This is Tony, Signing Off. > > Scott Walters wrote: > > >Well, I'm on the Postgres bandwagon myself, but most people can't design a > >half way relationtional schema in the first place, so either their lone table > >has no foreign keys to relate to or their quagmire has so many problems that > >losing data is the tip of the iceberg. Continuing with the bad habit of using > >myself as anecdotal evidence, I've cleaned up a number of bad Access database > >*and* MySQL databases. > > > >The original story of MySQL is somewhat telling though. They just needed > >to do simple reports on vast amounts of data that chained weekly and only > >constituted a few tables. So that's what MySQL was built for ;) > > > >-scott > > > >On 0, eden li wrote: > > > > > >>I'm surprised they still haven't implemented it. Hell even Microsoft Access lets you do foreign keys. The reasons they give for not implementing them are kind of bogus. When you design a sufficiently complex schema, it's nice to be able to depend on the database to keep certain things about the schema correct. All the problems they mention with foreign keys can be taken care of by good design. > >> > >>It seems the MySQL developers don't trust us with being able to make the right decisions about using foreign keys in the right places. Maybe that's the reason I haven't touched mysql in so long... > >> > >> > >>Bill Lindley wrote: > >> > >> > >>>...linked from a Slashdot thread, it's the MySQL developers eating > >>>humble pie... funny reading in a 'cvs commit' diff.. > >>> > >>>much more at > >>>http://lists.mysql.com/internals/1771 > >>> > >>> > > > > > > > > > > > -- > > SKYKING, SKYKING, DO NOT ANSWER. > > From Eden.Li at asu.edu Wed Apr 21 18:34:47 2004 From: Eden.Li at asu.edu (Eden Li) Date: Thu Aug 5 00:17:19 2004 Subject: Phoenix.pm: "Why Not To Use Foreign Keys" ? In-Reply-To: <20040421230211.GE120@illogics.org> Message-ID: I've never seen SNOBOL code. Can you grace the list with a few lines? On Wed, 21 Apr 2004, Scott Walters wrote: > SNOBOL would be dead if Philip Budne hadn't rewritten the 360 bits > in portable C 7 years back, but now, fools like me run it ;) From scott at illogics.org Wed Apr 21 19:07:49 2004 From: scott at illogics.org (Scott Walters) Date: Thu Aug 5 00:17:19 2004 Subject: Phoenix.pm: "Why Not To Use Foreign Keys" ? Message-ID: <20040422000749.GF120@illogics.org> Sure =) A simple loop... LOOPS = 10000 &STLIMIT = LOOPS * 2 + 10 A = 0 LOOP A = A + 1 LT(A,LOOPS) :S(LOOP) END Word counting program... * WORDS.SNO -- word counting program * * Sample program from Chapter 6 of the Tutorial * * A word is defined to be a contiguous run of letters, * digits, apostrophe and hyphen. This definition of * legal letters in a word can be altered for specialized * text. * * If the file to be counted is TEXT.IN, run this program * by typing: * B>SNOBOL4 WORDS /I=TEXT * &TRIM = 1 UCASE = "ABCDEFGHIJLKMNOPQRSTUVWXYZ" LCASE = "abcdefghijlkmnopqrstuvwxyz" WORD = "'-" '0123456789' UCASE LCASE BP = BREAK(WORD) SP = SPAN(WORD) WPAT = BREAK(WORD) SPAN(WORD) NEXTL LINE = INPUT :F(DONE) * OUTPUT = '>' LINE NEXTW * LINE WPAT = :F(NEXTL) LINE BP = LINE SP = :F(NEXTL) * OUTPUT = '>>' LINE N = N + 1 :(NEXTW) DONE OUTPUT = +N ' words' END And some sample pattern matching... pattern matching is SNOBOL's "thing"... RSI_2 SS '<' ARB . NM '>::=' = RSENT_TBL = '|' SS IDENT(S,'END') :S(RSENTENCE_END) SS = S :(RSI_1) Sorry this isn't very coherent... I'll put together something better later ;) -scott On 0, Eden Li wrote: > > I've never seen SNOBOL code. Can you grace the list with a few lines? > > On Wed, 21 Apr 2004, Scott Walters wrote: > > SNOBOL would be dead if Philip Budne hadn't rewritten the 360 bits > > in portable C 7 years back, but now, fools like me run it ;) > From aj at exiledplanet.org Thu Apr 22 02:12:16 2004 From: aj at exiledplanet.org (Andrew Johnson) Date: Thu Aug 5 00:17:19 2004 Subject: Phoenix.pm: "Why Not To Use Foreign Keys" ? In-Reply-To: <20040421221315.GC120@illogics.org> References: <20040421221315.GC120@illogics.org> Message-ID: <40877050.5000804@exiledplanet.org> Well, remember, MySQL will let you declare foreign keys, it just won't /enforce/ them. Wrap your head around /that/ for a little while... I _do_ like MySQL though. It's fast, fast, fast, and uses more or less standard SQL. Though for more heavy duty relational db work, I'm on the Oracle bandwagon, primarily because it makes the paychecks clear now. Scott Walters wrote: >Well, I'm on the Postgres bandwagon myself, but most people can't design a >half way relationtional schema in the first place, so either their lone table >has no foreign keys to relate to or their quagmire has so many problems that >losing data is the tip of the iceberg. Continuing with the bad habit of using >myself as anecdotal evidence, I've cleaned up a number of bad Access database >*and* MySQL databases. > >The original story of MySQL is somewhat telling though. They just needed >to do simple reports on vast amounts of data that chained weekly and only >constituted a few tables. So that's what MySQL was built for ;) > >-scott > >On 0, eden li wrote: > > >>I'm surprised they still haven't implemented it. Hell even Microsoft Access lets you do foreign keys. The reasons they give for not implementing them are kind of bogus. When you design a sufficiently complex schema, it's nice to be able to depend on the database to keep certain things about the schema correct. All the problems they mention with foreign keys can be taken care of by good design. >> >>It seems the MySQL developers don't trust us with being able to make the right decisions about using foreign keys in the right places. Maybe that's the reason I haven't touched mysql in so long... >> >> >>Bill Lindley wrote: >> >> >>>...linked from a Slashdot thread, it's the MySQL developers eating >>>humble pie... funny reading in a 'cvs commit' diff.. >>> >>>much more at >>>http://lists.mysql.com/internals/1771 >>> >>> From vodhner at cox.net Fri Apr 23 12:07:23 2004 From: vodhner at cox.net (Victor Odhner) Date: Thu Aug 5 00:17:19 2004 Subject: Phoenix.pm: quoting constant hash keys survey In-Reply-To: <40859B65.6070904@qwest.net> References: <20040420042007.GQ120@illogics.org> <4084A5C5.5000805@asu.edu> <40854300.40605@wlindley.com> <40854970.9090408@qwest.net> <4085942F.3040800@cox.net> <40859B65.6070904@qwest.net> Message-ID: <40894D4B.5010304@cox.net> Anthony Nemmer wrote: > Hey, wow. One of the things I collect is character sets. If you still > have your old manuals, could you scan the character set table in for me > (if there is one) and send it to me? > > Thanks, > Tony The character set was called BCL, which stood for Burroughs Common Language, and I heard it pointed out that it was not common and wasn't a language. But really it was just a variant on six-bit BCD, which originally was called Binary Coded Decimal although it had letters and punctuation as well. I did my first off-hours consulting job on a little Honeywell mini-computer, to schedule deliveries for a bakery, and I prepared some of the COBOL code at my Burroughs workplace. I had to do some translating from BCL to BCD before punching out the deck, but the two character sets were pretty similar - I think only some of the punctuation was different. My contact with BCL was on the Burroughs B5500, and I guess I last thought about it in about 1975. The B6700/7700 used EBCDIC. In 1980 I moved into the Honeywell/GCOS world, and in about 1988 started doing some Unix work, so I've used nothing but ASCII since 1980. Vic From scott at illogics.org Fri Apr 23 13:29:11 2004 From: scott at illogics.org (Scott Walters) Date: Thu Aug 5 00:17:19 2004 Subject: Phoenix.pm: Re: SNOBOL Message-ID: <20040423182910.GB7867@illogics.org> On 0, Scott Walters wrote: > Sure =) > > A simple loop... > > LOOPS = 10000 > &STLIMIT = LOOPS * 2 + 10 > A = 0 > LOOP A = A + 1 > LT(A,LOOPS) :S(LOOP) > END My memory is fuzzy... but here goes. Labels start in column 0. There are really only two columns and the other one isn't fixed. This is typical of assembler but assemblers tend to have 3 columns ;) SNOBOL does do subroutines and automatic (stack) variables but I don't think any of these examples do that. Branching is popular in SNOBOL, though. Each construct on succed or fail. LOOPS = 10000 is a simple assignment. Like Perl package variables ("globals"), variables string into existance by their mere mention. So we don't have to declare LOOPS first. &STRLIMIT is one of many special variables and sets the max size of strings for the purpose of detecting errors. A is set to 0 too. > LOOP A = A + 1 This just increments A but without the benefit of the C ++ operator. LOOP is a label. Labels are branch targets. > LT(A,LOOPS) :S(LOOP) I said that everything can succed or fail. Well, this is the primary way of doing conditionals. Pattern matches are conditionals. If this succeds (A is less than LOOPS) then we branch back to the LOOP label. :S(TARGET) branches on success, :F(TARGET) on fail, and :(TARGET) conditionally. You can have both a :S and :F target on the same line - that line will always branch, it'll just branch to a different location depending ;) Each kind of statement definds succed/fail differently. This is kind of assemblyish too. In Perl... $loops = 10000; $a = 0; loop: $a++; goto loop if $a < $loops; exit; > Word counting program... > > * WORDS.SNO -- word counting program > * > * Sample program from Chapter 6 of the Tutorial > * > * A word is defined to be a contiguous run of letters, > * digits, apostrophe and hyphen. This definition of > * legal letters in a word can be altered for specialized > * text. > * > * If the file to be counted is TEXT.IN, run this program > * by typing: > * B>SNOBOL4 WORDS /I=TEXT > * > &TRIM = 1 > UCASE = "ABCDEFGHIJLKMNOPQRSTUVWXYZ" > LCASE = "abcdefghijlkmnopqrstuvwxyz" > WORD = "'-" '0123456789' UCASE LCASE > BP = BREAK(WORD) > SP = SPAN(WORD) > WPAT = BREAK(WORD) SPAN(WORD) > > NEXTL LINE = INPUT :F(DONE) > * OUTPUT = '>' LINE > NEXTW > * LINE WPAT = :F(NEXTL) > LINE BP = > LINE SP = :F(NEXTL) > * OUTPUT = '>>' LINE > N = N + 1 :(NEXTW) > > DONE OUTPUT = +N ' words' > END $ucase = 'ABCDEFGHIJLKMNOPQRSTUVWXYZ'; $lcase = 'abcdefghijlkmnopqrstuvwxyz'; $word = join '', "'-", '0123456789', $ucase, $lcase; $word = join '|', split //, $word; # SNOBOL does essentially this automatically $word = qr/$word/; # ditto $bp = qr/.*?(?=$word)/; # yuck =P match non-greedy until we would match $word $sp = qr/$word+/; $wpat = qr/$bp$sp/; nextl: $line = or goto done; # print '>', $line; nextw: # $line =~ s/^$wpat// or goto nextl; $line =~ s/^$bp//; $line =~ s/^$sp// or goto nextl; # print '>>', $line; $n++; goto nextw; done: print "$n words\n"; exit; The default thing to do in SNOBOL is pattern match. The default thing to do on the right side of an assignment is concatonate. > WORD = "'-" '0123456789' UCASE LCASE This concats the 4 strings together. Like Perl, SNOBOL can quote with either "" or '', but SNOBOL doesn't do variable interpolation. Not having to type the . out, this really doesn't matter though ;) > BP = BREAK(WORD) > SP = SPAN(WORD) BREAK and SPAN are opposites. SPAN returns a pattern that matches for as long as its input pattern or string matches. It's positive. BREAK is negative. It matches everything up to the pattern or string it took as an argument. That it, is matches everything but its argument. > LINE BP = Assigning to a pattern match... well, it's a lot more mnemonic than what Perl wants you to do ;) > N = N + 1 :(NEXTW) This is an unconditional goto. Note that input and output happen by reading from and writing to special variables. Also note how SNOBOL makes building up patterns easy. User defined code can be used as part of a pattern too, and variable assignments can be done in middle of a pattern with the $ operator. FENCE prevents a pattern match from backing up past a point (if it made it this far, it must either finish or else fail), constraint that it be on a certain column. | takes two patterns and returns a pattern that will match either. ARB matches any character. ARBNUM matches an arbitrary number of any other pattern, sort of like * in regex. FAIL matches nothing ;) FAIL is extremely useful for forcing the pattern matcher to try all posibilities, which is useful for finding a best match rather than a first match. Some logic wired into the match could be saving the value that matched at some portion of it. This would be used to find the longest word in a string, for example. TAB will match everything up to a column, RTAB everything up to a column meassured relative the right. SNOBOL has an EVAL to evaluate more SNOBOL source code. It does complex data structures, such as hashes of multidim arrays of patterns. It can store function pointers (one of these days I'd like to hack on closures...) I'm half way buttering SNOBOL up and half way just drawing parallels to Perl here. I don't mean to say that it is better because it has certain features Perl has. That would be ignorant ;) But the simple syntax and user extensible, powerful pattern matching is *fun*. > > > And some sample pattern matching... pattern matching is > SNOBOL's "thing"... > > RSI_2 SS '<' ARB . NM '>::=' = > RSENT_TBL = '|' SS > IDENT(S,'END') :S(RSENTENCE_END) > SS = S :(RSI_1) This was taken out of context... I just wanted some meaty pattern matching action, so this Perl won't do anything useful. rsi_2: $ss =~ s/<(.*)(?{ $nm = $1 })>::='//; $rsent_tbl[$nm] = '|' . $ss; goto rsentence_end if $s eq 'END'; $ss = $s; > > Sorry this isn't very coherent... I'll put together something > better later ;) And this would probably be that ;) The Perl versions are litteral translations. They could be made shorter, especially since SNOBOL is restrictive about what constitutes a line. The word matching thing could be shorted in SNOBOL quite a bit, probably down to 3 or 4 lines, but I'm pretty sure that Perl could do it in one. Still, SNOBOL *is* expressive and pretty clean, atleast in some ways ;) -scott > > -scott > > > On 0, Eden Li wrote: > > > > I've never seen SNOBOL code. Can you grace the list with a few lines? > > > > On Wed, 21 Apr 2004, Scott Walters wrote: > > > SNOBOL would be dead if Philip Budne hadn't rewritten the 360 bits > > > in portable C 7 years back, but now, fools like me run it ;) > > From scott at illogics.org Fri Apr 23 13:42:21 2004 From: scott at illogics.org (Scott Walters) Date: Thu Aug 5 00:17:19 2004 Subject: Phoenix.pm: Re: SNOBOL Message-ID: <20040423184221.GO120@illogics.org> SNOBOL is pretty unusual as far as language syntax goes. You can't get far without a good tutorial, but given a good tutorial, it is easy to pick up. http://www.snobol4.com and http://www.snobol4.org have a tutorial between the two of them somewhere, I'm sure, and snobol4.org has the C-MAINBOL implementation of SNOBOL4 in portable C for Unix up for download. I haven't used anything but the POSIX version ;) I'm just kind of an amature history buff, like a lot of people... and I happened to have discovered SNOBOL before I discovered Perl. Comes of spending too much time in libraries... I got in on the whole computing deal when Commodore 64's and Apple II's and Atari's were big. Used to bounce off a VAXes that had guest logins through terminal servers that would let you connect anywhere in a University campus and connect directly to MUDs, all by 2400 baud modem. I was on the net 3 or 4 years before I had an email account and probably 5 years before I had my own email account ;) Back then, if you wanted to look at an image, you had to zmodem it down (or xmodem, or kermit), and then you sat there for an hour, unable to do anything else with the computer or the connection as it came down, then you'd save it, shell out of the terminal software, and run an image viewer on it and render it in 16 colors at 160 by 200 pixels. So I often feel old but I feel a little less old when someone else out-olds me ;) I replied to my earlier message... Cheers, -scott On 0, Victor Odhner wrote: > > Hi, Scott. > > We had SNOBOL at Honeywell (uncer GCOS) back in 1985 but > I never managed to grok it. I was also trying lisp, etc. > at that time. Perl is everything I was looking for > back then. > > So: Why don't you re-post that SNOBOL code > with equivalent Perl? > > Vic > From tayers at quaday.com Fri Apr 23 14:33:38 2004 From: tayers at quaday.com (Tim Ayers) Date: Thu Aug 5 00:17:19 2004 Subject: Phoenix.pm: Curmudgeons [Was Re: SNOBOL] In-Reply-To: <20040423184221.GO120@illogics.org> References: <20040423184221.GO120@illogics.org> Message-ID: <40896F92.5040707@quaday.com> Scott Walters wrote: > So I often feel old but I feel a little less old when > someone else out-olds me ;) Ooo. I love this game. :-) My first computer, a Radio Shack "Color Computer," had 20K of RAM. Upgrades I made to it over the next couple years, in order, were cassette tape storage, a 300 baud modem and then 8K more of RAM. Man, was I set up then. ;-) This was 1981-1984 or so. What a blast I had with that computer, teaching myself to program in BASIC. This computer was very good at graphics for the time. I wrote so many dorky little programs: 3D cube rotations, rotations of 2 variable equations around the Z axis, a slot machine simulation, pong-style games, and lots of graphs for trig, calculus and differential equations. It was sure nice to check your homework with a little home made program that could plot out a detailed isocline field in a minute or so. Hope you have a very nice day, :-) tim, who's waiting for Bill's dad's stories of punch cards and paper tapes. I remember going to my father's office as a child and playing on the punch card machines for their IBM mainframe the size of a refrigerator with 4K of RAM that was leased for $1,000 a month. This was in 1970 before the big time inflation! From scott at illogics.org Sat Apr 24 01:14:08 2004 From: scott at illogics.org (Scott Walters) Date: Thu Aug 5 00:17:19 2004 Subject: Phoenix.pm: Re: SNOBOL - resending Message-ID: <20040424061408.GC7867@illogics.org> I never saw this message come back from the list so I'm assuming the list lost it. Resending. Sorry. Lisp has been a bit flakey the last 3 or 4 years... This was in response to Victor's request for Perl translators of the SNOBOL examples. -scott ----- Forwarded message from Scott Walters ----- Date: Wed, 21 Apr 2004 17:07:49 -0700 From: Scott Walters To: Eden Li Cc: 20040421230211.GE120@illogics.org Subject: Re: Phoenix.pm: "Why Not To Use Foreign Keys" ? Message-ID: <20040422000749.GF120@illogics.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.5i Status: RO Content-Length: 1843 Lines: 71 Sure =) A simple loop... LOOPS = 10000 &STLIMIT = LOOPS * 2 + 10 A = 0 LOOP A = A + 1 LT(A,LOOPS) :S(LOOP) END Word counting program... * WORDS.SNO -- word counting program * * Sample program from Chapter 6 of the Tutorial * * A word is defined to be a contiguous run of letters, * digits, apostrophe and hyphen. This definition of * legal letters in a word can be altered for specialized * text. * * If the file to be counted is TEXT.IN, run this program * by typing: * B>SNOBOL4 WORDS /I=TEXT * &TRIM = 1 UCASE = "ABCDEFGHIJLKMNOPQRSTUVWXYZ" LCASE = "abcdefghijlkmnopqrstuvwxyz" WORD = "'-" '0123456789' UCASE LCASE BP = BREAK(WORD) SP = SPAN(WORD) WPAT = BREAK(WORD) SPAN(WORD) NEXTL LINE = INPUT :F(DONE) * OUTPUT = '>' LINE NEXTW * LINE WPAT = :F(NEXTL) LINE BP = LINE SP = :F(NEXTL) * OUTPUT = '>>' LINE N = N + 1 :(NEXTW) DONE OUTPUT = +N ' words' END And some sample pattern matching... pattern matching is SNOBOL's "thing"... RSI_2 SS '<' ARB . NM '>::=' = RSENT_TBL = '|' SS IDENT(S,'END') :S(RSENTENCE_END) SS = S :(RSI_1) Sorry this isn't very coherent... I'll put together something better later ;) -scott On 0, Eden Li wrote: > > I've never seen SNOBOL code. Can you grace the list with a few lines? > > On Wed, 21 Apr 2004, Scott Walters wrote: > > SNOBOL would be dead if Philip Budne hadn't rewritten the 360 bits > > in portable C 7 years back, but now, fools like me run it ;) > ----- End forwarded message ----- From aj at exiledplanet.org Thu Apr 29 14:43:11 2004 From: aj at exiledplanet.org (Andrew Johnson) Date: Thu Aug 5 00:17:19 2004 Subject: Phoenix.pm: Perl 6 Apocalypse 12 In-Reply-To: <20040424061408.GC7867@illogics.org> References: <20040424061408.GC7867@illogics.org> Message-ID: <40915ACF.3040508@exiledplanet.org> It's been a couple of weeks since Larry Wall releaed Perl 6 Apocalypse 12, in which he explains the Perl 6 object model. It's rather long (supposedly 80 printed pages). Given our recent discussion on Perl 6 syntax, I wondered if anyone in the group had any thoughts on the new Apocalypse? Since I brought up the subject, I can start the discussion: Likes: *I really like the basic syntax choices. You declare a class by using 'class', and methods by using 'method'. They're still packages and subs underneath, but Perl 6 takes care of that for you. *There is a default constructor, so you don't have to declare new() methods in every class structure you create. *The annoyance of '$self=shift' in every method is gone; $.attrname will automatically mean the 'attrname' value of the current object. Dislikes: *Secondary Sigils. Yuck. Class methods especially seem complicated with them. * I think the syntax: my Dog $spot .= new(...) looks _awful_. Of course, one does not have to use that syntax, but stuff like that is going to trip up Java/C/Perl 5 programmers, IMHO. Confusion: *I'm still a bit unclear about how traits, properties, and roles work. Traits sort of look a bit like Java interfaces, but not exactly. Somebody apparently likes them enough to port them to Perl 5 though: http://search.cpan.org/~stevan/Class-Trait-0.03/ Remember, this is all my US$0.02. Comments? Questions? Explanations? From scott at illogics.org Thu Apr 29 22:26:27 2004 From: scott at illogics.org (Scott Walters) Date: Thu Aug 5 00:17:19 2004 Subject: Phoenix.pm: Perl 6 Apocalypse 12 Message-ID: <20040430032627.GI120@illogics.org> Two weeks? Already? Damn. I'm way behind schedule. I started to read it. I don't like traits. They're mix-ins. Mix-ins punt on OO design. Rather than figuring out where in the inheritance hierachy to place something, you just suck it in anywhere you feel like. This makes it hard to talk about things in the general, which is the primary point of OO. They lead to bad design or no design. It makes for an OO equivilent of "global code", where the logic all exists in one place because you've sucked it in. I think Java went the right direction with single inheritance plus interfaces. That encourages delegation and design. Everything that happens in Perl 6 is the result of lobbying by one person or another. In this case, it's chromatic, an O'Reilly editor, and he vehomently argues that traits aren't mixins even as Larry and the rest of the world describe them that way. The bit about getting to the implmenetation of the class thorugh the .meta attribute was kind of interesting, so you can dig around in the information used to dispatch and get under the hood. Other than that, what you said ;) I guess Ruby and C# let you do obj.foo = 10 to mean obj.foo(10) and there was quite some fuss on the perl6-language list that this wasn't included. Some people coughed up 20 or 30 line code snippets that went under the hood and created setter attributes and parallel methods prototyped to lvalue context (ugh) that emulated it but there's quite a gap between "possible" and "easy and obvious for novices". Things only go into wide use in the latter case. Of course, you can still return lvalues as in Perl 5, but making the assigned in value look like an argument to the method requires the mucking with the OO guts to tie a dummy object which gets returned in that context. Re: traits, properties, and roles, traits bolt logic onto data storage to change how the data storage works. Properties bolt logic onto values to change how the values present themselves. In Perl (5 and 6), you've got something going on like... [symbol table or pad] -> [variable name] -> [container SV/AV/HV] -> [value] Right now, it's possible to tweak the container quite a bit. Scalar::Util and Hash::Util do this, as do tieing. Perl 6 standardizes these things into traits. That is, anything done to the container is logic contained in a trait. Traits are introduced with "is". On the other hand, very little can be done with the value itself in Perl 5. Perl 6 makes values complex. Attributes do this. They're introduced with "but". So every time you see one of these words you know that an object somewhere is being dynamicly subclassed. I try not to think about it. Roles are mixins for proper objects. It's basically multiple inheritance, but this is really busted. Something "is a" something else if it can serve as that thing for all intents and purposes. Something "has" something else if it holds a reference to that other thing (or can create one as needed). The first is very important for OO modeling. This lets you classify which methods can take the output of which other methods. Perl 5 has a funny thing called "can": perl -e 'sub foo { }; die unless main->can("foo");' can() checks if a method is defined. Perl 6 might have this. Well, Perl 6 does a step further with does(). does() checks for mix-ins. Mix-in interfaces aren't real interfaces! It is completely parallel to the OO modeling. In Java or any other OO language, if something implements an interface or uses a mix-in, it counts as that type. Not Perl 6. This is near the top of my "not going to use it" list. chromatic by the way is one of my arch nemesis. I wish I had something to add other than explanation, but for the 4 or so pages I've read, you've nailed my feelings exactly. It's good to see an OO system on Perl that makes instance data work correctly with inheritance and 'use strict' and require less syntax. After all, you don't access automatic/stack variables as $stack[$level]->{variable}, which is exactly the sort of thing you have to do if you want to write assembly code that's recursive safe and doesn't pre-allocate storage for each and every variable each routine might need at any point. Yet $foo->{variable} puts the work onto the programmer of creating storage implementation. Yuck =P My largest gripe right now isn't with anything they're doing in Perl 6 but rather how alienated they've made people to the process even though it is in fact open. If nothing else, not even pretending to be interested in what joe Perl user thinks, they're robbing themselves of lots of free labor. People get involved in projects when they feel like it is theirs in some small way, and when you tell people to "wait in the lobby" so to speak, well, that's more like a commercial thing where you either buy it or you don't and if you don't like it, too bad. Which is okey unless you really need the free labor. And for Perl 6, they really do. It's turned into one of those things where a few people do 90% of the work, and the more work they do, the less interested other people are and the more work they wind up doing. It's a downwards spiral. Mono, (the free CLR/C# runtime/compiler) on the other hand, has done a good job of recruiting and coordinating. As a parting stab, there are two related gripes with the Perl 5 VM that dominate all otheres: poor documentation, and few people understand how the really groddy innards work. Parrot was meant to fix this situation be rewritting it. Well, since it is all being written by a few people with virtually no overlap between parts, essentially only one person understands how each part works (the JIT, runops, garbage collection, etc). And since only a few people are doing the work they don't have time to write documentation, so no significant documentation has been writte in _years_. Parrot has grown the worst attributes of the Perl 5 VM. *stab* *stab* *stab* Disclaimer: it is in my nature never to be happy with anything. My dissatisfaction is what drives me. So I hope no one is offended that I'm nothing but critical. -scott On 0, Andrew Johnson wrote: > > It's been a couple of weeks since Larry Wall releaed Perl 6 Apocalypse > 12, in which he explains the Perl 6 object model. It's rather long > (supposedly 80 printed pages). Given our recent discussion on Perl 6 > syntax, I wondered if anyone in the group had any thoughts on the new > Apocalypse? > > Since I brought up the subject, I can start the discussion: > > Likes: > *I really like the basic syntax choices. You declare a class by using > 'class', and methods by using 'method'. They're still packages and subs > underneath, but Perl 6 takes care of that for you. > > *There is a default constructor, so you don't have to declare new() > methods in every class structure you create. > > *The annoyance of '$self=shift' in every method is gone; $.attrname > will automatically mean the 'attrname' value of the current object. > > Dislikes: > *Secondary Sigils. Yuck. Class methods especially seem complicated > with them. > > * I think the syntax: > my Dog $spot .= new(...) > looks _awful_. Of course, one does not have to use that syntax, but > stuff like that is going to trip up Java/C/Perl 5 programmers, IMHO. > > Confusion: > *I'm still a bit unclear about how traits, properties, and roles work. > Traits sort of look a bit like Java interfaces, but not exactly. > Somebody apparently likes them enough to port them to Perl 5 though: > http://search.cpan.org/~stevan/Class-Trait-0.03/ > > Remember, this is all my US$0.02. Comments? Questions? Explanations? >