From icon-group-sender Tue Jan 5 08:45:29 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id IAA24057 for icon-group-addresses; Tue, 5 Jan 1999 08:41:39 -0700 (MST) Message-Id: <199901051541.IAA24057@baskerville.CS.Arizona.EDU> Date: Mon, 04 Jan 1999 17:34:32 -0600 From: "Charles Hethcoat" To: icon-group@optima.CS.Arizona.EDU Subject: EditPAD Content-Disposition: inline X-MIME-Autoconverted: from quoted-printable to 8bit by baskerville.CS.Arizona.EDU id QAA13387 Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO MJE wrote: >Windows users might be interested in EditPAD, I never cared for Notepad, either. For several years I've been pretty happy using PFE (http://www.lancs.ac.uk/people/cpaap/pfe/) as a general purpose editor. A quick reading of the EditPAD description makes the two sound very similar. Has anyone got any comparative experience with both editors? I'd be interested in your comments. I've got so much stuff installed on my computer now that I'm reluctant to install both. I might, however, swap out PFE for EditPad if it seems clearly superior. Charles Hethcoat From icon-group-sender Tue Jan 5 16:31:24 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id QAA10984 for icon-group-addresses; Tue, 5 Jan 1999 16:31:07 -0700 (MST) Message-Id: <199901052331.QAA10984@baskerville.CS.Arizona.EDU> To: icon-group@optima.CS.Arizona.EDU Date: 05 Jan 1999 12:23:51 -1000 From: Robert Valliant Subject: Icon graphics Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO I was on vacation when I found some statistics that would allow me to make a population pyramid for Russia that I could put on my website. I thought I would do it in postscript; then I remembered reading in the Icon graphics book that I bought that Icon can output .gif files. Fine, sez I, I'll just do it. And I did. I had to figure out how to do the stuff I needed and play with it and other things, but I got it to work. Just save the file and it is a .gif, and I can use the full X font specification to get any font I need! Wonderful. I am now a happy camper. I should even be able to superimpose one pyramid on another. I love it! Thanks Icon. Robert Valliant Center for Russia in Asia, University of Hawaii at Manoa www.hawaii.edu/shaps/russia valliant@hawaii.edu Fax: 808.956.2682 Tel: 808.956.7814 From icon-group-sender Mon Jan 11 08:17:18 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id IAA05343 for icon-group-addresses; Mon, 11 Jan 1999 08:15:16 -0700 (MST) Message-Id: <199901111515.IAA05343@baskerville.CS.Arizona.EDU> Date: Fri, 8 Jan 1999 19:32:15 -0700 From: Ralph Griswold To: icon-group Subject: A Small Programming Problem Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO We've processed the solutions to the problem of sorting the digits of an integer. Preliminary result are on our Web site: http://www.cs.arizona.edu/icon/spp.htm If you have comments, please send them to me or to icon-group. Ralph Griswold From icon-group-sender Thu Jan 14 08:50:52 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id IAA05681 for icon-group-addresses; Thu, 14 Jan 1999 08:47:35 -0700 (MST) Message-Id: <199901141547.IAA05681@baskerville.CS.Arizona.EDU> Date: Wed, 13 Jan 1999 16:45:37 -0800 From: Jim Mehl X-Accept-Language: en To: icon-group@optima.CS.Arizona.EDU Subject: Getting started with QEI Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO I'm having trouble getting QEI to work as advertised. I am using Icon 9.3.1 on Windows 95. I have plenty of memory, disk space, etc. I compiled QEI and linked into an EXE file. When I run it I get a QEI console window saying Icon Expression Evaluator, Version 1.2 and a > prompt. I enter something like 3 + 4; but get nothing but another > prompt. If I then say :list it shows me #r1_ := (3 + 4) indicating that it accepted my input, but I get no direct output no matter what expression I enter. Any suggestions? Jim Mehl Los Gatos, CA From icon-group-sender Fri Jan 15 16:44:02 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id QAA04732 for icon-group-addresses; Fri, 15 Jan 1999 16:42:03 -0700 (MST) Message-Id: <199901152342.QAA04732@baskerville.CS.Arizona.EDU> To: icon-group@optima.CS.Arizona.EDU Date: Fri, 15 Jan 1999 21:35:12 GMT From: Mario.Dupuis@mfg.canadair.ca Subject: Icon and GUI development Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Hi, I'm presently just looking at Icon and I would like to know if there are people doing GUI with it. Is there a widget set available (scrollbars,menus ...) ? How would it compare to , TK/TCl as far as GUI dev. ? (please no language wars !!) Where could I see example of GUI developped with Icon ? Please reply directly to my E-mail Thanks -----------== Posted via Deja News, The Discussion Network ==---------- http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own From icon-group-sender Mon Jan 18 13:22:53 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id NAA03013 for icon-group-addresses; Mon, 18 Jan 1999 13:22:46 -0700 (MST) Message-Id: <199901182022.NAA03013@baskerville.CS.Arizona.EDU> Date: Sat, 16 Jan 1999 10:37:40 -0700 From: "Sandra L. Miller" X-Accept-Language: en To: icon-group@optima.CS.Arizona.EDU Subject: [Fwd: www site, pattern-matching research] Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO -------- Original Message -------- Subject: www site, pattern-matching research Date: Mon, 14 Dec 1998 10:36:32 -0800 From: Mike Shafto Reply-To: mshafto@mail.arc.nasa.gov Organization: NASA Ames Research Center To: icon-project@optima.CS.Arizona.EDU http://www.cs.purdue.edu/homes/stelo/pattern.html This www site seems potentially to have high relevance to the Icon Group. It is an index-site to people and information source on pattern-matching, including theoretical and applied work in biology, text processing, etc. Mike -- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ------- Mike Shafto (mshafto@mail.arc.nasa.gov) Chief, Human-Automation Integration Research Branch http://olias.arc.nasa.gov/ Mail Stop 262-4 NASA-Ames Research Center Moffett Field, CA 94035-1000 -------------------------------------------------------- The best-laid plans of mice and men oft-times go astray. Especially mice. -------------------------------------------------------- From icon-group-sender Thu Jan 21 16:49:57 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id QAA26896 for icon-group-addresses; Thu, 21 Jan 1999 16:47:33 -0700 (MST) Message-Id: <199901212347.QAA26896@baskerville.CS.Arizona.EDU> To: icon-group@optima.CS.Arizona.EDU Date: Thu, 21 Jan 1999 12:54:55 -0600 From: Scott Mcarthur Subject: Re: Icon and GUI development Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO I am personally doing some GUI development with icon. My development is for Windows, and not UNIX however. There is a widget set available (called vidgits) and a visual interface available (called the VIB Visual Interface Builder) Personally I have never used TK/TCL so I can not compare the ease of use. I have however used xforms and I find that the VIB is very similar to it. Personally I don't use the VIB much because I am developing for Windows and VIB creates GUI's that have a strong UNIX feel for them. Instead, I use the graphics facilities to create my own look and feel. (I do however use some of the Notice() vidgits at times). I have a tetris program that I am working on, but the source code is not available as I am planning on making this into a commercial product (sorry!). There are some uses of the notice boxes and a couple of other vidgits in the program that you can see visually though if you would like (plus it's just a fun game!) you can download it from http://www.cs.utsa.edu/~cmcarthu/sdfftetris.htm remember that this is intended for Windows! (Color map limitations have made me decide not to work on a unix version) I hope that this helps! Scott Mario.Dupuis@mfg.canadair.ca wrote: > Hi, > > I'm presently just looking at Icon and I would like to know if there > are people doing GUI with it. > > Is there a widget set available (scrollbars,menus ...) ? > > How would it compare to , TK/TCl as far as GUI dev. ? > (please no language wars !!) > > Where could I see example of GUI developped with Icon ? > > Please reply directly to my E-mail > > Thanks > > -----------== Posted via Deja News, The Discussion Network ==---------- > http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own -- Scott McArthur cmcarthu@cs.utsa.edu ------------------------------- If we aren't supposed to eat animals, why are they made of meat? From icon-group-sender Mon Jan 25 09:34:46 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id JAA12959 for icon-group-addresses; Mon, 25 Jan 1999 09:32:47 -0700 (MST) Message-Id: <199901251632.JAA12959@baskerville.CS.Arizona.EDU> From: "Yang, De (Dianna)" To: icon-group@optima.CS.Arizona.EDU Subject: qei questions Date: Sat, 23 Jan 1999 17:18:53 -0600 Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Dear Sirs, I download qei.icn and compiled it to run on my pc. But I did not get any echo of result from the input. For example, I input > 1+3; It does not return r1_:=4 but only another ">" for me. What did I do wrong? This is not described at the help page either. Thank you. De Yang From icon-group-sender Tue Jan 26 08:08:57 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id IAA19953 for icon-group-addresses; Tue, 26 Jan 1999 08:06:21 -0700 (MST) Message-Id: <199901261506.IAA19953@baskerville.CS.Arizona.EDU> Date: Mon, 25 Jan 1999 21:23:22 -0800 From: Jim Mehl X-Accept-Language: en To: icon-group@optima.CS.Arizona.EDU Subject: Re: qei questions Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO It sounds like Dianna is having the same problem I was having a couple of weeks ago. Thanks to help from Steve Wampler, I was able to sort it out. Dianna didn't say, but I assume she is using the Windows version of Icon. The problem is that qei (like a lot of other programs in the Icon library) makes a call to system("icont ...) to invoke the Icon compiler to evaluate expressions. Unfortunately with the Windows version, the Icon compiler is named wicont (for the windowing version) or nticont (for the command line version). The way I solved this was to make a copy of the nticont.exe compiler named icont.exe. From a Windows DOS command line issue copy nticont.exe icont.exe patchstr icont.exe icont.exe Patchstr comes with Windows Icon and is described under Windows Icon Help -> Known Bugs and Limitations. It is also necessary to compile qei.icn with either nticont or the icont you just created. What you get is a command line only version of qei, but it's better than nothing. It might be helpful if the documentation for Windows Icon mentioned the fact that the library includes all sorts of calls to icont, but that no icont.exe is included. Jim Mehl Los Gatos, CA mehl@ihot.com From icon-group-sender Tue Jan 26 13:09:42 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id NAA10508 for icon-group-addresses; Tue, 26 Jan 1999 13:09:02 -0700 (MST) Message-Id: <199901262009.NAA10508@baskerville.CS.Arizona.EDU> Date: Tue, 26 Jan 1999 09:23:55 -0600 From: MJE To: icon-group@optima.CS.Arizona.EDU Subject: Re: qei questions Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO What the program needs is conditional compilation around the name of the Icon compiler...such is typical of cross-platform code...don't know whether Icon supports it. Mark Jim Mehl wrote: > > It sounds like Dianna is having the same problem I was having a > couple of weeks ago. Thanks to help from Steve Wampler, I was able > to sort it out. > Dianna didn't say, but I assume she is using the Windows version > of Icon. > The problem is that qei (like a lot of other programs in the Icon > library) makes a call to system("icont ...) to invoke the Icon > compiler to evaluate expressions. Unfortunately with the Windows > version, the Icon compiler is named wicont (for the windowing > version) or nticont (for the command line version). > The way I solved this was to make a copy of the nticont.exe > compiler named icont.exe. From a Windows DOS command line issue > copy nticont.exe icont.exe > patchstr icont.exe icont.exe > Patchstr comes with Windows Icon and is described under > Windows Icon Help -> Known Bugs and Limitations. > It is also necessary to compile qei.icn with either nticont or the > icont you just created. What you get is a command line only version > of qei, but it's better than nothing. > It might be helpful if the documentation for Windows Icon mentioned > the fact that the library includes all sorts of calls to icont, but > that no icont.exe is included. > > Jim Mehl > Los Gatos, CA > mehl@ihot.com From icon-group-sender Tue Jan 26 13:11:02 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id NAA10636 for icon-group-addresses; Tue, 26 Jan 1999 13:10:54 -0700 (MST) Message-Id: <199901262010.NAA10636@baskerville.CS.Arizona.EDU> To: icon-group@optima.CS.Arizona.EDU Date: 21 Jan 1999 18:55:16 -0500 From: Scott Mcarthur Subject: Re: Icon and GUI development Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO I am personally doing some GUI development with icon. My development is for Windows, and not UNIX however. There is a widget set available (called vidgits) and a visual interface available (called the VIB Visual Interface Builder) Personally I have never used TK/TCL so I can not compare the ease of use. I have however used xforms and I find that the VIB is very similar to it. Personally I don't use the VIB much because I am developing for Windows and VIB creates GUI's that have a strong UNIX feel for them. Instead, I use the graphics facilities to create my own look and feel. (I do however use some of the Notice() vidgits at times). I have a tetris program that I am working on, but the source code is not available as I am planning on making this into a commercial product (sorry!). There are some uses of the notice boxes and a couple of other vidgits in the program that you can see visually though if you would like (plus it's just a fun game!) you can download it from http://www.cs.utsa.edu/~cmcarthu/sdfftetris.htm remember that this is intended for Windows! (Color map limitations have made me decide not to work on a unix version) I hope that this helps! Scott Mario.Dupuis@mfg.canadair.ca wrote: > Hi, > > I'm presently just looking at Icon and I would like to know if there > are people doing GUI with it. > > Is there a widget set available (scrollbars,menus ...) ? > > How would it compare to , TK/TCl as far as GUI dev. ? > (please no language wars !!) > > Where could I see example of GUI developped with Icon ? > > Please reply directly to my E-mail > > Thanks > > -----------== Posted via Deja News, The Discussion Network ==---------- > http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own -- Scott McArthur cmcarthu@cs.utsa.edu ------------------------------- If we aren't supposed to eat animals, why are they made of meat? From icon-group-sender Tue Jan 26 16:59:40 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id QAA20820 for icon-group-addresses; Tue, 26 Jan 1999 16:59:07 -0700 (MST) Message-Id: <199901262359.QAA20820@baskerville.CS.Arizona.EDU> To: icon-group@optima.CS.Arizona.EDU Date: Tue, 26 Jan 1999 23:05:02 +0100 From: "name" Subject: se busca profesor particular de programación Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Preferentemente con experiencia en C, Pascal y bases de datos. Las clases serán sobre TCL y Icon, de modo que el conocimiento previo de estos lenguajes, o uno de ellos, será valorado. Residencia en Madrid. Respuestas a jas@lander.es Saludos, JaS From icon-group-sender Tue Jan 26 17:01:30 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id RAA21041 for icon-group-addresses; Tue, 26 Jan 1999 17:01:23 -0700 (MST) Message-Id: <199901270001.RAA21041@baskerville.CS.Arizona.EDU> To: icon-group@optima.CS.Arizona.EDU Date: Tue, 26 Jan 1999 22:27:45 GMT From: "Marek Budyn" Subject: the beginning Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Hi! I am new in programming in ICON. So, I am looking for manuals, examples, specyfications, libraries for programming in Windows enviroment (I have downloaded almost everything from www.cs.arizona.edu). If somebody knows any web page that shares eg. books (id pdf or ps format) how to programm in Icon. Could somebody help me, please ? Marek Budyn rayn@infostrade.com.pl From icon-group-sender Wed Jan 27 09:09:00 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id JAA18913 for icon-group-addresses; Wed, 27 Jan 1999 09:07:04 -0700 (MST) Message-Id: <199901271607.JAA18913@baskerville.CS.Arizona.EDU> Date: Wed, 27 Jan 1999 00:14:27 -0800 From: Jim Mehl X-Accept-Language: en To: icon-group@optima.CS.Arizona.EDU Subject: Re: qei questions Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Mark is certainly right about that. And Icon does have preprocessing with conditional compilation. In fact there is a preprocessor symbol defined called _MS_WINDOWS that would allow something like $ifdef _MS_WINDOWS system("nticont ...) $else system("icont ...) $endif It just hasn't been used in the Icon library. Jim Mehl MJE wrote: > > What the program needs is conditional compilation around the name of the > Icon compiler...such is typical of cross-platform code...don't know > whether Icon supports it. > > Mark > From icon-group-sender Fri Jan 29 09:00:21 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id IAA02505 for icon-group-addresses; Fri, 29 Jan 1999 08:58:19 -0700 (MST) Message-Id: <199901291558.IAA02505@baskerville.CS.Arizona.EDU> Date: Thu, 28 Jan 1999 17:14:37 -0600 From: "George K. Thiruvathukal" X-Accept-Language: en To: icon-group@optima.CS.Arizona.EDU Subject: file and directory manipulation Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Help! Is it possible, other than by using system(...), to perform various file and directory manipulation functions on the Unix platform? I'm desperately trying to use Icon as a perl replacement, but I cannot seem to create directories easily. It seems like functions such as chdir are available, though the rest appear to be absent. Thanks, George From icon-group-sender Fri Jan 29 17:20:31 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id RAA20402 for icon-group-addresses; Fri, 29 Jan 1999 17:20:12 -0700 (MST) Message-Id: <199901300020.RAA20402@baskerville.CS.Arizona.EDU> Date: Fri, 29 Jan 1999 14:53:17 -0600 From: Clinton Jeffery To: gkt@math.luc.edu CC: icon-group@optima.CS.Arizona.EDU Subject: Re: file and directory manipulation Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO > Is it possible, other than by using system(...), to perform various file > and directory manipulation functions on the Unix platform? I'm > desperately trying to use Icon as a perl replacement. Hi George, You want Unicon, http://www.drones.com/unicon, an Icon with POSIX extensions developed by Shamim Mohamed. Unicon forms the basis for some multiplatform file, directory, and internet facilities that we are working on, which will be described in a forthcoming book. > I cannot seem to create directories easily. I really think that system() ought to work great for this, but in any case, Unicon has these types of functions as built-ins for Icon. Clint Jeffery, jeffery@cs.utsa.edu Research http://www.cs.utsa.edu/research/plss.html From icon-group-sender Fri Jan 29 17:23:01 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id RAA20480 for icon-group-addresses; Fri, 29 Jan 1999 17:22:55 -0700 (MST) Message-Id: <199901300022.RAA20480@baskerville.CS.Arizona.EDU> Date: Fri, 29 Jan 1999 15:59:01 -0700 From: Gregg Townsend To: gkt@math.luc.edu, icon-group@optima.CS.Arizona.EDU Subject: Re: file and directory manipulation Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO From: "George K. Thiruvathukal" Is it possible, other than by using system(...), to perform various file and directory manipulation functions on the Unix platform?... The usual solution is indeed a call to system(). Chdir is implemented in Icon as a special case because it can't be done by calling system(). There is an extended version of Icon ("Unicon") with additional calls; see http://www.drones.com/unicon/ for details. --------------------------------------------------------------------------- Gregg Townsend Gould-Simpson Building gmt@cs.arizona.edu Staff Scientist 1040 E. 4th St. 32 13 45N 110 57 16W Dept. of Computer Science PO Box 210077 tel: +1 520 621 4325 The University of Arizona Tucson, AZ 85721-0077 fax: +1 520 621 4246 From icon-group-sender Fri Jan 29 17:23:34 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id RAA20515 for icon-group-addresses; Fri, 29 Jan 1999 17:23:28 -0700 (MST) Message-Id: <199901300023.RAA20515@baskerville.CS.Arizona.EDU> Date: Fri, 29 Jan 1999 18:10:00 -0600 From: "George K. Thiruvathukal" X-Accept-Language: en To: Gregg Townsend CC: gkt@math.luc.edu, icon-group@optima.CS.Arizona.EDU Subject: Re: file and directory manipulation Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO This is a multi-part message in MIME format. --------------63F982C9BEE3D06D4563F24A Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Hi Gregg, Thanks for your reply. I know how to use the system() call; however, I really do not want the overhead of the shell for every operation I need to do. I can live with the interpreted nature of Icon. I'm still awaiting news on Unicon. My thought was to use loadable functions (or external calls) to support many of the features I need, since I have done this before to include DBM support in Icon. Best, George Gregg Townsend wrote: > From: "George K. Thiruvathukal" > > Is it possible, other than by using system(...), to perform various file > and directory manipulation functions on the Unix platform?... > > The usual solution is indeed a call to system(). Chdir is implemented > in Icon as a special case because it can't be done by calling system(). > > There is an extended version of Icon ("Unicon") with additional calls; see > http://www.drones.com/unicon/ > for details. > > --------------------------------------------------------------------------- > Gregg Townsend Gould-Simpson Building gmt@cs.arizona.edu > Staff Scientist 1040 E. 4th St. 32 13 45N 110 57 16W > Dept. of Computer Science PO Box 210077 tel: +1 520 621 4325 > The University of Arizona Tucson, AZ 85721-0077 fax: +1 520 621 4246 --------------63F982C9BEE3D06D4563F24A Content-Type: text/x-vcard; charset=us-ascii; name="thiruvathukal.vcf" Content-Description: Card for George K. Thiruvathukal Content-Disposition: attachment; filename="thiruvathukal.vcf" Content-Transfer-Encoding: 7bit begin:vcard n:Thiruvathukal;George K. tel;fax:773.508.2123 tel;work:773.508.3447 x-mozilla-html:TRUE url:http://www.jhpc.org/george org:Loyola University;Mathematical and Computer Sciences adr:;;6525 Sheridan Road;Chicago;IL;60613;USA version:2.1 email;internet:thiruvathukal@acm.org note:Go Cubs! fn:George K. Thiruvathukal end:vcard --------------63F982C9BEE3D06D4563F24A-- From icon-group-sender Fri Jan 29 17:23:56 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id RAA20550 for icon-group-addresses; Fri, 29 Jan 1999 17:23:49 -0700 (MST) Message-Id: <199901300023.RAA20550@baskerville.CS.Arizona.EDU> Date: Fri, 29 Jan 1999 17:21:13 -0700 From: Gregg Townsend To: thiruvathukal@acm.org Subject: Re: file and directory manipulation Cc: gkt@math.luc.edu, icon-group@optima.CS.Arizona.EDU Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO From: "George K. Thiruvathukal" ...My thought was to use loadable functions (or external calls) to support many of the features I need, since I have done this before to include DBM support in Icon. There are a few such loadable functions, mostly written as examples, in the cfuncs directory of the Icon program library. From icon-group-sender Mon Feb 1 08:28:46 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id IAA28893 for icon-group-addresses; Mon, 1 Feb 1999 08:25:45 -0700 (MST) Message-Id: <199902011525.IAA28893@baskerville.CS.Arizona.EDU> To: icon-group@optima.CS.Arizona.EDU Date: 29 Jan 1999 19:22:38 -0500 From: Clinton Jeffery Subject: Re: file and directory manipulation Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO > Is it possible, other than by using system(...), to perform various file > and directory manipulation functions on the Unix platform? I'm > desperately trying to use Icon as a perl replacement. Hi George, You want Unicon, http://www.drones.com/unicon, an Icon with POSIX extensions developed by Shamim Mohamed. Unicon forms the basis for some multiplatform file, directory, and internet facilities that we are working on, which will be described in a forthcoming book. > I cannot seem to create directories easily. I really think that system() ought to work great for this, but in any case, Unicon has these types of functions as built-ins for Icon. Clint Jeffery, jeffery@cs.utsa.edu Research http://www.cs.utsa.edu/research/plss.html From icon-group-sender Mon Feb 1 08:30:11 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id IAA29133 for icon-group-addresses; Mon, 1 Feb 1999 08:30:02 -0700 (MST) Message-Id: <199902011530.IAA29133@baskerville.CS.Arizona.EDU> To: icon-group@optima.CS.Arizona.EDU Date: Sun, 31 Jan 1999 19:05:37 +0800 From: "©ú¥Õ" Subject: [Q]:Latest version of ICON & tutorial Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Greetings: I currently have version 9.3 of ICON. Checking the ftp site, it seems that that is the lastest version available. But, I'd like to confirm. Also, in the documentation there is a statement concerning a toturial "to be added".....is that tutorial now available anywhere? Thanks! -- "Mathematics is the foundation of all science and those who are profficent in it become the builders of society." The Honorable Ellijah Mohammed "A mathematician is a machine for turning coffee into theorems." Paul Erdos Mathematician From icon-group-sender Mon Feb 1 08:30:30 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id IAA29174 for icon-group-addresses; Mon, 1 Feb 1999 08:30:24 -0700 (MST) Message-Id: <199902011530.IAA29174@baskerville.CS.Arizona.EDU> To: icon-group@optima.CS.Arizona.EDU Date: Mon, 01 Feb 1999 13:21:42 -0800 From: ©ú¥Õ Subject: Re: [Q]:Latest version of ICON & tutorial Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO ©ú¥Õ wrote: > > Greetings: > > I currently have version 9.3 of ICON. Checking the ftp site, it seems > that that is the lastest version available. But, I'd like to confirm. > > Also, in the documentation there is a statement concerning a toturial > "to be added".....is that tutorial now available anywhere? > > Thanks! Addendum to my own post: I now realize I'm not sure which version I have. The documentation that came with it says Verion 9.3 on the Introduction page. But this may be common to all packages. There is mention on the ICON website of a version 9.3.1 but it seems that is only for unix platforms. Is this true? I notice at the ICON site (as U. Arizona), there are two MS-DOS versions in the ftp archive. But I still am not clear as to what represents the most current version for a Win NT machine. Also, I am not sure (searching the archive) which (if any) document is the "tutorial" menioned in the introduction as "to be written". Answers and assistance still appreciated. > > -- > "Mathematics is the foundation of all science and those who are > profficent in it become the builders of society." > > The Honorable Ellijah Mohammed > > "A mathematician is a machine for turning coffee into theorems." > > Paul Erdos > Mathematician From icon-group-sender Mon Feb 1 08:30:52 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id IAA29203 for icon-group-addresses; Mon, 1 Feb 1999 08:30:45 -0700 (MST) Message-Id: <199902011530.IAA29203@baskerville.CS.Arizona.EDU> X-Sender: acsander@csat.gatech.edu Date: Mon, 01 Feb 1999 08:23:09 -0800 To: Clinton Jeffery , gkt@math.luc.edu From: Alan Sandercock Subject: Re: file and directory manipulation Cc: icon-group@optima.CS.Arizona.EDU Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO I've been successfully using Icon on a Unix platform (DGUX) for small programming jobs related to Geographical Information Processessing (GIS) and some text processing. We are moving to a Windows NT platform. Will I be able to use Unicon in this environment? I'm especially concerned about gathering a good set of software tools to ensure that our move from Unix to NT is as painless as possible, and I hope that I can continue to use Icon. I guess I can always resort to Perl which seems to enjoy good support on NT and fot that matter straight Icon will work, but I'm not sure about those POSIX extensions. At 02:53 PM 1/29/99 -0600, Clinton Jeffery wrote: > >> Is it possible, other than by using system(...), to perform various file >> and directory manipulation functions on the Unix platform? I'm >> desperately trying to use Icon as a perl replacement. > >Hi George, > >You want Unicon, http://www.drones.com/unicon, an Icon with POSIX extensions >developed by Shamim Mohamed. Unicon forms the basis for some multiplatform >file, directory, and internet facilities that we are working on, which will >be described in a forthcoming book. > >> I cannot seem to create directories easily. > >I really think that system() ought to work great for this, but in any case, >Unicon has these types of functions as built-ins for Icon. > >Clint Jeffery, jeffery@cs.utsa.edu >Research http://www.cs.utsa.edu/research/plss.html -- Alan Sandercock - acsander@csat.gatech.edu Phone (404) 894-0129 From icon-group-sender Mon Feb 1 12:46:28 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id MAA09894 for icon-group-addresses; Mon, 1 Feb 1999 12:45:51 -0700 (MST) Message-Id: <199902011945.MAA09894@baskerville.CS.Arizona.EDU> To: icon-group@optima.CS.Arizona.EDU Date: 1 Feb 1999 15:30:59 GMT From: corre@alpha1.csd.uwm.edu (Alan D Corre) Subject: Dead link Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO The very first link in http://www.drones.com/unicon/ is dead. There is no email address for the author. Clarification, please. -- Alan D. Corre Emeritus Professor of Hebrew Studies University of Wisconsin-Milwaukee http://www.uwm.edu/~corre/ From icon-group-sender Mon Feb 1 13:05:22 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id NAA10611 for icon-group-addresses; Mon, 1 Feb 1999 13:05:04 -0700 (MST) Message-Id: <199902012005.NAA10611@baskerville.CS.Arizona.EDU> Date: Mon, 1 Feb 1999 08:48:25 -0800 (PST) From: Shamim Mohamed To: Alan Sandercock Cc: icon-group@optima.CS.Arizona.EDU Subject: Re: file and directory manipulation Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO > I've been successfully using Icon on a Unix platform (DGUX) for small > programming jobs related to Geographical Information Processessing (GIS) > and some text processing. We are moving to a Windows NT platform. Will I > be able to use Unicon in this environment? Yes, the goal for the project is to be able to use the Unicon extensions both on Unix and on Windows. One of Clint's students has already ported most of the features to Windows. Some of the features Unix programmers expect are absent in NT, so those are deprecated. One example is fork/dup/exec that is a common idiom for spawning programs on Unix; it has been subsumed by extending system(). Please read http://www.drones.com/unicon/ for more details. (fork, exec and dup are still available in Unix versions but are deprecated.) -s From icon-group-sender Wed Feb 3 17:23:01 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id RAA25123 for icon-group-addresses; Wed, 3 Feb 1999 17:21:05 -0700 (MST) Message-Id: <199902040021.RAA25123@baskerville.CS.Arizona.EDU> To: icon-group@optima.CS.Arizona.EDU Date: Wed, 3 Feb 1999 16:49:59 -0600 From: Subject: Re: the beginning Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO The Icon Programming Language Handbook is available on http://www.toolsofcomputing.com/freesoftware.htm Marek Budyn wrote in message ... If somebody knows any >web page that shares eg. books (id pdf or ps format) how to programm in >Icon. From icon-group-sender Tue Feb 9 08:53:24 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id IAA27464 for icon-group-addresses; Tue, 9 Feb 1999 08:50:52 -0700 (MST) Message-Id: <199902091550.IAA27464@baskerville.CS.Arizona.EDU> To: icon-group@optima.CS.Arizona.EDU Date: 08 Feb 1999 19:11:44 -0500 From: clayton@jazz.cc.gatech.edu (R. Clayton) Subject: Calling C functions under Solaris. Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO I'd like to call some C functions from with an Icon program under Solaris, and I'm having a little trouble. First, here's what I'm doing and what I'd like to have happen (I don't care that the error number is the wrong one): ja uname -a SunOS jazz 4.1.3 1 sun4m ja cat ps.c #include "rt.h" int printstring(argc, argv) int argc; struct descrip * argv; {char str[MaxCvtLen]; if (qtos(argv[1], str) == Error) return 101; printf("printstring parameter is \"%s\".\n", str); return 0; } ja cat ps.icn procedure main() local printstring printstring := loadfunc("./ps.so", "printstring") | stop("Couldn't load printstring().") printstring("Hello world!") end # main ja make cc -I/usr/local/icon-9.3/src/h -I/usr/openwin/include -c ps.c -o ps.o ld -o ps.so ps.o icont -u ps.icn Translating: ps.icn: main No errors Linking: ja ./ps printstring parameter is "Hello world!". ja So everything works under SunOS. Here's Solaris: ma uname -a SunOS mayzie 5.5.1 Generic_103640-24 sun4u sparc SUNW,Ultra-2 ma rm *o ma make cc -I/usr/local/icon-9.3/src/h -I/usr/openwin/include -c ps.c -o ps.o "/usr/local/icon-9.3/src/h/../h/config.h", line 424: warning: macro replacement within a string literal cc -G -K pic -o ps.so ps.o icont -u ps.icn Translating: ps.icn: main No errors Linking: ma ./ps loadfunc("./ps.so","printstring"): ld.so.1: /usr/local/public/bin/iconx: fatal: relocation error: file ./ps.so: symbol qtos: referenced symbol not found Run-time error 216 File ps.icn; Line 5 external function not found Traceback: main() loadfunc("./ps.so\x00","printstring\x00") from line 5 in ps.icn ma I'm thinking I'm missing an Icon library under Solaris, but I can't find one in the source tree or the executable directories. And while I have your attention: does anybody know if there are C-callable routines for creating and manipulating Icon lists? Eventually I'm going to want to write some C routines that return a list of strings. From icon-group-sender Wed Feb 10 08:30:59 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id IAA17702 for icon-group-addresses; Wed, 10 Feb 1999 08:30:16 -0700 (MST) Message-Id: <199902101530.IAA17702@baskerville.CS.Arizona.EDU> Date: Tue, 9 Feb 1999 21:47:01 -0700 From: Gregg Townsend To: clayton@jazz.cc.gatech.edu, icon-group@optima.CS.Arizona.EDU Subject: Re: Calling C functions under Solaris. Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO From: clayton@jazz.cc.gatech.edu (R. Clayton) I'd like to call some C functions from with an Icon program under Solaris, and I'm having a little trouble.... loadfunc("./ps.so","printstring"): ld.so.1: /usr/local/public/bin/iconx: fatal: relocation error: file ./ps.so: symbol qtos: referenced symbol not found I'm thinking I'm missing an Icon library under Solaris, but I can't find one in the source tree or the executable directories. No, there is no separate Icon library, so that's not it. I'm not sure what the problem is; it worked for me on a Solaris 2.6 system using the Sun C compiler. I did have to edit your code to fix a wrong parameter to qtos, though; if you didn't see that error, maybe you have a different configuration, or a version of Icon older than 9.3.1? --------------------------------------------------------------------------- Gregg Townsend Gould-Simpson Building gmt@cs.arizona.edu Staff Scientist 1040 E. 4th St. 32 13 45N 110 57 16W Dept. of Computer Science PO Box 210077 tel: +1 520 621 4325 The University of Arizona Tucson, AZ 85721-0077 fax: +1 520 621 4246 From icon-group-sender Wed Feb 10 08:31:51 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id IAA17765 for icon-group-addresses; Wed, 10 Feb 1999 08:31:43 -0700 (MST) Message-Id: <199902101531.IAA17765@baskerville.CS.Arizona.EDU> Date: Wed, 10 Feb 1999 00:19:44 -0800 (PST) From: Shamim Mohamed To: icon-group@optima.CS.Arizona.EDU Subject: BART schedule, Tufte and Icon Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO I wrote a little Icon program to draw Bart (San Francisco area metro railway) schedules as first drawn by E. J. Marey and popularised by E. R. Tufte. I think it's not bad for a couple of hours of work, and thought others might be interested. It's about 500 lines of poorly documented (but easy to understand, I think!) code, and I'd be glad to send it to anyone that wants to play with it and improve it. For a picture, http://www.drones.com/bart.html -s From icon-group-sender Thu Feb 11 09:03:37 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id JAA06690 for icon-group-addresses; Thu, 11 Feb 1999 09:00:30 -0700 (MST) Message-Id: <199902111600.JAA06690@baskerville.CS.Arizona.EDU> To: icon-group@optima.CS.Arizona.EDU Date: Thu, 11 Feb 1999 04:54:49 GMT From: eodell@pobox.com (Eric O'Dell) Subject: Re: BART schedule, Tufte and Icon Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO On 10 Feb 1999 10:33:02 -0500, Shamim Mohamed wrote: >I wrote a little Icon program to draw Bart (San Francisco area metro >railway) schedules as first drawn by E. J. Marey and popularised by >E. R. Tufte. I feel much less geeky now knowing that I'm not the only person in the world who thinks E. R. Tufte is really cool. ;-) -E. +-------------------------------------------------------------------+ | "I have come a very long way from myself only to realize that | | identity is a skill and self-betrayal is a habit. Once lost, the | | former is very hard to regain; once gained, the latter is very | | hard to lose." ---I. Corvus, _The Europe of Our Dreams_ | +-------------------------------------------------------------------+ From icon-group-sender Thu Feb 11 09:10:17 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id JAA07128 for icon-group-addresses; Thu, 11 Feb 1999 09:08:35 -0700 (MST) Message-Id: <199902111608.JAA07128@baskerville.CS.Arizona.EDU> To: icon-group@optima.CS.Arizona.EDU Date: 11 Feb 1999 06:02:35 GMT From: jeffery@cs.utsa.edu (Clinton Jeffery) Subject: Re: BART schedule, Tufte and Icon Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Eric O'Dell (eodell@pobox.com) wrote: : SM> I wrote a little Icon program to draw Bart (San Francisco area metro : SM> railway) schedules as first drawn by E. J. Marey and popularised by : SM> E. R. Tufte. : I feel much less geeky now knowing that I'm not the only person in the : world who thinks E. R. Tufte is really cool. ;-) Tufte is the antithesis of geeky. Geeks do not go for $995-a-day seminars of the kind Tufte has been doing. His first book is especially cool, so I still recommend him to anyone interested in information visualization. Has anyone checked out his third book, to see if it is better than his second? -- Clint Jeffery, jeffery@cs.utsa.edu Research http://www.cs.utsa.edu/research/plss.html Will Hack Icon For Food! From icon-group-sender Tue Feb 16 11:37:18 1999 Return-Path: Received: from ursus.CS.Arizona.EDU (ursus.CS.Arizona.EDU [192.12.69.63]) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) with SMTP id LAA20509 for ; Tue, 16 Feb 1999 11:37:18 -0700 (MST) Received: by ursus.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA15852; Tue, 16 Feb 1999 11:37:17 -0700 From: WHITSTON@ltu.edu Date: Mon, 15 Feb 1999 13:26:24 -0500 (EST) Subject: Weaving Patterns and Analyst Issue #52 - A Question To: ICON-GROUP@optima.CS.Arizona.EDU Message-Id: <01J7RVJX4NOW90NYIT@LTU.EDU> X-Vms-To: ICON-GROUP@OPTIMA.CS.ARIZONA.EDU X-Vms-Cc: WHITSTON Mime-Version: 1.0 Content-Type: TEXT/PLAIN; CHARSET=US-ASCII Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO To the group: In the latest Analyst, there is an article about "weaving language" with examples. The first example is: 1346[]9231 which expands to: 111111111334441 Shouldn't it read: 111111111334446 - The next example is: 1345[]12{10}3 which expands to: 1334444444444666 Shouldn't it read: 1334444444444555 --- Did the typo imp strike twice or I'm missing the obvious? Thank you for your assistance in this matter. Howard Whitston Lawrence Tech. Univ. whitston@ltu.edu From icon-group-sender Tue Feb 16 11:48:43 1999 Return-Path: Received: from ursus.CS.Arizona.EDU (ursus.CS.Arizona.EDU [192.12.69.63]) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) with SMTP id LAA20936 for ; Tue, 16 Feb 1999 11:48:43 -0700 (MST) Received: by ursus.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA15885; Tue, 16 Feb 1999 11:48:42 -0700 Date: Tue, 16 Feb 1999 11:48:01 -0700 From: Ralph Griswold Message-Id: <9902161848.AA15033@jupiter.CS.Arizona.EDU> To: icon-group Subject: Re: Weaving Patterns and Analyst Issue #52 - A Question Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO You're right in both cases. The typos are my fault; sorry for the confusion. Ralph From icon-group-sender Thu Feb 18 11:47:26 1999 Return-Path: Received: from ursus.CS.Arizona.EDU (ursus.CS.Arizona.EDU [192.12.69.63]) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) with SMTP id LAA17905 for ; Thu, 18 Feb 1999 11:47:26 -0700 (MST) Received: by ursus.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA19830; Thu, 18 Feb 1999 11:47:25 -0700 Content-Identifier: EditPAD Hop-Count: 1 Date: Thu, 18 Feb 1999 09:21 -0600 From: Chris D Tenaglia Subject: EditPAD To: icon-group@optima.CS.Arizona.EDU Message-Id: <154482@jsux04.corp.jci.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO I tried them both. The EditPad has some convenience features like sitting in the "tray" preloaded. But I switched to PFedit because it has "auto-indent" which is something I value highly in a programmers' editor. Chris. ---------------------- Forwarded by Chris D Tenaglia/CORP/Johnson_Controls on 02/18/99 09:16 AM --------------------------- "Charles Hethcoat" on 01/04/99 05:34:32 PM To: icon-group@optima.CS.Arizona.EDU cc: (bcc: Chris D Tenaglia/CORP/Johnson_Controls) bcc: Chris D Tenaglia/CORP/Johnson_Controls Subject: EditPAD MJE wrote: >Windows users might be interested in EditPAD, I never cared for Notepad, either. For several years I've been pretty happy using PFE (http://www.lancs.ac.uk/people/cpaap/pfe/) as a general purpose editor. A quick reading of the EditPAD description makes the two sound very similar. Has anyone got any comparative experience with both editors? I'd be interested in your comments. I've got so much stuff installed on my computer now that I'm reluctant to install both. I might, however, swap out PFE for EditPad if it seems clearly superior. Charles Hethcoat From icon-group-sender Sun Feb 21 18:06:14 1999 Return-Path: Received: from ursus.CS.Arizona.EDU (ursus.CS.Arizona.EDU [192.12.69.63]) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) with SMTP id SAA18108 for ; Sun, 21 Feb 1999 18:06:13 -0700 (MST) Received: by ursus.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA26019; Sun, 21 Feb 1999 18:06:13 -0700 From: "Frank Lhota" To: Subject: Icon and the Codewright Editor Date: Fri, 19 Feb 1999 12:17:14 -0500 Message-Id: <01be5c2b$b1b12bc0$51cba326@freetown> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0036_01BE5C01.C8DB23C0" X-Priority: 3 X-Msmail-Priority: Normal X-Mailer: Microsoft Outlook Express 4.71.1712.3 X-Mimeole: Produced By Microsoft MimeOLE V4.71.1712.3 Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO This is a multi-part message in MIME format. ------=_NextPart_000_0036_01BE5C01.C8DB23C0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable We've had some recent posts regarding code editors: the god-awful = Notepad versus Editpad versus PFE. I am currently using Codewright for = Windows NT / 95 for most of my program editing for C, Ada, and Icon. I = have written a Codewright extension DLL for Icon, including = chroma-coding and templates. I would be happy to share this DLL and = sources with any other Icon programmer using Codewright. ------=_NextPart_000_0036_01BE5C01.C8DB23C0 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
We've had some recent posts regarding code editors: = the=20 god-awful  Notepad versus Editpad versus PFE. I am currently using=20 Codewright for Windows NT / 95 for most of my program editing for C, = Ada, and=20 Icon. I have written a Codewright extension DLL for Icon, including=20 chroma-coding and templates. I would be happy to share this DLL and = sources with=20 any other Icon programmer using Codewright.
------=_NextPart_000_0036_01BE5C01.C8DB23C0-- From icon-group-sender Mon Feb 22 07:32:04 1999 Return-Path: Received: from ursus.CS.Arizona.EDU (ursus.CS.Arizona.EDU [192.12.69.63]) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) with SMTP id HAA07372 for ; Mon, 22 Feb 1999 07:32:04 -0700 (MST) Received: by ursus.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA27100; Mon, 22 Feb 1999 07:32:03 -0700 Message-Id: <4.1.19990221195319.00a27c90@pop5.ibm.net> X-Sender: laturk@pop5.ibm.net X-Mailer: QUALCOMM Windows Eudora Pro Version 4.1 Date: Sun, 21 Feb 1999 20:08:02 -0600 To: icon-group@optima.CS.Arizona.EDU From: "Dr. Louis A. Turk" Subject: find() Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Dear friends on the Icon group, My last post was many months ago, right before a major computer crash shut me down for awhile. As a result of that crash, I also lost a lot of email that I needed to answer. I owed some of you thank you notes, but I can't remember who, after so long a time. Please accept my apology and thanks now. I am now back with a new computer, having fun programming in Icon. I have a question: is there a simple way to find only whole words in a document? I need "on" to be found, but not the "on" in "Icon." I also need whatever method I use to recognize that puncuation marks are not part of words. Many thanks in advance, Louis Turk From icon-group-sender Mon Feb 22 07:32:21 1999 Return-Path: Received: from ursus.CS.Arizona.EDU (ursus.CS.Arizona.EDU [192.12.69.63]) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) with SMTP id HAA07375 for ; Mon, 22 Feb 1999 07:32:21 -0700 (MST) Received: by ursus.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA27104; Mon, 22 Feb 1999 07:32:21 -0700 Date: Mon, 22 Feb 1999 09:04:37 -0500 Message-Id: <199902221404.JAA16135@mir.gis.gatech.edu> From: Alan Sandercock To: icon-group@optima.CS.Arizona.EDU In-Reply-To: <01be5c2b$b1b12bc0$51cba326@freetown> (lhotaf@lexma.meitech.com) Subject: Re: Icon and the Codewright Editor References: <01be5c2b$b1b12bc0$51cba326@freetown> Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO My favorite editor for Icon is Gnu Emacs for Windows Version 20.3.1 since it's free and it comes with color syntax highlighting already defined for Icon. It is also extremely easy to write and debug Icon programs from within the editor with output going to an emacs window. In fact this is by far the fastest and most interactive Icon programming environment that I've encountered so far. It is trivial to define function keys to compile and execute the contents of the buffer - the nticont/execute cycle. > We've had some recent posts regarding code editors: the god-awful = > Notepad versus Editpad versus PFE. I am currently using Codewright for = > Windows NT / 95 for most of my program editing for C, Ada, and Icon. I = > have written a Codewright extension DLL for Icon, including = > chroma-coding and templates. I would be happy to share this DLL and = > sources with any other Icon programmer using Codewright. > -- Alan Sandercock (404) 894-0129 acsander@csat.gatech.edu From icon-group-sender Mon Feb 22 09:21:32 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id JAA11214 for icon-group-addresses; Mon, 22 Feb 1999 09:21:25 -0700 (MST) Message-Id: <199902221621.JAA11214@baskerville.CS.Arizona.EDU> Date: Mon, 22 Feb 1999 08:42:31 -0600 From: "Charles Hethcoat" To: laturk@ibm.net, icon-group@optima.CS.Arizona.EDU Subject: Re: find() Content-Disposition: inline X-MIME-Autoconverted: from quoted-printable to 8bit by baskerville.CS.Arizona.EDU id HAA07568 Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO See "concord.icn" in the Icon Programming Library. This is an excellent tool in its own right and serves as a perfect starting point for custom work. Charles Hethcoat >>> "Dr. Louis A. Turk" 99-02-21 8:08:02 PM >>> ...is there a simple way to find only whole words in a document? I need "on" to be found, but not the "on" in "Icon." I also need whatever method I use to recognize that puncuation marks are not part of words. From icon-group-sender Mon Feb 22 16:26:19 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id QAA26732 for icon-group-addresses; Mon, 22 Feb 1999 16:25:10 -0700 (MST) Message-Id: <199902222325.QAA26732@baskerville.CS.Arizona.EDU> Date: Mon, 22 Feb 1999 14:25:59 -0800 (PST) From: Shamim Mohamed To: icon-group@optima.CS.Arizona.EDU Subject: Icon on Linux/PPC? Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO A friend of mine wants to run Icon (with graphics) on the Power PC running Linux. I told him it should be straightforward to port, except for the rswitch stuff. Does anyone know if there are any Power PC ports of Icon? (For now I've told him to disable coexpressions.) Thanks, -s From icon-group-sender Tue Feb 23 08:44:08 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id IAA21982 for icon-group-addresses; Tue, 23 Feb 1999 08:42:29 -0700 (MST) Message-Id: <199902231542.IAA21982@baskerville.CS.Arizona.EDU> Date: Mon, 22 Feb 1999 17:08:36 -0700 From: Gregg Townsend To: icon-group@optima.CS.Arizona.EDU, spm1@drones.com Subject: Re: Icon on Linux/PPC? Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO From: Shamim Mohamed ...Does anyone know if there are any Power PC ports of Icon? Try starting from the rswitch.s file in the rs6000_aix configuration. --------------------------------------------------------------------------- Gregg Townsend Gould-Simpson Building gmt@cs.arizona.edu Staff Scientist 1040 E. 4th St. 32 13 45N 110 57 16W Dept. of Computer Science PO Box 210077 tel: +1 520 621 4325 The University of Arizona Tucson, AZ 85721-0077 fax: +1 520 621 4246 From icon-group-sender Tue Feb 23 14:51:48 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id OAA04732 for icon-group-addresses; Tue, 23 Feb 1999 14:50:53 -0700 (MST) Message-Id: <199902232150.OAA04732@baskerville.CS.Arizona.EDU> From: "Frank Lhota" To: Subject: Bridging Icon and C Calls Date: Tue, 23 Feb 1999 12:03:24 -0500 X-Priority: 3 X-MSMail-Priority: Normal X-MimeOLE: Produced By Microsoft MimeOLE V4.71.1712.3 Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Recently, there have been some discussion of the Icon facility for calling external C functions. This facility varies widely from platform to platform, but it basically consists of calling loadfunc to load a C function from a dynamic library, then calling the function via the Icon callout function (or directly in the case of Unix). The problem with this facility is that it can only be used for C functions specifically written for Icon. The C function must accept Icon descriptors as parameters. You generally cannot call a typical external C function from Icon without first writing a "skin" function that does Icon-to-C argument translation. This would be particularly useful under Win 95 / 98 / NT, where the system services all take the form of functions in dynamic link libraries. The Windows API has hundreds of functions, many of which would be handy to use under Icon. These functions cannot be used, however, without some additional C work to turn Icon arguments into C arguments. What would be nicer if we could create a facility by which callout would automatically convert Icon parameters to C, e.g. if there is an external function foo declared as int foo ( int n, double x ); then to call this function from Icon, we first load it with loadfunc, then do this call: callout ( "foo", 3, 4.5 ) There are numerous complications with doing this. C includes integers and floating point numbers of various sizes, whereas Icon programmers are shielded from such concerns. C also uses pointers for many parameters, so we need to come up with Icon support for this. Pointer parameters can be implemented using an Icon record, e.g. record Pointer ( value ) # ... # function bar declared as # void bar ( int *ip ); callout ( "bar", ip := Pointer ( 0 ) ) # ip.value updated by callout I have some ideas about how this facility could be designed, and implemented. Before proceeding this much further, however, I would like some feedback. Would other Icon programmers find this useful? If I complete something like this for NT, could others help me port this to other platforms? From icon-group-sender Wed Feb 24 08:40:49 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id IAA18284 for icon-group-addresses; Wed, 24 Feb 1999 08:39:57 -0700 (MST) Message-Id: <199902241539.IAA18284@baskerville.CS.Arizona.EDU> X-Authentication-Warning: pandora.cs.utsa.edu: rpereda owned process doing -bs Date: Tue, 23 Feb 1999 22:02:14 -0600 (CST) From: Ray Pereda X-Sender: rpereda@pandora To: Frank Lhota cc: icon-group@optima.CS.Arizona.EDU Subject: Re: Bridging Icon and C Calls Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO On Tue, 23 Feb 1999, Frank Lhota wrote: > I have some ideas about how this facility could be designed, and > implemented. Before proceeding this much further, however, I would like some > feedback. Would other Icon programmers find this useful? If I complete > something like this for NT, could others help me port this to other > platforms? I and many others would find this very useful. Particularly if Icon to C compiler technology continues to improve. Look at www.swig.org Here is a bit on their title page: Welcome to SWIG SWIG is a software development tool that connects programs written in C, C++, and Objective-C with a variety of high-level programming languages. SWIG is primarily used with common scripting languages such as Perl, Python, and Tcl/Tk, but has also been extended to include languages such as Java, Eiffel, and Guile. SWIG is most commonly used to create high-level interpreted programming environments, systems integration, and as a tool for building user interfaces. SWIG is distributed as OpenSource and may be freely used, distributed, and modified for commercial or noncommercial use. -------------------------- I looked at it a while back. It looks like a well-thought out design for interfacing to C. I don't remember much right now. Let me know what you think. -ray From icon-group-sender Wed Feb 24 13:51:43 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id NAA29285 for icon-group-addresses; Wed, 24 Feb 1999 13:50:51 -0700 (MST) Message-Id: <199902242050.NAA29285@baskerville.CS.Arizona.EDU> Date: Wed, 24 Feb 1999 10:24:56 -0600 From: MJE To: icon-group@optima.CS.Arizona.EDU Subject: Re: Icon and the Codewright Editor Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Why not post your CodeWrite DLL to the Icon FTP site? Then it will be available anytime anywhere to anybody. Mark P.S. Can you fix your email program to send ASCII instead of HTML. Frank Lhota wrote: > > This is a multi-part message in MIME format. > > ------=_NextPart_000_0036_01BE5C01.C8DB23C0 > Content-Type: text/plain; > charset="iso-8859-1" > Content-Transfer-Encoding: quoted-printable > > We've had some recent posts regarding code editors: the god-awful = > Notepad versus Editpad versus PFE. I am currently using Codewright for = > Windows NT / 95 for most of my program editing for C, Ada, and Icon. I = > have written a Codewright extension DLL for Icon, including = > chroma-coding and templates. I would be happy to share this DLL and = > sources with any other Icon programmer using Codewright. > > ------=_NextPart_000_0036_01BE5C01.C8DB23C0 > Content-Type: text/html; > charset="iso-8859-1" > Content-Transfer-Encoding: quoted-printable > From icon-group-sender Thu Feb 25 12:32:44 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id MAA12131 for icon-group-addresses; Thu, 25 Feb 1999 12:30:44 -0700 (MST) Message-Id: <199902251930.MAA12131@baskerville.CS.Arizona.EDU> From: "Frank Lhota" To: Subject: Designing the Bridge between Icon and C Date: Thu, 25 Feb 1999 13:04:29 -0500 X-Priority: 3 X-MSMail-Priority: Normal X-MimeOLE: Produced By Microsoft MimeOLE V4.71.1712.3 Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO As I mentioned in a previous posting, I would like to develop an Icon facility for calling a native C function in a dynamic library, that is, a C function that is not an Icon "wrapper" function. I believe this can be done in reasonably flexible and portable way. In my proposed design, a C function is loaded into Icon using the predefined function loadfunc, which takes the form loadfunc ( modname, funcname, conv ) where - modname is the name of the dynamic library file, - funcname is the name of the function as it appears in the library; and - conv is a string indicating the calling convention ("C" or "Pascal"); the conv parameter defaults to "C". The loaded external C function is called using the callout function, invoked as follows: callout ( funcname, retval, argv[] ) where - funcname is the name of the external function; - retval is a prototype for the return value (defaults to &null, indicating that the C function return type is void); and - argv[] is the list of function arguments, which are to be converted to C format before the procedure is called. To free the resources associated with loaded C function, call the Icon function unloadfunc, called with the name of the loaded function: unloadfunc(funcname) The real sticking point is how to design the Icon specification of C data. Icon is relatively free of the data representation concerns that pervade C. Part of what we need to do when we to convert Icon data to C is to add a specification on how this data is to be represented. All C types fall into two categories: basic types and derived types. The basic data types of C can be divided into three categories: 1. The void type; 2. The integer types, including char, short, int, and long (as well as long long on some systems), along with their unsigned versions; and 3. The floating point types float, double, and on some systems, long double. Since enumerations always have integral values, we can include enumeration types with the integer types. Representing the C void is easy. The Icon null type is the perfect counterpart to the C void type. Integers and floats are more problematic. Icon is not concerned with number sizes, and Icon integers always have a sign. An Icon real can be directly be translated into a C double. An Icon integer can also be used to represent a signed C int. To translate Icon to other C numeric types, we need some way to specify the number format. To do this, I propose a standard Icon include file that defines the following Icon record types: record int ( value, size, unsigned ) record float ( value, size ) When records of these types are used as callout parameters, they have the following meanings: - A record of the form int ( value, size, unsigned ) represents a C integer with a value given by the value component and with a length of size bytes. This C integer is unsigned if the unsigned component of the record is non-null. - A record of the form float ( value, size ) represents a C real number with a value given by the value component of length of size bytes. These numeric formatting records should suffice for specifying any of the basic C numeric types. Generating the C derived types from Icon is a bit more challenging. Starting with the basic C types, all C types can be derived using the following constructs: 1. An array of objects of a given type; 2. A structure containing a sequence of objects of various types; 3. A union that is capable of containing any one of several objects of various types; 4. A pointer to an object of a given type; or 5. A pointer to a function. The Icon representation of a C array or structure is relatively straightforward. From a certain point of view, an array is quite similar to a structure. Both an array and a structure are a sequence of values; the difference is that in an array, the values are all of the same type. A C array or structure can be modeled in Icon using an Icon list. When callout translates an Icon list to C, it will create a C region consisting of a sequence of the C translations of the elements in the Icon list. The int and float record types can be used to specify structure member sizes. One of the most popular C arrays are, of course, arrays of characters. We should be able to use Icon strings to represent C strings. Representing a C union in Icon is trickier, since there is no obvious Icon equivalent. Some important API functions use unions, so we should come up with some way of representing them in Icon. For now, I'm stumpted on this one. I would greatly appreciate anyone's input on this matter. Pointers are very important. This is how C implements "call by reference". For many C functions, the most important outputs are returned by pointers. Icon technically uses only "call by value", but the effect of "call by reference" can be obtained by using Icon structures. We can therefore get the desired effect using the following record types: record Pointer ( value ) record CPointer ( value ) In the context of callout, a Pointer record represents a pointer to the C representation of the value component. When callout encounters a record of this type, it will allocate a C region to store the C translation of the Icon value. The pointer to this C region can then be used in the call to the C function. After the C function is called, the region value can then be copied back to the Pointer record, and the pointer is deallocated. For example, # function bar declared as # void bar ( int *ip ); callout ( "bar", &null, ip := Pointer ( 0 ) ) # ip.value updated by callout The CPointer record is similar to pointer, except that it is used to indicate a pointer to a region that will not be modified by the C function. The callout function processes a CPointer record in the same way, except that the region value is not copied back to pointer value. For now, I'm punting on coming up with an Icon representation of C function pointers. Ideally, it would be nice to be able to automatically generate C wrapper functions that call an Icon procedure, but that is a project for another day. I've started work on this interface design, but before I take it further, I would greatly some feedback from the Icon programmer community. In particular, - Does this design meet your interface needs? - Is there a simpler and/or more intuitive design for this interface? - How would you implement C unions in Icon? From icon-group-sender Mon Mar 1 09:00:53 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id IAA28134 for icon-group-addresses; Mon, 1 Mar 1999 08:57:45 -0700 (MST) Message-Id: <199903011557.IAA28134@baskerville.CS.Arizona.EDU> To: icon-group@optima.CS.Arizona.EDU Date: Sat, 27 Feb 1999 04:23:00 GMT From: eodell@pobox.com (Eric O'Dell) Subject: Re: Bridging Icon and C Calls Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO On 23 Feb 1999 16:55:50 -0500, "Frank Lhota" wrote: >I have some ideas about how this facility could be designed, and >implemented. Before proceeding this much further, however, I would like some >feedback. Would other Icon programmers find this useful? I think this would be enormously useful even if it wasn't portable from platform to platform. Being able to code speed-critical sections in C, or just to use pre-existing C functions would be a godsend. If it _was_ portable from one platform to another, it would be even more useful. I'm all for it. -E. +-------------------------------------------------------------------+ | "I have come a very long way from myself only to realize that | | identity is a skill and self-betrayal is a habit. Once lost, the | | former is very hard to regain; once gained, the latter is very | | hard to lose." ---I. Corvus, _The Europe of Our Dreams_ | +-------------------------------------------------------------------+ From icon-group-sender Wed Mar 10 17:37:48 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id RAA00150 for icon-group-addresses; Wed, 10 Mar 1999 17:35:13 -0700 (MST) Message-Id: <199903110035.RAA00150@baskerville.CS.Arizona.EDU> To: icon-group@optima.CS.Arizona.EDU Date: Wed, 10 Mar 1999 16:57:04 -0500 From: Charles Evans Subject: Mac version of 9.3? Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Any guesstimates on when the Mac version of 9.3 will be released? Also, is anyone working on a BeOS port? Sincerely, Charles Evans President, Chyden.Net Home of the World's First BeOS ISP http://www.chyden.net From icon-group-sender Thu Mar 11 09:05:29 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id JAA25487 for icon-group-addresses; Thu, 11 Mar 1999 09:04:36 -0700 (MST) Message-Id: <199903111604.JAA25487@baskerville.CS.Arizona.EDU> To: icon-group@optima.CS.Arizona.EDU Date: Thu, 11 Mar 1999 04:25:33 GMT From: hueras@world.std.com (Jon Hueras) Subject: Re: Mac version of 9.3? Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO In article <199903110035.RAA00150@baskerville.CS.Arizona.EDU>, Charles Evans wrote: > Any guesstimates on when the Mac version of 9.3 will be released? Although I have made a couple of attempts to kick-start a port of 9.3 to the Mac, various personal factors (not the least of which is my real job :-) have conspired to rob me of the time necessary to move it forward. At this point I cannot predict when this logjam will clear for a sufficient interval to permit me to wrap up the project. I apologize profusely to those who have been anxiously awaiting this version. Jon From icon-group-sender Mon Mar 15 16:41:55 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id QAA08488 for icon-group-addresses; Mon, 15 Mar 1999 16:37:00 -0700 (MST) Message-Id: <199903152337.QAA08488@baskerville.CS.Arizona.EDU> Date: Mon, 15 Mar 1999 13:03:15 -0700 From: "Sandra L. Miller" X-Accept-Language: en To: Mikko Saarela CC: ralph@optima.CS.Arizona.EDU, icon-group@optima.CS.Arizona.EDU Subject: Re: Icon for my company? Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO I have forwarded your email to the Icon mailing list. If you would like to subscribe to the list, send mail to icon-group-request@cs.arizona.edu requesting to be added to the list. The members of the list can be very helpful with questions such as yours. Mikko Saarela wrote: > > Hello! > > I wonder if I sent this e-mail to right address, but I would I have a > question about Icon. > I develop professionally shopping and ordering applications for web, and > it's critical that these applications function accurately. (As always whe > it'ss a question about money :) ) > > So the question is... is Icon suitable for my purposes? In other words, > does Icon as a language offer such features that allow the development of > highly reliable software? And what are these characteristics? > > Icon seems to me very promising and intelligent language. > > I liked the Icon - website too, it's clear and loads fast beside the > excellent content. > > I would appreciate a reply. > > Yours, > > Mikko Saarela, Druga Company, Finland > (e-mail: mikko.saarela@druga.com, www: www.druga.com) -- Sandra L. Miller Department of Computer Science University of Arizona From icon-group-sender Mon Mar 15 16:47:53 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id QAA08793 for icon-group-addresses; Mon, 15 Mar 1999 16:46:34 -0700 (MST) Message-Id: <199903152346.QAA08793@baskerville.CS.Arizona.EDU> Date: Mon, 15 Mar 1999 21:53:27 +0000 From: Ian Gilbert To: icon-group@optima.CS.Arizona.EDU Subject: compiling icon Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Hello, I have recently downloaded and installed icon version 9 and was wondering if you could answer a question about it. How do I compile and run an icon program to work outside of the wicon enviroment ??? and not in the console window that appears when you run an .exe ?? Hope you can see what I,m getting at , and can help. All the best , Ian Gilbert. From icon-group-sender Tue Mar 16 16:55:19 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id QAA23680 for icon-group-addresses; Tue, 16 Mar 1999 16:53:12 -0700 (MST) Message-Id: <199903162353.QAA23680@baskerville.CS.Arizona.EDU> To: icon-group@optima.CS.Arizona.EDU Date: Tue, 16 Mar 1999 17:58:16 -0400 From: "Gerardo H Calderon" Subject: Questions about Icon Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Hello. I'm a computer engineering student at the University of Puerto Rico, Mayaguez campus. I'm currently in my Programming Languages course and I have to do a project regarding the Icon Programming language. The professor assigned some questions to be answered, regarding it's creation, implementation, and parts. I would really appreciate if anyone could help me in acquiring this information. I'll try to post some of the questions later on. Attentively, Gerardo H Calderon Email: snooper@coqui.net From icon-group-sender Wed Mar 17 08:25:43 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id IAA17327 for icon-group-addresses; Wed, 17 Mar 1999 08:23:49 -0700 (MST) Message-Id: <199903171523.IAA17327@baskerville.CS.Arizona.EDU> Date: Tue, 16 Mar 1999 17:06:58 -0700 (MST) From: Gregg Townsend To: icon-group@optima.CS.Arizona.EDU, snooper@coqui.net Subject: Re: Questions about Icon Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Icon's history is covered in ACM SIGPLAN Notices for March 1993 (Vol 28, No 3): Preprints from the second HOPL (History of Programming Languages) conference. Other information about Icon can be found at the Icon web site, http://www.cs.arizona.edu/icon/ --------------------------------------------------------------------------- Gregg Townsend Gould-Simpson Building gmt@cs.arizona.edu Staff Scientist 1040 E. 4th St. 32 13 45N 110 57 16W Dept. of Computer Science PO Box 210077 tel: +1 520 621 4325 The University of Arizona Tucson, AZ 85721-0077 fax: +1 520 621 4246 From icon-group-sender Wed Mar 17 13:05:20 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id NAA02061 for icon-group-addresses; Wed, 17 Mar 1999 13:04:12 -0700 (MST) Message-Id: <199903172004.NAA02061@baskerville.CS.Arizona.EDU> To: icon-group@optima.CS.Arizona.EDU Date: Wed, 17 Mar 1999 08:08:30 -0800 From: "Alan B. Saichek" Subject: Re: Icon Programming Language FAQ: Y2K ? Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO icon-project@cs.arizona.edu wrote: > Archive-name: comp-lang-icon-faq > Posting-Frequency: monthly > > Frequently Asked Questions About The Icon Programming Language > > Last updated October 12, 1998. > Sorry if I've missed any discussion on Y2K and Icon previously. Is there a general observation about this topic? Might go on the FAQ? -- Alan B. Saichek abs@engr.sgi.com Member Technical Staff - QA Team Lead (650) 933-2507 Advanced Entertainment Systems, Video Compute R&D From icon-group-sender Thu Mar 18 08:39:53 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id IAA00942 for icon-group-addresses; Thu, 18 Mar 1999 08:34:59 -0700 (MST) Message-Id: <199903181534.IAA00942@baskerville.CS.Arizona.EDU> X-Authentication-Warning: pandora.cs.utsa.edu: rpereda owned process doing -bs Date: Wed, 17 Mar 1999 19:25:50 -0600 (CST) From: Ray Pereda X-Sender: rpereda@pandora To: "Alan B. Saichek" cc: icon-group@optima.CS.Arizona.EDU Subject: Re: Icon Programming Language FAQ: Y2K ? Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO On Wed, 17 Mar 1999, Alan B. Saichek wrote: > Sorry if I've missed any discussion on Y2K and Icon previously. > > Is there a general observation about this topic? Might go on the FAQ? I wrote a program to automatically fix this bug and have already been testing it. Below is the code: # Filename: y2k.icn procedure main() while write(map(read(), 'y', 'k')) end Here is the output when I run it on a calendar program: $ cal 1999 | y2k 1999 Januark Februark March Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa 1 2 1 2 3 4 5 6 1 2 3 4 5 6 3 4 5 6 7 8 9 7 8 9 10 11 12 13 7 8 9 10 11 12 13 10 11 12 13 14 15 16 14 15 16 17 18 19 20 14 15 16 17 18 19 20 17 18 19 20 21 22 23 21 22 23 24 25 26 27 21 22 23 24 25 26 27 24 25 26 27 28 29 30 28 28 29 30 31 31 April Mak June Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa 1 2 3 1 1 2 3 4 5 4 5 6 7 8 9 10 2 3 4 5 6 7 8 6 7 8 9 10 11 12 11 12 13 14 15 16 17 9 10 11 12 13 14 15 13 14 15 16 17 18 19 18 19 20 21 22 23 24 16 17 18 19 20 21 22 20 21 22 23 24 25 26 25 26 27 28 29 30 23 24 25 26 27 28 29 27 28 29 30 30 31 Julk August September Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa 1 2 3 1 2 3 4 5 6 7 1 2 3 4 4 5 6 7 8 9 10 8 9 10 11 12 13 14 5 6 7 8 9 10 11 11 12 13 14 15 16 17 15 16 17 18 19 20 21 12 13 14 15 16 17 18 18 19 20 21 22 23 24 22 23 24 25 26 27 28 19 20 21 22 23 24 25 25 26 27 28 29 30 31 29 30 31 26 27 28 29 30 October November December Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa 1 2 1 2 3 4 5 6 1 2 3 4 3 4 5 6 7 8 9 7 8 9 10 11 12 13 5 6 7 8 9 10 11 10 11 12 13 14 15 16 14 15 16 17 18 19 20 12 13 14 15 16 17 18 17 18 19 20 21 22 23 21 22 23 24 25 26 27 19 20 21 22 23 24 25 24 25 26 27 28 29 30 28 29 30 26 27 28 29 30 31 31 -ray From icon-group-sender Fri Mar 19 09:48:37 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id JAA06899 for icon-group-addresses; Fri, 19 Mar 1999 09:46:15 -0700 (MST) Message-Id: <199903191646.JAA06899@baskerville.CS.Arizona.EDU> Content-Identifier: Building Icon Hop-Count: 1 Date: Thu, 18 Mar 1999 16:48 -0600 From: Chris D Tenaglia Subject: Building Icon To: icon-group@optima.CS.Arizona.EDU Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Simple question : HP ux on risc I built icon, but it seems to be missing X-windows stuff. How do I configure it to build with the X-windows? I remember years ago there was a #define XWINDOWS in some file??? Perhaps point me at a good webpage about building icon with various features. Thanks in advance. Chris. From icon-group-sender Mon Mar 22 16:57:58 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id QAA07364 for icon-group-addresses; Mon, 22 Mar 1999 16:54:36 -0700 (MST) Message-Id: <199903222354.QAA07364@baskerville.CS.Arizona.EDU> Date: Fri, 19 Mar 1999 17:44:45 -0700 (MST) From: Gregg Townsend To: Chris.D.Tenaglia@jci.com, icon-group@optima.CS.Arizona.EDU Subject: Re: Building Icon Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO From: Chris D Tenaglia Simple question : HP ux on risc I built icon, but it seems to be missing X-windows stuff. How do I configure it to build with the X-windows? To configure for graphics, type make X-Configure name=hp_risc instead of make Configure name=hp_risc The installation guide is http://www.cs.arizona.edu/icon/docs/ipd243.htm --------------------------------------------------------------------------- Gregg Townsend Gould-Simpson Building gmt@cs.arizona.edu Staff Scientist 1040 E. 4th St. 32 13 45N 110 57 16W Dept. of Computer Science PO Box 210077 tel: +1 520 621 4325 The University of Arizona Tucson, AZ 85721-0077 fax: +1 520 621 4246 From icon-group-sender Tue Mar 23 09:20:19 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id JAA27920 for icon-group-addresses; Tue, 23 Mar 1999 09:19:10 -0700 (MST) Message-Id: <199903231619.JAA27920@baskerville.CS.Arizona.EDU> X-Authentication-Warning: helios.dmu.ac.uk: hgs owned process doing -bs Date: Tue, 23 Mar 1999 09:58:35 +0000 (GMT) From: Hugh Sasse To: Icon Group Subject: opendir/readdir in Icon? Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO I think every machine I have used since about 1978 which had a disk supported heirarchical directory structures. However, I cannot find anything in the Icon book or the online docs about how to test a "file" to see if it is a file or a directory, or how to list a directory without making a call to some program outside Icon. Is there really no equivalent to opendir and readdir in Icon? Or where should I be looking? Hugh hgs@dmu.ac.uk From icon-group-sender Tue Mar 23 09:20:56 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id JAA28013 for icon-group-addresses; Tue, 23 Mar 1999 09:20:49 -0700 (MST) Message-Id: <199903231620.JAA28013@baskerville.CS.Arizona.EDU> To: icon-group@optima.CS.Arizona.EDU Date: Tue, 23 Mar 1999 08:54:14 -0500 From: Robert Wyesham Subject: Help for the Newbie! Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO I'd like to define an "assert" macro for use in my Icon programs, using ipp, of course. I need criticism and advice regarding the definition that I'm proposing. I decided to steal from the best, so I looked up the definition that P.J. Plauger used in his book, "The Standard C Library." Here it is, with line-numbering added, in order to make it easy to refer to (any mistakes are my own): 1. #undef assert 2. #ifdef NDEBUG 3. #define assert(test) ((void)0) 4. #else 5. #define _STR(x) _VAL(x) 6. #define _VAL(x) #x 7. #define assert(test) (test) ? (void)0 : \ 8. _Assert( __FILE__ ":" _STR(__LINE__) #test ) 9. #endif The _STR and _VAL macros turn the __LINE__ macro from an integer into a string. Dr. Plauger defined assert as a ternary expression, rather than as an 'if' statement, so that crazy people could use the comma operator to do deranged things like: ( assert(0 < x), x < y ) Without an assert macro, I've been writing: $ifndef NDEBUG if test then (&null) else stop( "--- assertion failed: file ", &file, ", line ", &line ) $endif I'm proposing this: 10. $undef assert 11. $ifdef NDEBUG 12. $define assert(test) (&null) 13. $else 14. $define assert(test) if test then (&null) else \ 15. stop( "--- assertion failed: file ", &file, ", line ", &line ) 16. $endif Does anyone see anything basically wrong with this definition? Are there mistakes in it? Are there better ways to do this? A big problem with it is that the test never gets printed. I have no idea how to turn the test into a string that I can print. ipp and Icon must have a way to do this, but I haven't thought of it. Of course, in a macro, everything's a string. At this point, I get confused. Any ideas? Thanks and best regards, - rob Rob Wyesham, Wilmington, Delaware From icon-group-sender Tue Mar 23 09:21:28 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id JAA28101 for icon-group-addresses; Tue, 23 Mar 1999 09:21:19 -0700 (MST) Message-Id: <199903231621.JAA28101@baskerville.CS.Arizona.EDU> Date: Tue, 23 Mar 1999 10:07:54 -0600 From: "Charles Hethcoat" To: icon-group@optima.CS.Arizona.EDU Subject: Windows Unicon? Content-Disposition: inline X-MIME-Autoconverted: from quoted-printable to 8bit by baskerville.CS.Arizona.EDU id JAA27306 Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Some earlier posts to this group indicated (it seemed) that an evolution of Unicon to a common implementation for UNIX and Windows might be under way. Perhaps "convergence" would be the better word. I was wondering if or when such a thing might occur, and what the status might be, and is there anything I might do to help. (I run Windows when I can't run Linux, which is most of the time, and it would sure be a nice tool for me.) Thanks. Charles Hethcoat Oceaneering Space Systems From icon-group-sender Wed Mar 24 08:18:37 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id IAA02598 for icon-group-addresses; Wed, 24 Mar 1999 08:15:44 -0700 (MST) Message-Id: <199903241515.IAA02598@baskerville.CS.Arizona.EDU> Content-Identifier: Building on HP Hop-Count: 1 Date: Tue, 23 Mar 1999 11:20 -0600 From: Chris D Tenaglia Subject: Building on HP To: icon-group@optima.CS.Arizona.EDU Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Finally got it. The target systems have a good C compiler, and good XWindows support. They were just configured a little oddly and this complicated the build. My steps were (and work here, maybe nowhere else, but this is a methodolgy?): make Clean make X-Configure name=hp_risc make Icon *** oops, missing Xlib.h and other Xwindows files downloaded them *** oops, not on the path, can't find anything under X11/ hardcoded X11 occurences to fullpath (i.e. #include /user/is/cdt/i9/src/h/X11/Xlib.h) in all C and .h files. *** oops, linking problems HPUX uses the icon var LPATH, setenv LPATH /usr/lib *** oops, one more link problem setenv LPATH /usr/lib:/usr/lib/X11R5 Done. Note : When I built it without the X-Configure, there were no problems at all. Chris. From icon-group-sender Wed Mar 24 08:22:00 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id IAA02739 for icon-group-addresses; Wed, 24 Mar 1999 08:21:47 -0700 (MST) Message-Id: <199903241521.IAA02739@baskerville.CS.Arizona.EDU> Date: Tue, 23 Mar 1999 12:18:00 -0600 From: Clinton Jeffery To: chethcoa@oss.oceaneering.com CC: icon-group@optima.CS.Arizona.EDU Subject: Re: Windows Unicon? Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO [Charles Hethcoat wrote:] > Some earlier posts to this group indicated (it seemed) that an evolution > of Unicon to a common implementation for UNIX and Windows might be under > way. Perhaps "convergence" would be the better word. I was wondering if > or when such a thing might occur, and what the status might be, and is > there anything I might do to help. A student of mine, Li Lin, has been working on porting Unicon to Windows for the past 7-8 months. I believe much of the core file system access is working at this point. He is presently debugging the networking code. When his port works on reasonable tests, we will advertise for beta testers. Shamim Mohamed and I have revised and extended the Unicon facilities to be more platform-neutral. The new multiplatform system interface is covered in a forthcoming book, "Programming with Icon". The timetable for releasing everything was to be this spring, but the Windows Unicon port and some new Icon versions of the byacc and flex compiler-writer's tools are both behind schedule at this point. We won't do a beta release until the software is ready, hopefully later this spring. The new distributions also include an extensive set of database connectivity facilities, and a major rewrite of the object-oriented facilities. Clint Jeffery, jeffery@cs.utsa.edu Research http://www.cs.utsa.edu/research/plss.html Will Hack For Food! From icon-group-sender Wed Mar 24 08:23:24 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id IAA02782 for icon-group-addresses; Wed, 24 Mar 1999 08:23:13 -0700 (MST) Message-Id: <199903241523.IAA02782@baskerville.CS.Arizona.EDU> Date: Wed, 24 Mar 1999 11:29:38 +1200 (NZST) From: "Richard A. O'Keefe" To: hgs@dmu.ac.uk, icon-group@optima.CS.Arizona.EDU Subject: Re: opendir/readdir in Icon? Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Hugh Sasse wrote: I think every machine I have used since about 1978 which had a disk supported heirarchical directory structures. Then you haven't used VM/CMS or RT-11 or the old Mac filesystem. (The old Mac file system had nested *folders* but no actual directories, file names had to be unique on a disc.) However, I cannot find anything in the Icon book or the online docs about how to test a "file" to see if it is a file or a directory, or how to list a directory without making a call to some program outside Icon. Note that there are no such functions in standard C either. Is there really no equivalent to opendir and readdir in Icon? "Portable" Icon, right.l Or where should I be looking? Unicon. From icon-group-sender Wed Mar 24 08:23:48 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id IAA02816 for icon-group-addresses; Wed, 24 Mar 1999 08:23:42 -0700 (MST) Message-Id: <199903241523.IAA02816@baskerville.CS.Arizona.EDU> X-Authentication-Warning: helios.dmu.ac.uk: hgs owned process doing -bs Date: Wed, 24 Mar 1999 09:34:10 +0000 (GMT) From: Hugh Sasse To: "Richard A. O'Keefe" cc: icon-group@optima.CS.Arizona.EDU Subject: Re: opendir/readdir in Icon? Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO On Wed, 24 Mar 1999, Richard A. O'Keefe wrote: > Hugh Sasse wrote: > > I think every machine I have used since about 1978 which had a disk > > supported heirarchical directory structures. > > Then you haven't used VM/CMS or RT-11 or the old Mac filesystem. > (The old Mac file system had nested *folders* but no actual > directories, file names had to be unique on a disc.) No, I never used a Mac, and it explains why I found RT-11 baffling when I encountered it :-) And I vaguely remember RSX-11M being a bit odd in this department too, but am not sure. But we digress (a little)... > > > However, I cannot find > > anything in the Icon book or the online docs about how to test a > > "file" to > > see if it is a file or a directory, or how to list a directory without > > making a call to some program outside Icon. > > Note that there are no such functions in standard C either. > OK, though Unix provides stat, and Perl, Tcl, Python do also in a fairly cross platform way, and standard C doesn't provide anything like Icon's string handling so I would not have chosen that as a baseline :-) > > Is there really no equivalent to opendir and readdir in Icon? > "Portable" Icon, right. I want to keep things portable as far as possible. > > Or where should I be looking? > Unicon. Discussions I have had confirm that this is looking a good way to go. However, I am surprised at the number of answers on this list that say "Use Unicon" rather than "It is available in Unicon but in Icon 9.4 we plan to have ...". So I have to ask: what is the future of Icon, as opposed to its descendents Idol, Jcon, Unicon? The language has some really cunning features, (readable string scanning, result or failure, generators...) so it would be a shame if development just stopped. Or is it just that the Icon Project are trying to avoid "feeping creaturism", as Larry Wall called it? Thank you, Hugh hgs@dmu.ac.uk From icon-group-sender Thu Mar 25 08:37:54 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id IAA18367 for icon-group-addresses; Thu, 25 Mar 1999 08:35:23 -0700 (MST) Message-Id: <199903251535.IAA18367@baskerville.CS.Arizona.EDU> To: icon-group@optima.CS.Arizona.EDU Date: Wed, 24 Mar 1999 21:03:51 -0400 From: "Gerardo H Calderon" Subject: Icon Inquiries Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Hello again. Here are some of the questions I have to answer for my Programming Languages project about Icon. If any of you can help me out, I'll be very grateful. Name of the language. When was it created? Who created it? Where was it created? A university or private company? Paradigm to which it belongs. >From which language did it inherit characteristics? (Mention all languages of which it inherited any characteristics from.) Is it compatible with another language? Does a formal definition of the language exist? (i.e. IEEE, ANSI, ISO, etc.) What was the purpose for its creation? Did it accomplish those purposes? Is the language still in use? Is it used for the purpose it was created for? How many official revisions have there been? Any help is fully appreciated. Thank you all. Gerardo H. Calderon Email: snooper@coqui.net From icon-group-sender Thu Mar 25 12:25:56 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id MAA13234 for icon-group-addresses; Thu, 25 Mar 1999 12:24:58 -0700 (MST) Message-Id: <199903251924.MAA13234@baskerville.CS.Arizona.EDU> To: icon-group@optima.CS.Arizona.EDU Date: Thu, 25 Mar 1999 16:58:33 +0100 From: "Rommert J. Casimir" Subject: Re: Icon Inquiries Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Gerardo H Calderon wrote: > > Hello again. Here are some of the questions I have to answer for my > Programming Languages project about Icon. If any of you can help me out, > I'll be very grateful. Many answers to your questions can be found in The Icon programming language / Ralph E. Griswold and Madge T. Griswold Englewoods Cliffs, N.J. : Prentice Hall 2nd ed Prentice-Hall software series -- -------------------------------------------- Rommert J. Casimir Tilburg University, Room B435 P.O. Box 90153 5000LE Tilburg, The Netherlands tel 31 13 4662016, fax 31 13 4663377 http://cwis.kub.nl/~few/few/BIKA/rc_home.htm --------------------------------------------- From icon-group-sender Thu Mar 25 12:26:33 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id MAA13392 for icon-group-addresses; Thu, 25 Mar 1999 12:26:20 -0700 (MST) Message-Id: <199903251926.MAA13392@baskerville.CS.Arizona.EDU> From: Bob Ardler To: icon-group@optima.CS.Arizona.EDU Date: Thu, 25 Mar 1999 18:30:11 +0000 (GMT) Subject: Re: Icon Inquiries User-Agent: Pluto/1.11f (RISC-OS/3.6) Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Gerardo H Calderon: >questions I have to answer for my Programming Languages project >about Icon Quote from a Griswold posting re Icon:- >Frequently Asked Questions About The Icon Programming Language >Last updated October 12, 1998. >The FAQ answers questions about the Icon programming language, >ranging from what it is to how you can get it. The master copy of >this FAQ is the Web page http://www.cs.arizona.edu/icon/faq.htm. >Other on-line documentation is available via the main Icon page at >http://www.cs.arizona.edu/icon/ -- Bob Ardler, ardler@argonet.co.uk From icon-group-sender Fri Mar 26 07:27:36 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id HAA22468 for icon-group-addresses; Fri, 26 Mar 1999 07:26:44 -0700 (MST) Message-Id: <199903261426.HAA22468@baskerville.CS.Arizona.EDU> X-Authentication-Warning: helios.dmu.ac.uk: hgs owned process doing -bs Date: Fri, 26 Mar 1999 10:09:03 +0000 (GMT) From: Hugh Sasse To: Icon Group Subject: Installation step 8... Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO With reference to : http://www.cs.arizona.edu/icon/docs/ipd243.htm for the last step (8) in the Install, (which I have not needed till now because I have been using Icon where I built it), I would like to put the files in these positions: icont /usr/local/bin/icont iconx /usr/local/bin/iconx Icon.1 /usr/local/man/man1 ilib/ /usr/local/lib/icon/ [plus others??] but as far as I can see Setup will not do this -- thee is no flexibility in where things go, patchstr doesn't seem to tell Icont where the libraries (ilib) are -- at least I didn't see it in the above doc. Could someone tell me how to do this correctly? I cannot continue to use it from ~hgs/icon because I will be NFS mounting ~hgs for Sparc and for Alpha, and they both need different binaries. They will both have different /usr/local partitions. Maybe someone has written install_thyself.icn to accomplish this? :-) Thank you, Hugh hgs@dmu.ac.uk From icon-group-sender Fri Mar 26 12:38:25 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id MAA04189 for icon-group-addresses; Fri, 26 Mar 1999 12:35:38 -0700 (MST) Message-Id: <199903261935.MAA04189@baskerville.CS.Arizona.EDU> Date: Fri, 26 Mar 1999 08:39:53 -0700 (MST) From: Gregg Townsend To: hgs@dmu.ac.uk, icon-group@optima.CS.Arizona.EDU Subject: Re: Installation step 8... Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Date: Fri, 26 Mar 1999 10:09:03 +0000 (GMT) From: Hugh Sasse I would like to put the files in these positions: icont /usr/local/bin/icont iconx /usr/local/bin/iconx Icon.1 /usr/local/man/man1 ilib/ /usr/local/lib/icon/ [plus others??] You'd run patchstr like this: patchstr /usr/local/bin/icont /usr/local/bin/iconx Icont has no embedded knowledged about library locations; it gets this from environment variables. You would typically put something like setenv IPATH /usr/local/lib/icon setenv LPATH /usr/local/lib/icon in your shell startup file (.cshrc or .profile or whatever). --------------------------------------------------------------------------- Gregg Townsend Gould-Simpson Building gmt@cs.arizona.edu Staff Scientist 1040 E. 4th St. 32 13 45N 110 57 16W Dept. of Computer Science PO Box 210077 tel: +1 520 621 4325 The University of Arizona Tucson, AZ 85721-0077 fax: +1 520 621 4246 From icon-group-sender Fri Mar 26 12:39:44 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id MAA04286 for icon-group-addresses; Fri, 26 Mar 1999 12:39:33 -0700 (MST) Message-Id: <199903261939.MAA04286@baskerville.CS.Arizona.EDU> X-Authentication-Warning: helios.dmu.ac.uk: hgs owned process doing -bs Date: Fri, 26 Mar 1999 17:12:55 +0000 (GMT) From: Hugh Sasse To: Gregg Townsend cc: icon-group@optima.CS.Arizona.EDU Subject: Re: Installation step 8... Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO On Fri, 26 Mar 1999, Gregg Townsend wrote: > Date: Fri, 26 Mar 1999 10:09:03 +0000 (GMT) > From: Hugh Sasse > > I would like to put the files in these positions: > [...] > > You'd run patchstr like this: > patchstr /usr/local/bin/icont /usr/local/bin/iconx > > Icont has no embedded knowledged about library locations; it gets this > from environment variables. You would typically put something like > setenv IPATH /usr/local/lib/icon > setenv LPATH /usr/local/lib/icon > in your shell startup file (.cshrc or .profile or whatever). > > --------------------------------------------------------------------------- > Gregg Townsend Gould-Simpson Building gmt@cs.arizona.edu Thank you. Hugh hgs@dmu.ac.uk From icon-group-sender Tue Mar 30 15:30:02 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id PAA13864 for icon-group-addresses; Tue, 30 Mar 1999 15:25:42 -0700 (MST) Message-Id: <199903302225.PAA13864@baskerville.CS.Arizona.EDU> Date: Tue, 30 Mar 1999 11:02:54 -0600 From: Steve Graham X-Accept-Language: en To: icon-group@optima.CS.Arizona.EDU Subject: Problem reading binary file Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Hello. I am using MS-DOS Icon 9.1 to read a binary file. After reading 6 characters, the program apparently quits reading. I have attached the relevant portion of the code: -------------------------- Code ------------------------------ procedure main(args) # cnt := 0 in := open(args[1],"r") | stop("Unable to open ",args[1]) out := open(args[2],"w") | stop("Unable to open ",args[2]) while character := reads(in,1) do { write(character," -->", ord(character)) cnt := cnt+1 } close(in,out) write(cnt," characters transferred") end -----------------------End of Code------------------------- I invoke the program with: word r99-0059.doc r99-0059.txt I get output of (some unprintable characters are represent by _): - -->208 - -->207  -->17 _ -->224 í -->161 _ -->177 6 characters transferred Any ideas? Thanks in advance. -- Steve ______________________________________________________ Steve Graham Laboratory Corporation of America (LabCorp) 12160 Abrams Road, Suite 601 Dallas, Texas 75243 E-mail: graham@cowboy.biomed.com Phone: 972.643.6124 (direct to desk) 972.437.5255 ext 5224 FAX: 972.454.1040 _______________________________________________________ From icon-group-sender Tue Mar 30 15:32:46 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id PAA14056 for icon-group-addresses; Tue, 30 Mar 1999 15:32:39 -0700 (MST) Message-Id: <199903302232.PAA14056@baskerville.CS.Arizona.EDU> Date: Tue, 30 Mar 1999 16:04:23 -0600 From: Steve Graham X-Accept-Language: en To: Icon Mailing List Subject: [Fwd: Problem reading binary file] Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Hello again. Turns out that the problem with this was that the 7th character was an ASCII 26 (^Z) and Icon would not read any further than that. I created a 2nd file with a ^Z in a different position and got a similar result. This is despite the fact that there were over 25,000 characters following the Control Z. So, my question is: Why does Icon stop reading when it hits a ^Z? I can kind of understand this if I were reading a text file; but I was specifically using reads() because this is a binary file? Should not reads() support all 256 ASCII codes and only stop reading when there are REALLY no more characters to read? I ended up using another language, which was significantly harder for me, to read the binary characters. In Icon's defense, I notice that when I TYPE the above-mentioned 2nd file, I only see the characters occurring prior to the ^Z. And I do not want it to appear that I am questioning Icon's usefulness. It is normally one of the 1st languages I choose for utilities of this type. Comments? Steve Graham === Steve Graham wrote: > > Hello. > > I am using MS-DOS Icon 9.1 to read a binary file. After reading 6 > characters, the program apparently quits reading. I have attached the > relevant portion of the code: > > -------------------------- Code ------------------------------ > procedure main(args) > # > cnt := 0 > in := open(args[1],"r") | stop("Unable to open ",args[1]) > out := open(args[2],"w") | stop("Unable to open ",args[2]) > while character := reads(in,1) do { > write(character," -->", ord(character)) > cnt := cnt+1 > } > close(in,out) > write(cnt," characters transferred") > end > -----------------------End of Code------------------------- > > I invoke the program with: > > word r99-0059.doc r99-0059.txt > > I get output of (some unprintable characters are represent by _): > > - -->208 > - -->207 >  -->17 > _ -->224 > í -->161 > _ -->177 > 6 characters transferred > > Any ideas? > > Thanks in advance. > > -- Steve > > ______________________________________________________ > > Steve Graham > Laboratory Corporation of America (LabCorp) > 12160 Abrams Road, Suite 601 > Dallas, Texas 75243 > > E-mail: graham@cowboy.biomed.com > Phone: 972.643.6124 (direct to desk) > 972.437.5255 ext 5224 > FAX: 972.454.1040 > _______________________________________________________ From icon-group-sender Wed Mar 31 09:23:13 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id JAA09145 for icon-group-addresses; Wed, 31 Mar 1999 09:21:52 -0700 (MST) Message-Id: <199903311621.JAA09145@baskerville.CS.Arizona.EDU> Date: Tue, 30 Mar 1999 17:27:24 -0600 From: Steve Graham X-Accept-Language: en To: Ralph Griswold Subject: Re: [Fwd: Problem reading binary file] Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Ralph, This makes sense now. I modified my program based on this and earlier responses and I was able to read all the characters. Thanks a lot. Steve Graham P.S. My sister is involved in computers and research libraries and she was saying that computers are now being applied in new areas in education, such as the humanities. It seems to me that I read that Icon had been put to use in this area, but I don't remember any details. Can you elaborate on this or point me in the right direction? Thanks again. === Ralph Griswold wrote: > > Icon doesn't stop reading on a ^Z. The DOS/WIndows I/O system > does. -- ______________________________________________________ Steve Graham Laboratory Corporation of America (LabCorp) 12160 Abrams Road, Suite 601 Dallas, Texas 75243 E-mail: graham@cowboy.biomed.com Phone: 972.643.6124 (direct to desk) 972.437.5255 ext 5224 FAX: 972.454.1040 _______________________________________________________ From icon-group-sender Wed Mar 31 09:26:05 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id JAA09302 for icon-group-addresses; Wed, 31 Mar 1999 09:25:57 -0700 (MST) Message-Id: <199903311625.JAA09302@baskerville.CS.Arizona.EDU> Date: Tue, 30 Mar 1999 17:28:55 -0600 From: Steve Graham X-Accept-Language: en To: Alan Saichek , Icon Mailing List Subject: Re: [Fwd: Problem reading binary file] Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Alan, I tried it and that did the trick. Thanks a lot. Steve Graham === Alan Saichek wrote: > > > Hi Steve, > > I haven't tried this, but on the surface... > > Ctrl-Z is end-of-file in DOS. > > Check out Chap 11 Input and Output (2nd edition) > Text Files and Binary Files > > which mentions translated mode. Use "u" qualifier for > untranslated mode. > > > > in := open(args[1],"ru") | stop("Unable to open ",args[1]) > > > out := open(args[2],"wu") | stop("Unable to open ",args[2]) > > Regards, Alan > > > > > Hello again. > > > > Turns out that the problem with this was that the 7th character was an > > ASCII 26 (^Z) and Icon would not read any further than that. I created > > a 2nd file with a ^Z in a different position and got a similar result. > > This is despite the fact that there were over 25,000 characters > > following the Control Z. > > > > So, my question is: Why does Icon stop reading when it hits a ^Z? I > > can kind of understand this if I were reading a text file; but I was > > specifically using reads() because this is a binary file? Should not > > reads() support all 256 ASCII codes and only stop reading when there are > > REALLY no more characters to read? I ended up using another language, > > which was significantly harder for me, to read the binary characters. > > > > In Icon's defense, I notice that when I TYPE the above-mentioned 2nd > > file, I only see the characters occurring prior to the ^Z. And I do not > > want it to appear that I am questioning Icon's usefulness. It is > > normally one of the 1st languages I choose for utilities of this type. > > > > Comments? > > > > > > Steve Graham > > > > === > > > > Steve Graham wrote: > > > > > > Hello. > > > > > > I am using MS-DOS Icon 9.1 to read a binary file. After reading 6 > > > characters, the program apparently quits reading. I have attached the > > > relevant portion of the code: > > > > > > -------------------------- Code ------------------------------ > > > procedure main(args) > > > # > > > cnt := 0 > > > in := open(args[1],"r") | stop("Unable to open ",args[1]) > > > out := open(args[2],"w") | stop("Unable to open ",args[2]) > > > while character := reads(in,1) do { > > > write(character," -->", ord(character)) > > > cnt := cnt+1 > > > } > > > close(in,out) > > > write(cnt," characters transferred") > > > end > > > -----------------------End of Code------------------------- > > > > > > I invoke the program with: > > > > > > word r99-0059.doc r99-0059.txt > > > > > > I get output of (some unprintable characters are represent by _): > > > > > > - -->208 > > > - -->207 > > >  -->17 > > > _ -->224 > > > í -->161 > > > _ -->177 > > > 6 characters transferred > > > > > > Any ideas? > > > > > > Thanks in advance. > > > > > > -- Steve > > > > > > ______________________________________________________ > > > > > > Steve Graham > > > Laboratory Corporation of America (LabCorp) > > > 12160 Abrams Road, Suite 601 > > > Dallas, Texas 75243 > > > > > > E-mail: graham@cowboy.biomed.com > > > Phone: 972.643.6124 (direct to desk) > > > 972.437.5255 ext 5224 > > > FAX: 972.454.1040 > > > _______________________________________________________ > > > > -- > Alan B. Saichek abs@engr.sgi.com > Member Technical Staff - QA Team Lead (650) 933-2507 > Advanced Entertainment Systems, Video Compute R&D 07L-808 -- ______________________________________________________ Steve Graham Laboratory Corporation of America (LabCorp) 12160 Abrams Road, Suite 601 Dallas, Texas 75243 E-mail: graham@cowboy.biomed.com Phone: 972.643.6124 (direct to desk) 972.437.5255 ext 5224 FAX: 972.454.1040 _______________________________________________________ From icon-group-sender Wed Mar 31 09:26:35 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id JAA09337 for icon-group-addresses; Wed, 31 Mar 1999 09:26:27 -0700 (MST) Message-Id: <199903311626.JAA09337@baskerville.CS.Arizona.EDU> Date: Tue, 30 Mar 1999 17:29:50 -0600 From: Steve Graham X-Accept-Language: en To: Ralph Griswold Subject: Re: Problem reading binary file Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Ralph, I tried that and it worked great. Thanks a lot. Steve Graham === Ralph Griswold wrote: > > If you're working under DOS or windows, open the file in untranslate > mode. Otherwise the I/O system interprets ^Z and an end of file. > > For example, > > open(..., "ur") -- ______________________________________________________ Steve Graham Laboratory Corporation of America (LabCorp) 12160 Abrams Road, Suite 601 Dallas, Texas 75243 E-mail: graham@cowboy.biomed.com Phone: 972.643.6124 (direct to desk) 972.437.5255 ext 5224 FAX: 972.454.1040 _______________________________________________________ From icon-group-sender Wed Mar 31 09:26:55 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id JAA09376 for icon-group-addresses; Wed, 31 Mar 1999 09:26:48 -0700 (MST) Message-Id: <199903311626.JAA09376@baskerville.CS.Arizona.EDU> Date: Tue, 30 Mar 1999 22:47:27 -0500 From: Phillip Lee Thomas X-Accept-Language: en To: Steve Graham , icon-group@optima.CS.Arizona.EDU Subject: Re: Problem reading binary file Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Steve, Under DOS, the files need to be opened in "untranslated" mode: in := open(args[1],"ru") | stop("Unable to open ",args[1]) out := open(args[2],"wu") | stop("Unable to open ",args[2]) This stops the translation of and other characters with special meaning in DOS. Phillip Steve Graham wrote: > Hello. > > I am using MS-DOS Icon 9.1 to read a binary file. After reading 6 > characters, the program apparently quits reading. I have attached the > relevant portion of the code: > > -------------------------- Code ------------------------------ > procedure main(args) > # > cnt := 0 > in := open(args[1],"r") | stop("Unable to open ",args[1]) > out := open(args[2],"w") | stop("Unable to open ",args[2]) > while character := reads(in,1) do { > write(character," -->", ord(character)) > cnt := cnt+1 > } > close(in,out) > write(cnt," characters transferred") > end > -----------------------End of Code------------------------- > > I invoke the program with: > > word r99-0059.doc r99-0059.txt > > I get output of (some unprintable characters are represent by _): > > - -->208 > - -->207 >  -->17 > _ -->224 > í -->161 > _ -->177 > 6 characters transferred > > Any ideas? > > Thanks in advance. > > -- Steve > > ______________________________________________________ > > Steve Graham > Laboratory Corporation of America (LabCorp) > 12160 Abrams Road, Suite 601 > Dallas, Texas 75243 > > E-mail: graham@cowboy.biomed.com > Phone: 972.643.6124 (direct to desk) > 972.437.5255 ext 5224 > FAX: 972.454.1040 > _______________________________________________________ From icon-group-sender Wed Mar 31 09:27:26 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id JAA09430 for icon-group-addresses; Wed, 31 Mar 1999 09:27:18 -0700 (MST) Message-Id: <199903311627.JAA09430@baskerville.CS.Arizona.EDU> Date: Wed, 31 Mar 1999 00:13:29 -0400 (AST) From: Larry Bezeau X-Sender: bezeau@sol.sun.csd.unb.ca To: Icon list Subject: Re: Problem reading binary file Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Steve, >I am using MS-DOS Icon 9.1 to read a binary file. After reading 6 >characters, the program apparently quits reading. I have attached the >relevant portion of the code: > I encountered this problem myself sometime ago. To overcome it you must open the file in unstranslated mode as shown below. Note the "u" in the open statement. A "t" in the same position means translated but this is the default if neither is specified. in := open(args[1],"ru") | stop("Unable to open ",args[1]) This will allow your program to read the file character by character without having to worry about whether the character is an end of file character or a line-ending character. In general, if you are reading a file with reads, it should be opened in untranslated mode and if you are reading it with read it should be opened in translated mode. To put it another way, if the file is being used as a text file it should be opened in translated mode but if it is being used as a binary file it should be opened in untranslated mode. Larry Bezeau@UNB.Ca >-------------------------- Code ------------------------------ >procedure main(args) ># > cnt := 0 > out := open(args[2],"w") | stop("Unable to open ",args[2]) > while character := reads(in,1) do { > write(character," -->", ord(character)) > cnt := cnt+1 > } > close(in,out) > write(cnt," characters transferred") >end >-----------------------End of Code------------------------- > >I invoke the program with: > >word r99-0059.doc r99-0059.txt > > >I get output of (some unprintable characters are represent by _): > >- -->208 >- -->207 > -->17 >_ -->224 >í -->161 >_ -->177 >6 characters transferred > > >Any ideas? > >Thanks in advance. > > >-- Steve > > >______________________________________________________ > >Steve Graham >Laboratory Corporation of America (LabCorp) >12160 Abrams Road, Suite 601 >Dallas, Texas 75243 > >E-mail: graham@cowboy.biomed.com >Phone: 972.643.6124 (direct to desk) > 972.437.5255 ext 5224 >FAX: 972.454.1040 >_______________________________________________________ > >From icon-group-sender@baskerville.CS.Arizona.EDU Tue Mar 30 18:42:50 1999 >Date: Tue, 30 Mar 1999 16:04:23 -0600 >From: Steve Graham >Subject: [Fwd: Problem reading binary file] >Status: O >X-Status: >X-Keywords: >X-UID: 2 > >Hello again. > >Turns out that the problem with this was that the 7th character was an >ASCII 26 (^Z) and Icon would not read any further than that. I created >a 2nd file with a ^Z in a different position and got a similar result. >This is despite the fact that there were over 25,000 characters >following the Control Z. > >So, my question is: Why does Icon stop reading when it hits a ^Z? I >can kind of understand this if I were reading a text file; but I was >specifically using reads() because this is a binary file? Should not >reads() support all 256 ASCII codes and only stop reading when there are >REALLY no more characters to read? I ended up using another language, >which was significantly harder for me, to read the binary characters. > >In Icon's defense, I notice that when I TYPE the above-mentioned 2nd >file, I only see the characters occurring prior to the ^Z. And I do not >want it to appear that I am questioning Icon's usefulness. It is >normally one of the 1st languages I choose for utilities of this type. > >Comments? > > >Steve Graham > >=== > >Steve Graham wrote: >> >> Hello. >> >> I am using MS-DOS Icon 9.1 to read a binary file. After reading 6 >> characters, the program apparently quits reading. I have attached the >> relevant portion of the code: >> >> -------------------------- Code ------------------------------ >> procedure main(args) >> # >> cnt := 0 >> in := open(args[1],"r") | stop("Unable to open ",args[1]) >> out := open(args[2],"w") | stop("Unable to open ",args[2]) >> while character := reads(in,1) do { >> write(character," -->", ord(character)) >> cnt := cnt+1 >> } >> close(in,out) >> write(cnt," characters transferred") >> end >> -----------------------End of Code------------------------- >> >> I invoke the program with: >> >> word r99-0059.doc r99-0059.txt >> >> I get output of (some unprintable characters are represent by _): >> >> - -->208 >> - -->207 >>  -->17 >> _ -->224 >> í -->161 >> _ -->177 >> 6 characters transferred >> >> Any ideas? >> >> Thanks in advance. >> >> -- Steve >> >> ______________________________________________________ >> >> Steve Graham >> Laboratory Corporation of America (LabCorp) >> 12160 Abrams Road, Suite 601 >> Dallas, Texas 75243 >> >> E-mail: graham@cowboy.biomed.com >> Phone: 972.643.6124 (direct to desk) >> 972.437.5255 ext 5224 >> FAX: 972.454.1040 >> _______________________________________________________ > From icon-group-sender Wed Mar 31 09:27:48 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id JAA09479 for icon-group-addresses; Wed, 31 Mar 1999 09:27:39 -0700 (MST) Message-Id: <199903311627.JAA09479@baskerville.CS.Arizona.EDU> Date: Wed, 31 Mar 1999 16:21:53 +0200 (CEST) From: Bohdan Rau X-Sender: ethanak@guru To: icon-group@optima.CS.Arizona.EDU Subject: Re: Problem reading binary file Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO On Tue, 30 Mar 1999, Steve Graham wrote: > Hello. Hello! > cnt := 0 > in := open(args[1],"r") | stop("Unable to open ",args[1]) ^^ In MSDOS use "rb" for binary files! ethanak From icon-group-sender Wed Mar 31 09:28:10 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id JAA09520 for icon-group-addresses; Wed, 31 Mar 1999 09:28:00 -0700 (MST) Message-Id: <199903311628.JAA09520@baskerville.CS.Arizona.EDU> Date: Wed, 31 Mar 1999 09:07:15 -0700 (MST) From: Gregg Townsend To: graham@cowboy.biomed.com, icon-group@optima.CS.Arizona.EDU Subject: Re: Problem reading binary file Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO From: Steve Graham Date: Tue, 30 Mar 1999 11:02:54 -0600 I am using MS-DOS Icon 9.1 to read a binary file. After reading 6 characters, the program apparently quits reading... You might try opening the file in untranslated mode: open(filename, "ru") --------------------------------------------------------------------------- Gregg Townsend Gould-Simpson Building gmt@cs.arizona.edu Staff Scientist 1040 E. 4th St. 32 13 45N 110 57 16W Dept. of Computer Science PO Box 210077 tel: +1 520 621 4325 The University of Arizona Tucson, AZ 85721-0077 fax: +1 520 621 4246 From icon-group-sender Wed Mar 31 09:28:28 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id JAA09577 for icon-group-addresses; Wed, 31 Mar 1999 09:28:19 -0700 (MST) Message-Id: <199903311628.JAA09577@baskerville.CS.Arizona.EDU> From: Lloyd Uhler To: "'icon-group@cs.arizona.edu'" Subject: Selecting and moving Graphics Objects Date: Wed, 31 Mar 1999 10:17:01 -0600 Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO What modules (subroutines) in the Graphics Library (or in ICON) support the selection of an object with the mouse and then moving that object? In VIB, you select somthing like a "slider" and move it to the Design Window. I was curious on how this is done in general. Thanks. From icon-group-sender Wed Mar 31 09:28:46 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id JAA09634 for icon-group-addresses; Wed, 31 Mar 1999 09:28:38 -0700 (MST) Message-Id: <199903311628.JAA09634@baskerville.CS.Arizona.EDU> Date: Wed, 31 Mar 1999 10:18:31 -0600 From: Steve Graham X-Accept-Language: en To: Icon Mailing List Subject: Re: Problem Reading Binary File Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO To all Iconists: I would like to take a moment to publicly thank the group for the rapid and voluminous response to my above question. I received e-mail from 7 individuals, which proved to be just what I needed. -- Steve Graham ______________________________________________________ Steve Graham Laboratory Corporation of America (LabCorp) 12160 Abrams Road, Suite 601 Dallas, Texas 75243 E-mail: graham@cowboy.biomed.com Phone: 972.643.6124 (direct to desk) 972.437.5255 ext 5224 FAX: 972.454.1040 _______________________________________________________ From icon-group-sender Wed Mar 31 13:26:46 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id NAA20561 for icon-group-addresses; Wed, 31 Mar 1999 13:25:36 -0700 (MST) Message-Id: <199903312025.NAA20561@baskerville.CS.Arizona.EDU> Date: Wed, 31 Mar 1999 09:40:06 -0700 (MST) From: Gregg Townsend To: icon-group@optima.CS.Arizona.EDU, luhler@excel.com Subject: Re: Selecting and moving Graphics Objects Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO From: Lloyd Uhler Subject: Selecting and moving Graphics Objects What modules (subroutines) in the Graphics Library (or in ICON) support the selection of an object with the mouse and then moving that object? For dragging, see Drag() from the Icon program library (ipl/gprocs/drag.icn). This is what VIB uses. For selection, VIB just uses a simple loop that compares the mouse position with the bounds of the objects it knows. --------------------------------------------------------------------------- Gregg Townsend Gould-Simpson Building gmt@cs.arizona.edu Staff Scientist 1040 E. 4th St. 32 13 45N 110 57 16W Dept. of Computer Science PO Box 210077 tel: +1 520 621 4325 The University of Arizona Tucson, AZ 85721-0077 fax: +1 520 621 4246 From icon-group-sender Wed Mar 31 13:27:37 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id NAA20624 for icon-group-addresses; Wed, 31 Mar 1999 13:27:29 -0700 (MST) Message-Id: <199903312027.NAA20624@baskerville.CS.Arizona.EDU> Date: Wed, 31 Mar 1999 10:47:00 -0600 From: Steve Graham X-Accept-Language: en To: Icon Mailing List Subject: Icon in the Humanities Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO My sister is involved with research libraries and recently mentioned the use of computers in fields such as the Humanities. If there is any related work in Icon, I would like to pass that on to her. Does anyone know of any such endeavors using Icon? Thanks in advance. -- Steve Graham ______________________________________________________ Steve Graham Laboratory Corporation of America (LabCorp) 12160 Abrams Road, Suite 601 Dallas, Texas 75243 E-mail: graham@cowboy.biomed.com Phone: 972.643.6124 (direct to desk) 972.437.5255 ext 5224 FAX: 972.454.1040 _______________________________________________________ From icon-group-sender Thu Apr 1 12:59:41 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id MAA00234 for icon-group-addresses; Thu, 1 Apr 1999 12:57:27 -0700 (MST) Message-Id: <199904011957.MAA00234@baskerville.CS.Arizona.EDU> From: Art Eschenlauer To: "'icon-group@cs.arizona.edu'" Subject: has anyone written 'make' utility in Icon Date: Thu, 1 Apr 1999 11:30:50 -0600 Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO I am wondering if anyone has written 'make' using Icon. Not wishing to reinvent the wheel, I checked the Icon Programming Library, but saw nothing there that seemed to be like 'make'. Yes, I understand the operating-system-specific implications, but I have always been able to get a lot of mileage out of the system(s) call. > Art Eschenlauer, Systems Analyst > Sufficient Systems, Inc. > 2860 Patton Road > Roseville, MN 55113 > Phone: (651) 638-9190, ext. 29. Fax: (651) 638-9290 > eMail: Art.Eschenlauer@sufsys.com > From icon-group-sender Mon Apr 5 08:59:07 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id IAA20054 for icon-group-addresses; Mon, 5 Apr 1999 08:47:02 -0700 (MST) Message-Id: <199904051547.IAA20054@baskerville.CS.Arizona.EDU> From: "Mark Evans" To: "Icon List" Subject: Ccon and Icon-based Compilers Date: Sat, 3 Apr 1999 10:34:49 -0600 X-Priority: 3 (Normal) X-MSMail-Priority: Normal Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3155.0 Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO The Jcon effort involved a Java translator plus a runtime system in Java. My question is whether anyone has ideas about the same concept for the C/C++ language. Let's call it "Ccon." That is, a runtime system (library/classes), plus a translator to turn Icon into C/C++ targeted for that runtime system. I remember something called "iconc" but it seems to have fallen into disfavor, is not being upgraded, all attention is now on Unicon, etc., etc. Another idea for which I would like to solicit opinions is writing a machine-code compiler in the Icon language directly. Good? Bad? Ugly? What about using a GNU compiler and then Icon code as the front end and/or back end. Any advantages? The kind of comments I don't need are people telling me that I don't need C code, I can use Icon as it is, why don't I get with it, etc. If I didn't need C code I wouldn't bother with this note. Regards, Mark Evans Believe Evolution? Save this block as FAITH.HTM and open with your browser. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

From icon-group-sender Mon Apr 5 09:23:07 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id JAA21689 for icon-group-addresses; Mon, 5 Apr 1999 09:22:52 -0700 (MST) Message-Id: <199904051622.JAA21689@baskerville.CS.Arizona.EDU> X-Authentication-Warning: pluto.mscc.huji.ac.il: mslamm owned process doing -bs Date: Mon, 5 Apr 1999 15:13:05 +0300 (WET) From: Ehud Lamm To: icon-group@optima.CS.Arizona.EDU Subject: How programs fail Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Had a funny problem today, which may give a lesson to us all. I had some files that needed to be hacked a bit (a chunk was to be removed from each of them), and I decided to use Icon. I am using Win95, but my Icon version is quite old - 8.10 I think. It took me a few minutes to find filter.icn in the IPL, change it to my needs and test to see it works. All was fine. Then I tried to run it on my files, but it didn't work. No error messages, just that the output files didn't get created, and the input files, which weren't supposed to change were suddenly empty. It occured to me that Win95 allows long file names, so I changed my directory names to one word shorter than 8 letters. However things still didn't work. I tried moving the files arround, to my Icon direcotry, so no path will be used. No improvement. It tried &trace - didn't give a clue. Only thing I found out was that the read() from the input file fails. However, I didn't see any reason for this. I almost decided to think of another solution. And than it hit me... The input files were named *.htm, and I was so happy I found a way to get meaningful output names with little effort - just call them *.html. This means my code simply appended an "l". However this made the extension longer than 3 letters... Took me an hour to notice. A minute to fix. Than it worked. Aside from feeling stupid, I think it would have been nice if Icon would have yeeld saying that the output file name I gave it was bad. I am not sure if this can be done in any nice way, but it does show that software must be maintained, and that the dictum "if it ain't broke don't fix it" is wrong when applied to software. Other software will be upgraded and will cause yours to fail. It is also quite sad that instead of producing an error, when the open was done - the code continued to run and corrupted the input files. Even sadder is the fact that I had no tools to help analyze the problem. My Icon version is very lacking in this regard. I seem to recall seeing that Ralph Griswold is teaching Software Eng. Well I may use this story on my SE students... Ehud Lamm mslamm@pluto.mscc.huji.ac.il From icon-group-sender Mon Apr 5 12:24:02 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id MAA29776 for icon-group-addresses; Mon, 5 Apr 1999 12:22:27 -0700 (MST) Message-Id: <199904051922.MAA29776@baskerville.CS.Arizona.EDU> From: Todd Proebsting To: "'Ehud Lamm'" , icon-group@optima.CS.Arizona.EDU Subject: RE: How programs fail Date: Mon, 5 Apr 1999 09:42:11 -0700 Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO I like Icon's model of what is failure and what is an error, although I, too, have been nailed by a failing expression that in a particular context is fatal to my application. To find such, I use the following pattern: f := open(filename) | runerr(500, filename) runerr(500) is for "Programmer-Specified Errors" and reports "program malfunction", which is precisely what you want in this circumstance. Getting the stack trace is useful. Todd -----Original Message----- From: Ehud Lamm [mailto:mslamm@mscc.huji.ac.il] Sent: Monday, April 05, 1999 5:13 AM To: icon-group@optima.CS.Arizona.EDU Subject: How programs fail Had a funny problem today, which may give a lesson to us all. I had some files that needed to be hacked a bit (a chunk was to be removed from each of them), and I decided to use Icon. I am using Win95, but my Icon version is quite old - 8.10 I think. It took me a few minutes to find filter.icn in the IPL, change it to my needs and test to see it works. All was fine. Then I tried to run it on my files, but it didn't work. No error messages, just that the output files didn't get created, and the input files, which weren't supposed to change were suddenly empty. It occured to me that Win95 allows long file names, so I changed my directory names to one word shorter than 8 letters. However things still didn't work. I tried moving the files arround, to my Icon direcotry, so no path will be used. No improvement. It tried &trace - didn't give a clue. Only thing I found out was that the read() from the input file fails. However, I didn't see any reason for this. I almost decided to think of another solution. And than it hit me... The input files were named *.htm, and I was so happy I found a way to get meaningful output names with little effort - just call them *.html. This means my code simply appended an "l". However this made the extension longer than 3 letters... Took me an hour to notice. A minute to fix. Than it worked. Aside from feeling stupid, I think it would have been nice if Icon would have yeeld saying that the output file name I gave it was bad. I am not sure if this can be done in any nice way, but it does show that software must be maintained, and that the dictum "if it ain't broke don't fix it" is wrong when applied to software. Other software will be upgraded and will cause yours to fail. It is also quite sad that instead of producing an error, when the open was done - the code continued to run and corrupted the input files. Even sadder is the fact that I had no tools to help analyze the problem. My Icon version is very lacking in this regard. I seem to recall seeing that Ralph Griswold is teaching Software Eng. Well I may use this story on my SE students... Ehud Lamm mslamm@pluto.mscc.huji.ac.il From icon-group-sender Mon Apr 5 13:20:34 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id NAA02010 for icon-group-addresses; Mon, 5 Apr 1999 13:20:09 -0700 (MST) Message-Id: <199904052020.NAA02010@baskerville.CS.Arizona.EDU> From: "Mark Evans" To: "Icon List" Subject: RE: Ccon and Icon-based Compilers Date: Mon, 5 Apr 1999 11:52:15 -0500 X-Priority: 3 (Normal) X-MSMail-Priority: Normal Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3155.0 Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Thanks, Todd! Helpful comments. Garbage collection is not a big deal to me, e.g. http://reality.sgi.com/boehm_mti/gc.html As for runtime support, it already exists in C. The Icon interpreter is implemented in C. All I have to do is tweak the code that is there already. (With Jcon, you did not have Java code for the runtime system; your case is not the same as mine.) I like co-expressions but detest their current implementation, which involves custom assembly language. Yuk! I want to rewrite that stuff, whether with threads or something simpler. Type inferencing is fine if it helps performance, and if there is code already out there. Presumably I can get my hands on the source to "iconc" and determine how it was done. We can talk ourselves blue in the face about whether C will perform better than native Icon. To me that is not the point. The point is, I want to extend the C language. I want Icon code that integrates cleanly into C/C++ projects under Windows. The reason I said that I wanted to avoid discussion of "why C?" is that I already know my reasons, and they are valid. Best regards, Mark -----Original Message----- From: Todd Proebsting [mailto:toddpro@microsoft.com] Sent: Monday, April 05, 1999 11:24 AM To: 'Mark Evans'; Icon List Subject: RE: Ccon and Icon-based Compilers Jcon's translator is written in Icon. It would be very easy to adapt it to emit C++ (or assembly for your favorite machine). In fact, the translator was structured to be easy to retarget. (I'm toying with the idea of retargetting Jcon to emit Postscript---with only a limited run-time system---just for kicks....) The problem is not translating Icon, however, but providing the run-time support for all of Icon's built-in types and functions. This can be done easily in C++, too, with enough time. With the exception of the graphics stuff, most of Jcon should translate pretty cleanly into C++. Two issues that any Icon implementation must face are how to handle co-expressions, and how to handle garbage collection. Co-expressions are easy if you have a threads package. Garbage collection is a royal pain. Jcon relied on Java's garbage collection, so GC in Jcon was free. Unless you use a conservative collector in a C++ implementation, I think GC would be complete mess: a source of lots of complications, lots of performance problems, and lots of hard-to-track bugs. I should comment, however, on emitting machine code. It's not going to help performance much at all. The vast majority of the time in an Icon program is spent in the run-time system, not in compiled code. In Jcon, its around 10% in compiled code, if I recall correctly. (The old Icon compiler, iconc, had significant performance gains not because it compiled to C rather than being interpreted, but because it did type inferencing to avoid having to do lots of type conversions and type tests. This is an orthogonal issue to what target or implementation languages are used.) I'd be surprised if any implementation of Icon is going to be significantly faster than the current interpreter unless the new implementation does type-specific optimizations. Todd -----Original Message----- From: Mark Evans [mailto:evans@gte.net] Sent: Saturday, April 03, 1999 8:35 AM To: Icon List Subject: Ccon and Icon-based Compilers The Jcon effort involved a Java translator plus a runtime system in Java. My question is whether anyone has ideas about the same concept for the C/C++ language. Let's call it "Ccon." That is, a runtime system (library/classes), plus a translator to turn Icon into C/C++ targeted for that runtime system. I remember something called "iconc" but it seems to have fallen into disfavor, is not being upgraded, all attention is now on Unicon, etc., etc. Another idea for which I would like to solicit opinions is writing a machine-code compiler in the Icon language directly. Good? Bad? Ugly? What about using a GNU compiler and then Icon code as the front end and/or back end. Any advantages? The kind of comments I don't need are people telling me that I don't need C code, I can use Icon as it is, why don't I get with it, etc. If I didn't need C code I wouldn't bother with this note. Regards, Mark Evans Believe Evolution? Save this block as FAITH.HTM and open with your browser. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

From icon-group-sender Mon Apr 5 13:21:17 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id NAA02050 for icon-group-addresses; Mon, 5 Apr 1999 13:21:09 -0700 (MST) Message-Id: <199904052021.NAA02050@baskerville.CS.Arizona.EDU> X-Authentication-Warning: pluto.mscc.huji.ac.il: mslamm owned process doing -bs Date: Mon, 5 Apr 1999 20:08:26 +0300 (WET) From: Ehud Lamm To: Todd Proebsting cc: icon-group@optima.CS.Arizona.EDU Subject: RE: How programs fail Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO On Mon, 5 Apr 1999, Todd Proebsting wrote: > I like Icon's model of what is failure and what is an error, although I, > too, have been nailed by a failing expression that in a particular context > is fatal to my application. To find such, I use the following pattern: > > f := open(filename) | runerr(500, filename) > > runerr(500) is for "Programmer-Specified Errors" and reports "program > malfunction", which is precisely what you want in this circumstance. > Getting the stack trace is useful. > The actuall code looked like this: o := if fn == "-" then &output else open(fn||"l","w") | stop("Can't open output file \"",fn||"l,"\"") Also, as I said I ran it with a trace, which didn't show anything relevant. I too am fond of "failure as a programming sitation." In this case it is like excpetions in other language, but of course the goal directed nature of Icon makes it much more powerful. Ehud Lamm mslamm@pluto.mscc.huji.ac.il http://www2.cybercities.com/e/ehud <== E-List, Ada, SE and more. From icon-group-sender Mon Apr 5 13:21:54 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id NAA02091 for icon-group-addresses; Mon, 5 Apr 1999 13:21:46 -0700 (MST) Message-Id: <199904052021.NAA02091@baskerville.CS.Arizona.EDU> Date: Mon, 05 Apr 1999 13:35:24 -0500 From: David Starner X-Accept-Language: en To: Mark Evans CC: Icon List Subject: Re: Ccon and Icon-based Compilers Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Mark Evans wrote: > > The Jcon effort involved a Java translator plus a runtime system in Java. My > question is whether anyone has ideas about the same concept for the C/C++ > language. Let's call it "Ccon." That is, a runtime system (library/classes), > plus a translator to turn Icon into C/C++ targeted for that runtime system. > > I remember something called "iconc" but it seems to have fallen into disfavor, > is not being upgraded, all attention is now on Unicon, etc., etc. Wouldn't it be easier to upgrade iconc than start over? > > Another idea for which I would like to solicit opinions is writing a > machine-code compiler in the Icon language directly. Good? Bad? Ugly? Ugly. Very ugly. > What > about using a GNU compiler and then Icon code as the front end and/or back end. > Any advantages? It automatically* handles many systems and has great optimizing routines. Much more work has gone into the GBE (GCC Back End) than you could ever find time to put into your backend. OTOH, you will have to write it in C because to do otherwise would force you to cross-compiler first to each system (which is evil) and will make extra work for EGCS people. You should work with the EGCS people to make it a part of EGCS, so that it gets updated to new versions of the GNU compiler and builds easily. Working with the EGCS people would also imply assigning copyright of any code used in the compiler to the FSF, although they would probably waive that if you chose to use parts of Icont in it. *Coroutines. I don't think that the GBE will handle coroutines without some extension, which may have to be especially added for each computer. > Believe Evolution? Save this block as FAITH.HTM and open with your browser. This would be much better as small block with a couple URL's than an ugly piece of HTML. -- David Starner - OSU student - dstarner98@aasaa.ofe.org If you want a real optimist, look up Ray Bradbury. Guy's nuts. He actually likes people. -David Brin From icon-group-sender Tue Apr 6 08:32:22 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id IAA03358 for icon-group-addresses; Tue, 6 Apr 1999 08:31:43 -0700 (MST) Message-Id: <199904061531.IAA03358@baskerville.CS.Arizona.EDU> Date: 06 Apr 99 10:27:33 BST From: rjhare@ed.ac.uk Subject: Visualisation To: icon-group@optima.CS.Arizona.EDU Organisation: Edinburgh Parallel Computing Centre Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO I'm not sure if this is even a `sensible' question when there are visualisation packages like AVS, vis5d, etc. around, but has anyone used Icon to create a `basic' visualisation suite which could handle (say) `stick and ball' molecular models or vector/streamline visualisation? I can't see anything `obvious' in the IPL which maps to this. Thanks. Roger Hare From icon-group-sender Tue Apr 6 16:58:43 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id QAA18453 for icon-group-addresses; Tue, 6 Apr 1999 16:56:40 -0700 (MST) Message-Id: <199904062356.QAA18453@baskerville.CS.Arizona.EDU> Date: Tue, 06 Apr 1999 16:09:24 -0500 From: "Charles Hethcoat" To: rjhare@ed.ac.uk, icon-group@optima.CS.Arizona.EDU Subject: Re: Visualisation Content-Disposition: inline X-MIME-Autoconverted: from quoted-printable to 8bit by baskerville.CS.Arizona.EDU id OAA12042 Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO On a lark, to learn more about how 3D graphics are implemented, I started rewriting the C code in a textbook several years ago. Here are the header comments: # model3d.icn - rudimentary 3-d modelling with Gnuplot output # The basic approach is borrowed from "High-Resolution Computer # Graphics Using C" by Ian Angell (Wiley/Halstead, 1990). However, # since this is Icon, the code is much clearer, the data structures # are simpler, and I haven't shrunk from changing some routines into # functions returning structured values to the point of invocation. # Gnuplot is the output "device". There is no interface with any other # hardware, nor any attempt to format for any other plotting language. # If you don't have gnuplot installed, get it. You're going to need # it. What is there is crude. It has worked fine on my limited testing, but as yet there is no interactivity, no animation, not much color (lines only), and no surface textures. These could be added, but I haven't had much time to work on it in a couple of years. It could easily be modified to emit PostScript or VRML as well as Gnuplot. If this sounds interesting (to anybody) as a basis for further work, I could post what I have to a friendly FTP site (due to exigencies beyond my control, I cannot keep mine up 24 hours a day). Let me know if you want a copy. Cheers, Charles Hethcoat >>> 99-04-06 10:32:53 AM >>> ...anyone used Icon to create a `basic' visualisation suite which could handle (say) `stick and ball' molecular models or vector/streamline visualisation? I can't see anything `obvious' in the IPL which maps to this. From icon-group-sender Wed Apr 7 08:16:35 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id IAA11685 for icon-group-addresses; Wed, 7 Apr 1999 08:16:07 -0700 (MST) Message-Id: <199904071516.IAA11685@baskerville.CS.Arizona.EDU> From: Vickie.M.Fazio2@ucm.com To: icon-group@optima.CS.Arizona.EDU Date: Wed, 7 Apr 1999 06:42:53 -0500 Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO To whom it may concern, I am using Icon programming for a class I am taking at Benedictine College. This is my first time using Icon programming. Can you enlighten me on how to print my source code and results. Vickie Fazio From icon-group-sender Wed Apr 7 13:00:06 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id MAA24236 for icon-group-addresses; Wed, 7 Apr 1999 12:55:09 -0700 (MST) Message-Id: <199904071955.MAA24236@baskerville.CS.Arizona.EDU> From: gep2@terabites.com Date: Wed, 07 Apr 1999 11:59:21 -0500 Subject: Re: Printing source code and results To: Vickie.M.Fazio2@ucm.com, icon-group@optima.CS.Arizona.EDU Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO > Can you enlighten me on how to print my source code and results. To at least some degree this will vary depending on the operating system environment you have. If you're running on a Windows (and DOS) environment, you can load your Icon source program into Notepad and print it from there. You can print output by opening your output file as LPT1 (use that as your filename). Alternately, if you write your output to a specific disk file, you can also open that file in Notepad and print it the same way you would your source code. Likewise, you can just (from the DOS shell command line) copy your Icon source program to LPT1 for printing: copy myprog.icn lpt1 I think you can also 'drag and drop' a text file icon onto a printer icon, although I personally never do it that way. If your program writes to standard output, you can also usually print the output directly by redirecting your program's standard output to the printer: iconx myprog >lpt1 I hope these help you. Gordon Peterson http://www.computek.net/public/gep2/ Support the Anti-SPAM Amendment! Join at http://www.cauce.org/ 12/19/98: the day the Conservatives demonstrated their scorn for their fraudulent sham of representative government. Voters, remember it! From icon-group-sender Thu Apr 8 13:26:17 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id NAA15295 for icon-group-addresses; Thu, 8 Apr 1999 13:22:06 -0700 (MST) Message-Id: <199904082022.NAA15295@baskerville.CS.Arizona.EDU> To: icon-group@optima.CS.Arizona.EDU Date: Thu, 08 Apr 1999 15:18:14 GMT From: jsgraham@my-dejanews.com Subject: Re: Problem reading binary file Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Bohdan, Thanks for your reply. I had a variety of responses to this and what worked for me was changing "r" to "ru". Steve Graham === In article <199903311627.JAA09479@baskerville.CS.Arizona.EDU>, Bohdan Rau wrote: > On Tue, 30 Mar 1999, Steve Graham wrote: > > > Hello. > > Hello! > > > cnt := 0 > > in := open(args[1],"r") | stop("Unable to open ",args[1]) > ^^ > In MSDOS use "rb" for binary files! > > ethanak > > -----------== Posted via Deja News, The Discussion Network ==---------- http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own From icon-group-sender Thu Apr 8 16:28:46 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id QAA22603 for icon-group-addresses; Thu, 8 Apr 1999 16:27:34 -0700 (MST) Message-Id: <199904082327.QAA22603@baskerville.CS.Arizona.EDU> To: icon-group@optima.CS.Arizona.EDU Date: Thu, 08 Apr 1999 17:35:22 -0400 From: "Hudon, Christian (EXCHANGE:MTL:6X16)" Subject: Deep copy in Icon? Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Hi, could someone tell me what's wrong with the following snippet of Icon code? procedure deepcopy(x, t) /t := table() case type(x) of { "list"|"table"|"set"|"record" : { e := t[image(x)] if /e then { e := copy(x) t[image(x)] := e every sub := !e do sub := deepcopy(sub, t) } return e } default: return x } end (This is supposed to do a deep copy of an arbitrary object, preserving the structure.) I thought you could assign to the elements of a set, list, etc. with something like every e := !l do e := foo(e) but it doesn't seem to work here... when I do deepcopy([1, [2, 3], 4]), the list that's returned still has the inner list [2, 3] shared. If there's a more Icon-ish way to do all this, I'm also appreciate hearing about it. Thanks, Christian From icon-group-sender Fri Apr 9 08:09:21 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id IAA11954 for icon-group-addresses; Fri, 9 Apr 1999 08:07:19 -0700 (MST) Message-Id: <199904091507.IAA11954@baskerville.CS.Arizona.EDU> Date: Thu, 8 Apr 1999 19:21:04 -0500 (CDT) From: "John C. Paolillo" To: icon-group@optima.CS.Arizona.EDU Subject: Assumption Grammars in Icon? Cc: johnp@ling.uta.edu Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Dear Icon group -- Icon has a number of features that are related to logic programming languages (e.g. it allows nondeterministic depth-first search through automatic backtracking), but these days in logic programming and NLP-type applications especially, we are starting to see more and more use of "linear logic" to help solve certain problems. I don't have a good definition of linear logic handy, but as I understand it, it allows one to treat certain kinds of information as being "consumed" when certain kinds of conditions are met. This is helpful in many kinds of NLP tasks, e.g. when you need to match a verb with its arguments in a language where word order is free (arguments can be in any order with respect to the verb). I was wondering if anyone has (or knows of) any ideas about implementing linear logic like constructs in Icon. My sense is that very probably this can be done without any modifications to the language, but I'm a bit unsure as to how it would be done. Can anyone suggest something (a technique, or a reference to a paper)? If you need to see something in order to get a sense of the kind of thing that linear logic allows, Dahl and Tarau discuss an implementation of what they call "assumption grammars" in Tarau's BinProlog, in the following paper: Assumption Grammars: Parsing as Hypothetical Reasoning http://clement.info.umoncton.ca/html/JAGS/html.html (For those that read comp.lang.prolog, this was recently mentioned there). Thanks, John C. Paolillo UTA Linguistics From icon-group-sender Fri Apr 9 08:17:45 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id IAA12257 for icon-group-addresses; Fri, 9 Apr 1999 08:17:37 -0700 (MST) Message-Id: <199904091517.IAA12257@baskerville.CS.Arizona.EDU> From: swampler@noao.edu (Steve Wampler) Date: Thu, 8 Apr 1999 18:37:14 MST To: "Hudon, Christian (EXCHANGE:MTL:6X16)" , icon-group@optima.CS.Arizona.EDU Subject: Re: Deep copy in Icon? Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO > Hi, > > could someone tell me what's wrong with the following snippet of Icon > code? > > procedure deepcopy(x, t) > /t := table() > case type(x) of { > "list"|"table"|"set"|"record" : { > e := t[image(x)] > if /e then { > e := copy(x) > t[image(x)] := e > every sub := !e do sub := deepcopy(sub, t) > } > return e > } > default: return x > } > end Hi Christian, This isn't the problem, but you just use t[x] instead of t[image(x)]... Where you're problem shows up is in the "every sub := !e do sub := ..." line. Immediately after each iteration of "sub := !e" you nicely have the *value* of the variable sub the same value as in e, but... The assignment of "sub := deepcopy(..." is replacing the value of sub with a new value, but isn't touching the list e, where the original value stays untouched. (i.e. before the assignment, sub referenced the same value referenced in e, but now the value of sub references elsewhere). Here's one solution, perhaps someone has a cleaner one: procedure deepcopy(e, t) /t := table() if type(e) == ("list"|"table"|"set"|"record") then { e := copy(e) every a := e[i := 1 to *e] do { /t[a] := deepcopy(a, t) e[i] := t[a] } } return e end From icon-group-sender Fri Apr 9 08:20:10 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id IAA12377 for icon-group-addresses; Fri, 9 Apr 1999 08:20:00 -0700 (MST) Message-Id: <199904091520.IAA12377@baskerville.CS.Arizona.EDU> From: "J.R. Sampson" To: icon-group@optima.CS.Arizona.EDU Date: Fri, 9 Apr 1999 09:28:53 +0100 Subject: File I/O in Winicon Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Hello - I notice that Icon 9 for Windows expects UNIX-style text files rather than DOS-style. Is there a way to change this? Regards _John Sampson_ From icon-group-sender Fri Apr 9 13:03:04 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id NAA23393 for icon-group-addresses; Fri, 9 Apr 1999 13:01:54 -0700 (MST) Message-Id: <199904092001.NAA23393@baskerville.CS.Arizona.EDU> From: "Nevin Liber" To: Cc: "Hudon, Christian (EXCHANGE:MTL:6X16)" Subject: RE: Deep copy in Icon? Date: Fri, 9 Apr 1999 10:33:54 -0500 X-Priority: 3 (Normal) X-MSMail-Priority: Normal Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2014.211 Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO > procedure deepcopy(x, t) > /t := table() > case type(x) of { > "list"|"table"|"set"|"record" : { > e := t[image(x)] > if /e then { > e := copy(x) > t[image(x)] := e > every sub := !e do sub := deepcopy(sub, t) > } > return e > } > default: return x > } > end > (This is supposed to do a deep copy of an arbitrary object, preserving > the structure.) First off, good job on dealing with the problems of self-referential data structures, such as L := list() put(L, L) although you can just use x instead of image(x) in your above snippet and it will still work. > I thought you could assign to the elements of a set, list, etc. with > something like > every e := !l do e := foo(e) What you need is something like: every i := 1 to *l do l[i] := foo(l[i]) To borrow from C++ terminology, the difference is that l[i] is a "reference" (l-value) to element i in list l, while e is the "value" of element i in list l. __ Nevin ":-)" Liber (312) 855-1000 x199 From icon-group-sender Fri Apr 9 17:25:30 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id RAA02117 for icon-group-addresses; Fri, 9 Apr 1999 17:24:46 -0700 (MST) Message-Id: <199904100024.RAA02117@baskerville.CS.Arizona.EDU> Date: Fri, 9 Apr 1999 15:06:18 -0700 (PDT) From: Shamim Mohamed To: icon-group@optima.CS.Arizona.EDU Subject: 99 Bottles of Beer on the Wall Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO A friend pointed me to a site featuring programs to print out the "99 bottles of beer on the wall" song. I thought the Icon version lacked a certain je ne sais quois; this is the best I could come up with: # Look ma, no loops! procedure main(a) write(stanza(beer(n := a[1]))) & n = 0 end procedure beer(n) n >= 0 | fail suspend n || " bottle" || (if n ~= 1 then "s" else "") || " of beer" | beer(n-1) end procedure stanza(s) s[1] ~== "0" | return s || "." return s || " on the wall.\n\n" || s || " on the wall.\n" || s || ".\nTake one down, pass it around," end I'm not happy with the way plurals are handled. Anyone else? -s From icon-group-sender Mon Apr 12 08:11:09 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id IAA07607 for icon-group-addresses; Mon, 12 Apr 1999 08:06:35 -0700 (MST) Message-Id: <199904121506.IAA07607@baskerville.CS.Arizona.EDU> To: icon-group@optima.CS.Arizona.EDU Date: Sat, 10 Apr 1999 12:22:40 +0100 From: Steve Harborne Subject: Y2000 Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Is there a statement about the Y2K status of Icon on the web site? I am testing Icon 9.3.1 under Irix 6.5 on a Silicon Graphics Power Challenge. Does anyone have any experience of Icon on this platform and OS? Steve -------------------------------- Science is only a theory From icon-group-sender Mon Apr 12 08:12:54 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id IAA07932 for icon-group-addresses; Mon, 12 Apr 1999 08:11:23 -0700 (MST) Message-Id: <199904121511.IAA07932@baskerville.CS.Arizona.EDU> From: Todd Proebsting To: "'Mark Evans'" , Icon List Subject: RE: Ccon and Icon-based Compilers Date: Mon, 5 Apr 1999 09:23:44 -0700 Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Jcon's translator is written in Icon. It would be very easy to adapt it to emit C++ (or assembly for your favorite machine). In fact, the translator was structured to be easy to retarget. (I'm toying with the idea of retargetting Jcon to emit Postscript---with only a limited run-time system---just for kicks....) The problem is not translating Icon, however, but providing the run-time support for all of Icon's built-in types and functions. This can be done easily in C++, too, with enough time. With the exception of the graphics stuff, most of Jcon should translate pretty cleanly into C++. Two issues that any Icon implementation must face are how to handle co-expressions, and how to handle garbage collection. Co-expressions are easy if you have a threads package. Garbage collection is a royal pain. Jcon relied on Java's garbage collection, so GC in Jcon was free. Unless you use a conservative collector in a C++ implementation, I think GC would be complete mess: a source of lots of complications, lots of performance problems, and lots of hard-to-track bugs. I should comment, however, on emitting machine code. It's not going to help performance much at all. The vast majority of the time in an Icon program is spent in the run-time system, not in compiled code. In Jcon, its around 10% in compiled code, if I recall correctly. (The old Icon compiler, iconc, had significant performance gains not because it compiled to C rather than being interpreted, but because it did type inferencing to avoid having to do lots of type conversions and type tests. This is an orthogonal issue to what target or implementation languages are used.) I'd be surprised if any implementation of Icon is going to be significantly faster than the current interpreter unless the new implementation does type-specific optimizations. Todd -----Original Message----- From: Mark Evans [mailto:evans@gte.net] Sent: Saturday, April 03, 1999 8:35 AM To: Icon List Subject: Ccon and Icon-based Compilers The Jcon effort involved a Java translator plus a runtime system in Java. My question is whether anyone has ideas about the same concept for the C/C++ language. Let's call it "Ccon." That is, a runtime system (library/classes), plus a translator to turn Icon into C/C++ targeted for that runtime system. I remember something called "iconc" but it seems to have fallen into disfavor, is not being upgraded, all attention is now on Unicon, etc., etc. Another idea for which I would like to solicit opinions is writing a machine-code compiler in the Icon language directly. Good? Bad? Ugly? What about using a GNU compiler and then Icon code as the front end and/or back end. Any advantages? The kind of comments I don't need are people telling me that I don't need C code, I can use Icon as it is, why don't I get with it, etc. If I didn't need C code I wouldn't bother with this note. Regards, Mark Evans Believe Evolution? Save this block as FAITH.HTM and open with your browser. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

From icon-group-sender Tue Apr 20 13:37:10 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id NAA26127 for icon-group-addresses; Tue, 20 Apr 1999 13:31:51 -0700 (MST) Message-Id: <199904202031.NAA26127@baskerville.CS.Arizona.EDU> Delivered-To: icon-group@cs.arizona.edu To: icon-group@optima.CS.Arizona.EDU Date: Tue, 20 Apr 1999 13:09:31 -0400 From: Dennis Corbo Subject: Question: ICON XML Parser? Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Is there an ICON implementation of an XML parser available anywhere? Dennis Corbo MRO Inc The contents of this message express only the sender's opinion. This message does not necessarily reflect the policy or views of my employer, Merck & Co., Inc. All responsibility for the statements made in this Usenet posting resides solely and completely with the sender. From icon-group-sender Thu Apr 22 09:06:30 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id JAA08029 for icon-group-addresses; Thu, 22 Apr 1999 09:04:39 -0700 (MST) Message-Id: <199904221604.JAA08029@baskerville.CS.Arizona.EDU> Delivered-To: icon-group@cs.arizona.edu To: icon-group@optima.CS.Arizona.EDU Date: 22 Apr 1999 01:25:36 GMT From: porco@stat.Berkeley.EDU (Travis C. Porco) Subject: CGI library in Icon Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Dear readers-- Is there a CGI library in Icon? I am told there is. Does it have any noteworthy disadvantages or pose any security problems? -- Travis **standard disclaimers apply** "Their real problem was that they assumed themselves able to formulate the questions, and ignored the fact that the questions were every bit as important as the answers." --Idries Shah, _The Sufis_ From icon-group-sender Mon Apr 26 08:31:30 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id IAA06577 for icon-group-addresses; Mon, 26 Apr 1999 08:25:15 -0700 (MST) Message-Id: <199904261525.IAA06577@baskerville.CS.Arizona.EDU> Delivered-To: icon-group@optima.cs.arizona.edu From: "Mark Evans" To: "Icon List" Subject: Modula 3 Date: Sat, 24 Apr 1999 14:14:26 -0500 X-Priority: 3 (Normal) X-MSMail-Priority: Normal Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO How does Icon compare to Modula-3? The following blurb about Modula-3 sounds a lot like the blurbs for Icon. ftp://ftp.gte.com/pub/m3/linux-journal.html Having never used this language, I am curious what Icon users think. Mark From icon-group-sender Mon Apr 26 12:29:22 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id MAA16763 for icon-group-addresses; Mon, 26 Apr 1999 12:27:44 -0700 (MST) Message-Id: <199904261927.MAA16763@baskerville.CS.Arizona.EDU> Delivered-To: icon-group@cs.arizona.edu From: eka@corp.cirrus.com (Eka Laiman) Subject: Re: Modula 3 To: evans@gte.net (Mark Evans) Date: Mon, 26 Apr 1999 09:51:54 -0700 (PDT) Cc: icon-group@optima.CS.Arizona.EDU Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Mark Evans wrote: > How does Icon compare to Modula-3? The following blurb about > Modula-3 sounds a lot like the blurbs for Icon. > > ftp://ftp.gte.com/pub/m3/linux-journal.html > > Having never used this language, I am curious what Icon users think. >From what I remember Modula-3 was designed by Niklaus Wirth (the originator of Pascal) in connection with Oberon. The "philosophy" of the language is totally different from that of icon. The root of Modula-3 lies in Pascal and hence the great resemblance of the language to its predecessor, especially in syntax. Modula-2 and Modula-3 support the concept of "object oriented" programming and hence also modules. The origin of icon lies in snobol which was originally intended for string manipulation. What differentiates snobol from other languages of its time was the many non-conventional operations which it provides, especially in pattern matching. I believe icon inherits its scanning operations from snobol. -eka- From icon-group-sender Mon Apr 26 16:25:09 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id QAA08221 for icon-group-addresses; Mon, 26 Apr 1999 16:23:08 -0700 (MST) Message-Id: <199904262323.QAA08221@baskerville.CS.Arizona.EDU> Delivered-To: icon-group@cs.arizona.edu From: "Mark Evans" To: Subject: RE: Modula 3 Date: Mon, 26 Apr 1999 15:48:12 -0500 X-Priority: 3 (Normal) X-MSMail-Priority: Normal Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO -----Original Message----- R. Clayton: I don't think they're comparable. [...lots of theoretical points, then...] Icon and Modula-3 are two of my favorite languages; I spend most of my time programming Icon (my thesis work, for example). -------------------------- Eka Laiman: The "philosophy" of the language is totally different from that of icon. -------------------------- Both these answers give theory. I already know that Icon came out of SNOBOL, and Modula-3 out of Pascal. So what? A lot of people think that man evolved from a very lucky primordial amoeba, but what does that say about the utility either of man or amoebas? Not much. My question was about practical field experience from people who have used both Icon and Modula-3 in the field, for real projects. Let's assume a hypothetical scenario in which you tried to develop the same program under Icon and Modula-3 simultaneously. How would your experience turn out? Part of the reason for asking this question is that the Icon Project is now growing many different branches. Count them all: Jcon, Godiva, Unicon, Icon-2 (and now, Ray Pereda is heading off to Microsoft with dollar signs in his eyes). So evidently, a lot of important Icon people admit that Icon must evolve into something else, otherwise it will remain a toy language. (It is still useful for system scripts.) Modula 3 is supposed to be capable of handling vast software systems without all the header file nightmares of C++. It is supposed to capture essentially all the good and "proven" features of modern software compiler design practice, without all the bad stuff (but still allowing for low-level machine access as required, in controlled interfaces). Whether it was based on Pascal or BASIC or FORTRAN or C or Ada does not answer the question of the Modula-3 language's practical utility as it exists today, in comparison to Icon. The blurbs for Icon make a lot of similar claims. Modula-3 has some GUI stuff but it looks to me like it's not very full-fledged -- rather like the situation with Icon. The blurbs I have read from the Modula-3 home page indicate that some groups of experienced C++ programmers never looked back after using Modula-3. That is exactly the experience I had with Icon as far as string processing in C. I don't know how I would feel about Modula-3 because I have never used it. Maybe another way to ask my question is this: if Icon evolves, should it evolve in the direction of Modula-3? Even partly? Mark From icon-group-sender Mon Apr 26 16:27:53 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id QAA08406 for icon-group-addresses; Mon, 26 Apr 1999 16:27:38 -0700 (MST) Message-Id: <199904262327.QAA08406@baskerville.CS.Arizona.EDU> Delivered-To: icon-group@cs.arizona.edu Date: Tue, 27 Apr 1999 10:34:31 +1200 (NZST) From: "Richard A. O'Keefe" To: evans@gte.net, icon-group@optima.CS.Arizona.EDU Subject: Re: Modula 3 Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Mark Evans asked: How does Icon compare to Modula-3? Modula-3 is basically an OO revision of Modula-2. It also supports concurrency. There is nothing exciting about its treatment of strings. Unlike C++ but like Eiffel, it does have fully automatic storage management; unlike Eiffel there are documented ways to safely bypass this (there are checked pointers and unchecked pointers). Syntax apart, its closest relatives might be Limbo and Object Pascal. Like its ancestors, it relies on strong static type checking. Icon uses dynamic type checking, not static type checking. Icon supports string matching via its fundamental support for backtracking execution, something Modula-3 entirely lacks. There is no direct OO support in Icon, although there is an OO preprocessor Idol for it. Aside from their common Algol-family heritage, and their common reliance on fully automatic storage management, the two languages have very little in common. From icon-group-sender Wed Apr 28 08:12:12 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id IAA14990 for icon-group-addresses; Wed, 28 Apr 1999 08:09:01 -0700 (MST) Message-Id: <199904281509.IAA14990@baskerville.CS.Arizona.EDU> Delivered-To: icon-group@cs.arizona.edu Date: Wed, 28 Apr 1999 11:41:00 +1200 (NZST) From: "Richard A. O'Keefe" To: evans@gte.net, icon-group@optima.CS.Arizona.EDU Subject: RE: Modula 3 Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Modula 3 is supposed to be capable of handling vast software systems without all the header file nightmares of C++. It is supposed to capture essentially all the good and "proven" features of modern software compiler design practice, without all the bad stuff (but still allowing for low-level machine access as required, in controlled interfaces). Whether it was based on Pascal or BASIC or FORTRAN or C or Ada does not answer the question of the Modula-3 language's practical utility as it exists today, in comparison to Icon. The blurbs for Icon make a lot of similar claims. You can think of Modula 3 as a poor man's Ada 95 PLUS required garbage collection PLUS a GUI kit of its own instead of Ada's X and Windows bindings. Modula-3 should give you pretty good performance, but probably won't match Ada or SmallEiffel. If only Ada 95 systems all had garbage collection (instead of only some of them) I don't know why anyone would use Modula-3. The blurbs I have read from the Modula-3 home page indicate that some groups of experienced C++ programmers never looked back after using Modula-3. That's largely because C++ is uniquely horrible. "Header file nightmares" are confined to C-like languages; Simula 67 had full typesafe separate compilation without any of that nonsense back in the late 60s. If you want a decent OO language with generics, Eiffel and Sather deserve as much consideration as Modula-3, and Eiffel has multiple implementations. Maybe another way to ask my question is this: if Icon evolves, should it evolve in the direction of Modula-3? Even partly? It couldn't, not without changing its character so much as to be unrecognisable. Icon *could* evolve in the direction of ISETL, Pop-11, or Lisp without losing too much; indeed, if you get Jeff Siskind's SCREAMER package for Lisp, you end up with a rather more powerful language than Icon but in much the same spirit. (To start with, the Common Lisp Object System is the most powerful in existence, far beyond anything Modula-3 can muster.) You could *possibly* bolt some kind of Haskell-like type system on top of Icon and still salvage much of the language (there's an interesting M.Sc. topic), but not a Modula-3-like type system, and it's only a little exaggeration to say that the type system _is_ Modula-3. From icon-group-sender Wed Apr 28 12:33:24 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id MAA28778 for icon-group-addresses; Wed, 28 Apr 1999 12:32:08 -0700 (MST) Message-Id: <199904281932.MAA28778@baskerville.CS.Arizona.EDU> Delivered-To: icon-group@cs.arizona.edu From: "Mark Evans" To: Subject: RE: Modula 3 Date: Wed, 28 Apr 1999 10:34:18 -0500 X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 Importance: Normal Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO To reiterate, I asked for a utility comparison of Modula-3 with Icon, not with all the other languages in the world: "My question was about practical field experience from people who have used both Icon and Modula-3 in the field, for real projects." You say "pretty good performance" but your comments are relative to languages other than Icon. What is the performance relative to Icon? How does the GUI Kit for Modula 3 compare to the GUI Kit for Icon? How easy is it to code Modula 3 vs. Icon? Etc. As far as the evolution of Icon -- Icon is by its own admission a small language, and I daresay that its main features (string parsing, goal-direction) could be incorporated into other languages wholesale. The impetus for this line of questioning is the notion that Icon is not good for large-scale projects, whereas Modula-3 claims that's what it was made for. Mark -----Original Message----- From: icon-group-sender@CS.Arizona.EDU [mailto:icon-group-sender@CS.Arizona.EDU]On Behalf Of Richard A. O'Keefe Sent: Tuesday, April 27, 1999 6:41 PM To: evans@gte.net; icon-group@CS.Arizona.EDU Subject: RE: Modula 3 Modula 3 is supposed to be capable of handling vast software systems without all the header file nightmares of C++. It is supposed to capture essentially all the good and "proven" features of modern software compiler design practice, without all the bad stuff (but still allowing for low-level machine access as required, in controlled interfaces). Whether it was based on Pascal or BASIC or FORTRAN or C or Ada does not answer the question of the Modula-3 language's practical utility as it exists today, in comparison to Icon. The blurbs for Icon make a lot of similar claims. You can think of Modula 3 as a poor man's Ada 95 PLUS required garbage collection PLUS a GUI kit of its own instead of Ada's X and Windows bindings. Modula-3 should give you pretty good performance, but probably won't match Ada or SmallEiffel. If only Ada 95 systems all had garbage collection (instead of only some of them) I don't know why anyone would use Modula-3. The blurbs I have read from the Modula-3 home page indicate that some groups of experienced C++ programmers never looked back after using Modula-3. That's largely because C++ is uniquely horrible. "Header file nightmares" are confined to C-like languages; Simula 67 had full typesafe separate compilation without any of that nonsense back in the late 60s. If you want a decent OO language with generics, Eiffel and Sather deserve as much consideration as Modula-3, and Eiffel has multiple implementations. Maybe another way to ask my question is this: if Icon evolves, should it evolve in the direction of Modula-3? Even partly? It couldn't, not without changing its character so much as to be unrecognisable. Icon *could* evolve in the direction of ISETL, Pop-11, or Lisp without losing too much; indeed, if you get Jeff Siskind's SCREAMER package for Lisp, you end up with a rather more powerful language than Icon but in much the same spirit. (To start with, the Common Lisp Object System is the most powerful in existence, far beyond anything Modula-3 can muster.) You could *possibly* bolt some kind of Haskell-like type system on top of Icon and still salvage much of the language (there's an interesting M.Sc. topic), but not a Modula-3-like type system, and it's only a little exaggeration to say that the type system _is_ Modula-3. From icon-group-sender Tue May 4 15:02:32 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id OAA23035 for icon-group-addresses; Tue, 4 May 1999 14:58:09 -0700 (MST) Message-Id: <199905042158.OAA23035@baskerville.CS.Arizona.EDU> Delivered-To: icon-group@cs.arizona.edu To: icon-group@optima.CS.Arizona.EDU Date: 4 May 1999 13:45:16 -0500 From: msglass@MCS.COM (Michael Glass) Subject: Digit Sort Worst Algorithm Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO I just read the article on the digit sort problem in April _Icon Analyst_. I apologize for posting solution #17 sans explanation. I was having fun trying to write a DIFFERENT (not BETTER) solution. I knew it was awful and should have said something. The algorithm is O(n^4). It works (conceptually) like this: # Let D[1] ... D[n] be an array of digits called by value procedure P(D) if there exist i,j such that D[i] and D[j] are out of order then return P(D with the i and j digits swapped) else return D Since finding two digits to swap is O(n^2), and this thing calls itself up to O(n^2) times, the worst case performance is O(n^4). In words, it is imitating something like an exchange or bubble sort. The difference is that after every swap, the indices START AGAIN FROM THE BEGINNING looking for new elements to swap. So finding the NEXT pair of elements to swap is O(n^2). A non-recursive version would look like this: for j := 2 to n for i := 1 to j-1 if D[i] > D[j] then { swap D[i] and D[j] i := 1 # The recursive call forces j := 1 # the indices to start at the beginning } Digits are swapped by arithmetic. Suppose you have 7830 and you want to swap the 7 with the the 3. The difference 7 - 3 = 4, so you can subtract 4000 (converting 7000 to 3000) and add 40 (converting 30 to 70): 7830 - 4000 + 40 = 3870 This is accomplished in the usual way of raising 10 to the powers of digit positions. Further inefficiency comes from the fact that the sort is performed on a string of digits and the arithmetic is performed on the number. Since the base representation is the number, the number-to-string conversion is really overdone. By the way, I thought there was a kind of sick beauty in using goal-directed evaluation and tail recursion to produce a two line sort. Probably it comes from having taught the undergraduate algorithms class a few times. You start finding beauty in the darndest algorithms, even if they take the worst performance in the book and square it. But there was someting about 25 days of compute time that really took the shine off of it. -- Michael Glass From icon-group-sender Fri May 14 17:23:57 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id RAA18471 for icon-group-addresses; Fri, 14 May 1999 17:21:09 -0700 (MST) Message-Id: <199905150021.RAA18471@baskerville.CS.Arizona.EDU> Delivered-To: icon-group@silliac.cs.arizona.edu Date: Fri, 14 May 1999 15:31:53 -0400 From: "Steve Graham" To: Subject: Activity on List Content-Disposition: inline X-MIME-Autoconverted: from quoted-printable to 8bit by baskerville.CS.Arizona.EDU id MAA00880 Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Just subscribed to the list. Is it still active? Steve Graham _______________________________________________________ Steve Graham Laboratory Corporation of America (LabCorp) 12160 Abrams Road, Suite 601 Dallas, Texas 75243 E-mail: grahams@labcorp.com Phone: 972.643.6124 (direct to desk) 972.437.5255 ext 5224 FAX: 972.454.1040 _______________________________________________________ From icon-group-sender Mon May 17 09:23:00 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id JAA08541 for icon-group-addresses; Mon, 17 May 1999 09:19:48 -0700 (MST) Message-Id: <199905171619.JAA08541@baskerville.CS.Arizona.EDU> Delivered-To: icon-group@silliac.cs.arizona.edu From: Bob Ardler To: Date: Sat, 15 May 1999 09:57:18 +0100 Subject: Re: Activity on List User-Agent: Pluto/1.11k (RISC-OS/3.6) Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Steve Graham wrote: > Just subscribed to the list. Is it still active? You have to ask them a question (draw a pentacle on the floor first) and they enter omni(except RiscOS)scient mode. -- Bob Ardler, ardler@argonet.co.uk From icon-group-sender Mon May 17 09:24:55 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id JAA08672 for icon-group-addresses; Mon, 17 May 1999 09:23:11 -0700 (MST) Message-Id: <199905171623.JAA08672@baskerville.CS.Arizona.EDU> Delivered-To: icon-group@silliac.cs.arizona.edu X-Sender: memphis@popmail.macconnect.com Date: Sat, 15 May 1999 10:06:57 -0500 To: "Steve Graham" , From: Garry Subject: Re: Activity on List Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO At 15:31 -0400 1999-05-14, Steve Graham wrote: >Just subscribed to the list. Is it still active? Yes. And this is MY first message -- Has anyone written a C preprocessor in Icon, or can you point me to a starting place for finding Icon code for a C compiler and/or preprocessor. By the way, I suppose many have had this experience but as I read the Icon Programming Language book I find myself over and over exclaiming "Now that makes sense... what a great design... Oh good!" I'm using Icon 9.0 with MacOS under the MPW Shell. Over the past week I have been realizing that this is probably the most powerful language in my (small) repetoire. I would love to see how it has been used for writing an actual compiler... Thanks, to everyone who have created Icon. -- Garry -- Garry Roseman Tech Writer & Freelance Programmer Memphis, TN USA From icon-group-sender Tue May 18 13:03:55 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id NAA07251 for icon-group-addresses; Tue, 18 May 1999 13:00:38 -0700 (MST) Message-Id: <199905182000.NAA07251@baskerville.CS.Arizona.EDU> Delivered-To: icon-group@silliac.cs.arizona.edu From: dgamey@ca.ibm.com X-Lotus-FromDomain: IBMCA@IBMUS To: icon-group@optima.CS.Arizona.EDU Date: Tue, 18 May 1999 12:32:23 -0400 Subject: Y2k and Icon? Content-Disposition: inline Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Hi, I haven't seen anything on Icon's Y2K readiness. Did I miss it? What's the status? I expect I'll have to check all of my IPL contributions, is there a target date for this kind of activity? David From icon-group-sender Wed May 19 13:10:20 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id NAA29978 for icon-group-addresses; Wed, 19 May 1999 13:05:06 -0700 (MST) Message-Id: <199905192005.NAA29978@baskerville.CS.Arizona.EDU> Delivered-To: icon-group@silliac.cs.arizona.edu To: icon-group@optima.CS.Arizona.EDU Date: Tue, 18 May 1999 09:42:43 +1000 From: brennie Subject: Re: Activity on List Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Steve Graham wrote: > > Just subscribed to the list. Is it still active? > > Steve Graham > > _______________________________________________________ > > Steve Graham > Laboratory Corporation of America (LabCorp) > 12160 Abrams Road, Suite 601 > Dallas, Texas 75243 > > E-mail: grahams@labcorp.com > Phone: 972.643.6124 (direct to desk) > 972.437.5255 ext 5224 > FAX: 972.454.1040 > _______________________________________________________ Yes, But not real busy. -- Bruce Rennie ( from God's Own Country Downunder ) Disciple of Jesus Christ in Training Song of Solomon ( Song of Songs ) - The greatest Love Story Ever and a story for our times. Be a GOD Chaser. From icon-group-sender Fri May 21 14:00:03 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id NAA03312 for icon-group-addresses; Fri, 21 May 1999 13:56:35 -0700 (MST) Message-Id: <199905212056.NAA03312@baskerville.CS.Arizona.EDU> Delivered-To: icon-group@silliac.cs.arizona.edu Date: Thu, 20 May 1999 17:07:25 -0700 From: Steve Wampler X-Accept-Language: en To: icon-group@optima.CS.Arizona.EDU Subject: Icon work? Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO My eldest is about to head off to college, in an apparently successful attempt at creating a sinkhole into which I'm to pour large amounts of money. To help feed the sinkhole, I'm asking if any of you have any Icon projects that you'd like some (mercenary) help on. If you do, let me know and we can talk. --- Steve Wampler {sbw@tapestry.tucson.az.us} The gods that smiled upon your birth are laughing now. -- fortune cookie From icon-group-sender Mon May 24 08:34:17 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id IAA23951 for icon-group-addresses; Mon, 24 May 1999 08:31:33 -0700 (MST) Message-Id: <199905241531.IAA23951@baskerville.CS.Arizona.EDU> Delivered-To: icon-group@silliac.cs.arizona.edu To: icon-group@optima.CS.Arizona.EDU Date: Mon, 24 May 1999 09:50:31 +1100 From: spierings Subject: CodeWarrior, Mac and Icon Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO I'm trying to compile Icon for Macintosh in CodeWarrior. Anybody want to help me, or has had any luck doing so? Thanks, Andre From icon-group-sender Thu May 27 16:38:21 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id QAA28539 for icon-group-addresses; Thu, 27 May 1999 16:35:18 -0700 (MST) Message-Id: <199905272335.QAA28539@baskerville.CS.Arizona.EDU> Delivered-To: icon-group@silliac.cs.arizona.edu To: icon-group@optima.CS.Arizona.EDU Date: 27 May 1999 14:40:58 -0700 From: collberg@optima.CS.Arizona.EDU (Christian S. Collberg) Subject: Icon cgi interface? Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Is there an Icon package for parsing cgi headers? Thanks! Christian From icon-group-sender Thu May 27 16:45:12 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id QAA28732 for icon-group-addresses; Thu, 27 May 1999 16:43:28 -0700 (MST) Message-Id: <199905272343.QAA28732@baskerville.CS.Arizona.EDU> Delivered-To: icon-group@silliac.cs.arizona.edu To: icon-group@optima.CS.Arizona.EDU Date: 27 May 1999 12:00:21 -1000 From: Robert Valliant Subject: Re: Icon cgi interface? Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Indeed there is .. called cgi-icn I use it on my web site. -- Robert Valliant Center for Russia in Asia, University of Hawaii at Manoa www.hawaii.edu/shaps/russia valliant@hawaii.edu Fax: 808.956.2682 Tel: 808.956.7814 From icon-group-sender Sat May 29 15:29:09 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id PAA02037 for icon-group-addresses; Sat, 29 May 1999 15:26:28 -0700 (MST) Message-Id: <199905292226.PAA02037@baskerville.CS.Arizona.EDU> Delivered-To: icon-group@silliac.cs.arizona.edu Content-Identifier: Holiday Item Hop-Count: 1 Date: Fri, 28 May 1999 12:27 -0500 From: Chris D Tenaglia Subject: Holiday Item To: icon-group@optima.CS.Arizona.EDU Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Well Memorial Day is nigh upon us. Once upon a time I wrote an icon tik tak toe game that wins! It uses a trick difficult for many computers, it cheats ;-). I was trying to write your typical run of the mill game, when an imperceptable program error, a side effect of untyped variables, generated a cheating game. It's so stinky, you can't see the cheating logic. It's a side effect. I fixed the problem in one version, but still kept the cheat because I think it has interesting educational possibilities. I thought it reminded me of my manager at a previous position. No matter how close you come to winning, you still loose. And you thought you could at least stalemate? Well sometimes, maybe. And it's well nigh impossible to prove there's anything amiss until it's too late..... Now it's the WEB age. I wanted to port it to CGI. The cheat, being a software side effect, was impossible to translate into the web paradigm. The harder I tried, the CGI became all HTML. Check out http://www.execpc.com/~cdt/tttc.html The web just shows, it doesn't decide. The web tik tak toe is alas just a document. It lays there, and does nothing. The plays are an illusion. Well I guess that's neat and theoretical in it's own way. If you're interested in the cgi version, check out http://www.execpc.com/~cdt/tik.html which has some view/downloadables. If interested in the cheating tiktaktoe game that runs under unix with a VT terminal/emulation just ask and I'll post it too. The source is a little long. Have a nice holiday! Chris Tenaglia, technical analyst, Johnson Controls From icon-group-sender Tue Jun 1 15:20:02 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id PAA02413 for icon-group-addresses; Tue, 1 Jun 1999 15:18:40 -0700 (MST) Message-Id: <199906012218.PAA02413@baskerville.CS.Arizona.EDU> Delivered-To: icon-group@silliac.cs.arizona.edu From: Art Eschenlauer To: icon-group@optima.CS.Arizona.EDU Subject: Jcon on windows NT? anybody running it on that platform? Date: Tue, 1 Jun 1999 13:23:27 -0500 Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO I see from the webpage http://www.cs.arizona.edu/icon/jcon/ that Jcon requires Unix and the Korn shell, Icon 9.3 and Java 1.1. I am wondering if anyone has done the work to port Jcon to a Windows NT platform so that one can run an executable on Windows NT to translate Icon programs into Java classes, and, if so, what they did to achieve that feat. Thank you. From icon-group-sender Thu Jun 3 16:45:03 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id QAA28313 for icon-group-addresses; Thu, 3 Jun 1999 16:43:49 -0700 (MST) Message-Id: <199906032343.QAA28313@baskerville.CS.Arizona.EDU> Delivered-To: icon-group@silliac.cs.arizona.edu Date: Thu, 03 Jun 1999 16:59:34 -0500 From: de yang To: icon-group@optima.CS.Arizona.EDU Subject: Find the longest matching substrings Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Dear Sirs, I am working on a project that will mark the inserted or deleted phases between two strings. I am wondering whether you know any library procedure that will anchor ( or report ) the longest phases that exists in both strings. For example, assume that we have two strings: old:="other strings ab cd e and more substrings" new:="some more substrings ab cd ab cd e" This function should return phases and position in both strings, i.e. [15, 28, "ab cd e"] for "ab cd e" is the longest phase that matched ( it has three continuous matching elements ). Thanks, De Yang Lucent Technologies Inc. deyang@lucent.com From icon-group-sender Fri Jun 4 08:01:40 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id IAA19355 for icon-group-addresses; Fri, 4 Jun 1999 08:01:01 -0700 (MST) Message-Id: <199906041501.IAA19355@baskerville.CS.Arizona.EDU> Delivered-To: icon-group@silliac.cs.arizona.edu From: swampler@noao.edu (Steve Wampler) Date: Thu, 3 Jun 1999 21:17:38 MST To: icon-group@optima.CS.Arizona.EDU Subject: Re: Find the longest matching substrings Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO On Jun 3 at 4:59pm, de yang writes: } Dear Sirs, } } I am working on a project that will mark the inserted or deleted phases } between two strings. I am wondering whether you know any library } procedure that will anchor ( or report ) the longest phases that exists } in both strings. } } For example, assume that we have two strings: } old:="other strings ab cd e and more substrings" } new:="some more substrings ab cd ab cd e" } } This function should return phases and position in both strings, i.e. } [15, 28, "ab cd e"] for "ab cd e" is the longest phase that matched ( } it has three continuous matching elements ). I've send a solution to De Yang, but it occurred to me that others might like to see it (and improve on it - it's a bit, uh, ugly). This solutions makes two assumptions: (1) There is a simple definition for what a phrase element is (in fact, it assumes an element is a sequence of letters!) (2) Punctuation should be considered when matching phrases, so "that that is is that that is not is not" and "that that is, is. that that is not, is not." do not match each other (instead, the longest common phrase in this case is "that that is not") I have another solution that drops assumption 2, if any one is interested. Anyway, here's a solution, plus a simple test driver... ----- procedure main(args) if result := longPhrase(read(),read()) then write("[",result[1],",",result[2],",\"",result[3],"\"]") end # Find longest phrase common to s1 and s2. Fails if no common phrase. # # Assumes simple definition for a phrase (sequence of letters) # Assumes punctuation is to be considered when matching phrases # procedure longPhrase(s1,s2) static pChars initial pChars := &letters # chars legal in phrase element maxlen := 0 every j := findPhrase(s1[ (i := pStart(s1,pChars)) : (k := rpStop(s1,pChars)) ], s2, pChars) do { if maxlen <:= numPhrases(s1[i:k], pChars) then { write(s1[i:k]) saveStart1 := i saveStop1 := k saveStart2 := j } } return [\saveStart1, saveStart2, s1[saveStart1:saveStop1]] end procedure pStart(s, pc) # generate start of all phrases in s s ? { while tab(i := upto(pc)) do { tab(many(pc)) suspend i } } end procedure rpStop(s, pc) # generates end of all phrases in s, # starting from right of string suspend *s+2 - pStart(reverse(s), pc) end procedure numPhrases(s, pc) # Count number of phrases in s local count count := 0 every pStart(s,pc) do count +:= 1 return count end procedure findPhrase(p, s, pc) # find phrase p in s s ? { while tab(i := upto(pc)) do { if match(p) then suspend i tab(many(pc)) } } end -- -- Steve Wampler- SOLIS Project, National Solar Observatory swampler@noao.edu From icon-group-sender Fri Jun 4 08:03:30 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id IAA19581 for icon-group-addresses; Fri, 4 Jun 1999 08:03:22 -0700 (MST) Message-Id: <199906041503.IAA19581@baskerville.CS.Arizona.EDU> Delivered-To: icon-group@silliac.cs.arizona.edu Date: Fri, 4 Jun 99 00:51:50 -0500 (CDT) From: gep2@terabites.com Subject: Find the longest matching substrings To: icon-group@optima.CS.Arizona.EDU Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO > I am working on a project that will mark the inserted or deleted phases between two strings. I am wondering whether you know any library procedure that will anchor ( or report ) the longest phases that exists in both strings. I'm not aware of any such ready-made routine, although certainly "longest common substring" logic is frequently (and heavily!) used in file compression software (PKZIP for example). > For example, assume that we have two strings: old:="other strings ab cd e and more substrings" new:="some more substrings ab cd ab cd e" > This function should return phases and position in both strings, i.e. [15, 28, "ab cd e"] for "ab cd e" is the longest phase that matched ( it has three continuous matching elements ). Intriguing that you consider the "three matching elements" phrase (only seven characters) 'longer' than the sixteen-character common phrase " more substrings". I guess the criteria here could be most anything you want to make it, but still... :-) Generally the logic to do stuff like this (in good programs, anyhow) is coded at very low levels using very heavily optimized code... since it tends to be very, very compute-intensive (this is especially true as the two strings get longer). Of course, the problem's solution might be VERY different depending on whether you're looking for something that's "elegant" in terms of the source code, versus something that's FAST, versus something that is storage-efficient, or something else. (The rule about what substring is 'longer' also is going to have an effect too!). If I were going to try to make something like this FAST (and especially if one of the strings were relatively constant) I'd probably want to use a hash (or even direct index?) table pre-computed with the offsets of character substrings (I'd probably use two-character adjacent pairs) in one of those strings; this would enable stepping rapidly through the second string and quickly finding at least (only just the) plausible candidates for launching more detailed substring compare (and length computation) operations. This kind of thing would likely be storage-hungry, but that's less of a concern today than it once was. Gordon Peterson http://web2.airmail.net/gep2/ Support the Anti-SPAM Amendment! Join at http://www.cauce.org/ 12/19/98: the day the Conservatives demonstrated their scorn for their fraudulent sham of representative government. Voters, remember it! From icon-group-sender Fri Jun 4 14:45:35 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id OAA03881 for icon-group-addresses; Fri, 4 Jun 1999 14:41:55 -0700 (MST) Message-Id: <199906042141.OAA03881@baskerville.CS.Arizona.EDU> Delivered-To: icon-group@silliac.cs.arizona.edu Date: Fri, 04 Jun 1999 09:09:29 -0700 From: Steve Wampler X-Accept-Language: en To: icon-group@optima.CS.Arizona.EDU Subject: Re: Find the longest matching substrings Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO This is a multi-part message in MIME format. --------------09EB4280837648B91A00FBDF Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit gep2@terabites.com wrote: > > > I am working on a project that will mark the inserted or deleted phases > between two strings. I am wondering whether you know any library > procedure that will anchor ( or report ) the longest phases that exists > in both strings. > > > For example, assume that we have two strings: > old:="other strings ab cd e and more substrings" > new:="some more substrings ab cd ab cd e" > > > This function should return phases and position in both strings, i.e. > [15, 28, "ab cd e"] for "ab cd e" is the longest phase that matched ( > it has three continuous matching elements ). > > If I were going to try to make something like this FAST (and especially if one > of the strings were relatively constant) I'd probably want to use a hash (or > even direct index?) table pre-computed with the offsets of character substrings > (I'd probably use two-character adjacent pairs) in one of those strings; this > would enable stepping rapidly through the second string and quickly finding at > least (only just the) plausible candidates for launching more detailed substring > compare (and length computation) operations. This kind of thing would likely be > storage-hungry, but that's less of a concern today than it once was. Taking Gordon's comment on speed to heart, here's an adaptation of the previous solution that is faster (uses simple heuristics to avoid looking at phrases that can't possibly be longer than ones that are found already). Note that it can probably be sped up even more by improving these heuristics a bit. This version is about 2.5x faster on my test case (the "that that is..." nonsense). Applying this adaptation to my solution that ignores punctuation when comparing phrases results in a speedup of about 25x! (Because the test case strings match each other when ignoring punctuation.) Oh, I also modified the test driver to do time comparisions. Incidently, it would be 'better' if the phrase element procedures were converted into string scanning procedures. Scanning strings for phrase elements sounds useful to me and can considered as a generalization of scanning strings for characters - in fact, the code here is just an adaptation of code to find the longest common substring. It would also be better if the code were rewritten to accept different definitions of a phrase element more easily! -- Steve Wampler- SOLIS Project, National Solar Observatory swampler@noao.edu --------------09EB4280837648B91A00FBDF Content-Type: text/plain; charset=us-ascii; name="phrase3.icn" Content-Disposition: inline; filename="phrase3.icn" Content-Transfer-Encoding: 7bit procedure main(args) n := args[1]|10 start := &time every 1 to n do { result := longPhrase(read(),read()) } len := &time - start write("[",result[1],",",result[2],",\"",result[3],"\"]") write(real(len)/n,"ms per loop for ",n," loops") end # Find longest phrase common to s1 and s2. Fails if no common phrase. # # Assumes simple definition for a phrase (sequence of letters) # Assumes punctuation is to be considered when matching phrases # procedure longPhrase(s1,s2) static pChars initial pChars := &letters # chars legal in phrase element maxlen := 0 every i := pStart(s1, pChars) do { every k := rpStop(s1, i, pChars) do { if j := findPhrase(s1[i:k], s2, pChars) then { if maxlen <:= numPhrases(s1[i:k], pChars) then { saveStart1 := i saveStop1 := k saveStart2 := j } break # no need to find shorter phrases } # that start here } } return [\saveStart1, saveStart2, s1[saveStart1:saveStop1]] end procedure pStart(s, pc) # generate start of all phrases in s local i s ? { while tab(i := upto(pc)) do { tab(many(pc)) suspend i } } end procedure rpStop(s, i, pc) # generates end of all phrases in s, # starting from right of string suspend *s+2 - pStart(reverse(s[i:0]), pc) end procedure numPhrases(s, pc) # Count number of phrases in s local count count := 0 every pStart(s,pc) do count +:= 1 return count end procedure findPhrase(p, s, pc) # find phrase p in s local i s ? { while tab(i := upto(pc)) do { if match(p) then suspend i tab(many(pc)) } } end --------------09EB4280837648B91A00FBDF-- From icon-group-sender Fri Jun 4 16:27:05 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id QAA11368 for icon-group-addresses; Fri, 4 Jun 1999 16:26:34 -0700 (MST) Message-Id: <199906042326.QAA11368@baskerville.CS.Arizona.EDU> Delivered-To: icon-group@silliac.cs.arizona.edu To: icon-group@optima.CS.Arizona.EDU Date: 4 Jun 1999 22:45:41 GMT From: guy@orion.math.tau.ac.il (Guy Laden) Subject: parsing java .class files Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Hi all, does anybody have an icon library for reading java .class files that they are willing to share? (Jcon seems to come with one for writing .class files, not reading) thanks, guy From icon-group-sender Mon Jun 7 09:33:19 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id JAA23335 for icon-group-addresses; Mon, 7 Jun 1999 09:31:20 -0700 (MST) Message-Id: <199906071631.JAA23335@baskerville.CS.Arizona.EDU> Delivered-To: icon-group@silliac.cs.arizona.edu Date: Sat, 05 Jun 1999 14:42:52 -0500 From: "Charles Hethcoat" To: icon-group@optima.CS.Arizona.EDU Subject: File Translators in Icon Content-Disposition: inline X-MIME-Autoconverted: from quoted-printable to 8bit by baskerville.CS.Arizona.EDU id MAA04406 Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO There always seems to be a nagging need to be able to translate between different application file formats. The problem is that many of these file formats are incredibly complex. I recently had the humbling experience of reviewing the definitions of MS Word 97 and RTF formats. My idea was that it couldn't be so hard to write code to read or write these formats. My hopes were dashed pretty quickly! Here is an assortment of converters I have wished for recently LaTeX to RTF: A C version exists, but it hasn't worked for me yet. (Gives me nonsense RTF.) I think it requires considerable amounts of customization. LaTeX to Word 95/97: Haven't found one that seems worth the effort. VRML to Encapsulated PostScript (EPS): We use Pro/Engineer, which generates pretty good VRML. The idea is to select your view, then generate a "still" for technical publication (preferably in B&W vector line art format). The viewers I have seen will dump various raster formats, but there is no logical reason why a vector projection to the screen can't also be mapped to PostScript. IGES to EPS. (BTW, an IGES reader/checker/viewer would be very handy for troubleshooting this error-prone format. A couple of commercial viewers exist, but they are expensive and don't make EPS.) Mathcad to LaTeX. The problem here is updating engineering reports with new data and re-evaluating all the formulas. Mathcad is good at dynamically updating the math, but crappy at typesetting and page layout; LaTeX is the opposite. How to get the benefits of both? If anyone has code (or pointers thereto), I would like to know about it. I also would be interested in knowing if any of the above-mentioned conversion tools would be of interest to any of you. If there were some demand, I might be persuaded to go to work on one of them. Charles Hethcoat From icon-group-sender Mon Jun 7 09:37:14 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id JAA23547 for icon-group-addresses; Mon, 7 Jun 1999 09:37:04 -0700 (MST) Message-Id: <199906071637.JAA23547@baskerville.CS.Arizona.EDU> Delivered-To: icon-group@silliac.cs.arizona.edu From: Art Eschenlauer To: "'guy@orion.math.tau.ac.il'" Cc: "'icon-group@optima.CS.Arizona.EDU'" Subject: RE: parsing java .class files Date: Mon, 7 Jun 1999 10:27:01 -0500 Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Why not use a java decompiler? I use JAD.EXE for Win NT/9x. It is a fast, slick, one file, no-messing-with-the-registry C++ program that converts .class files into .java files. It can even convert .jars into the a java source tree. You can find out more at http://meurrens.ml.org/ip-Links/Java/CodeEngineering/jad15.html -----Original Message----- From: guy@orion.math.tau.ac.il [mailto:guy@orion.math.tau.ac.il] Sent: Friday, June 04, 1999 5:46 PM To: icon-group@optima.CS.Arizona.EDU Subject: parsing java .class files Hi all, does anybody have an icon library for reading java .class files that they are willing to share? (Jcon seems to come with one for writing .class files, not reading) thanks, guy From icon-group-sender Tue Jun 8 08:26:40 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id IAA08100 for icon-group-addresses; Tue, 8 Jun 1999 08:25:37 -0700 (MST) Message-Id: <199906081525.IAA08100@baskerville.CS.Arizona.EDU> Delivered-To: icon-group@silliac.cs.arizona.edu To: icon-group@optima.CS.Arizona.EDU Date: 7 Jun 1999 20:03:40 GMT From: guy@orion.math.tau.ac.il (Guy Laden) Subject: RE: parsing Java .class files Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO > Why not use a java decompiler? I plan to write some programs to analyze the bytecode: a decompiler won't help here. Guy From icon-group-sender Tue Jun 8 08:27:08 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id IAA08145 for icon-group-addresses; Tue, 8 Jun 1999 08:26:59 -0700 (MST) Message-Id: <199906081526.IAA08145@baskerville.CS.Arizona.EDU> Delivered-To: icon-group@silliac.cs.arizona.edu To: icon-group@optima.CS.Arizona.EDU Date: Tue, 08 Jun 1999 00:23:56 GMT From: cbbrowne@news.isp.giganews.com (Christopher Browne) Subject: Re: Find the longest matching substrings Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO On 4 Jun 1999 11:05:40 -0400, gep2@terabites.com wrote: >If I were going to try to make something like this FAST (and especially if one >of the strings were relatively constant) I'd probably want to use a hash (or >even direct index?) table pre-computed with the offsets of character substrings >(I'd probably use two-character adjacent pairs) in one of those strings; this >would enable stepping rapidly through the second string and quickly finding at >least (only just the) plausible candidates for launching more detailed substring >compare (and length computation) operations. This kind of thing would likely be >storage-hungry, but that's less of a concern today than it once was. Alternatively, treat the main string as a semi-infinite string (si-string), and insert pointers to each successive character of the si-string into a Patricia tree. Then do a tree walk to find the longest matches that were found. -- "Unlike computers, guns don't have Y2K problems..." cbbrowne@hex.net- From icon-group-sender Tue Jun 8 13:30:37 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id NAA20978 for icon-group-addresses; Tue, 8 Jun 1999 13:29:25 -0700 (MST) Message-Id: <199906082029.NAA20978@baskerville.CS.Arizona.EDU> Delivered-To: icon-group@silliac.cs.arizona.edu Date: Tue, 08 Jun 1999 13:38:25 -0500 From: "Charles Hethcoat" To: icon-group@optima.CS.Arizona.EDU Subject: Fwd: Re: File Translators in Icon Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO This is a MIME message. If you are reading this text, you may want to consider changing to a mail reader or gateway that understands how to properly handle MIME multipart messages. --=_4B1D2C2A.95F49ED1 Content-Type: text/plain; charset=US-ASCII Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Anonymous wrote: >Try Mathematica. I'd love to give it a whirl. If I could just get my PHB to spring the = long green for it. It's a little dear, and in that it conflicts with my = innate cheapskate tendencies. What the world needs here is a good 5c = cigar with a public license! >RTF is a monstrosity. Beyond doubt. >Compare the file sizes of RTF versus equivalent HTML or even Word. I found that out the hard way. One 30KB Word file grew to 650-odd KB when = exported to RTF. But you know, fter I learned a little bit about = PostScript, I understood why so many automatically-generated PS files are = also huge. They basically carry a lot of baggage in the form of stock = libraries of PS code that in many cases is not even used in a given = graphic! If you write your own and are careful, you can usually make it = _much_ smaller. A good example of a pretty efficient PS-generator is = gnuplot. I suspect the same thing happens with RTF. The files I have inspected = seem to contain, e.g. font data and other junk that has a lot of overhead. = Trouble is, I don't know enough about it to test that theory, and I'm not = sure it's worth doing in the end. Charles Hethcoat --=_4B1D2C2A.95F49ED1 Content-Type: message/rfc822 Received: from mail.replay.com ([194.109.9.44]) by hougwia1.oceaneering.com; Mon, 07 Jun 1999 13:11:40 -0500 Received: (from remailer@localhost) by mail.replay.com (8.9.2/8.9.2/Replay Associates LLP) id UAA18278; Mon, 7 Jun 1999 20:11:34 +0200 (CEST) Date: Mon, 7 Jun 1999 20:11:34 +0200 (CEST) Message-Id: <199906071811.UAA18278@mail.replay.com> From: Anonymous Comments: This message did not originate from the Sender address above. It was remailed automatically by anonymizing remailer software. Please report problems or inappropriate use to the remailer administrator at . Subject: Re: File Translators in Icon To: CHETHCOA@oss.oceaneering.com MIME-Version: 1.0 Try Mathematica. A new version just came out (v.4). It can handle all the math typesetting you want. Converts to EPS, HTML, TeX, etc. Imports/exports a variety of standard formats. There is an addon that lets you run Mathematica from within MS Word directly. http://www.wolfram.com/ RTF is a monstrosity. Compare the file sizes of RTF versus equivalent HTML or even Word. -----Original Message----- From: Charles Hethcoat [mailto:CHETHCOA@oss.oceaneering.com] Sent: Saturday, June 05, 1999 2:43 PM To: icon-group@optima.CS.Arizona.EDU Subject: File Translators in Icon There always seems to be a nagging need to be able to translate between different application file formats. --=_4B1D2C2A.95F49ED1-- From icon-group-sender Tue Jun 8 17:06:25 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id RAA00220 for icon-group-addresses; Tue, 8 Jun 1999 17:05:52 -0700 (MST) Message-Id: <199906090005.RAA00220@baskerville.CS.Arizona.EDU> Delivered-To: icon-group@silliac.cs.arizona.edu Date: Tue, 8 Jun 1999 15:41:22 -0500 (CDT) From: "John C. Paolillo" To: CHETHCOA@oss.oceaneering.com, icon-group@optima.CS.Arizona.EDU Subject: Re: Fwd: Re: File Translators in Icon Cc: john@ling.uta.edu Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO I don't know if this will help, but I once had reason to write the following Icon program to assist in typesetting Feature-Attribute matrices in MS Word. In MS Word for mac v 4.0 and 5.0, there is a family of mathematical typesetting formulas (listed unde "Formula" in the user manuals) which employ a special typesetting character (that turns out to be ASCII 006) as an escape character. The formulas are acceptably typeset (or they were for my purposes) but very cumbersome to type. I wrote this program to translate from a more transparent syntax into the form actually used by MS Word. As for newer versions of MS Word, I don't know if you can type the formula typesetting sequences directly (I couldn't figure out how to do it), but my files with the complex formulas in them that were created in MS Word v 4.0 still display correctly when converted. I haven't tried this in a long time, so I am not 100% certain if this is the best version. There are probably improvements that can be made to it at any rate. Some of the typesetting that is possible (e.g. integrals) are not implemented, but that could easily be added by referring to the appropriate pages in the Word manuals. The program was written to be used as a clipboard filter with the macintosh interpreter IClip. John C. Paolillo Program in Linguistics University of Texas at Arlington ########################################################################## # # This program parses a description of a attribute-value matrix using # ordinary ascii characters (using upper and lowercase letters for # feature values and labels, [] to delimit matrices, {} to delimit sets # and <> to delimit lists), and outputs a string of the appropriate # description, using MS Word's formula typesetting expressions. The # resulting string, when pasted into a Word document, will appear in # the correctly typeset form. For example, the following description # # [ [ this | is ] # [ an | example # of | typesetting] ] # # Will be typeset as below (ascii impression). # # +- -+ # | [ this | is ] | # | +- -+ | # | | an | example | | # | | of | typesetting | | # | +- -+ | # +- -+ # # The program will parse as many such expressions as are in the input, # until it encounters a non well-formed description. All remaining # input (well formed or not) is discarded. # ######################################################################## global white_sp # white space character set procedure main() white_sp := ' \t' # white space is tab and space line := "" while line ||:= read() # concatenate input into one long string # (removes return/new line characters) line ? # and scan the line for parsing { while a_parse := parse() do { # write each parse as a separate line write(lst_2_str(a_parse)) } } end # This procedure converts an input list (a parse) into a formatted # string. Many variations are possible. This one replaces the # string, list and set delimiter characters with the appropriate # typesetting commands. The "" character below is ascii 006, Word's # formula typesetting command character. Using backslash to represent # this character, the strings replacing the delimiters are: # # [ \b\bc\[(\a\al( # begin a bracket delimited by "[]" # # with a left-alligned array as argument # # < \b\bc\<(\a\ac( # begin a bracket delimited by "<>" # # with a center-alligned array as argument # # { \b\bc\[(\a\ac( # begin a bracket delimited by "{}" # # with a center-alligned array as argument # # ] )) # close two argument lists # > )) # } )) # procedure lst_2_str(alist) if x := string(alist) then # don't convert it if its already a string return case x of { # do the above replacements "[" : "bbc[(aal(" "<" : "bbc<(aac(" "{" : "bbc{(aac(" "]" : "))" ">" : "))" "}" : "))" default : x # default to the incoming value } else # if it's a list then convert it { mid_str := "" # mnemonically "middle string" every x := !alist do { # iterate through the arguments mid_str ||:= lst_2_str(x) # concatenate mid_str ||:= " " # pad with space } return mid_str[1:-1] # don't include the last space } end # the parser looks for each of the following possibilities # label -- a string of letters # expr -- a label followed by a value # box -- labels with values inside [] # l_list -- boxes grouped inside <> # set -- boxes grouped inside {} procedure parse() suspend label() | expr() | box() | set() | l_list() end # a label is a bunch of letters together with no whitespace or punctuation # no digits are allowed procedure label() suspend tab(many(&letters)) end # an expression is a label with a value. The value may be # a label (separated by "|"), a box, a set a list or another expression procedure expr() suspend [ one_of(label) ] ||| ( [ ="|", one_of(label) ] | [ one_of( box | set | l_list | expr ) ] ) end # a box is some arbitrary number of expressions enclosed in [] # the parsed expressions will have "," items between them in the parse # so that Word will know to typeset them vertically in the array. # DO NOT use the commas in your description, it will not parse if you do. # box()es must have at least one exprtession in them procedure box() suspend [ ="[" ] ||| com_arbno(expr) ||| [ ="]" ] end # a set is an arbitrary number of boxes enclosed in {} -- the same # caveats apply as for box() procedure set() suspend [ ="{" ] ||| com_arbno(box) ||| [ ="}" ] end # a l_list is an arbitrary number of boxes enclosed by <>, with no commas # between them so Word will know to typeset them horizontally. There # may be zero items in a l_list. procedure l_list() suspend [ ="<" ] ||| arbno(box) ||| [ =">" ] end # com_abrno() produces a list containing an arbitrary number of # some matching expression p, separated by one fewer "," items # on the list than there are p's. This is for things that need to # be typeset vertically by Word. The base case is a single p, with # no commas in the putput list. procedure com_arbno(p) suspend [one_of(p)] ||| ( [] | ( [ "," ] ||| arbno(p) ) ) end # arbno() produces a list containing an arbitrary number of some # matching procedure p. This is for things that need to be typeset # horizontally. The base case is an empty list procedure arbno(p) suspend [] | [one_of(p)] ||| arbno(p) end # one_of() produces a single match of the expression p, discarding # any surrounding whitespace it encounters. This is a useful technique # to use in a parser, with a little modification, it can also be # used to get optional constituents. procedure one_of(p) tab(many(white_sp)) x <- p() tab(many(white_sp)) suspend \x end From icon-group-sender Thu Jun 10 16:55:22 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id QAA03665 for icon-group-addresses; Thu, 10 Jun 1999 16:54:23 -0700 (MST) Message-Id: <199906102354.QAA03665@baskerville.CS.Arizona.EDU> Delivered-To: icon-group@silliac.cs.arizona.edu From: Art Eschenlauer To: icon-group@optima.CS.Arizona.EDU Subject: Syntax coloring .vim file for editing .icn programs with vim Date: Thu, 10 Jun 1999 14:22:05 -0500 Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO I like vim for editing code. It allows you to syntax color, using .vim files stored in the syntax directory. Has anyone written one for .icn files. I'm sure that I can do it, but I have a lot of other wheels to reinvent already.... Thanks From icon-group-sender Fri Jun 11 08:37:47 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id IAA15033 for icon-group-addresses; Fri, 11 Jun 1999 08:37:00 -0700 (MST) Message-Id: <199906111537.IAA15033@baskerville.CS.Arizona.EDU> Delivered-To: icon-group@silliac.cs.arizona.edu To: icon-group@optima.CS.Arizona.EDU Date: 11 Jun 1999 12:48:53 GMT From: espie@liafa.jussieu.fr (Marc Espie) Subject: Re: Syntax coloring .vim file for editing .icn programs with vim Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO In article <199906102354.QAA03665@baskerville.CS.Arizona.EDU>, Art Eschenlauer wrote: >I like vim for editing code. > >It allows you to syntax color, >using .vim files stored in the syntax directory. > >Has anyone written one for .icn files. >I'm sure that I can do it, but I have a lot of >other wheels to reinvent already.... This is definitely *not* perfect, as this was just a quick hack, copied over from other syntax files. If you make improvements to that small file, I'd like a copy :) " Vim syntax file " Language: Icon " Remove any old syntax stuff hanging around syn clear syn case ignore syn keyword iconBlock procedure end link syn keyword iconLabel case of goto default syn keyword iconConditional if else then syn keyword iconRepeat do every while repeat syn keyword iconStatement return next suspend syn keyword iconTodo contained TODO " String syn region iconString start=+"+ end=+"+ syn match iconMatrixDelimiter "[][]" syn match iconNumber "-\=\<\d\+\>" syn match iconComment "#.*$" contains=iconTodo "syn match iconKeyword "&(null|[lrm]press|resize|fail)" syn match iconKeyword "&null" syn match iconKeyword "&fail" syn match iconKeyword "&shift" syn match iconKeyword "&[lmr]press" syn match iconKeyword "&resize" syn match iconKeyword "&window" syn match iconKeyword "&time" syn keyword iconFunction read write reads writes open close syn keyword iconFunction put push pop pull syn keyword iconFunction insert member key tab set syn keyword iconFunction many any upto move table list trim find syn keyword iconFunction match bal syn keyword iconFunction sin cos dtor rtod syn keyword iconFunction integer string left right map image syn keyword iconOperator to by not syn keyword iconType static initial global record syn sync lines=250 if !exists("did_icon_syntax_inits") let did_icon_syntax_inits = 1 " The default methods for highlighting. Can be overridden later hi link iconBlock PreProc hi link iconKeyword PreProc hi link iconStatement Statement hi link iconLabel Label hi link iconConditional Conditional hi link iconRepeat Repeat hi link iconTodo Todo hi link iconString String hi link iconMatrixDelimiter Identifier hi link iconNumber Number hi link iconByte Number hi link iconOperator Operator hi link iconFunction Function hi link iconType Type hi link iconComment Comment hi link iconStatement Statement "optional highlighting "hi link iconDelimiter Identifier "hi link iconShowTab Error "hi link iconShowTabc Error "hi link iconIdentifier Identifier endif let b:current_syntax = "icon" " vim: ts=8 -- Marc Espie |anime, sf, juggling, unicycle, acrobatics, comics... |AmigaOS, OpenBSD, C++, perl, Icon, PostScript... | `real programmers don't die, they just get out of beta' From icon-group-sender Mon Jun 14 12:47:18 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id MAA04250 for icon-group-addresses; Mon, 14 Jun 1999 12:45:25 -0700 (MST) Message-Id: <199906141945.MAA04250@baskerville.CS.Arizona.EDU> Delivered-To: icon-group@silliac.cs.arizona.edu Date: Mon, 14 Jun 1999 16:51:45 +0100 From: "C.R. Smith" To: icon-group@optima.CS.Arizona.EDU Subject: help with vib Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Hi I wonder if you could possible help me. I am a student studying computer science at Liverpool University in the UK. I have been given a project to do concerning creating a students admission procedure amd linking to a database. Our supervisor informs us that we should use the VIB tool to build the interface. My problem is that although I have bought the Icon book "The Icon Programming Language" and have ordered the "Graphics programming in Icon" i am struggling for information especially small simple programs using VIB. I like to use VIB i find it very easy to create nice looking interface.s My problem is linking code to the VIB generated source code. For example a have creaated a simple interface that opens and displays a file. However although I have used to code supplied in the book I cannot get it to save the displayed file as another name. Also I am unsure of how I should print a file - (program must work on unix and win95. To get to the crux of the matter what I am asking is if you could send me any simple programs which uses the VIB interface as this would help me enormously. I have searched th online documentation but cannot find any such programs. Thanks christine smith From icon-group-sender Tue Jun 15 16:21:59 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id QAA12496 for icon-group-addresses; Tue, 15 Jun 1999 16:20:36 -0700 (MST) Message-Id: <199906152320.QAA12496@baskerville.CS.Arizona.EDU> Delivered-To: icon-group@silliac.cs.arizona.edu Date: Tue, 15 Jun 1999 16:41:16 -0300 (ADT) From: Larry Bezeau X-Sender: bezeau@sol.sun.csd.unb.ca To: Icon list Subject: Problems with noncase.icn from program library Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO I have recently been using the Icon program library for dealing with strings using regular expressions and have run into a few problems, not with the regular expression procedures themselves, but with a set of procedures called "noncase.icn", used for case insensitive searching with regular expressions. An example follows. The following procedure from noncase.icn is intended to duplicate find in a case insensitive way. procedure c_find(s1,s2,i1,i2) local scanPos,endPos scanPos := match("",s2,i1,i2) endPos := many(&cset,s2,i1,i2) suspend scanPos - 1 + find(map(s1), map((if \s2 then s2 else &subject)[scanPos:endPos])) end A problem occurs if the subject string is empty. In this case, the statement to set the value of endPos fails leaving endPos undefined. The last statement produces a program error when an attempt is made to extract a substring of &subject with one index having the null value. The analogous built-in function (find) simply fails under the same circumstances. My solution was to replace the fourth line in the procedure with endPos := (many(&cset,s2,i1,i2) | scanPos) which at least prevents the program error. I have not tested this rigorously. Can anyone see problems with this or make other suggestions? Larry Bezeau@UNB.Ca From icon-group-sender Wed Jun 16 08:47:44 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id IAA11063 for icon-group-addresses; Wed, 16 Jun 1999 08:47:10 -0700 (MST) Message-Id: <199906161547.IAA11063@baskerville.CS.Arizona.EDU> Delivered-To: icon-group@silliac.cs.arizona.edu Date: Wed, 16 Jun 1999 05:32:12 -0700 (PDT) From: Arthur Eschenlauer Subject: algebraic to spreadsheet translator (was File Translators in Icon) To: icon-group@optima.CS.Arizona.EDU Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO --0-1714636915-929536332=:16201 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline > -----Original Message----- > From: John C. Paolillo > Sent: Tuesday, June 08, 1999 3:41 PM > To: CHETHCOA@oss.oceaneering.com; icon-group@optima.CS.Arizona.EDU > Cc: john@ling.uta.edu > Subject: Re: Fwd: Re: File Translators in Icon > > I don't know if this will help, but I once had reason to > write the following Icon program to assist in typesetting > Feature-Attribute matrices in MS Word. . . . Along the same lines, I once wrote a program (see attachment) to be able to write reasonably algebraic expressions that could then be translated into spreadsheet formulas, which I fid a lot more difficult to read and understand. === Arthur Eschenlauer (eschen@alumni.princeton.edu) When possible, please direct business email to: Art.Eschenlauer@sufsys.com _________________________________________________________ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com --0-1714636915-929536332=:16201 Content-Type: application/x-unknown-content-type-icn_auto_file; name="spread.icn" Content-Description: spread.icn Content-Disposition: attachment; filename="spread.icn" Content-Transfer-Encoding: base64 IyBzcHJlYWQuaWNuIHRyYW5zbGF0ZXMgYSBodW1hbi1yZWFkYWJsZSBpbmZp eCBpbnB1dCBleHByZXNzaW9uIA0KIyAgICAgICAgICAgICAgIGludG8gYW4g aW5maXggZXhwcmVzc2lvbiBmb3IgYSBzcHJlYWRzaGVldA0KIw0KIyAgICAg ICAgICAgIDE5OTUuMDguMTIgQXJ0IEVzY2hlbmxhdWVyIChlc2NoZW5AYWx1 bW5pLnByaW5jZXRvbi5lZHUpDQojIEVYQU1QTEUNCiMNCiMgIHRoZSBmb2xs b3dpbmcgaW5wdXQgKG5vdGUgaG93IHR3byBkZWNsYXJhdGlvbnMgYXJlIHJl cXVpcmVkDQojICAgICAgICAgICAgICAgICAgICAgICBmb3IgdGhlIHByZWZp eCBvcGVyYXRvciAnc3FydCcpOg0KIw0KIyAgICBbICgNCiMgICAgXSApDQoj ICAgIF9yIHNxcnQNCiMgICAgX3INCiMgICAgYWxwaGEgIEExMQ0KIyAgICBi b3R0bGUgJEMkMg0KIyAgICBjYW4gICAgQiQzDQojICAgIGRydW0gICBleHAo JEE0KQ0KIyAgICAuLg0KIyAgICBhbHBoYS9bX3IoIGJvdHRsZSArIGNhbiAp IGRydW1dDQojDQojICBwcm9kdWNlcyBhcyBvdXRwdXQ6DQojDQojICAgIEEx MSAvIChzcXJ0KCAkQyQyICsgQiQzKSAqIGV4cCgkQTQpKQ0KIw0KIyBJTlBV VCBTWU5UQVgNCiMNCiMgMC4gRm9yIGNvbW1lbnRpbmcsIGFsbCBjaGFyYWN0 ZXJzIGFmdGVyIGEgInBvdW5kIHNpZ24iICgnIycpIGFyZSBpZ25vcmVkDQoj DQojIDEuIEJlZ2luIHdpdGggdmFyaWFibGUgZGVmaW5pdGlvbnMgDQojICAg ICAgKG5vdGU6IGNhc2Ugc2Vuc2l0aXZlLCBpLmUuLCBsZXR0ZXJzICdhLXon IGFyZSBkaXN0aW5jdCBmcm9tICdBLVonKToNCiMNCiMgICAgICA8dmFyaWFi bGUgX25hbWVfIHVzZWQgaW4gaW5wdXQ+PHdoaXRlc3BhY2U+PG5hbWUgdG8g dXNlIGluIG91dHB1dD4NCiMgICAgICAgIChXaGl0ZXNwYWNlIGNhbiBiZSBz cGFjZXMgb3IgdGFicy4pDQojDQojICAgICAgPFtwcmVmaXhdIF9vcGVyYXRv cl8gbmFtZSB1c2VkIGluIGlucHV0Pjxub3RoaW5nIGJ1dCB3aGl0ZXNwYWNl Pg0KIw0KIyAgICAgIDxfcmVzZXJ2ZWQgY2hhcmFjdGVyXyBpbiBpbnB1dD48 d2hpdGVzcGFjZT48bmV3IGRlZmluaXRpb24gaW4gb3V0cHV0Pg0KIyAgICAg ICAgKFJlc2VydmVkIGNoYXJhY3RlcnMgYXJlICdbXXt9XisqLS8gJyANCiMg ICAgICAgICAgYW5kIGJ5IGRlZmF1bHQgdHJhbnNsYXRlIHRvIHRoZW1zZWx2 ZXMuDQojICAgICAgICAgIFBsZWFzZSBkb24ndCB1c2UgcmVzZXJ2ZSBjaGFy YWN0ZXJzIGluIGFueSBfbmFtZXNfDQojICAgICAgICAgIHRoYXQgeW91IHVz ZSBmb3IgX2lucHV0XywgdGhvdWdoIHRoZXkgYXJlIG9rYXkgaW4gX291dHB1 dF8uKQ0KIw0KIyAyLiBFbmQgdmFyaWFibGUgZGVmaW5pdGlvbnMgd2l0aCBh IGxpbmUgYmVnaW5uaW5nIHdpdGggIi4uIiANCiMgICAgICAgIGFuZCB3aXRo b3V0IGFueSBvdGhlciBub253aGl0ZSBjaGFyYWN0ZXJzIA0KIw0KIyAzLiBG b2xsb3cgd2l0aCB0aGUgZXhwcmVzc2lvbnMgdG8gYmUgdHJhbnNsYXRlZCwg b25lIHBlciBsaW5lDQojICAgICAgKHVudHJhbnNsYXRlZCB2YXJpYWJsZSBu YW1lcyBhcmUgY29waWVkIHRocm91Z2ggdG8gb3V0cHV0KQ0KIyAgICAgIChi ZXdhcmUgLSBpZiB5b3UgbmFtZSBhIHZhcmlhYmxlICJrLTEiLCB0aGVuIHVz ZSAiayAtIDEiDQojICAgICAgICAgeW91IGRvbid0IG1lYW4gdGhlIHZhcmlh YmxlICJrLTEiISkNCiMNCg0KIyB0b2tlbiB0YWJsZSwgb3BlcmF0b3IgdGFi bGUsIHJlc2VydmUgY2hhcmN0ZXIgY3NldCwgcHJpbnRhYmxlIGNoYXIgY3Nl dA0KZ2xvYmFsIHRva2VudGFiLCBvcGVydGFiLCBjcmVzZXJ2ZSwgY3ByaW50 LCB3aGl0ZXNldA0KDQpwcm9jZWR1cmUgbWFpbigpDQogICANCiAgIHRva2Vu dGFiICA6PSB0YWJsZSgmbnVsbCkgICAgICAgICAgICAgICAgICAgICAgICMg dGFibGUgb2YgdG9rZW5zDQogICBvcGVydGFiICAgOj0gdGFibGUoJm51bGwp ICAgICAgICAgICAgICAgICAgICAgICAjIHRhYmxlIG9mIG9wZXJhdG9ycw0K ICAgY3Jlc2VydmUgIDo9ICcoKVtde309XisqLS8gXHQnICAgICAgICAgICAg ICAgICAgIyBjc2V0IG9mIHJlc2VydmVkIGNoYXJhY3RlcnMNCiAgIGNvcGVy YXRvciA6PSAnKFt7PSovKy1eJyAgICAgICAgICAgICAgICAgICAgICAgICMg Y3NldCBvZiBvcGVyYXRvciBjaGFyYWN0ZXJzDQogICBjcHJpbnQgOj0gY3Nl dCgmY3NldFszNDoxMjhdIHx8ICZjc2V0WzEyOToyNTZdKSAjIGNzZXQgb2Yg bm9ud2hpdGUgcHJpbnRhYmxlcw0KICAgd2hpdGVzZXQgIDo9IHNldCggWyAi ICIsICJcdCIgXSApICAgICAgICAgICAgICAgIyBzZXQgb2Ygd2hpdGUgcHJp bnRhYmxlcw0KICAgDQogICAjIGluaXRpYWxpemUgdG9rZW4gdGFibGUgYW5k IG9wZXJhdG9yIHRhYmxlDQoNCiAgIGV2ZXJ5IHMgOj0gc3RyaW5nKCFjcmVz ZXJ2ZSkgZG8gdG9rZW50YWJbc10gOj0gcw0KICAgZXZlcnkgcyA6PSBzdHJp bmcoIWNvcGVyYXRvcikgZG8gb3BlcnRhYltzXSA6PSBzDQogICANCiAgICMg cmVhZCB1c2VyIGRlZmluaXRpb25zIG9mIHRva2VucyBhbmQgb3BlcmF0b3Jz IHVwIHRvICIuLiIgc2VwYXJhdG9yDQoNCiAgICMgZm9yIGVhY2ggbGluZS4u LnRoYXQgaXMgbm90IGEgY29tbWVudC4uLnNldCBsaW5lIGFzIHRoZSBzdHJp bmcgc2Nhbm5pbmcgc3ViamVjdA0KICAgd2hpbGUgbGluZSA6PSAocmVhZCgp ID8gdGFiKHVwdG8oJyMnKSB8IDApKSBkbyBsaW5lID8gew0KDQogICAgICBp ZiBtYXRjaCgiLi4iKSB0aGVuIGJyZWFrICAgICAgICAgICAgICAgICAgICAj IGRvdWJsZSBkb3QgbWVhbnMgZW5kIG9mIGRlZmluaXRpb25zDQoNCiAgICAg ICMgZXh0cmFjdCB0b2tlbiBzeW1ib2wgYW5kIGRlZmluaXRpb24sIGlmIGFu eQ0KICAgICAgc3ltIDo9IGRlZiA6PSAiIiAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIyBjbGVhciB0b2tlbiBzeW1ib2wgYW5kIGRlZmluaXRp b24NCiAgICAgIHRhYih1cHRvKGNwcmludCkpICYgKHN5bSA6PSB0YWIobWFu eShjcHJpbnQpKSkgICMgZXh0cmFjdCB0b2tlbiBzeW1ib2wNCiAgICAgIHRh Yih1cHRvKGNwcmludCkpICYgKGRlZiA6PSB0YWIoMCkpICAgICAgICAgICAg ICMgZXh0cmFjdCB0b2tlbiBkZWZpbml0aW9uIChpZiBhbnkpDQoNCiAgICAg ICMgaWYgdG9rZW4gZGVmaW5pdGlvbiwgdGhlbiBwdXQgZGVmaW5pdGlvbiBp bnRvIHRva2VuIHRhYmxlLA0KICAgICAgIyBlbHNlIHB1dCBvcGVyYXRvciBk ZWZpbnRpb24gaW50byBvcGVyYXRvciB0YWJsZSBhbmQNCiAgICAgICMgICAg ICBhbmQsIGlmIG5lZWQgYmUsIHRva2VuIGRlZmluaXRpb24gaW50byB0b2tl biB0YWJsZQ0KICAgICAgaWYgZGVmIH49PSAiIiAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIyBpZiB0b2tlbiBkZWZpbml0aW9uLi4uDQogICAg ICB0aGVuICB7IA0KICAgICAgICAgICAgICAgIHRva2VudGFiW3N5bV0gOj0g ZGVmICAgICAgICAgICAgICAgIyB0aGVuIHB1dCBkZWZpbml0aW9uIGludG8g dGFibGUNCiAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAjIC4uLmVsc2UgYW4g b3BlcmF0b3IgZGVmaW5pdGlvbg0KICAgICAgZWxzZSAgeyANCiAgICAgICAg ICAgIGlmICAgIHRva2VudGFiW3N5bV0gfj09PSAmbnVsbCAgICAgICAgICMg aWYgdG9rZW50YWIgZW50cnkgZXhpc3RzDQogICAgICAgICAgICB0aGVuICBv cGVydGFiW3N5bV0gOj0gMSAgICAgICAgICAgICAgICAjIHRoZW4gZG9uJ3Qg Y2hhbmdlIGl0DQogICAgICAgICAgICBlbHNlICBpZiAgICBzeW0gfj09ICIi ICAgICAgICAgICAgICAgICAjIGxhc3QgY2hlY2sgdGhhdCBzeW0gaXMgbGVn aXQNCiAgICAgICAgICAgICAgICAgIHRoZW4gIG9wZXJ0YWJbc3ltXSA6PSB0 b2tlbnRhYltzeW1dIDo9IHN5bSAgICAjIHVwZGF0ZSB0YWJsZXMNCiAgICAg ICAgICAgIH0NCiAgIH0NCiAgIA0KICAgIyBlbmQgb2YgZGVmaW5pdGlvbnMs IGFuZCBiZWdpbm5pbmcgb2YgZXhwcmVzc2lvbnMgdG8gYmUgdHJhbnNsYXRl ZA0KDQogICAjIGluaXRpYWxpemUgb3V0bCAob3V0cHV0IHN0cmluZykNCiAg IG91dGwgOj0gIiINCiAgICMgaW5pdGlhbGl6ZSBsYXN0IChsYXN0IHR5cGUp DQogICBsYXN0IDo9ICdeJw0KDQogICAjIGZpcnN0LCByZWFkIGFuZCBjbGVh biB1cCAnbGluZScgZnJvbSBpbnB1dCAuLi4NCiAgIHdoaWxlIGxpbmUgOj0g KCANCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICMgc3ViamVjdCBmb3Igc3RyaW5nIHNjYW5uaW5nIGlzIA0KICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIyAgIGV2 ZXJ5dGhpbmcgZnJvbSBmaXJzdCBub253aGl0ZQ0KICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIyAgIHVwIHRvICcjJyBv ciBlbmQgb2YgbGluZQ0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIyB3aGVuIHJlYWQoKSBmYWlscywgd2hpbGUgbG9v cCBlbmRzDQogICAgICAoDQogICAgICAgICByZWFkKCkgPyB0YWIoIHVwdG8o JyMnKSB8IDAgKSAgICAgICAjIGdldCBpbnB1dCB1cCB0byAnIycgb3IgZW5k IG9mIGxpbmUNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICMgKGFzc2lnbm1lbnQgZmFpbHMgaWYgY2Fubm90IHJlYWQp DQoNCiAgICAgICkgPyAoICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICMgc2V0IHN1YmplY3QgZm9yIHN0cmluZyBzY2FubmluZw0KICAgICAg ICAgKA0KICAgICAgICAgICAgdGFiKCB1cHRvKGNwcmludCkgKSAgJiB0YWIo MCkgICAgIyBza2lwIGxlYWRpbmcgbm9ucHJpbnRhYmxlcw0KICAgICAgICAg KSB8ICIiICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIyBvciBza2lw IGFsbCwgYnV0IGFzc2lnbm1lbnQgc3VjY2VlZHMNCiAgICAgICkNCg0KICAg IyAuLi4gYW5kIHRoZW4gcGFyc2UgbGluZSwgY29uY2F0ZW5hdGluZyBvdXRw dXQgb250byB0aGUgb3V0cHV0IGV4cHJlc3Npb24gJ291dGwnDQogICApIGRv IHsgICANCiAgICAgICAgICAgICMgJz8nIHNldHMgc3RyaW5nIHNjYW5uaW5n IHN1YmplY3QgdG8gJ2xpbmUnDQogICAgICAgICAgICAjIHdoaWxlIChub3Qg YXQgZW5kIG9mIGxpbmUpIGNvbmNhdGVuYXRlIG9udG8gJ291dGwnDQogICAg ICAgICAgICBsaW5lID8gd2hpbGUgbm90IHBvcygwKSBkbyBvdXRsIHx8Oj0g Y2FzZSAmbnVsbCBvZiB7DQogICAgICAgICAgICAgICANCiAgICAgICAgICAg ICAgICAgICMgbm9udG9rZW4gLSB3cml0ZSBhc3RlcmlzayBleGNlcHQgYWZ0 ZXIgDQogICAgICAgICAgICAgICAgICAjICAgICAgICAgICAgbm9udG9rZW4s IG9wZXJhdG9yLCBvciBzdGFydCANCiAgICAgICAgICAgICAgICAgICMgICAg ICAgICAgICAocHJvY2VkdXJlICdsb25na2V5JyBnZW5lcmF0ZXMgYWxsIHRv a2VucykNCiAgICAgICAgICAgICAgICAgIG5vdCBtYXRjaCggayA6PSBsb25n a2V5KHRva2VudGFiKSApIDogMSgNCiAgICAgICAgICAgICAgICAgICAgICAg IGNhc2UgbGFzdCBvZiB7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAn ICcgfCAndCcgICAgICAgOiAiKiIgfHwgbW92ZSgxKQ0KICAgICAgICAgICAg ICAgICAgICAgICAgICAgJ14nIHwgJ24nIHwgJ28nIDogbW92ZSgxKQ0KICAg ICAgICAgICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgICAgICAgICAg ICAgLCBsYXN0IDo9ICduJw0KICAgICAgICAgICAgICAgICAgICAgKQ0KDQog ICAgICAgICAgICAgICAgICAjIHNwYWNlIC0gd3JpdGUgc3BhY2UgYnV0IGRv bid0IGNoYW5nZSBhbnl0aGluZw0KICAgICAgICAgICAgICAgICAgIyAgICAg ICAgIHVubGVzcyBwcmVjZWVkZWQgYnkgYSBub250b2tlbg0KICAgICAgICAg ICAgICAgICAgbm90IChrIH49PSAiICIpIDogY2FzZSBsYXN0IG9mIHsNCiAg ICAgICAgICAgICAgICAgICAgICAgICAgICdeJyB8ICdvJyB8ICd0JyB8ICcg JzogbW92ZSgxKSANCiAgICAgICAgICAgICAgICAgICAgICAgICAgICduJyA6 IDEobW92ZSgxKSxsYXN0IDo9JyAnKQ0KICAgICAgICAgICAgICAgICAgICAg fQ0KDQoNCiAgICAgICAgICAgICAgICAgICMgdG9rZW4sIGJ1dCBub3Qgb3Bl cmF0b3IgLSB3cml0ZSBhc3RlcmlzayBleGNlcHQgYWZ0ZXIgDQogICAgICAg ICAgICAgICAgICAjICAgICAgICAgICAgICAgICAgICAgICAgICAgb3BlcmF0 b3Igb3Igc3RhcnQgb3IgYmVmb3JlICddfSknDQogICAgICAgICAgICAgICAg ICBvcGVydGFiW2tdIDogMSgNCiAgICAgICAgICAgICAgICAgICAgICAgIGNh c2UgbGFzdCBvZiB7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAnbicg fCAnICcgfCAndCcgOiANCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIChpZiBub3QgYW55KCddfSknLGspIHRoZW4gIioiIGVsc2Ug IiIpIHx8IA0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgKG1vdmUoKmspICYgdG9rZW50YWJba10pDQogICAgICAgICAgICAgICAg ICAgICAgICAgICAnXicgfCAnbycgICAgICAgOiAobW92ZSgqaykgJiB0b2tl bnRhYltrXSkNCiAgICAgICAgICAgICAgICAgICAgICAgIH0NCiAgICAgICAg ICAgICAgICAgICAgICAgICwgbGFzdCA6PSAndCcNCiAgICAgICAgICAgICAg ICAgICAgICkNCg0KICAgICAgICAgICAgICAgICAgIyBvcGVyYXRvciAtIHdy aXRlIGFzdGVyaXNrIGV4Y2VwdCBhZnRlciANCiAgICAgICAgICAgICAgICAg ICMgICAgICAgICAgICBvcGVyYXRvciBvciBzdGFydCBvciBiZWZvcmUgJz0r LSovXicNCiAgICAgICAgICAgICAgICAgIG5vdCAoJm51bGwgPT09IG9wZXJ0 YWJba10pIDogMSgNCiAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgbGFz dCBvZiB7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAnbicgfCAnICcg fCAndCcgOg0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgKGlmIG5vdCBhbnkoJz0rLSovXl19KScsaykgdGhlbiAiKiIgZWxzZSAi IikgfHwgDQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAobW92ZSgqaykgJiB0b2tlbnRhYltrXSkNCiAgICAgICAgICAg ICAgICAgICAgICAgICAgICdeJyB8ICdvJyAgICAgICA6IChtb3ZlKCprKSAm IHRva2VudGFiW2tdKQ0KICAgICAgICAgICAgICAgICAgICAgICAgfQ0KICAg ICAgICAgICAgICAgICAgICAgICAgLCBsYXN0IDo9ICdvJw0KICAgICAgICAg ICAgICAgICAgICAgKQ0KDQogICAgICAgICAgICB9DQoNCiAgICAgICMgb3V0 cHV0IGV4cHJlc3Npb24sIGNsZWFuIHVwLCBhbmQgcmVhZCBuZXh0IGxpbmUN CiAgICAgIHdyaXRlKG91dGwpDQogICAgICBvdXRsIDo9ICIiDQogICAgICBs YXN0IDo9ICdeJw0KICAgfQ0KICAgDQplbmQNCg0KIyBwcm9jZWR1cmUgJ2xv bmdrZXknIGdlbmVyYXRlcyBhbGwgdG9rZW5zDQpwcm9jZWR1cmUgbG9uZ2tl eSh0KQ0KDQogICAjICd0b3RsJyBpcyBhIHBlcnNpc3RlbnQgdGFibGUgb2Yg dG9rZW4gbGlzdHMNCiAgIHN0YXRpYyB0b3RsDQogICANCiAgICMgdGhlIGZp cnN0IHRpbWUgdGhyb3VnaCwgY3JlYXRlIHRhYmxlLW9mLXRva2VuLWxpc3Rz ICd0b3RsJyANCiAgICMgICAgIGFuZCBpbml0aWFsaXplIHRvdGwgdmFsdWVz IHRvICZudWxsIChOT1QgdG8gZW1wdHkgbGlzdHMpDQogICBpbml0aWFsIHsg dG90bCA6PSB0YWJsZSgmbnVsbCkgfQ0KICAgDQogICAjIGlmICd0b3RsJyBp cyBub3QgeWV0IGRlZmluZWQsIGNyZWF0ZSB0b2tlbmxpc3RzIGFuZCBzb3J0 IGFscGhhYmV0aWNhbGx5DQogICAvdG90bFt0XSAmIHsNCiAgICAgIHNvcnRh YiA6PSB0YWJsZSgmbnVsbCkNCiAgICAgIGV2ZXJ5IHNvcnRhYltrIDo9IGtl eSh0KV0gOj0gKmsNCiAgICAgIGwgOj0gc29ydChzb3J0YWIsNCkNCiAgICAg IHRvdGxbdF0gOj0gW10NCiAgICAgIGV2ZXJ5IGkgOj0gMSB0byAoKmwgLSAx KSBieSAyIGRvIHB1c2goIHRvdGxbdF0sIGxbaV0gKQ0KICAgfQ0KICAgDQog ICAjIGdlbmVyYXRlIGVhY2ggdG9rZW4gYWxwaGFiZXRpY2FsbHkNCiAgIGV2 ZXJ5IHN1c3BlbmQgIXRvdGxbdF0NCg0KICAgIyBwcm9jZWR1cmUgZmFpbHMg dG8gcHJvZHVjZSBhIHJlc3VsdCBhZnRlciBhbGwgdG9rZW5zIGhhdmUgYmVl biBnZW5lcmF0ZWQNCiAgIA0KZW5kDQ0K --0-1714636915-929536332=:16201-- From icon-group-sender Wed Jun 16 12:30:54 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id MAA19875 for icon-group-addresses; Wed, 16 Jun 1999 12:30:23 -0700 (MST) Message-Id: <199906161930.MAA19875@baskerville.CS.Arizona.EDU> Delivered-To: icon-group@silliac.cs.arizona.edu From: "Steven Gross" To: "Larry Bezeau" , "Icon list" Subject: Re: Problems with noncase.icn from program library Date: Wed, 16 Jun 1999 19:50:35 +0200 X-Priority: 3 X-MSMail-Priority: Normal X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.37 Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO The function c_match in the same library seems to have a typo in scanPos := match("",s,i1,i2) since s is not defined in the procedure. From icon-group-sender Wed Jun 16 16:23:11 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id QAA28885 for icon-group-addresses; Wed, 16 Jun 1999 16:21:57 -0700 (MST) Message-Id: <199906162321.QAA28885@baskerville.CS.Arizona.EDU> Delivered-To: icon-group@silliac.cs.arizona.edu Date: Wed, 16 Jun 1999 17:49:55 -0300 (ADT) From: Larry Bezeau X-Sender: bezeau@sol.sun.csd.unb.ca To: Icon list Subject: Re: Problems with noncase.icn from program library Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO On Wed, 16 Jun 1999, Steven Gross wrote: >The function c_match in the same library seems to have a typo in >scanPos := match("",s,i1,i2) >since s is not defined in the procedure. > This problem will be flagged if noncase.icn is compiled with the -u option. The identifier "s" is neither defined in the procedure nor global. I ended up replacing it with s2, but I don't believe my program actually uses that particular procedure so I haven't verified my change. Larry Bezeau@UNB.Ca From icon-group-sender Fri Jun 18 08:19:42 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id IAA13448 for icon-group-addresses; Fri, 18 Jun 1999 08:17:35 -0700 (MST) Message-Id: <199906181517.IAA13448@baskerville.CS.Arizona.EDU> Delivered-To: icon-group@silliac.cs.arizona.edu To: icon-group@optima.CS.Arizona.EDU Date: Fri, 18 Jun 1999 12:12:34 GMT From: "Ian Trudel" Subject: Icon implementation detail: run time type convertion? Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Hi, I would like to know how the type convertion is applied on compiled programs (binary file, such .exe on WinNT) from Icon. Actually, I know that the type convertion is made in run time. But I cannot figure out how they generate code for it. Is the run time system included in every executables? Ian From icon-group-sender Tue Jun 22 09:53:00 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id JAA25306 for icon-group-addresses; Tue, 22 Jun 1999 09:48:05 -0700 (MST) Message-Id: <199906221648.JAA25306@baskerville.CS.Arizona.EDU> From: Kostas Oikonomou Date: Mon, 21 Jun 1999 17:37:20 -0400 (EDT) To: icon-group@optima.CS.Arizona.EDU Subject: Assertions in Icon Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Hello, Does anyone have a suggestion about how to implement a procedure "assert", which, when called with an expression "e" as argument, implements e | stop("Assertion on line ", &line, " failed!") Here &line should be the line on which assert(e) appears. Thanks. Kostas Oikonomou From icon-group-sender Tue Jun 22 12:32:44 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id MAA00996 for icon-group-addresses; Tue, 22 Jun 1999 12:32:19 -0700 (MST) Message-Id: <199906221932.MAA00996@baskerville.CS.Arizona.EDU> Date: Tue, 22 Jun 1999 10:22:34 -0700 From: Steve Wampler X-Accept-Language: en To: Kostas Oikonomou , icon-group@optima.CS.Arizona.EDU Subject: Re: Assertions in Icon Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Kostas Oikonomou wrote: > > Hello, > > Does anyone have a suggestion about how to implement a procedure "assert", > which, when called with an expression "e" as argument, implements > > e | stop("Assertion on line ", &line, " failed!") > > Here &line should be the line on which assert(e) appears. > Thanks. Hard! As far as I know, there is no easy way to get the line number from which a procedure was called (too bad, the interpreter must have this information around or it couldn't generate the traceback messages). Maybe someone knows of a way to get to this information (I assume it can be an expensive solution, since the program is going to stop immediately afterwards)? About the best I can is to have the call pass down the current line number, as shown in the following example: ---- procedure main() assert{3 > 5, &line} end procedure assert(e) if not @e[1] then { stop(&errout, "Assertion failed on line ", @e[2] | "unknown") } end ---- Note that the call to assert is really a PDCO (Programmer Defined Control Operation) to delay evaluation of the expression until inside the assert procedure. -- Steve Wampler- SOLIS Project, National Solar Observatory swampler@noao.edu From icon-group-sender Tue Jun 22 12:33:06 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id MAA01037 for icon-group-addresses; Tue, 22 Jun 1999 12:32:55 -0700 (MST) Message-Id: <199906221932.MAA01037@baskerville.CS.Arizona.EDU> From: dgamey@ca.ibm.com X-Lotus-FromDomain: IBMCA@IBMUS To: Kostas Oikonomou cc: icon-group@optima.CS.Arizona.EDU Date: Tue, 22 Jun 1999 13:41:34 -0400 Subject: Re: Assertions in Icon Content-Disposition: inline Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO >Does anyone have a suggestion about how to implement a procedure "assert", >which, when called with an expression "e" as argument, implements > > e | stop("Assertion on line ", &line, " failed!") > >Here &line should be the line on which assert(e) appears. I don't think there is a way to get your callers &line, unless you provide it as a parameter to each call. There may be some other possibilities but they seem messy to me. Another route is to use runerr() instead of stop which will cause a program termination with a traceback. Not as pretty but serviceable. Hope that helps. David From icon-group-sender Tue Jun 22 12:34:32 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id MAA01135 for icon-group-addresses; Tue, 22 Jun 1999 12:34:24 -0700 (MST) Message-Id: <199906221934.MAA01135@baskerville.CS.Arizona.EDU> To: icon-group@optima.CS.Arizona.EDU Date: Tue, 22 Jun 1999 19:05:11 GMT From: "Ian Trudel" Subject: Re: Assertions in Icon Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Well, I guess I cannot answer properly to this question since I am not an Icon programmer. Though, I am studying Icon's implementation and I can tell you a bit about. First of all, I know that you can use &trace diagnostic facility for tracing. You could certainly assign a non-zero value to &trace before evaluate "e" and put it back to zero after (yeah, if it fails, you'd still have to halt the program). Anyway, Icon implementation is very straightforward and at worst case, you could implement an assertion function. Ian Kostas Oikonomou wrote in message <199906221648.JAA25306@baskerville.CS.Arizona.EDU>... : :Hello, : :Does anyone have a suggestion about how to implement a procedure "assert", :which, when called with an expression "e" as argument, implements : : e | stop("Assertion on line ", &line, " failed!") : :Here &line should be the line on which assert(e) appears. :Thanks. : : Kostas Oikonomou : : From icon-group-sender Wed Jun 23 09:06:16 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id JAA10769 for icon-group-addresses; Wed, 23 Jun 1999 09:05:33 -0700 (MST) Message-Id: <199906231605.JAA10769@baskerville.CS.Arizona.EDU> Date: Wed, 23 Jun 1999 12:31:37 +1200 (NZST) From: "Richard A. O'Keefe" To: dgamey@ca.ibm.com, oikonomou@att.com Subject: Re: Assertions in Icon Cc: icon-group@optima.CS.Arizona.EDU Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO >Does anyone have a suggestion about how to implement a procedure "assert", >which, when called with an expression "e" as argument, implements > > e | stop("Assertion on line ", &line, " failed!") > >Here &line should be the line on which assert(e) appears. The obvious answer is "do it the way C does; use a preprocessor". In what follows, I'm going to use M4, because - it's the traditional UNIX macro processor - there are two free versions: GNU M4 and pdm4 - I know it fairly well. Method 1. define(assert, `real_assert((`$1'), &line)') where the real_assert procedure is plain Icon code. Method 2. define(assert, `((`$1') | stop("Assertion on line ", &line, " failed!"))') where now everything is in the macro. That's the quick and easy way. A better way, long term, would be for someone to patch the Icon translator to support `assert'. It's *FAR* too powerful a debugging tool to leave out of the language much longer. From icon-group-sender Wed Jun 23 09:06:42 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id JAA10826 for icon-group-addresses; Wed, 23 Jun 1999 09:06:30 -0700 (MST) Message-Id: <199906231606.JAA10826@baskerville.CS.Arizona.EDU> To: icon-group@optima.CS.Arizona.EDU Date: 23 Jun 1999 10:17:28 GMT From: eddie@holyrood.ed.ac.uk (Eddie Corns) Subject: Re: Assertions in Icon Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Kostas Oikonomou writes: >Hello, >Does anyone have a suggestion about how to implement a procedure "assert", >which, when called with an expression "e" as argument, implements > e | stop("Assertion on line ", &line, " failed!") >Here &line should be the line on which assert(e) appears. >Thanks. > Kostas Oikonomou > Easiest soln which occurs to me is to use a preprocessor to convert assert(e) to the form you want. Either inline it or replace with do_assert(e,nnn) where nnn is the line no. I usually use symobolic tags like assert(e,"RDF4") then use a file that maps tags to meaningful messages like "Read failed in Open Directory". (Well to be truthful, most of the time I just print the tag and check it in the source). Eddie From icon-group-sender Thu Jun 24 17:11:15 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id RAA07451 for icon-group-addresses; Thu, 24 Jun 1999 17:10:04 -0700 (MST) Message-Id: <199906250010.RAA07451@baskerville.CS.Arizona.EDU> From: Art Eschenlauer To: icon-group@optima.CS.Arizona.EDU Subject: Using Icon to execute SQL queries? Date: Thu, 24 Jun 1999 16:48:28 -0500 Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Has anyone had experience using Icon to execute SQL queries? I am imaging an external C function that would be invoked sql(query) where query would be a string with the SQL query. I would imagine that it would produce a list of N lists each of which has M members, where N would be the number of rows selected and M would be the number of columns specified in the SQL query. Has anyone out there tried something like this? From icon-group-sender Wed Jul 7 08:11:25 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id IAA00687 for icon-group-addresses; Wed, 7 Jul 1999 08:09:25 -0700 (MST) Message-Id: <199907071509.IAA00687@baskerville.CS.Arizona.EDU> From: "Bob Alexander" To: "Icon Project" , "Icon Group" Subject: noncase.icn Date: Sat, 3 Jul 1999 19:28:57 -0700 X-Priority: 3 X-MSMail-Priority: Normal X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2615.200 Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO This is a multi-part message in MIME format. ------=_NextPart_000_001B_01BEC58A.4BC65380 Content-Type: multipart/alternative; boundary="----=_NextPart_001_001C_01BEC58A.4BCDF4A0" ------=_NextPart_001_001C_01BEC58A.4BCDF4A0 Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable There were a few messages recently mentioning bugs in the IPL module = procs/noncase.icn. Sorry I've taken so long to respond to this (I'm the = author). I had stumbled across and corrected those same bugs a while back (Jan = '98, if my source code comments are to be believed), but it looks like I = never submitted the corrected version to the Icon Project. The changes I = made were virtually identical to the suggestions made in this forum. The = updated file is attached -- it's small (Icon Project, can you make this = update to the library?). -- Bob ------=_NextPart_001_001C_01BEC58A.4BCDF4A0 Content-Type: text/html; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable
There were a few messages recently mentioning bugs = in the IPL=20 module procs/noncase.icn. Sorry I've taken so long to respond to this = (I'm the=20 author).
 
I had stumbled across and corrected those same bugs = a while=20 back (Jan '98, if my source code comments are to be believed), but it = looks like=20 I never submitted the corrected version to the Icon Project. The changes = I made=20 were virtually identical to the suggestions made in this forum. The = updated file=20 is attached -- it's small (Icon Project, can you make this update to the = library?).
 
-- Bob
------=_NextPart_001_001C_01BEC58A.4BCDF4A0-- ------=_NextPart_000_001B_01BEC58A.4BC65380 Content-Type: text/icon; name="noncase.icn" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="noncase.icn" Content-Transfer-Encoding: quoted-printable #########################################################################= ### # # File: noncase.icn # # Subject: Procedures for case-independent matching # # Author: Robert J. Alexander # # Date: January 9, 1998 # #########################################################################= ### # # This file is in the public domain. # #########################################################################= ### # # Kit of case-independent versions of Icon's built-in string-analysis # procedures. # #########################################################################= ### procedure c_find(s1,s2,i1,i2) local scanPos,endPos scanPos :=3D match("",s2,i1,i2) endPos :=3D many(&cset,s2,i1,i2) | scanPos suspend scanPos - 1 + find(map(s1), map((if \s2 then s2 else &subject)[scanPos:endPos])) end procedure c_many(c,s,i1,i2) return many(c_cset(c),s,i1,i2) end procedure c_match(s1,s2,i1,i2) local scanPos,endPos scanPos :=3D match("",s2,i1,i2) endPos :=3D scanPos + *s1 return (map(s1) =3D=3D map((if \s2 then s2 else = &subject)[scanPos:endPos]),endPos) end procedure c_upto(c,s,i1,i2) suspend upto(c_cset(c),s,i1,i2) end procedure c_cset(c) static lstring,ustring initial { lstring :=3D string(&lcase) ustring :=3D string(&ucase) } return cset(map(c) || map(c,lstring,ustring)) end ------=_NextPart_000_001B_01BEC58A.4BC65380-- From icon-group-sender Wed Jul 7 08:11:58 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id IAA00817 for icon-group-addresses; Wed, 7 Jul 1999 08:11:48 -0700 (MST) Message-Id: <199907071511.IAA00817@baskerville.CS.Arizona.EDU> From: Tim Patti To: icon-group@optima.CS.Arizona.EDU Subject: Dynamic function loading on Linux Date: Mon, 5 Jul 1999 12:21:33 -0500 Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO I'm looking for a simple solution to using dynamic loading on Linux. In order to get the test program in icon/tests/calling/loadfunc to work, I've got to remove or rename icon/src/h/features.h. What seems to be happening is - 1. bitcount.c includes rt.h 2. icon/src/h/rt.h gets included, which includes 3. icon/src/h/sys.h which includes 4. /usr/local/ctype.h which wants to include /usr/local/features.h 5. because ISRCH in the Makefile points to icon/src/h/ the icon/src/h/features.h file gets included instead, breaking the compile. I created a icon/src/h/dynamic_linux directory that dosen't have features.h in it that I can point ISRCH to in the Makefile but, I have to edit a lot of the header files. The includes in h/rt.h are written as #include "../h/define.h", which I changed to #include "define.h" in order to make it work in a different directory. Is there an easier way of dealing with this ? Tim From icon-group-sender Wed Jul 7 13:21:57 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id NAA21228 for icon-group-addresses; Wed, 7 Jul 1999 13:21:34 -0700 (MST) Message-Id: <199907072021.NAA21228@baskerville.CS.Arizona.EDU> Date: Wed, 7 Jul 1999 13:05:21 -0300 (ADT) From: Larry Bezeau X-Sender: bezeau@sol.sun.csd.unb.ca To: Icon list Subject: Re: Problems with noncase.icn from program library Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO The postings from Nevin Liber and later Bob Alexander concerning fixes for the problems in the Icon library procedure set "noncase.icn" were certainly welcome. Nevin Liber's fix worked well in my application. I have just tested Bob Alexander's fix and it also works except for the omission of the procedure entitled "c_any" from the new noncase set. This procedure did not require a fix and so I pasted the original version into the new noncase.icn and that seems to work fine. Larry Bezeau@UNB.Ca From icon-group-sender Thu Jul 8 08:19:06 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id IAA23530 for icon-group-addresses; Thu, 8 Jul 1999 08:17:30 -0700 (MST) Message-Id: <199907081517.IAA23530@baskerville.CS.Arizona.EDU> Date: Wed, 7 Jul 1999 17:55:25 -0700 (MST) From: Gregg Townsend To: icon-group@optima.CS.Arizona.EDU, timp@clarityconnect.com Subject: Re: Dynamic function loading on Linux Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO From: Tim Patti I'm looking for a simple solution to using dynamic loading on Linux. In order to get the test program in icon/tests/calling/loadfunc to work, I've got to remove or rename icon/src/h/features.h.... It appears that nobody's looked at tests/calling/loadfunc in a long time, and I'd forgotten all about it. There is a newer example of dynamic loading in the Icon Program Library, in the packs/loadfunc directory of the IPL source package. *That* one works. For the IPL see http://www.cs.arizona.edu/icon/ipl93.htm There's also a larger set of functions, but no driver programs, in the IPL's cfuncs directory. --------------------------------------------------------------------------- Gregg Townsend Staff Scientist The University of Arizona gmt@cs.arizona.edu Computer Science Tucson, Arizona, USA From icon-group-sender Mon Jul 12 11:39:15 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id LAA27422 for icon-group-addresses; Mon, 12 Jul 1999 11:37:18 -0700 (MST) Message-Id: <199907121837.LAA27422@baskerville.CS.Arizona.EDU> To: icon-group@optima.CS.Arizona.EDU Date: 10 Jul 1999 19:09:52 -0700 From: gmt@optima.CS.Arizona.EDU (Gregg Townsend) Subject: Versions 9.3.2 of Icon and IPL available for Unix Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Version 9.3.2 of Icon for Unix, and version 9.3.2 of the Icon program library, are now available from the Icon web site: http://www.cs.arizona.edu/icon/v93u.htm (Icon for Unix) http://www.cs.arizona.edu/icon/ipl93.htm (Icon program library) Source code is available for Icon and for the library. Binaries of Icon are available for several common Unix platforms. Precompiled ucode files of the library procedures are also available. For the Icon source code, this is primarily a maintenance release. The code has been reworked and simplified to increase portability. An ANSI C compiler is now required, and UNIX systems are expected to supply a POSIX (1003.1-1988) library. This new source release is sufficiently portable that it also builds on the Be operating system (see www.be.com), albeit without graphics. Version 9.3.2 adds one new feature to Icon: The files in a directory can be listed by opening the directory as a file. Subsequent reads return the names of the files contained in the directory. The names are returned in no particular order, and for Unix, the directories "." and ".." are included. The program library update reflects all the changes that have accumulated since the release of version 9.3.1 in December of 1997, and includes several new programs, procedures, and packages. For more information, visit the Icon web site at http://www.cs.arizona.edu/icon/ --------------------------------------------------------------------------- Gregg Townsend Staff Scientist The University of Arizona gmt@cs.arizona.edu Computer Science Tucson, Arizona, USA From icon-group-sender Tue Jul 13 07:57:47 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id HAA01858 for icon-group-addresses; Tue, 13 Jul 1999 07:56:47 -0700 (MST) Message-Id: <199907131456.HAA01858@baskerville.CS.Arizona.EDU> Date: Tue, 13 Jul 1999 12:18:39 +0100 (BST) From: Hugh Sasse To: Gregg Townsend cc: icon-group@optima.CS.Arizona.EDU Subject: Re: Versions 9.3.2 of Icon and IPL available for Unix Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO On 10 Jul 1999, Gregg Townsend wrote: > Version 9.3.2 adds one new feature to Icon: The files in a directory > can be listed by opening the directory as a file. Subsequent reads > return the names of the files contained in the directory. The names > are returned in no particular order, and for Unix, the directories > "." and ".." are included. > I cannot see a function which will allow one to determine if the list of names one is reading is due to reading a genuine directory or a file produced by 'ls -a > files'. There seems to be no stat or lstat function. Have I missed something? Thank you. Hugh hgs@dmu.ac.uk From icon-group-sender Tue Jul 13 12:31:56 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id MAA10696 for icon-group-addresses; Tue, 13 Jul 1999 12:30:15 -0700 (MST) Message-Id: <199907131930.MAA10696@baskerville.CS.Arizona.EDU> Date: Tue, 13 Jul 1999 09:36:28 -0700 (MST) From: Gregg Townsend To: hgs@dmu.ac.uk Cc: icon-group@optima.CS.Arizona.EDU Subject: Re: checking for directory Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Date: Tue, 13 Jul 1999 12:18:39 +0100 (BST) From: Hugh Sasse I cannot see a function which will allow one to determine if the list of names one is reading is due to reading a genuine directory or a file produced by 'ls -a > files'. There seems to be no stat or lstat function. You can't tell by the file contents, but you can determine whether a filename s is a directory by checking to see whether open(s || "/.") succeeds. This is encapsulated in the directory(s) procedure in the Icon program library ("link io"). There's no general stat()/lstat() function, though. --------------------------------------------------------------------------- Gregg Townsend Staff Scientist The University of Arizona gmt@cs.arizona.edu Computer Science Tucson, Arizona, USA From icon-group-sender Tue Jul 13 16:36:15 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id QAA21471 for icon-group-addresses; Tue, 13 Jul 1999 16:35:48 -0700 (MST) Message-Id: <199907132335.QAA21471@baskerville.CS.Arizona.EDU> From: "Iain Alexander" To: icon-group@optima.CS.Arizona.EDU Date: Tue, 13 Jul 1999 23:16:49 +0100 Subject: Re: Versions 9.3.2 of Icon and IPL available for Unix Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO On 13 Jul 99, at 12:18, Hugh Sasse wrote: > On 10 Jul 1999, Gregg Townsend wrote: > > > Version 9.3.2 adds one new feature to Icon: The files in a directory > > can be listed by opening the directory as a file. Subsequent reads > > return the names of the files contained in the directory. The names > > are returned in no particular order, and for Unix, the directories > > "." and ".." are included. > > > I cannot see a function which will allow one to determine if the list of > names one is reading is due to reading a genuine directory or a file > produced by 'ls -a > files'. There seems to be no stat or lstat function. > Have I missed something? Perhaps. You appear to want to open("directory/files"), whereas you actually open the directory itself - open("directory"). Or perhaps *I've* misunderstood. :-) -- Iain Alexander PGP 1024-bit key id B501A0AD ia@stryx.demon.co.uk I.Alexander@bra0105.wins.icl.co.uk From icon-group-sender Wed Jul 14 07:53:31 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id HAA19313 for icon-group-addresses; Wed, 14 Jul 1999 07:53:23 -0700 (MST) Message-Id: <199907141453.HAA19313@baskerville.CS.Arizona.EDU> Date: Wed, 14 Jul 1999 09:32:53 +0100 (BST) From: Hugh Sasse To: Gregg Townsend cc: icon-group@optima.CS.Arizona.EDU Subject: Re: checking for directory Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO On Tue, 13 Jul 1999, Gregg Townsend wrote: > You can't tell by the file contents, but you can determine whether a > filename s is a directory by checking to see whether open(s || "/.") Yes, that would do the trick. Thank you. > succeeds. This is encapsulated in the directory(s) procedure in the > Icon program library ("link io"). There's no general stat()/lstat() > function, though. I think it is worth considering. It is not so unix specific: DOS C compilers had it in the 1980's. I get the impression that the Unicon people are keen to contribute their extensions to the Icon core, but you would have to ask them of course :-) If Icon is regarded as being complete now, then I suppose this won't get included. > > --------------------------------------------------------------------------- > Gregg Townsend Staff Scientist The University of Arizona > gmt@cs.arizona.edu Computer Science Tucson, Arizona, USA > Thank you, Hugh From icon-group-sender Sun Jul 18 15:22:32 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id PAA07448 for icon-group-addresses; Sun, 18 Jul 1999 15:22:24 -0700 (MST) Message-Id: <199907182222.PAA07448@baskerville.CS.Arizona.EDU> X-Sender: memphis@popmail.macconnect.com Date: Wed, 14 Jul 1999 15:05:05 -0500 To: icon-group@optima.CS.Arizona.EDU From: Garry Subject: Basename.icn in Library 9.3.2 Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Am I not correct that it's not correct? The implementation of Basename in release 9.3.1 was procedure basename(name, suffix) #: base name of file local i name ? { every i := upto('/\\:') tab(integer(i) + 1) # get rid of path, if any return tab(find(\suffix | ".") | 0) # return part before suffix, if any } end In release 9.3.2 Basename has become a little "safer" ("Basename xyzzy.c .cpp" returns xyzzy.c not xyzzy) procedure basename(name, suffix) #: base name of file local i, base name ? { every i := upto('/\\:') tab(integer(i) + 1) # get rid of path, if any if base := 1(tab(find(\suffix)), pos(-*suffix)) then return base else return tab(0) } end I like the new version, it's the Basename that I know and love, but the behavior has actually changed and the documentation doesn't reflect that (so I don't know if the behavior is intended or not). The file documentation says that # If no suffix is provided, the portion of the name up to the first # "." is returned. I think that that is no longer true and that the new Basename returns the simple filename, with suffix, if no suffix is specified. Am I correct? (I'm an Icon newbie and I'm confused as to whether I'm confused...) Is the behavior intended? Should the documentation be corrected? (* BTW I'm using Icon 9.0 on MacOS 8 under the MPW Shell. I'm looking forward to using Icon graphics procedures when 9.3 is done for Macintosh. I'll implement it myself if necessary but right now I'm working on compiling release 9.0 with MrC. *) -- Garry Roseman Tech Writer & Freelance Programmer From icon-group-sender Sun Jul 18 15:23:12 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id PAA07496 for icon-group-addresses; Sun, 18 Jul 1999 15:22:58 -0700 (MST) Message-Id: <199907182222.PAA07496@baskerville.CS.Arizona.EDU> To: icon-group@optima.CS.Arizona.EDU Date: Thu, 15 Jul 1999 21:08:44 -0500 From: memphis@macconnect.com (Garry) Subject: [Q][newbie] Why use a useless loop? Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO There is a wonderful little procedure, lastname(s), in the Icon Library for extracting the last name from a string s representing a person's full name. (It seems wonderful to me considering how compact yet tolerant it is, and how I would write it in other languages ). e.g. lastname("Dr. I. M. Zany, Jr.") produces a "Zany" result. The implementation is # File: lastname.icn # Subject: Procedure to produce last name # Author: Ralph E. Griswold # Date: April 30, 1993 # # Produces the last name of a name in conventional form. Obviously, it # doesn't work for every possibility. procedure lastname(s) local line, i while line := trim(s) do { line ?:= tab(upto(',')) # Get rid of things like " ... , Jr." line ? { every i := upto(' ') tab(\i + 1) return tab(0) } } end My problem is that I can't think of any reason for writing while line := trim(s) do { ... } instead of just line := trim(s) Can anyone see a need for the "while"? If so, please teach me. I did of course already spend more than one full minute thinking about this and looked up trim() in the Icon book. Maybe there really is no need for the "while" but then I've observed that I'm blind to my blind spots. -- Garry Tech Writer & Freelance Programmer From icon-group-sender Sun Jul 18 15:23:50 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id PAA07540 for icon-group-addresses; Sun, 18 Jul 1999 15:23:25 -0700 (MST) Message-Id: <199907182223.PAA07540@baskerville.CS.Arizona.EDU> Date: Fri, 16 Jul 1999 17:59:13 +0200 (CEST) From: Anonymous Comments: This message did not originate from the Sender address above. It was remailed automatically by anonymizing remailer software. Please report problems or inappropriate use to the remailer administrator at . Subject: 9.3.2 for Windows To: icon-group@optima.CS.Arizona.EDU Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO is there 9.3.2 for MS Windows - would be nice - also how soon for the posix port to MS Windows...? From icon-group-sender Mon Jul 19 08:29:01 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id IAA05230 for icon-group-addresses; Mon, 19 Jul 1999 08:28:17 -0700 (MST) Message-Id: <199907191528.IAA05230@baskerville.CS.Arizona.EDU> From: "Frank Lhota" To: , "Garry" Subject: Re: Basename.icn in Library 9.3.2 Date: Mon, 19 Jul 1999 10:39:06 -0400 X-Priority: 3 X-MSMail-Priority: Normal X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO > I like the new version, it's the Basename that I know and love, but the behavior has actually changed and the documentation doesn't reflect that (so I don't know if the behavior is intended or not). The file documentation says that > # If no suffix is provided, the portion of the name up to the first > # "." is returned. > > I think that that is no longer true and that the new Basename returns the simple filename, with suffix, if no suffix is specified. > > Am I correct? (I'm an Icon newbie and I'm confused as to whether I'm confused...) > Is the behavior intended? Yes, that is true. Obviously, the new version has no search for "." if suffix is undefined or not present. The best way to verify this is by unit testing, e.g., procedure main ( arg ) write ( basename ( arg [ 1 ], ( arg [ 2 ] | &null ) ) end > Should the documentation be corrected? > That all depends on how we want basename to behave. If we actually want the old behavior, we should correct the procedure instead. I think that the original idea was to make basename mimic the Unix utility of the same name. The latest version of basename does seem to match the Unix basename, so if this is what is desired, we should update the documentation. Here is how I would implement basename: procedure basename(name, suffix) #: base name of file local base name ? { while tab ( upto('/\\:') + 1 ) # get rid of path, if any if ( base := tab ( -*\suffix ) ) & =suffix then return base $ifdef OLD_STYLE else return tab ( find ( "." ) | 0 ) $else # OLD_STYLE else return tab ( 0 ) $endif # OLD_STYLE } end To get the old behavior (cut off everything after the first "." if suffix is null or not at the end of the name), define the symbol OLD_STYLE. Otherwise, you'll get the Unix style, i.e. if the suffix is null or not at the end, return everything past the path part. From icon-group-sender Mon Jul 19 08:29:31 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id IAA05286 for icon-group-addresses; Mon, 19 Jul 1999 08:29:23 -0700 (MST) Message-Id: <199907191529.IAA05286@baskerville.CS.Arizona.EDU> From: "Frank Lhota" To: , "Garry" Subject: Re: [Q][newbie] Why use a useless loop? Date: Mon, 19 Jul 1999 11:22:52 -0400 X-Priority: 3 X-MSMail-Priority: Normal X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO You're right. the loop appears to be unnecessary. My guess is that it is a fossil remain of a previous implementation. One thing that strikes me about the implementation of both this procedure and of basename is the use of a variable to store a position in the subject string. Frankly, I do not know why this is done when a simpler and more straightforward solution can be obtained by using the tab function. for example, we can implement lastname as follows: procedure lastname(s) local line line := trim(s) line ?:= tab(find(",")) # Get rid of things like " ... , Jr." line ? { while tab(find(" ")+1) # Move past all blanks. return tab(0) } end Now isn't that clearer than the version that uses the local variable i to store positions? ----- Original Message ----- From: Garry To: Sent: Thursday, July 15, 1999 10:08 PM Subject: [Q][newbie] Why use a useless loop? > There is a wonderful little procedure, lastname(s), in the Icon Library > for extracting the last name from a string s representing a person's > full name. (It seems wonderful to me considering how compact yet > tolerant it is, and how I would write it in other languages ). > > e.g. lastname("Dr. I. M. Zany, Jr.") produces a "Zany" result. > > The implementation is > # File: lastname.icn > # Subject: Procedure to produce last name > # Author: Ralph E. Griswold > # Date: April 30, 1993 > # > # Produces the last name of a name in conventional form. Obviously, it > # doesn't work for every possibility. > > procedure lastname(s) > local line, i > > while line := trim(s) do { > line ?:= tab(upto(',')) # Get rid of things like " ... , Jr." > line ? { > every i := upto(' ') > tab(\i + 1) > return tab(0) > } > } > end > > > My problem is that I can't think of any reason for writing > while line := trim(s) do { ... } > instead of just > line := trim(s) > > Can anyone see a need for the "while"? If so, please teach me. I did of > course already spend more than one full minute thinking about this and > looked up trim() in the Icon book. Maybe there really is no need for the > "while" but then I've observed that I'm blind to my blind spots. > > -- > Garry > Tech Writer & Freelance Programmer > From icon-group-sender Mon Jul 19 12:46:50 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id MAA14861 for icon-group-addresses; Mon, 19 Jul 1999 12:46:09 -0700 (MST) Message-Id: <199907191946.MAA14861@baskerville.CS.Arizona.EDU> Date: Mon, 19 Jul 1999 09:03:13 -0700 From: Blake Chapman To: icon-group@optima.CS.Arizona.EDU Subject: Where does EXE file go ? Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO I am attempting to use WinIcon. In Wi I create a program, save it as an .icn file, and then in the Compile menu select "Make (compile + link) executable". Then I select Run|Run and it works. However, there is no .EXE file SAVED anywhere I can find. It isn't in the directory the *.icn file was saved into, and using the Microsoft Find utility I can't find it anywhere on the disk. What is wrong ? Thanks, Blake Chapman From icon-group-sender Mon Jul 19 12:47:36 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id MAA14947 for icon-group-addresses; Mon, 19 Jul 1999 12:47:29 -0700 (MST) Message-Id: <199907191947.MAA14947@baskerville.CS.Arizona.EDU> From: "Nevin Liber" To: Cc: "Frank Lhota" , "Garry" Subject: RE: [Q][newbie] Why use a useless loop? Date: Mon, 19 Jul 1999 10:57:42 -0500 X-Priority: 3 (Normal) X-MSMail-Priority: Normal Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2014.211 Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Frank Lhota [mailto:lhotaf@lexma.meitech.com] wrote: > One thing that strikes me about the implementation of both this procedure > and of basename is the use of a variable to store a position in > the subject > string. Frankly, I do not know why this is done when a simpler and more > straightforward solution can be obtained by using the tab function. I vaguely remember that in older implementations of Icon there were some pecularities when having nested string scanning environments. There is some reference to this at , although I might be thinking of something else. Most of these procedures are probably old enough that they were coded to explicitly keep track of the position within a string as to avoid problems when being called within a string scanning environment. If this is indeed the reason, I'm sure that most of the authors today would use string scanning to implement their solutions. __ Nevin ":-)" Liber (312) 855-1000 x199 From icon-group-sender Tue Jul 20 08:50:22 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id IAA20055 for icon-group-addresses; Tue, 20 Jul 1999 08:49:42 -0700 (MST) Message-Id: <199907201549.IAA20055@baskerville.CS.Arizona.EDU> To: icon-group@optima.CS.Arizona.EDU Date: Tue, 20 Jul 1999 10:46:02 +1000 From: ir Subject: Re: Where does EXE file go ? Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO If the installation was done correctly the Exe file is saved in Winicon, next to the source file. Anyway, check the Readme.txt file from the Winicon directory. Start with line 9 - Setup your Path and Environment variables Regards Ion Blake Chapman wrote: > I am attempting to use WinIcon. In Wi I create a program, save it as an > .icn file, and then in the Compile menu select "Make (compile + link) > executable". Then I select Run|Run and it works. However, there is no > .EXE file SAVED anywhere I can find. It isn't in the directory the > *.icn file was saved into, and using the Microsoft Find utility I can't > find it anywhere on the disk. What is wrong ? > > Thanks, > Blake Chapman From icon-group-sender Thu Jul 22 16:43:50 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id QAA21384 for icon-group-addresses; Thu, 22 Jul 1999 16:42:02 -0700 (MST) Message-Id: <199907222342.QAA21384@baskerville.CS.Arizona.EDU> From: "Iain Alexander" To: icon-group@optima.CS.Arizona.EDU Date: Thu, 22 Jul 1999 23:12:07 +0100 Subject: Re: Where does EXE file go ? Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Correct, there is no .EXE, there is instead a .BAT :-) (At least, with the version I'm using. I believe the situation may have changed with more recent versions of WinIcon, but if you've got an old version, it may be worth checking.) On 19 Jul 99, at 9:03, Blake Chapman wrote: > I am attempting to use WinIcon. In Wi I create a program, save it as an > .icn file, and then in the Compile menu select "Make (compile + link) > executable". Then I select Run|Run and it works. However, there is no > .EXE file SAVED anywhere I can find. It isn't in the directory the > *.icn file was saved into, and using the Microsoft Find utility I can't > find it anywhere on the disk. What is wrong ? > > Thanks, > Blake Chapman > > > -- Iain Alexander PGP 1024-bit key id B501A0AD ia@stryx.demon.co.uk I.Alexander@bra0105.wins.icl.co.uk From icon-group-sender Tue Jul 27 07:37:56 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id HAA08828 for icon-group-addresses; Tue, 27 Jul 1999 07:34:35 -0700 (MST) Message-Id: <199907271434.HAA08828@baskerville.CS.Arizona.EDU> To: icon-group@optima.CS.Arizona.EDU Date: 27 Jul 1999 01:39:06 GMT From: nr@viper.cs.Virginia.EDU (Norman Ramsey) Subject: Re: Basename.icn in Library 9.3.2 Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO In article <199907191948.MAA14993@baskerville.CS.Arizona.EDU>, Frank Lhota wrote: >> Should the documentation be corrected? >> > >That all depends on how we want basename to behave. If we actually want the >old behavior, we should correct the procedure instead. I think that the >original idea was to make basename mimic the Unix utility of the same name. >The latest version of basename does seem to match the Unix basename, so if >this is what is desired, we should update the documentation. A wise man once said, ``If you change the specification of a procedure, also change its name.'' From icon-group-sender Tue Jul 27 12:22:12 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id MAA18656 for icon-group-addresses; Tue, 27 Jul 1999 12:21:44 -0700 (MST) Message-Id: <199907271921.MAA18656@baskerville.CS.Arizona.EDU> From: "Frank Lhota" To: Subject: The Correct Basename Documentation Date: Tue, 27 Jul 1999 12:31:17 -0400 X-Priority: 3 X-MSMail-Priority: Normal X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO This is a multi-part message in MIME format. ------=_NextPart_000_0022_01BED82B.EC3433B0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Recently, we have been discussing the basename procedure in the 9.3.2 = library. It has been noted that the behavior of the procedure has = changed without any modification in the documentation. There is general = agreement that either the procedure or the documentation should be = changed in order to bring them into agreement. Norman Ramsey made a very = good point regarding this discussion: A wise man once said, ``If you change the specification of a = procedure, also change its name.'' In general, I strongly agree with this principle. Identifier names are = one of the most valuable forms of internal documentation. It is a shame = that so many programmers treat identifier naming as a second class = issue. The name of a procedure should express what a procedure does, and = if the actions of that procedure changes, its name should change to = express its current actions. In this case, however, we have a case where the procedure has not = behaved as its name suggests until recently. The name suggests an = internal version of the Unix basename utility. The procedure header = makes this link. Until the 9.3.2 library, however, the basename = procedure has not behaved the same as its namesake Unix utility. If the = Unix basename utility is not provided with a suffix, or if the specified = suffix is not at the end of the name, then basename prints everything = past the path info. Try this at a Unix command line: $ basename /usr/icon/ipl/procs/basename.icn .icn basename $ basename /usr/icon/ipl/procs/basename.icn basename.icn $ basename /usr/icon/ipl/procs/basename.icn .c basename.icn In the previous versions of the Icon basename procedure, if the suffix = was absent or not found at the end, the procedure would lop off both the = path and everything past the first period. Before the 9.3.2 library, the = name of this procedure has therefore been misleading. As a result, the right way to keep basename true to its name is too keep = its current behavior, that is, matching its Unix namesake. The = documentation should be updated to reflect this. Here is how = basename.icn should look: #########################################################################= ### # # File: basename.icn # # Subject: Procedures to produce base name of a file # # Author: Ralph E. Griswold # # Date: September 22, 1998 # #########################################################################= ### # # This file is in the public domain. # #########################################################################= ### # # Contributor: Charles Shartsis # # Updated By: Frank J. Lhota # #########################################################################= ### # # This procedure is based on the UNIX basename(1) utility. It strips = off # any path information. If a suffix is specified, and the stripped name # ends with the suffix, the suffix will be stripped off too. # # It should work under UNIX, MS-DOS, and the Macintosh. # #########################################################################= ### procedure basename(name, suffix) #: base name of file local base name ? { while tab ( upto('/\\:') + 1 ) # get rid of path, if any if ( base :=3D tab ( -*\suffix ) ) & =3Dsuffix then return base else return tab ( 0 ) } end ------=_NextPart_000_0022_01BED82B.EC3433B0 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Recently, we have been discussing the basename = procedure in=20 the 9.3.2 library. It has been noted that the behavior of the procedure = has=20 changed without any modification in the documentation. There is general=20 agreement that either the procedure or the documentation should be = changed in=20 order to bring them into agreement. Norman Ramsey made a very good point = regarding this discussion:
 
A wise man once said, ``If you change the = specification of a=20 procedure, also change its name.''
 
In general, I strongly agree with this principle. = Identifier=20 names are one of the most valuable forms of internal documentation. It = is a=20 shame that so many programmers treat identifier naming as a second class = issue.=20 The name of a procedure should express what a procedure does, and if the = actions=20 of that procedure changes, its name should change to express its current = actions.
 
In this case, however, we have a case where the = procedure has=20 not behaved as its name suggests until recently. The name suggests an = internal=20 version of the Unix basename utility. The procedure header makes this = link.=20 Until the 9.3.2 library, however, the basename procedure has not behaved = the=20 same as its namesake Unix utility. If the Unix basename utility is not = provided=20 with a suffix, or if the specified suffix is not at the end of the name, = then=20 basename prints everything past the path info. Try this at a Unix = command=20 line:
 
$ basename=20 /usr/icon/ipl/procs/basename.icn .icn
basename
$ basename=20 /usr/icon/ipl/procs/basename.icn
basename.icn
$ basename=20 /usr/icon/ipl/procs/basename.icn .c
basename.icn
 
In the previous versions of the Icon basename = procedure, if=20 the suffix was absent or not found at the end, the procedure would lop = off both=20 the path and everything past the first period. Before the 9.3.2 = library,=20 the name of this procedure has therefore been misleading.
 
As a result, the right way to keep basename true to = its name=20 is too keep its current behavior, that is, matching its Unix = namesake. The=20 documentation should be updated to reflect this. Here is how = basename.icn should=20 look:
 
################################################################= ############
#
# File:    =20 basename.icn
#
# Subject:  Procedures to produce base = name of a=20 file
#
# Author:   Ralph E.=20 Griswold
#
# Date:     September 22,=20 1998
#
############################################################= ################
#
#  =20 This file is in the public=20 domain.
#
#########################################################= ###################
#
# =20 Contributor:  Charles Shartsis
#
#  Updated By: Frank J. = Lhota
#
###########################################################= #################
#
# =20 This procedure is based on the UNIX basename(1) utility.  It strips = off
#  any path information. If a suffix is specified, and the = stripped=20 name
#  ends with the suffix, the suffix will be stripped off=20 too.
#
#  It should work under UNIX, MS-DOS, and the=20 Macintosh.
#
######################################################= ######################
 
procedure basename(name, = suffix)  #:=20 base name of file
   local base
 
   name ?=20 {
      while tab ( upto('/\\:') + 1 )  = # get=20 rid of path, if any
      if ( base :=3D tab = (=20 -*\suffix ) ) & = =3Dsuffix
        =20 then return base
         = else return=20 tab ( 0 )
      }
end
 
------=_NextPart_000_0022_01BED82B.EC3433B0-- From icon-group-sender Tue Jul 27 16:55:25 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id QAA01509 for icon-group-addresses; Tue, 27 Jul 1999 16:54:55 -0700 (MST) Message-Id: <199907272354.QAA01509@baskerville.CS.Arizona.EDU> From: "Nevin Liber" To: Cc: "Frank Lhota" Subject: Re: The Correct Basename Documentation Date: Tue, 27 Jul 1999 18:32:31 -0500 X-Priority: 3 (Normal) X-MSMail-Priority: Normal Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2014.211 Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO >> A wise man once said, ``If you change the specification of a = >> procedure, also change its name.'' > As a result, the right way to keep basename true to its name is too keep = > its current behavior, that is, matching its Unix namesake. I'm not sure this is the correct behavior (I'm not sure it isn't either). Whenever someone makes a change to a public library or API, what that person really has to weigh is how much of the installed base of code depends on the previous buggy or unspecified behavior. While most would agree that it is a bad idea to code to an implementation instead of an interface (can anyone tell that I'm in the middle of reading Design Patterns? :-)), library writers, OS implementers, etc., have to worry about the people who do code to a specific, concrete implementation. Just changing the documentation isn't enough; what you really have to do is regression test any code that is dependent upon the particular routine you are "improving". In practice, this can't be accomplished, because you really don't know the entire user base of your library, so you have to guess. It isn't the new users of the function that worry me nearly as much as the existing users of the function. Are people dependent on the previous behavior? __ Nevin ":-)" Liber (312) 855-1000 x199 From icon-group-sender Thu Jul 29 12:28:22 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id MAA02945 for icon-group-addresses; Thu, 29 Jul 1999 12:26:12 -0700 (MST) Message-Id: <199907291926.MAA02945@baskerville.CS.Arizona.EDU> From: "Frank Lhota" To: Subject: How to Bring Back the Old basename Date: Thu, 29 Jul 1999 12:10:19 -0400 X-Priority: 3 X-MSMail-Priority: Normal X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Nevin Liber has a good point regarding basename. Even if the latest version is closer to the original intentions, as well as the closer to what the name suggests, there may be many applications dependant on the old behavior. To keep these applications from breaking, we need to retain the old, quirky behavior. This is unfortunate for new developers who would rather have something closer to the Unix utility. Has anyone else noticed how superfluous the second parameter to the old basename is? The old basename chops off the extension whether or not the second parameter is specified, and whether or not it is present, so when does specifying an extension make a difference? The best option for now may be to fix basename to return the old behavior, and also update the documentation to clarify the quirk. Here is my proposal: ############################################################################ # # File: basename.icn # # Subject: Procedures to produce base name of a file # # Author: Ralph E. Griswold # # Date: September 22, 1998 # ############################################################################ # # This file is in the public domain. # ############################################################################ # # Contributor: Charles Shartsis # ############################################################################ # # This procedure is based on the UNIX basename(1) utility. It strips off # any path information and removes the specified suffix, if present. # # If no suffix is provided, or if the suffix is not at the end of the name, # the portion of the name up to the first "." is returned. # # It should work under UNIX, MS-DOS, and the Macintosh. # ############################################################################ procedure basename(name, suffix) #: base name of file local base name ? { while tab ( upto('/\\:') + 1 ) # get rid of path, if any if ( base := tab ( -*\suffix ) ) & =suffix then return base else return tab ( find ( "." ) | 0 ) } end From icon-group-sender Thu Jul 29 16:26:22 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id QAA11212 for icon-group-addresses; Thu, 29 Jul 1999 16:25:50 -0700 (MST) Message-Id: <199907292325.QAA11212@baskerville.CS.Arizona.EDU> Date: Thu, 29 Jul 1999 13:31:49 -0700 (PDT) From: "Glenn E. Thobe" To: icon-group@optima.CS.Arizona.EDU Subject: coswitch for Sun3 SunOS 4.1.1 Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO In the new icon 9.3.2 source distribution, I cannot find the coswitch routine for the Sun 3 (Motorola 680x0) architecture. This was included in the 9.3.1 source code although apparently not by intention. I no longer have the 9.3.1 source, but I believe it was in config/unix/*/rswitch.c where * was NeXT or Mac or some other Motorola based machine. The old source distribution has been removed from www.cs.arizona.edu. Is there any way to get this code? I am trying to build icon on my Sun 3/80, SunOS 4.1.1_U1 with gcc and X11R6.3. I almost had 9.3.1 working, but 9.3.2 came out while before I had solved all the problems and I deleted the 9.3.1 source code before I realized this vital bit of code was missing from the newer edition. Thanks. -Glenn Thobe From icon-group-sender Fri Jul 30 07:26:11 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id HAA04723 for icon-group-addresses; Fri, 30 Jul 1999 07:25:27 -0700 (MST) Message-Id: <199907301425.HAA04723@baskerville.CS.Arizona.EDU> From: gep2@terabites.com Date: Thu, 29 Jul 1999 18:48:11 -0500 Subject: How to Bring Back the Old basename To: icon-group@optima.CS.Arizona.EDU Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO > Nevin Liber has a good point regarding basename. Even if the latest version is closer to the original intentions, as well as the closer to what the name suggests, there may be many applications dependant on the old behavior. I'm going to make several observations here. > To keep these applications from breaking, we need to retain the old, quirky behavior. This is unfortunate for new developers who would rather have something closer to the Unix utility. Personally, I have no vested interest (or other interest, for that matter) in making ANYTHING work like some Unix version does... I consider Unix in general to be an anachronistic relic, with crappy documentation standards and inherently anarchistic ongoing development efforts. And I also don't consider it particularly compelling to argue that any given name (especially something as generic as "basename") has any kind of copyright on the name, giving them the right to define what said named function does (or doesn't do) forever and ever amen. And that's especially true when the function's behavior can be argued to be "broken" in the way an old, stupid, anachronistic implementation did things. > Has anyone else noticed how superfluous the second parameter to the old basename is? The old basename chops off the extension whether or not the second parameter is specified, and whether or not it is present, so when does specifying an extension make a difference? > The best option for now may be to fix basename to return the old behavior, and also update the documentation to clarify the quirk. Here is my proposal: I think my recommendation would be to specify in the documentation and/or routine comments that this routine has a number of quirks and odd behavior, and give some specific examples showing cases that might yield unexpected results. It would be perfectly reasonable to compare (in the comments) how the old-fashioned Unix-y "basename", the "old Icon" basename, and the "new Icon" basename would behave in the same situations. Yet another approach might be to add a third "mode" parameter, which could be set to different values specifying which type of behavior one wanted from the routine. To eliminate unwanted "default" behavior, one might purposely "break" old programs by requiring that the third mode parameter be explicitly provided... this would attract attention to the comments in the revised routine and force the programmer to decide (and specify) which behavior he (or she) wants. Gordon Peterson http://web2.airmail.net/gep2/ Support the Anti-SPAM Amendment! Join at http://www.cauce.org/ 12/19/98: the day the Conservatives demonstrated their scorn for their fraudulent sham of representative government. Voters, remember it! From icon-group-sender Fri Jul 30 12:37:01 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id MAA13972 for icon-group-addresses; Fri, 30 Jul 1999 12:35:39 -0700 (MST) Message-Id: <199907301935.MAA13972@baskerville.CS.Arizona.EDU> From: "Frank Lhota" To: Subject: When Do You Keep A Quirk? Date: Fri, 30 Jul 1999 11:39:17 -0400 X-Priority: 3 X-MSMail-Priority: Normal X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Gordon Peterson makes an excellent argument for moving to a less quirky definition of basename, going so far as to purposely break older programs that might depend on the quirks. I am totally sympathetic to this point of view. I had a friend that worked on the ANSI C standards committee. He frequently lamented that there were proposed changes to C that every committee member agreed would make a for a better language, but were voted down because they would break large, existing applications. One has to weigh the cost of revising old programs with the possible gains in new programs. In the case of basename, there are over a dozen IPL sources that use basename. If these IPL programs have not been tested with the new version of basename, I would be very concerned about this change, for this can effect programs that are not even using basename directly. Of course, it is very hard to determine how much non-IPL code out there uses basename, or how many programs depend on the quirks. As much as I prefer the new version of basename, making this change in the short run is too risky. If and when we do wish to change the behavior of basename, there is a way to ease the migration path. We can write a procedure old_basename that has the old behavior, then add the following line to old source files: $define basename old_basename One final point: could we please cut down on ending Icon group mailings with political or religious messages? I say this not because I disagree (or agree) with the religious / political / aesthetic views of the members of the group. It's just that the purpose of the group is to exchange information on the Icon programming language. This is not the place for discussion of these other topics. From icon-group-sender Fri Jul 30 17:49:41 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id RAA24130 for icon-group-addresses; Fri, 30 Jul 1999 17:44:44 -0700 (MST) Message-Id: <199907310044.RAA24130@baskerville.CS.Arizona.EDU> From: gep2@terabites.com Date: Fri, 30 Jul 1999 18:16:13 -0500 Subject: When Do You Keep A Quirk? To: icon-group@optima.CS.Arizona.EDU Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO > Gordon Peterson makes an excellent argument for moving to a less quirky definition of basename, ...thank you... > ...going so far as to purposely break older programs that might depend on the quirks. Right. Some years ago, I was the programmer in charge of Datapoint's disk operating system. Although the system was really quite reliable, we'd (only rarely) occasionally seen problems of the Cluster Allocation Table (the bitmap of available clusters on the disk) becoming corrupted. This would eventually result in clusters being cross-linked to more than one file, obviously resulting in serious problems. Other times, we'd sometimes simply "lose" space on the disk that was no longer allocated to any file. One day I was wondering about how it was that file close (and space deallocation, including when a file was being totally deleted) function was able to run so quickly, even for large files. In our system, we had a fixed number of disk controller buffers, and a fixed number of Logical File Table entries (think of these as being similar the the data referenced by a "file handle"). When deleting a file (or the end, unused part of a file that had been extended) the system loaded the Cluster Allocation Table into disk controller buffer zero, and the RIB (Retrieval Information Block) for the file (detailing the locations and sizes of the allocated pieces for the file) into the disk controller buffer corresponding to the LFT entry in use when the file was being closed. It then ran down through the appropriate entries in the RIB, clearing bits in the CAT and rewriting the CAT and its backup copy to disk when done. As I thought about this, I realized that if one were using LFT entry zero to close a file and deallocate space, the two blocks would be loaded into the same buffer, resulting in (sometimes) extraneous entries in the CAT being cleared (and for a variety of technical reasons, probably not worth going into here, this tended to occur most often when a file that had been on the disk for a long time had been moved or replaced) since now the CAT was being also used as if it were the RIB of the file being closed as well. I couldn't imagine a program actually doing such a thing as closing a file using LFT entry zero, but just as a precaution built into the system a feature that would prevent the incorrect behavior by not allowing files to be closed and their space deallocated when using that LFT entry. It wasn't too long after that when one afternoon the programmer in charge of our BASIC compiler came in, angry as all hell, pissed off at the change I've made and complaining that BASIC needed to use LFT entry zero when deleting files... and BINGO, we'd found the cause of the mysterious CAT corruption. :-) Anyhow, I tend to think that (if this BASENAME routine is actually used at all) it's PROBABLY being used by people who are unaware of the bug, and using it presuming that it works the way it sounds like it's supposed to work. The "quirky" behavior (i.e. LONGSTANDING BUG) probably results in a lot of "quirky behavior" (i.e. LONGSTANDING BUGS) in the programs which use BASENAME, too. When changing such an implementation detail, I'd think that a reasonable way to handle that is to carefully document (preferably in a source file comment, perhaps also in a more global README file or something) the "bug" that was fixed, examples of previous and new behavior, and let it go at that. The other idea (about adding a mandatory third parameter) would be one way to make SURE that programs using the routine had been made aware of the fix, and that someone responsible for each such program had (hopefully) considered the behavior and what mode they genuinely wanted. (Leaving each of the perhaps-desired modes in the routine, in this case, is no big deal and results in a routine only slightly larger than it would be otherwise... therefore I don't see this as being a huge issue). > I am totally sympathetic to this point of view. I had a friend that worked on the ANSI C standards committee. He frequently lamented that there were proposed changes to C that every committee member agreed would make a for a better language, but were voted down because they would break large, existing applications. One has to weigh the cost of revising old programs with the possible gains in new programs. That's perhaps a very different issue, since there it may be much more difficult to provide BOTH functionalities as options. And here we're not talking about a core language issue anyhow... BASENAME is only just an IPL routine (not even part of the standard compiler runtime or anything) and the IPL is primarily used as EXAMPLES of how stuff is done in Icon. Although certainly some of the other IPL routines use it (and in fact, that might be an interesting exercise... to see if any of those programs count on the quirky behavior or leave it as just another latent bug) it's not clear that the routine is hugely widely used otherwise. (And if, indeed, the correction would FIX a latent bug in each of the IPL sources which call BASENAME, then that would reinforce the decision to fix it, and reduce the worry about programs counting on the anachronistic, buggy, Unix-y behavior). > In the case of basename, there are over a dozen IPL sources that use basename. If these IPL programs have not been tested with the new version of basename, I would be very concerned about this change, for this can effect programs that are not even using basename directly. Are those IPL sources complete stand-alone programs, or lower-level functions likely to have been designed into larger programs or systems? > Of course, it is very hard to determine how much non-IPL code out there uses basename, or how many programs depend on the quirks. Yes. But there are probably at least as many programs which have latent bugs as a result of the quirks... and I'd tend to believe that a program would count on the routine behaving the way one would EXPECT it to behave (i.e. without bugs) based on the description of what the routine is supposed to do. Again, I'll point out that I'm not aware that the routine has ever been documented as behaving with all the same bugs and flaws as the anachronistic Unix routine historically called "basename" (and that's a VERY generic name, not something like "fsprintx" or the like), and that in this business we don't have eternal copyrights or trademarks on function names and ancient (buggy!) implementations based on those names. > As much as I prefer the new version of basename, making this change in the short run is too risky. You're entitled to your opinion... as are all the rest of us too. > If and when we do wish to change the behavior of basename, there is a way to ease the migration path. We can write a procedure old_basename that has the old behavior, then add the following line to old source files: > $define basename old_basename Personally, I don't see that that makes a whole lot of sense. The change is cosmetic at best, and more confusing to programmers who (forever) look at a source file being edited and see 'basename' without being made aware of the macro substitution. If you're gonna change the routine, then let's change it and be done with it. At least adding a third (required) parameter would help make it more obvious to programmers that this routine is NOT an Icon-implemented clone of the archaic Unix "basename". > One final point: could we please cut down on ending Icon group mailings with political or religious messages? I say this not because I disagree (or agree) with the religious / political / aesthetic views of the members of the group. It's just that the purpose of the group is to exchange information on the Icon programming language. This is not the place for discussion of these other topics. I presume the writer is commenting on my sig file, which makes a statement against SPAM E-mails, as well as reminding people of the **shameful** way in which our congresscritters, sent to Washington promising to represent their constituents, instead brazenly participated in the most outrageous orgy of partisan, politically motivated bullshit (and CLEARLY contrary to the expressed will of the majority of the voters) that this country has seen in as far back as *I* (at almost 50) can remember. While I do agree that this is NOT the forum to dwell on discussions of that occurrence, I'll point out too that sig files are a VERY longstanding way for people on the Internet to voice their opinions on a variety of subjects (sort of a "bumpersticker for E-mail") and as such are an important element of free speech. If you don't like to put your stand on such issues in your SIG file, then feel free not to. But don't bitch about other people who do so, just because it makes you uncomfortable to be reminded about the kind of shameful bullshit that some politicos in this country seem to think the public will forget about prior to the next elections. Some of us have longer memories than that!!! Gordon Peterson http://web2.airmail.net/gep2/ Support the Anti-SPAM Amendment! Join at http://www.cauce.org/ 12/19/98: the day the Conservatives demonstrated their scorn for their fraudulent sham of representative government. Voters, remember it! From icon-group-sender Mon Aug 2 16:52:39 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id QAA20277 for icon-group-addresses; Mon, 2 Aug 1999 16:50:42 -0700 (MST) Message-Id: <199908022350.QAA20277@baskerville.CS.Arizona.EDU> Date: Tue, 3 Aug 1999 10:50:09 +1200 (NZST) From: "Richard A. O'Keefe" To: gep2@terabites.com, icon-group@optima.CS.Arizona.EDU Subject: Re: When Do You Keep A Quirk? Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO It sounds as though the right thing to do is to withdraw the basename function *entirely*. I'd like to point out that the situation in UNIX is actually rather confused, thanks to some people adding 'neat hacks'. Solaris: basename string [suffix] deletes any prefix ending in / (does that mean '/' or does it mean _any_ directory separator? matters on DOS/Windows/OS/2) suffix, if present, is a REGULAR EXPRESSION; if there is a tail of string matching suffix, it will be removed (but if there are _several_ such tails, _which_?) XPG4, BSD basename string [suffix] same rule and problem with string; but suffix is a LITERAL and NONE of its characters are significant. There is for example nothing special about '.'. C library: basename(path) does NOT take a suffix argument; removes leading directory prefixes by smashing its argument. It also deletes any trailing slashes, except that a path that is one or more slashes and nothing else yields "/". A null pointer or an empty string yields ".". In particular, basename latex .tex could give you 'l' or 'latex' depending on which of /usr/bin /usr/xpg4/bin comes first in your $PATH. The basename command combines two operations: remove_directory_part which is what the basename() function does, and remove_matching_extension which has no corresponding library function. Nor is the function I've _really_ wanted often enough, remove_any_extension provided in any form. I firmly believe that the _best_ thing to do is to junk basename and its relatives completely and to provide a 'pathname' library modelled on Common Lisp. The second best thing to do is to throw 'basename' out as being just too confusing, and to provide two _new_ library functions remove_directory_part(FileName) -> FileName without any (drive or) directory part. name (if present), extension (if present), and version number (if present) are retained. remove_extension(FileName[, Extension]) -> if Extension is provided, ignore any leading dot to get Extension', remove trailing . Extension' from FileName if present, no change to FileName if . Extension' not present if Extension not provided, remove trailing . ext from FileName if present, where ext is anything host file system allows in an extension. Leave any directory part intact. return modified FileName. When writing new code, you can use these without wondering which version of `basename', if any, Icon `basename' corresponds to. Old code will promptly break. If it assumed the documented behavior of basename, just plug in basename(F, E) = remove_extension(remove_directory_part(F), E) basename(F) = remove_directory_part(F) If it assumed the actual behaviour, just plug in basename(F) = remove_extension(remove_directory_part(F)) One of the best things about Java is @deprecated, obviously swiped from Eiffel's 'obsolete' keyword. In Eiffel, you can write obsolete "" and the compiler writes the string as a warning if your program uses that procedure. Icon could do with something similar for cases like this. From icon-group-sender Tue Aug 3 07:45:33 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id HAA12956 for icon-group-addresses; Tue, 3 Aug 1999 07:41:54 -0700 (MST) Message-Id: <199908031441.HAA12956@baskerville.CS.Arizona.EDU> From: gep2@terabites.com Date: Mon, 02 Aug 1999 23:08:37 -0500 Subject: Re: When Do You Keep A Quirk? To: "Richard A. O'Keefe" , icon-group@optima.CS.Arizona.EDU Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO The fact, as Richard points out, that Unix systems aren't even consistent within themselves gives even one more reason to not worry about trying to recreate the mythical "standard" basename()'s routine's anachronistic behavior. His suggestions for new routines (which would hopefully be even more useful and practical) sound fine, and I'm sure would be appreciated by many programmers. The idea, though, that we have to retire the generic function name "basename" for all time still strikes me as being pretty ridiculous. Again, don't people understand that a lot of the routines in IPL are there principally AS EXAMPLES!!!??? Gordon Peterson http://web2.airmail.net/gep2/ Support the Anti-SPAM Amendment! Join at http://www.cauce.org/ 12/19/98: the day the Conservatives demonstrated their scorn for their fraudulent sham of representative government. Voters, remember it! From icon-group-sender Tue Aug 3 16:45:48 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id QAA22281 for icon-group-addresses; Tue, 3 Aug 1999 16:41:17 -0700 (MST) Message-Id: <199908032341.QAA22281@baskerville.CS.Arizona.EDU> X-Sender: memphis@popmail.macconnect.com Date: Tue, 3 Aug 1999 15:08:17 -0500 To: gep2@terabites.com, icon-group@optima.CS.Arizona.EDU From: Garry Subject: Learning by Example (was: When Do You Keep A Quirk?) X-MIME-Autoconverted: from quoted-printable to 8bit by baskerville.CS.Arizona.EDU id NAA09706 Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Gordon Peterson wrote: >The fact, as Richard points out, that Unix systems aren't even consistent within >themselves gives even one more reason to not worry about trying to recreate the >mythical "standard" basename()'s routine's anachronistic behavior. > >His suggestions for new routines (which would hopefully be even more useful and >practical) sound fine, and I'm sure would be appreciated by many programmers. > >The idea, though, that we have to retire the generic function name "basename" >for all time still strikes me as being pretty ridiculous. > >Again, don't people understand that a lot of the routines in IPL are there >principally AS EXAMPLES!!!??? The IPL has quite a large number of good examples, as Gordon has pointed out (some of the IPL code I don't understand yet but I'm making good progress on my first set of programs, for maintaining my programming notes and extracting reports from them -- stuff that I used to with big ugly shell scripts). Personally I can't imagine blindly incorporating anything from any library into my work without at least considering checking out (I keep everything under version control using MPW Projector) a branch version that I will modify for the specific needs of the project. That's why I was looking at the implementation of Basename in the first place; I was considering whether it was suitable as a replacement for my own quirky (accepts regex for the suffix) implementation of Basename in a current project. As a newbie I can tell you that I have found three great resources for learning Icon: 1) The Icon Programming Language by Griswold and Griswold. This book is worth every penny; it is a labor of love and has obviously been honed and polished to explain the Deep Concepts of Icon in crystal clear fashion. 2) The Icon Programming Language Handbook by Thomas W. Christopher. A gem of almost-mathematical precision. Explains some idioms and gives a viewpoint that complements the Griswold book. This is a "must have" and that's not a problem because it's FREE. This handbook has lots of very helpful examples. Some problems are solved repeatedly using different techniques to show how you would do it using the different features of Icon. 3) The IPL. May be easy to overlook as a teaching resource because it is so large. It would be almost impossible to read all of the good stuff in the Icon Library. Don't neglect reading some of the Library just because you can't read all of the library. (Some of it is discouraging to newbies because it is incomprehensible even after a once-through reading of the Griswold book. Man! You can do some wild things with Icon. ) The golden rule to writing Icon seems to be "tell what you want to do". I could write in a similar style in Forth, but then I had to invent all of the constructs that I used. Icon, as William Mitchell says, "provides a great set of abstract data types right out of the box." An example of "telling what you want to do" occured last night when I wanted to step through a file to the first line that starts with a section mark character (some of you can see the character here: §) I had the darndest time until I wrote simply if not while line := read( file ) do if match( "§ ", line) then break then fail which is close to a direct statement of what I was trying to do and was possible because Icon, like Scheme, has only expressions, even "while e1 do e2" is an expression (that ultimately fails unless exited by a "break"). -- Garry Roseman Tech Writer & Freelance Programmer From icon-group-sender Wed Aug 4 17:34:58 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id RAA11646 for icon-group-addresses; Wed, 4 Aug 1999 17:33:28 -0700 (MST) Message-Id: <199908050033.RAA11646@baskerville.CS.Arizona.EDU> Date: Wed, 04 Aug 1999 16:16:42 -0500 From: "Thomas W. Christopher" X-Accept-Language: en To: Garry CC: gep2@terabites.com, icon-group@optima.CS.Arizona.EDU Subject: Re: Learning by Example (was: When Do You Keep A Quirk?) Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Garry Roseman wrote: ... As a newbie I can tell you that I have found three great resources for learning Icon: ... 2) The Icon Programming Language Handbook by Thomas W. Christopher. A gem of almost-mathematical precision. Explains some idioms and gives a viewpoint that complements the Griswold book. This is a "must have" and that's not a problem because it's FREE. This handbook has lots of very helpful examples. Some problems are solved repeatedly using different techniques to show how you would do it using the different features of Icon. ... Thanks for the kind words, Garry. People can get to it with one fewer click from http://www.toolsofcomputing.com/freesoftware.htm or directly from http://www.toolsofcomputing.com/iconprog.pdf The IIT page may vanish after a while, since I've resigned from there effective Aug. 5th, 1999. -- Thomas W. Christopher -- tc@toolsofcomputing.com Operating Manager, Tools of Computing LLC. -- http://www.toolsofcomputing.com From icon-group-sender Mon Aug 9 08:00:40 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id HAA04946 for icon-group-addresses; Mon, 9 Aug 1999 07:59:10 -0700 (MST) Message-Id: <199908091459.HAA04946@baskerville.CS.Arizona.EDU> Date: Sun, 08 Aug 1999 14:43:58 +0100 From: "C.R. Smith" To: icon-group@optima.CS.Arizona.EDU CC: m8hz@csc.liv.ac.uk Subject: newbie question Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Please can anyone help novice programmer re highligting with ICON I am reading an array of student records into a "display" window when I click on a record the record is selected and displayed in a "selection window". I would like the selected record to be highlighted in the display record - How do I go about this. From icon-group-sender Tue Aug 10 12:39:24 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id MAA00681 for icon-group-addresses; Tue, 10 Aug 1999 12:35:31 -0700 (MST) Message-Id: <199908101935.MAA00681@baskerville.CS.Arizona.EDU> X-Authentication-Warning: nntprelay.berkeley.edu: news set sender to using -f From: espie@liafa.jussieu.fr (Marc Espie) Subject: Re: When Do You Keep A Quirk? Date: 10 Aug 1999 18:59:44 GMT To: icon-group@optima.CS.Arizona.EDU Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO If you want useful directory/filename handling functions in Icon, why not take perl as a prime example ? File::Spec and friends, in recent perl functions, provide everything that's needed to make filename analysis/reconstruction a breeze... independently of the OS involved, which is the whole point, since any of those functions is trivial for one given OS. -- Marc Espie |anime, sf, juggling, unicycle, acrobatics, comics... |AmigaOS, OpenBSD, C++, perl, Icon, PostScript... | `real programmers don't die, they just get out of beta' From icon-group-sender Wed Sep 1 07:38:48 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id HAA28389 for icon-group-addresses; Wed, 1 Sep 1999 07:37:10 -0700 (MST) Message-Id: <199909011437.HAA28389@baskerville.CS.Arizona.EDU> Date: Wed, 01 Sep 1999 13:55:22 +0100 From: J D Burnley To: icon-group@optima.CS.Arizona.EDU Subject: The remove() function Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO I'm no programmer, although I do manage to do useful things with Icon which I couldn't do with any other language (esp. text manipulation). In most of the programs I write (using DOS), the remove() function refuses to delete the files named. Although of course it works from a stand-alone procedure devoted to the purpose, it won't work predictably from the same procedure called within a larger program -- even if the file has been explicitly closed. There may be no simple answer to this, but if there is, I'd be grateful to know it. Regards, David Burnley. From icon-group-sender Wed Sep 1 12:53:30 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id MAA19536 for icon-group-addresses; Wed, 1 Sep 1999 12:52:52 -0700 (MST) Message-Id: <199909011952.MAA19536@baskerville.CS.Arizona.EDU> From: "Frank Lhota" To: "J D Burnley" , Subject: Re: The remove() function Date: Wed, 1 Sep 1999 12:15:01 -0400 X-Priority: 3 X-MSMail-Priority: Normal X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO First of all, you should be aware that DOS has problems with deleting a file that is currently open. Depending on how the file is opened, the version of DOS, and whether there is any buffered data, deleting a file that is open can succeed, fail, or result in "lost clusters". My advice is that your program be modified to make absolutely sure that the file is closed before remove is called. Icon cannot make any promises that the host OS cannot keep. My advice is that you try to come up with a small Icon program that reproduces the problem by paring down your current program. This might clarify the problem, and if it does not, you can post the small program to this newsgroup for evaluation. ----- Original Message ----- From: J D Burnley To: Sent: Wednesday, September 01, 1999 8:55 AM Subject: The remove() function > I'm no programmer, although I do manage to do useful things with Icon > which I couldn't do with any other language (esp. text manipulation). > In most of the programs I write (using DOS), the remove() function > refuses to delete the files named. Although of course it works from a > stand-alone procedure devoted to the purpose, it won't work predictably > from the same procedure called within a larger program -- even if the > file has been explicitly closed. > > There may be no simple answer to this, but if there is, I'd be grateful > to know it. > > Regards, > > David Burnley. From icon-group-sender Thu Sep 2 07:52:01 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id HAA16293 for icon-group-addresses; Thu, 2 Sep 1999 07:49:59 -0700 (MST) Message-Id: <199909021449.HAA16293@baskerville.CS.Arizona.EDU> X-Authentication-Warning: agate-ether.berkeley.edu: news set sender to using -f From: memphis@macconnect.com (Garry) X-Newsgroups: comp.lang.icon Subject: Is open(..,"b") broken in MPW Icon 9.0? Date: Wed, 1 Sep 1999 22:32:14 -0500 User-Agent: MacSOUP/2.4 To: icon-group@optima.CS.Arizona.EDU Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO The most up-to-date Icon available for the Macintosh MPW environment is version 9.0, which I think may have been implemented by Bob Alexander (email address?). I've implemented most of an outline processor / note organizer for MPW using Icon; maybe I'll proceed to try using it for keeping source code in outline form, BUT after more than a month of fun with Icon I've run into a problem!! I can't open a file for update (read/write). When I follow the Icon practice of opening my file with "b" mode I find that I can read it but I can not write to the file. For example if I execute f := open( "Testfile", "b" ) seek( f ) writes( f, "**" ) where "Testfile" is a small test file created previously, then I get the message Run-time error 214 input/output error I've tried specifying "r+" mode or "b+r" or "ub" mode without success. As a test I opened the same file in "w" mode and proved that I was able to write it (destroying the previous contents) but I can not find a way to write to random locations. BTW, is any progress being made on Icon 9.3 for Macintosh? Advice, or just sympathy, will be appreciated. Right now my fall-back solution is to rewrite the entire file just to update the 8 bytes which holds my note ID counter. -- Garry Tech Writer & Freelance Programmer From icon-group-sender Thu Sep 2 13:18:14 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id NAA00177 for icon-group-addresses; Thu, 2 Sep 1999 13:17:34 -0700 (MST) Message-Id: <199909022017.NAA00177@baskerville.CS.Arizona.EDU> Date: Thu, 2 Sep 1999 09:21:02 -0700 (MST) From: Gregg Townsend To: icon-group@optima.CS.Arizona.EDU, memphis@macconnect.com Subject: Re: Mac Icon Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO From: memphis@macconnect.com (Garry) Date: Wed, 1 Sep 1999 22:32:14 -0500 BTW, is any progress being made on Icon 9.3 for Macintosh? No. Nobody that we know of is working on a Macintosh port. One volunteer made a start in 1998, but that project stalled. The 9.3.2 portability cleanup might make it a little less difficult if somebody wants to give it a shot. Another possibility would be to get Jcon (the Java implementation of Icon) working on a Macintosh. The work at Arizona, however, is restricted to maintenance of the Unix version. --------------------------------------------------------------------------- Gregg Townsend Staff Scientist The University of Arizona gmt@cs.arizona.edu Computer Science Tucson, Arizona, USA From icon-group-sender Thu Sep 2 13:19:32 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id NAA00261 for icon-group-addresses; Thu, 2 Sep 1999 13:19:13 -0700 (MST) Message-Id: <199909022019.NAA00261@baskerville.CS.Arizona.EDU> From: "Frank Lhota" To: "Garry" , Subject: Re: Is open(..,"b") broken in MPW Icon 9.0? Date: Thu, 2 Sep 1999 12:32:19 -0400 X-Priority: 3 X-MSMail-Priority: Normal X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO The Icon file management routines are based on the C facilitates. The Icon open mode specifications are mapped to the C fopen mode parameter, and unfortunately the available fopen modes vary from platform to platform. Do you have a C compiler for the Macintosh MPW environment? If so, try to see which C fopen modes will give you the desired results. From this, we can figure out the how to fix the Icon run time code. ----- Original Message ----- From: Garry To: Sent: Wednesday, September 01, 1999 11:32 PM Subject: Is open(..,"b") broken in MPW Icon 9.0? > The most up-to-date Icon available for the Macintosh MPW environment is > version 9.0, which I think may have been implemented by Bob Alexander > (email address?). I've implemented most of an outline processor / note > organizer for MPW using Icon; maybe I'll proceed to try using it for > keeping source code in outline form, BUT after more than a month of fun > with Icon I've run into a problem!! I can't open a file for update > (read/write). When I follow the Icon practice of opening my file with > "b" mode I find that I can read it but I can not write to the file. For > example if I execute > f := open( "Testfile", "b" ) > seek( f ) > writes( f, "**" ) > where "Testfile" is a small test file created previously, then I get the > message > Run-time error 214 > input/output error > > I've tried specifying "r+" mode or "b+r" or "ub" mode without success. > As a test I opened the same file in "w" mode and proved that I was able > to write it (destroying the previous contents) but I can not find a way > to write to random locations. > > BTW, is any progress being made on Icon 9.3 for Macintosh? > > Advice, or just sympathy, will be appreciated. Right now my fall-back > solution is to rewrite the entire file just to update the 8 bytes which > holds my note ID counter. > > -- > Garry > Tech Writer & Freelance Programmer From icon-group-sender Thu Sep 2 17:06:11 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id RAA05094 for icon-group-addresses; Thu, 2 Sep 1999 17:05:54 -0700 (MST) Message-Id: <199909030005.RAA05094@baskerville.CS.Arizona.EDU> X-Authentication-Warning: agate-ether.berkeley.edu: news set sender to using -f From: Robert Valliant X-Newsgroups: comp.lang.icon Subject: Re: Is open(..,"b") broken in MPW Icon 9.0? Date: 02 Sep 1999 11:55:28 -1000 X-Trace: news.hawaii.edu 936309455 27487 128.171.23.89 (2 Sep 1999 21:57:35 GMT) X-Complaints-To: usenet@hawaii.edu X-Newsreader: Gnus v5.5/Emacs 20.3 To: icon-group@optima.CS.Arizona.EDU Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO In my icon manual, seek says: seek(f,i) where f is the filename and "i" is the position (1=beginning, 0=end) Did you try that, but leave it out of your post? -- Robert Valliant Center for Russia in Asia, University of Hawaii at Manoa www.hawaii.edu/shaps/russia valliant@hawaii.edu Fax: 808.956.2682 Tel: 808.956.7814 From icon-group-sender Thu Sep 2 17:07:22 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id RAA05171 for icon-group-addresses; Thu, 2 Sep 1999 17:07:01 -0700 (MST) Message-Id: <199909030007.RAA05171@baskerville.CS.Arizona.EDU> X-Sender: memphis@popmail.macconnect.com Date: Thu, 2 Sep 1999 17:17:45 -0500 To: "Frank Lhota" , From: Garry Subject: Re: Is open(..,"b") broken in MPW Icon 9.0? X-MIME-Autoconverted: from quoted-printable to 8bit by baskerville.CS.Arizona.EDU id PAA20871 Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO At 12:32 -0400 1999-09-02, Frank Lhota wrote: >The Icon file management routines are based on the C facilitates. >The Icon open mode specifications are mapped to the C fopen mode parameter, >and unfortunately the available fopen modes vary from platform to platform. > >Do you have a C compiler for the Macintosh MPW environment? If so, try to >see which C fopen modes will give you the desired results. From this, we can >figure out the how to fix the Icon run time code. Thanks for your response Frank. I don't quite understand; the mode to pass to fopen for updating a file is "r+" on every platform (the lower level Mac toolbox call is something funky but the standard C library function is "standard"). I checked the "r+" mode on my problem file using a C program. "f = fopen( "Testfile", "r+" );" works fine. Thereafter I can read lines with fgets() or write to random locations using fseek() and fprintf() or fputs(). Of course I'm using an up-to-date StdCLib (I'm using MacOS 8.6 and MPW / MrC with Universal Interfaces 3.2). I'm also using the new file system, HFS+, which (I hope) is transparent at the level of standard C functions. Maybe MPW Icon (9.0) just needs to be recompiled against new libraries -- but that's easier said than done. It would become somewhat larger (because of changing from 68K to PowerPC RISC instructions) and much faster. Would anyone be willing to help me? (As for my immediate problem -- it is perhaps most simply solved by using Icon for the analysis and reporting functions, in which it excels, and dropping back to C for writing my files in the first place. Since what I'm working on is a notekeeper/outliner to use in my MPW programming environment, I can tie Icon and C programs together using the Shell.) >----- Original Message ----- >From: Garry > >> The most up-to-date Icon available for the Macintosh MPW environment is >> version 9.0, which I think may have been implemented by Bob Alexander >> (email address?). I've implemented most of an outline processor / note >> organizer for MPW using Icon; maybe I'll proceed to try using it for >> keeping source code in outline form, BUT after more than a month of fun >> with Icon I've run into a problem!! I can't open a file for update >> (read/write). When I follow the Icon practice of opening my file with >> "b" mode I find that I can read it but I can not write to the file. For >> example if I execute >> f := open( "Testfile", "b" ) >> seek( f ) >> writes( f, "**" ) >> where "Testfile" is a small test file created previously, then I get the >> message >> Run-time error 214 >> input/output error >> >> I've tried specifying "r+" mode or "b+r" or "ub" mode without success. -- Garry Roseman Tech Writer & Freelance Programmer Memphis, TN USA From icon-group-sender Tue Sep 7 16:58:37 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id QAA07136 for icon-group-addresses; Tue, 7 Sep 1999 16:57:41 -0700 (MST) Message-Id: <199909072357.QAA07136@baskerville.CS.Arizona.EDU> From: "Bob Alexander" To: "Garry" , Subject: Re: Is open(..,"b") broken in MPW Icon 9.0? Date: Thu, 2 Sep 1999 20:26:54 -0700 X-Priority: 3 X-MSMail-Priority: Normal X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2615.200 Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO I'm the author of MPW Icon, and as far as I know it hasn't been maintained since my last update. I don't remember exactly when that was, but it's been at least, I'd guess, 3 years. That version was very solid, although I don't know what's happened with MPW since then. Last I knew they were talking about dropping official support and releasing the source code. Currently, I'm more involved with the dark side and seem to only have Windows boxes around, so I can't really even check your bug. So... all I'm offering is sympathy. I really enjoyed using MPW and Icon together -- Icon's a great language and they are a natural pair! I personally never used the "b" option. There weren't any any complaints about it (until now), but then the intersection of MPW users and "b" option users is probably pretty sparse :-) The MPW Icon source code is available, and the Icon open() function translates to a variant of fopen(). Check the source code to see what fopen() option it uses, and then either: - change it to something that works with MPW (if possible) and rebuild. - stick with the copy method you're using now. I would guess that it is trying to use an fopen() option that works under Unix but not under MPW. Sorry I can't offer any real support on this. Feel free to ask any more questions you may have -- I'll do my best to answer. -- Bob ----- Original Message ----- From: Garry To: Sent: Thursday, September 02, 1999 7:53 AM Subject: Is open(..,"b") broken in MPW Icon 9.0? > The most up-to-date Icon available for the Macintosh MPW environment is > version 9.0, which I think may have been implemented by Bob Alexander > (email address?). I've implemented most of an outline processor / note > organizer for MPW using Icon; maybe I'll proceed to try using it for > keeping source code in outline form, BUT after more than a month of fun > with Icon I've run into a problem!! I can't open a file for update > (read/write). When I follow the Icon practice of opening my file with > "b" mode I find that I can read it but I can not write to the file. For > example if I execute > f := open( "Testfile", "b" ) > seek( f ) > writes( f, "**" ) > where "Testfile" is a small test file created previously, then I get the > message > Run-time error 214 > input/output error > > I've tried specifying "r+" mode or "b+r" or "ub" mode without success. > As a test I opened the same file in "w" mode and proved that I was able > to write it (destroying the previous contents) but I can not find a way > to write to random locations. > > BTW, is any progress being made on Icon 9.3 for Macintosh? > > Advice, or just sympathy, will be appreciated. Right now my fall-back > solution is to rewrite the entire file just to update the 8 bytes which > holds my note ID counter. > > -- > Garry > Tech Writer & Freelance Programmer > > From icon-group-sender Tue Sep 7 16:59:11 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id QAA07190 for icon-group-addresses; Tue, 7 Sep 1999 16:58:51 -0700 (MST) Message-Id: <199909072358.QAA07190@baskerville.CS.Arizona.EDU> From: "Frank Lhota" To: , "Garry" Subject: Re: Is open(..,"b") broken in MPW Icon 9.0? Date: Fri, 3 Sep 1999 09:04:21 -0400 X-Priority: 3 X-MSMail-Priority: Normal X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Amazingly enough, it looks like the code for the Icon open function does not include the right code for opening a file in bi-directional mode. I think I can help you patch the source code, however, so that it will work correctly In the file RUNTIME\FSYS.R, search for the text "fsys.05". This search should bring you to the following comment: /* * The following code is operating-system dependent [@fsys.05]. Handle open * modes. */ Previous to this section, the bits of the variable status have been set to indicate the desired open mode. The bits in status are translated into a mode string to be passed on to the C fopen function. Right before this comment, the first mode character is set to one of 'r', 'w', or 'a'. The possible mode parameter characters are, unfortunately, not that well standardized. The code after this comment should have the OS dependent code for handling the addition open modes. For the Macintosh, we see #if MACINTOSH /* nothing to do */ #endif /* MACINTOSH */ This is undoubtedly wrong; there are definitely things to do here for the Mac. At a minimum, we should add '+' to mode if both the Fs_Read and Fs_Write flags in status are on. Also, I believe that we also need to process the Fs_Untrans flag for the Macintosh, since the Mac does not use the Unix text file format. I am not sure what mode characters MPW uses to indicate translated / untranslated mode; in my fix, I assume that MPW fopen uses 't' for translated mode, 'b' for untranslated mode. Given, this, the MACHINTOSH section for the open modes should look like this: #if MACINTOSH if ((status & (Fs_Read|Fs_Write)) == (Fs_Read|Fs_Write)) { mode[1] = '+'; mode[2] = ((status & Fs_Untrans) != 0) ? 'b' : 't'; } else mode[1] = ((status & Fs_Untrans) != 0) ? 'b' : 't'; #endif /* MACINTOSH */ Try making this change and rebuild. ----- Original Message ----- From: Garry To: Frank Lhota ; Sent: Thursday, September 02, 1999 6:17 PM Subject: Re: Is open(..,"b") broken in MPW Icon 9.0? At 12:32 -0400 1999-09-02, Frank Lhota wrote: >The Icon file management routines are based on the C facilitates. >The Icon open mode specifications are mapped to the C fopen mode parameter, >and unfortunately the available fopen modes vary from platform to platform. > >Do you have a C compiler for the Macintosh MPW environment? If so, try to >see which C fopen modes will give you the desired results. From this, we can >figure out the how to fix the Icon run time code. Thanks for your response Frank. I don't quite understand; the mode to pass to fopen for updating a file is "r+" on every platform (the lower level Mac toolbox call is something funky but the standard C library function is "standard"). I checked the "r+" mode on my problem file using a C program. "f = fopen( "Testfile", "r+" );" works fine. Thereafter I can read lines with fgets() or write to random locations using fseek() and fprintf() or fputs(). Of course I'm using an up-to-date StdCLib (I'm using MacOS 8.6 and MPW / MrC with Universal Interfaces 3.2). I'm also using the new file system, HFS+, which (I hope) is transparent at the level of standard C functions. Maybe MPW Icon (9.0) just needs to be recompiled against new libraries -- but that's easier said than done. It would become somewhat larger (because of changing from 68K to PowerPC RISC instructions) and much faster. Would anyone be willing to help me? (As for my immediate problem -- it is perhaps most simply solved by using Icon for the analysis and reporting functions, in which it excels, and dropping back to C for writing my files in the first place. Since what I'm working on is a notekeeper/outliner to use in my MPW programming environment, I can tie Icon and C programs together using the Shell.) >----- Original Message ----- >From: Garry > >> The most up-to-date Icon available for the Macintosh MPW environment is >> version 9.0, which I think may have been implemented by Bob Alexander >> (email address?). I've implemented most of an outline processor / note >> organizer for MPW using Icon; maybe I'll proceed to try using it for >> keeping source code in outline form, BUT after more than a month of fun >> with Icon I've run into a problem!! I can't open a file for update >> (read/write). When I follow the Icon practice of opening my file with >> "b" mode I find that I can read it but I can not write to the file. For >> example if I execute >> f := open( "Testfile", "b" ) >> seek( f ) >> writes( f, "**" ) >> where "Testfile" is a small test file created previously, then I get the >> message >> Run-time error 214 >> input/output error >> >> I've tried specifying "r+" mode or "b+r" or "ub" mode without success. -- Garry Roseman Tech Writer & Freelance Programmer Memphis, TN USA From icon-group-sender Tue Sep 7 16:59:45 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id QAA07227 for icon-group-addresses; Tue, 7 Sep 1999 16:59:24 -0700 (MST) Message-Id: <199909072359.QAA07227@baskerville.CS.Arizona.EDU> From: dgamey@ca.ibm.com X-Lotus-FromDomain: IBMCA@IBMUS To: icon-group@optima.CS.Arizona.EDU, "J D Burnley" Date: Mon, 6 Sep 1999 13:18:52 -0400 Subject: Re: The remove() function Content-Disposition: inline Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Checkj out http://www.cs.arizona.edu/icon/library/src/procs/openchk.icn it shoul help you find out if you haven't closed the file. David From icon-group-sender Wed Sep 8 07:48:30 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id HAA28228 for icon-group-addresses; Wed, 8 Sep 1999 07:47:56 -0700 (MST) Message-Id: <199909081447.HAA28228@baskerville.CS.Arizona.EDU> Date: Wed, 8 Sep 1999 13:13:46 +1200 (NZST) From: "Richard A. O'Keefe" To: icon-group@optima.CS.Arizona.EDU, lhotaf@lexma.meitech.com, memphis@macconnect.com Subject: Re: Is open(..,"b") broken in MPW Icon 9.0? Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO #if MACINTOSH if ((status & (Fs_Read|Fs_Write)) == (Fs_Read|Fs_Write)) { mode[1] = '+'; mode[2] = ((status & Fs_Untrans) != 0) ? 'b' : 't'; } else mode[1] = ((status & Fs_Untrans) != 0) ? 'b' : 't'; #endif /* MACINTOSH */ 't' is a Windows-ism that has no defined effect in the C standard, nor is it defined in any of the Macintosh C compilers I have ready access to. The modes supported are (r|w|a)(+[b]|b[+]) Some Macintosh C compilers define '\n' to be CR, which is the only really sensible choice, and with those compilers the 'b' option is superfluous. Some define '\n' to be LF, which is really really silly, and those compilers translate between external CR and internal LF. So the 'b' option is not superfluous with those compilers. From icon-group-sender Wed Sep 8 07:49:48 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id HAA28346 for icon-group-addresses; Wed, 8 Sep 1999 07:49:39 -0700 (MST) Message-Id: <199909081449.HAA28346@baskerville.CS.Arizona.EDU> From: "Frank Lhota" To: "Richard A. O'Keefe" , , Subject: Re: Is open(..,"b") broken in MPW Icon 9.0? Date: Wed, 8 Sep 1999 09:38:42 -0400 X-Priority: 3 X-MSMail-Priority: Normal X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Armed with this information, I would try this in the [@fsys.05] section for MACINTOSH: #if MACINTOSH if ((status & (Fs_Read|Fs_Write)) == (Fs_Read|Fs_Write)) { mode[1] = '+'; if ((status & Fs_Untrans) != 0) mode[2] = 'b'; } else if ((status & Fs_Untrans) != 0) mode[1] = 'b'; #endif /* MACINTOSH */ Please let me know if this fixes the problem. While we're on the subject, it might be worth our while to revisit the [@fsys.05] section of code. Quite conceivably, we could cut this section out entirely The raison d'jtre for this section is that in Vanilla C, the form of the fopen mode parameter was platform specific. The only mode parameters spelled out in the original K&R book were "r", "w", and "a", although many pre-ANSI compilers supported more options. With ANSI C, the form of the fopen mode has become much better standardized. The ANSI standard actually requires support for the '+' and 'b' fopen modes, so the code given above for the MACINTOSH could be used for all platforms. Once this is done, the only platform specific tweaking would be if you wanted to include a 't' for translated modes, e.g. #if MSDOS || ( OS2 && !CSET2 ) if ((status & Fs_Untrans) == 0) strcat(mode,"t"); endif /* MSDOS || ( OS2 && !CSET2 ) */ Even this is not absolutely necessary, since fopen defaults to opening in text mode if the mode parameter does not include 'b'. Since Icon now requires an ANSI compiler, we could simply retire the [@fsys.05] section and replace it with the code for adding 'b' and '+' to mode. ----- Original Message ----- From: Richard A. O'Keefe To: ; Lhota, Frank ; Sent: Tuesday, September 07, 1999 9:13 PM Subject: Re: Is open(..,"b") broken in MPW Icon 9.0? > #if MACINTOSH > if ((status & (Fs_Read|Fs_Write)) == (Fs_Read|Fs_Write)) { > mode[1] = '+'; > mode[2] = ((status & Fs_Untrans) != 0) ? 'b' : 't'; > } > else mode[1] = ((status & Fs_Untrans) != 0) ? 'b' : 't'; > #endif /* MACINTOSH */ > > 't' is a Windows-ism that has no defined effect in the C standard, > nor is it defined in any of the Macintosh C compilers I have ready > access to. The modes supported are > > (r|w|a)(+[b]|b[+]) > > Some Macintosh C compilers define '\n' to be CR, which is the only > really sensible choice, and with those compilers the 'b' option is > superfluous. Some define '\n' to be LF, which is really really > silly, and those compilers translate between external CR and internal > LF. So the 'b' option is not superfluous with those compilers. From icon-group-sender Thu Sep 9 12:45:07 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id MAA23587 for icon-group-addresses; Thu, 9 Sep 1999 12:43:22 -0700 (MST) Message-Id: <199909091943.MAA23587@baskerville.CS.Arizona.EDU> From: "Frank Lhota" To: Subject: Could we tend the result of memb? Date: Thu, 9 Sep 1999 13:46:07 -0400 X-Priority: 3 X-MSMail-Priority: Normal X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO This message deals with the implementation of Icon, and assumes familiarity with the current implementation. Icon implements sets and tables using a hash chain system. The structures for sets and tables are similar enough that they share a fair number of common utilities. One of the most commonly used utilities for set and table work is memb. The memb function determines whether a given item is a member of a set or table. This function has the following prototype: union block **memb (union block *pb,dptr x,uword hn, int *res); The pb parameter is a pointer to either a set or table block. The x parameter points to the descriptor of the value that memb will search for, and hn is the hash value for *x. After calling memb, *res receives whether *x cam be found in the set / table *pb (*res = 1 if the search succeeded, 0 otherwise). The result of memb is a pointer to a block pointer member within some block that is part of the set / table representation. Assume we perform int res; union block **slot; slot = memb(pb,x,hn,&res); If *x was found in *pb (res == 1), *slot points to the set / table element in *pd for *x. If *x was not found in *pb (res == 0), *slot is the location that should receive the address of a newly created element for *x. The handy, dandy memb function is useful for searching, modifying, adding and deleting the elements of a set or table. There is one problem, however, with memb: the result of memb cannot be tended. If a new block is allocated, the existing blocks may get moved around, and a stored memb result will be invalidated. Moreover, searches take a long time, so you really do not want to repeat a search unless absolutely necessary. To avoid invalidating the result of memb, several functions will perform an allocation before calling memb, even if we need to see the results of memb to determine if the allocation was actually needed. For example, the pseudo-code for inserting a value X into a set S is basically this. Allocate a new set element block; Call memb to see if X is in S; If ( X is not in S ) { Fill in new set element block with data for X; Link new set element block into S using result of memb; } else Deallocate new set element block; /* it was not really needed */ This approach is complicated, error prone and inefficient. If there was only some way to tend the result of memb, we could do the following more natural and efficient algorithm: Call memb to see if X is in S; If ( X is not in S ) { Allocate a new set element block; Fill in new set element block with data for X; Link new set element block into S using result of memb; } There is no known method for tending a value of type (union block **), since one cannot reliably find the start of the block that this value points into. Basically, memb is returning the address of a member in some block. Could memb return this information in another form that can be tended? One possibility that comes to mind is that memb can return its result in a tended variable of type struct descrip. Remember, the result is always an address of a member of some block. We can store the start of this block in the BlkLoc part of the descriptor. The offset from the start of the block to the particular member can be stored in the Offset portion of the dword member of the descriptor. The resulting descriptor is in a form quite similar to descriptors that are currently tended. Consider an alternative form of memb: int memb (union block *pb,dptr x,uword hn, dptr slot); In this new version, the function return value indicates whether the search was successful (1 if search succeeded, 0 if failed). The slot parameter is the address of a tended descriptor. Upon return, we have: slot.dword = (F_Nqual | F_Ptr) | ( offset in words to the member ) BlkLoc(*s) = (Start of the block) If we do this, should also add a macro that will turn such a descriptor into a (union block **) value. Before I start working on this, I pose this question: does anyone know of a reason why this wouldn't work, or wouldn't be desirable? From icon-group-sender Thu Sep 9 17:07:14 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id RAA03088 for icon-group-addresses; Thu, 9 Sep 1999 17:06:36 -0700 (MST) Message-Id: <199909100006.RAA03088@baskerville.CS.Arizona.EDU> Date: Thu, 9 Sep 1999 15:21:37 -0700 (MST) From: Gregg Townsend To: icon-group@optima.CS.Arizona.EDU, lhotaf@lexma.meitech.com Subject: Re: Could we tend the result of memb? Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO From: "Frank Lhota" Date: Thu, 9 Sep 1999 13:46:07 -0400 Before I start working on this, I pose this question: does anyone know of a reason why this wouldn't work, or wouldn't be desirable? Allocation and deallocation are pretty cheap. It's not obvious to me whether this would actually gain anything. It might, but tended descriptors incur some cost, too. --------------------------------------------------------------------------- Gregg Townsend Staff Scientist The University of Arizona gmt@cs.arizona.edu Computer Science Tucson, Arizona, USA From icon-group-sender Tue Sep 14 12:28:18 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id MAA04598 for icon-group-addresses; Tue, 14 Sep 1999 12:26:28 -0700 (MST) Message-Id: <199909141926.MAA04598@baskerville.CS.Arizona.EDU> X-Authentication-Warning: agate-ether.berkeley.edu: news set sender to using -f From: Stephen Harborne X-Newsgroups: comp.lang.icon Subject: Icon 9.3.2 under HP-UX Date: Tue, 14 Sep 1999 16:53:06 +0100 X-NNTP-Posting-Host: sc98a.demon.co.uk:212.228.9.236 X-Trace: news.demon.co.uk 937324556 nnrp-06:9553 NO-IDENT sc98a.demon.co.uk:212.228.9.236 X-Complaints-To: abuse@demon.net X-Newsreader: Turnpike (32) Version 4.01 To: icon-group@optima.CS.Arizona.EDU Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO I am trying to build Icon on a Hewlett Packard machine under HP-UX 11.0. I found that 9.3.1 of Icon would not build. I then received 9.3.2. This compiled but linked with errors, related to the co-expression modules. Non of Icon programs would then run and they all produce error 117 - "no main program". I have not investigated the code as I was trying to build Icon "out-of-the-box". This is the first OS that I have had problems with at this early stage. Is a HP a common platform for running Icon? Grateful for any thoughts? Regards -- Stephen Harborne From icon-group-sender Tue Sep 21 09:32:57 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id JAA17244 for icon-group-addresses; Tue, 21 Sep 1999 09:29:20 -0700 (MST) Message-Id: <199909211629.JAA17244@baskerville.CS.Arizona.EDU> From: jeffery@big-bill.CS.UNLV.EDU To: icon-group@optima.CS.Arizona.EDU Subject: "Programming with Unicon" draft manuscript now available Date: Tue, 21 Sep 1999 04:12:06 -0700 Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO You can't download the software yet, but we are soliciting comments, corrections, and suggestions on the manuscript for our new book "Programming with Unicon" (formerly titled "Programming with Icon"), which is available in PDF format on our web site (http://icon.cs.unlv.edu), thanks to help from volunteer Kostas Oikonomou. The book describes the core language you know and love, the portable system and internet interface, the new object oriented facilities, packages, parameter coercion syntax, a new OO GUI class library and interface builder, compiler writer's tools, substantive example application areas, and the valuable and underutilized Icon procedure and program libraries. Its 474 pages with lots of graphics, so the book is a large download. We are sure there will be many changes and improvements between now and the book's publication...thanks to your help! Clint Jeffery, jeffery@cs.unlv.edu and my co-authors, Shamim Mohamed, Ray Pereda, and Robert Parlett From icon-group-sender Mon Sep 27 08:01:18 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id HAA15798 for icon-group-addresses; Mon, 27 Sep 1999 07:58:34 -0700 (MST) Message-Id: <199909271458.HAA15798@baskerville.CS.Arizona.EDU> X-Authentication-Warning: agate-ether.berkeley.edu: news set sender to using -f From: "Steve Adams" X-Newsgroups: comp.lang.icon Subject: IDBC? X-Newsreader: Microsoft Outlook Express 4.72.3110.5 X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3 Date: Wed, 22 Sep 1999 08:48:09 -0400 X-Trace: newsfeed.slurp.net 938004261 206.153.26.162 (Wed, 22 Sep 1999 07:44:21 CDT) To: icon-group@optima.CS.Arizona.EDU Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Is there any information on the Icon IDBC project? Thanks. From icon-group-sender Mon Sep 27 08:03:16 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id IAA16179 for icon-group-addresses; Mon, 27 Sep 1999 08:03:02 -0700 (MST) Message-Id: <199909271503.IAA16179@baskerville.CS.Arizona.EDU> From: SungJae Yi To: "'icon-group@cs.arizona.edu'" Subject: newbie question Date: Thu, 23 Sep 1999 16:42:10 -0400 X-MIME-Autoconverted: from quoted-printable to 8bit by baskerville.CS.Arizona.EDU id NAA22186 Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Hi: I have a newbie question. ( Sorry, I tried to look up various documents but I could not find the info). What I want to do is to have my C++ program, which has the main(), call the Icon interpreter and let it process the provided data based on the external configuration (Icon program). So the system would look like the following: [data file in]--> [ My Main Process ] --> [Icon Interpreter] [ ] | ^ [data file out]<-- [ ]<----------+ | [Icon program] Textual description: A program, My Main Process has two file I/O: input & output. Once the input data has been read in, it is massaged and passed to the Icon interpreter. The Icon interpreter processes the data according to the external (external to My Main Process) configuration (Icon program) and returns the data to My Main Process. The returned data is then written out to output data file. I noticed that I can call C functions from Icon program, but can I call Icon from a C/C++ program? Sincerely, SungJae Yi From icon-group-sender Mon Sep 27 08:04:15 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id IAA16252 for icon-group-addresses; Mon, 27 Sep 1999 08:04:05 -0700 (MST) Message-Id: <199909271504.IAA16252@baskerville.CS.Arizona.EDU> Date: Thu, 23 Sep 1999 23:42:03 -0400 (EDT) From: Mark Kot Subject: FFT in Icon ? To: icon-group@optima.CS.Arizona.EDU Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Before I spend too much time reinventing the wheel, I thought I would ask if anyone has a good clean implementation of the FFT (or of the fast Hartley transform) in Icon. Any leads are appreciated. Many thanks ! Best wishes, Mark Kot From icon-group-sender Mon Sep 27 14:06:05 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id OAA03100 for icon-group-addresses; Mon, 27 Sep 1999 14:03:41 -0700 (MST) Message-Id: <199909272103.OAA03100@baskerville.CS.Arizona.EDU> To: Steve Adams CC: icon-group@optima.CS.Arizona.EDU Subject: Re: IDBC? Date: Mon, 27 Sep 1999 09:07:22 -0700 From: Clinton L Jeffery Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Steve Adams> Is there any information on the Icon IDBC project? Thanks. Steve, Check out http://icon.cs.utsa.edu for a preliminary look at what we've got. The ODBC software is in alpha testing, and some functionality may change. In particular, what my fine student Federico Balbi has implemented doesn't look very much like what I originally specified, and I may cajole him into some changes before it ships. The website is his version of the documentation, so it corresponds to what is actually implemented. The URL is not a typo; the project was started at UT San Antonio but will be distributed and maintained from University of Nevada, Las Vegas, because I moved there. Federico is at UT San Antonio and is still employed on the project. Clint From icon-group-sender Mon Sep 27 14:07:09 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id OAA03315 for icon-group-addresses; Mon, 27 Sep 1999 14:07:02 -0700 (MST) Message-Id: <199909272107.OAA03315@baskerville.CS.Arizona.EDU> Date: Mon, 27 Sep 1999 09:18:44 -0700 (MST) From: Gregg Townsend To: icon-group@optima.CS.Arizona.EDU, sung@opencon.com Subject: Re: newbie question Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO From: SungJae Yi Date: Thu, 23 Sep 1999 16:42:10 -0400 What I want to do is to have my C++ program, which has the main(), call the Icon interpreter... There's no provision for that in the Icon system. Your best bet, if the problem can be so structured, is to arrange a pipeline of two programs. --------------------------------------------------------------------------- Gregg Townsend Staff Scientist The University of Arizona gmt@cs.arizona.edu Computer Science Tucson, Arizona, USA From icon-group-sender Thu Sep 30 17:18:29 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id RAA28106 for icon-group-addresses; Thu, 30 Sep 1999 17:13:55 -0700 (MST) Message-Id: <199910010013.RAA28106@baskerville.CS.Arizona.EDU> X-Sender: memphis@popmail.macconnect.com Date: Thu, 30 Sep 1999 15:57:25 -0500 To: icon-group@optima.CS.Arizona.EDU From: Garry Subject: Compiler Design in Icon X-MIME-Autoconverted: from quoted-printable to 8bit by baskerville.CS.Arizona.EDU id OAA21468 Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO I was just re-reading chapter 18 of the Griswolds's "The Icon Programming Language"; it is a very inspiring treatment of matching procedures, recognition of grammars, and parsing in Icon. That got me thinking about the courses I took long ago on compiler design and on finite state automata but I wonder if the availability of generators (and recursive generators) and coexpressions in the compiler implementation language doesn't affect the whole treatment of the subject. Maybe books written from within a Scheme viewpoint would be most sympathetic. (Scheme and Icon bear deep similarity don't they?) If any of the Icon experts here have found books on compiler design/automata/formal language theory (or string matching for that matter) that are particularly mappable to Icon, your recommendations would be appreciated. -- Garry Roseman Tech Writer & Freelance Programmer Memphis, TN USA From icon-group-sender Thu Sep 30 17:34:12 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id RAA28600 for icon-group-addresses; Thu, 30 Sep 1999 17:33:53 -0700 (MST) Message-Id: <199910010033.RAA28600@baskerville.CS.Arizona.EDU> Date: Thu, 30 Sep 1999 17:25:43 -0700 From: Steve Wampler X-Accept-Language: en To: icon-group@optima.CS.Arizona.EDU Subject: A small puzzle Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO I haven't posted anything for a while, but thought this might be fun: Write an Icon program to generate the pairings in a round-robin tournament. The program should accept the player names as command line arguments (see the example below). In a round-robin tournament, every player plays every other player exactly once. If there are an odd number of players, then a special "bye" player is added. For example, given players Alice, Bonnie, and Carole, a sample run of the program should produce: $ roundrobin Alice Bonnie Carole Round 1 Court 1: Alice vs bye Court 2: Bonnie vs Carole Round 2 Court 1: Alice vs Bonnie Court 2: Carole vs bye Round 3 Court 1: Alice vs Carole Court 2: bye vs Bonnie Naturally, there should be no limit on the number of players. You can assume that there are enough courts available to satisfy each round. (As an additional challenge, implement an optional -n argument, where n is the number of courts - this is as much an exercise in determining a reasonable policy for handling the pairing overfow as it is an exercise in Icon programming.) I have a non-backtracking solution and think I know the way to do a back-tracking one, but thought others might enjoy playing with this problem. Send solutions to me (or back to icon-group) - I'll be happy to look at them and summarize. Speed isn't much of a concern - though randomly producing pairings and rejecting bad ones probably isn't going to win great praise! Finally, if you really have too much time on your hand, add code to produce a scoresheet suitable for recording the results. I'd prefer it if you provided this separately, to keep the size of the solutions to the original problem down... -- --- Steve Wampler {sbw@tapestry.tucson.az.us} The gods that smiled upon your birth are laughing now. -- fortune cookie From icon-group-sender Fri Oct 1 08:19:23 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id IAA23810 for icon-group-addresses; Fri, 1 Oct 1999 08:18:27 -0700 (MST) Message-Id: <199910011518.IAA23810@baskerville.CS.Arizona.EDU> Date: Thu, 30 Sep 1999 23:58:02 -0500 From: "Thomas W. Christopher" X-Accept-Language: en To: Garry CC: icon-group@optima.CS.Arizona.EDU Subject: Re: Compiler Design in Icon Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO For a couple of parser generators and an Euler compiler in Icon, see: http://www.toolsofcomputing.com/freesoftware.htm For a couple of more compilers in Icon (not as well documented), see http://www.iit.edu/~tc/toolsfor.htm#Compilers These are educational compilers, not production quality. Garry wrote: > ...If any of the Icon experts here have found books on compiler design/automata/formal language theory (or string matching for that matter) that are particularly mappable to Icon, your recommendations would be appreciated. > -- Thomas W. Christopher, tchristopher@cs.depaul.edu Visiting Associate Professor, DePaul Univ., Chicago Operating Manager, Tools of Computing LLC.: http://www.toolsofcomputing.com, tc@toolsofcomputing.com From icon-group-sender Fri Oct 1 13:38:47 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id NAA05989 for icon-group-addresses; Fri, 1 Oct 1999 13:38:23 -0700 (MST) Message-Id: <199910012038.NAA05989@baskerville.CS.Arizona.EDU> Date: Fri, 01 Oct 1999 08:41:09 -0700 From: Steve Wampler X-Accept-Language: en To: Steve Wampler CC: icon-group@optima.CS.Arizona.EDU Subject: Re: A small puzzle Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Steve Wampler wrote: > > Write an Icon program to generate the pairings in a round-robin > tournament. The program should accept the player names as > command line arguments (see the example below). As a postscript, here's one more little challenge you might want to work on... Assuming that the order of names given as arguments is the order of seeding in the tournament (i.e. first name is top seed, second name is 2nd seed, and so on). Arrange the rounds so that the last round has the first and 2nd seeds paired, 3rd and 4th paired, etc. -- Steve Wampler- SOLIS Project, National Solar Observatory swampler@noao.edu From icon-group-sender Fri Oct 1 13:48:03 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id NAA06491 for icon-group-addresses; Fri, 1 Oct 1999 13:47:54 -0700 (MST) Message-Id: <199910012047.NAA06491@baskerville.CS.Arizona.EDU> Date: Fri, 01 Oct 1999 12:34:37 -0700 From: Steve Wampler X-Accept-Language: en To: icon-group Subject: An a2ps style sheet for Icon Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO This is a multi-part message in MIME format. --------------351713C02FB9FE89DD635AF3 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit If anyone's interested, here's the first cut at a style-sheet for printing Icon files using the a2ps utility. I'm hoping that someone will take this and improve upon it (the handling of operators could be a lot better). If you do improve it, please send me the improved version (and "Thanks"!). -- Steve Wampler- SOLIS Project, National Solar Observatory swampler@noao.edu --------------351713C02FB9FE89DD635AF3 Content-Type: text/plain; charset=us-ascii; name="icon.ssh" Content-Disposition: inline; filename="icon.ssh" Content-Transfer-Encoding: 7bit # Style sheet for Icon # # # This file is part of a2ps. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; see the file COPYING. If not, write to # the Free Software Foundation, 59 Temple Place - Suite 330, # Boston, MA 02111-1307, USA. # ## 1.0 Steve Wampler style Icon is version is 1.0 requires a2ps version 4.10 written by "Steve Wampler " first alphabet is "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_#$&" second alphabet is "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz._" case sensitive keywords in Keyword are "\&allocated", "\&ascii", "\&clock", "\&collections", "\&cset", "\¤t", "\&date", "\&dateline", "\&digits", "\&dump", "\&e", "\&error", "\&errornumber", "\&errortext", "\&errorvalue", "\&errout", "\&fail", "\&features", "\&file", "\&host", "\&input", "\&lcase", "\&letters", "\&level", "\&line", "\&main", "\&null", "\&outpout", "\&phi", "\&pi", "\&pos", "\&progname", "\&random", "\®ions", "\&source", "\&storage", "\&subject", "\&time", "\&trace", "\&ucase", "\&version" end keywords keywords in Keyword_strong are "break", "by", "case", "create", "default", "do", "else", "end", "every", "fail", "global", "if", "initial", "invocable", "link", "local", "next", "not", "of", "procedure", "record", "repeat", "return", "static", "suspend", "then", "to", "until", "while" end keywords optional operators are # This needs more work! <- \leftarrow, ~= \neq, === \equiv, <<<=, >>>=, <<=, >>=, <= \leq, >= \geq, ~ \not end operators sequences are # Comments (could make this "Comment_strong" to stand out more...) "#" Comment, # Strings C-string, # Csets "'" Plain String "'" Plain exceptions are "\\'", "\\\\" end exceptions, # Special case procedure declarations so names stand out "procedure " Keyword_strong Label_strong /[ \t]*(/ Plain end sequences end style --------------351713C02FB9FE89DD635AF3-- From icon-group-sender Mon Oct 4 08:42:18 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id IAA00712 for icon-group-addresses; Mon, 4 Oct 1999 08:42:09 -0700 (MST) Message-Id: <199910041542.IAA00712@baskerville.CS.Arizona.EDU> X-Authentication-Warning: agate-ether.berkeley.edu: news set sender to using -f From: luvisi@andru.sonoma.edu X-Newsgroups: comp.lang.icon Subject: Re: A small puzzle Date: 02 Oct 1999 15:23:04 -0700 To: Steve Wampler X-Newsreader: Gnus v5.3/Emacs 19.34 To: icon-group@optima.CS.Arizona.EDU Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Steve Wampler writes: [snip] > Write an Icon program to generate the pairings in a round-robin > tournament. The program should accept the player names as > command line arguments (see the example below). [snip] Here's my attempt: procedure main() every gameset := turnament(["a","b","c","d","e"]) do every write((left((pair := !gameset)[1], 5) || left(pair[2], 5)) | ""); every gameset := turnament(["a","b","c","d","e","f"]) do every write((left((pair := !gameset)[1], 5) || left(pair[2], 5)) | ""); end procedure turnament(people) local i; local stationary_player, gameset; stationary_player := (*people % 2 = 0 & get(people)) | "Buy"; every 1 to *people do { gameset := [ [ stationary_player, people[*people] ] ]; every gameset |||:= [[people[ i := 1 to (*people - 1) / 2 ], people[-i-1]]]; suspend gameset; push(people, pull(people)); } fail; end [snip] > (As an additional challenge, implement an optional -n argument, where > n is the number of courts - this is as much an exercise in determining > a reasonable policy for handling the pairing overfow as it is an > exercise in Icon programming.) [snip] hm... it seems the hardest part would be when at the end of a virtual match, finding the pairs in the next virtual match that don't contain anybody who's playing in the curent physical match... Andru -- -------------------------------------------------------------------------- | Andru Luvisi | http://libweb.sonoma.edu/ | | Programmer/Analyst | Library Resources Online | | Ruben Salazar Library |-----------------------------------------| | Sonoma State University | http://www.belleprovence.com/ | | luvisi@andru.sonoma.edu | Textile imports from Provence, France | -------------------------------------------------------------------------- From icon-group-sender Mon Oct 4 09:07:27 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id JAA01781 for icon-group-addresses; Mon, 4 Oct 1999 09:07:12 -0700 (MST) Message-Id: <199910041607.JAA01781@baskerville.CS.Arizona.EDU> Date: Sun, 03 Oct 1999 14:45:55 -0700 From: Blake Chapman Subject: Any File System for Icon Yet? To: icon-group@optima.CS.Arizona.EDU Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Icon Project, I have downloaded, installed, and done some little programs in Icon for Windows. I find that the documentation that comes with the package is missing library routines that are actually present; that is, it doesn't document them. The free manual from documents some missing routines, like xencode() and xdecode(), and they work. I find no routines to pluck one element out of the middle of a list, or insert one in. Are there such routines? Would I get documentation of the if I got the book? At $35 a student like myself has to find out whether Icon has enough library routines to support real programming problems before I buy it. There is no mention of any file system in downloaded documentation. To work on persistent data I have to write a whole list out with xencode() and read it in with xdecode(). I read in the Dec. 1, 1998 Icon Newsletter the article titled "Database Connectivity": "Work is beginning at UT San Antonio, with generous support from the National Library of Medicine, on a high-level database interface to Icon. The initial implementation will emphasize Windows Icon ...". Is this done yet? If not, is there even a primitive file system available, with a B-tree index method and data file access routines? Icon is a nice language; very powerful! Blake Chapman From icon-group-sender Mon Oct 4 12:38:36 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id MAA09976 for icon-group-addresses; Mon, 4 Oct 1999 12:38:02 -0700 (MST) Message-Id: <199910041938.MAA09976@baskerville.CS.Arizona.EDU> From: eka@corp.cirrus.com (Eka Laiman) Subject: Re: A small puzzle To: sbw@tapestry.tucson.az.us (Steve Wampler) Date: Mon, 4 Oct 1999 10:49:38 -0700 (PDT) Cc: icon-group@optima.CS.Arizona.EDU Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO > I haven't posted anything for a while, but thought this might be fun: > > Write an Icon program to generate the pairings in a round-robin > tournament. The program should accept the player names as > command line arguments (see the example below). > > In a round-robin tournament, every player plays every other player > exactly once. If there are an odd number of players, then a > special "bye" player is added. > ................. edited .................. If I understand the problem correctly, here is how I approach the problem: Model the problem as "graph" in the following sense: Each player forms a vertex of the graph. Each pair of player is an edge in the graph. >From the condition that every player plays every other player exactly once, we see the following graph property: each vertex is connected to every vertex in the graph, forming a "complete graph". Let N be the number of the vertices in the graph, clearly there are N(N-1)/2 edges. >From this analysis we come up with the following algorithm: Let player[1..n] be the array of the players. 1. Set up the second array partner[1..n] such that: partner[i] := player[n - i + 1] # initialize partner as the reverse of player. 2. Repeat the following steps (n - 1) times: 2a. For i := 1 to n/2 do write(pair(player[i], partner[i]) 2b. Rotate array partner one step. >From the rule of counting, we see that step 2 generates all edges in our complete graph. I think the implementation of the above algorithm is straightforward. -eka- From icon-group-sender Mon Oct 4 12:39:15 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id MAA10026 for icon-group-addresses; Mon, 4 Oct 1999 12:39:01 -0700 (MST) Message-Id: <199910041939.MAA10026@baskerville.CS.Arizona.EDU> From: gep2@terabites.com Date: Mon, 04 Oct 1999 13:13:51 -0500 Subject: Any File System for Icon Yet? To: blakec@pacbell.net, icon-group@optima.CS.Arizona.EDU Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO > I have downloaded, installed, and done some little programs in Icon for Windows. I find that the documentation that comes with the package is missing library routines that are actually present; that is, it doesn't document them. The free manual from documents some missing routines, like xencode() and xdecode(), and they work. I haven't used (specifically) Icon for Windows, although I've worked with the command-line version to a fair degree. Others here will certainly know more about it, but I'll offer at least some observations... > I find no routines to pluck one element out of the middle of a list, or insert one in. Are there such routines? Perhaps not, since those functions are really pretty trivial (you can use subscript ranges to specify sublists, making that kind of thing a simple expression). > Would I get documentation of the if I got the book? Dunno which book in particular you're referring to. The book I have and use, 'The Icon Programming Language' is a very complete description of the basic language. > At $35 a student like myself has to find out whether Icon has enough library routines to support real programming problems before I buy it. That, of course, depends entirely upon what kind of "real programming problems" you intend to tackle with it. One serious missing thing, for business type programming, is any kind of indexed-sequential file system. (If there is such by now, I'm not aware of it). On the other hand, I'm not aware of ANY general-purpose programming language which has ALL of every kind of support routine that anyone is likely to ever need, already built-in... > There is no mention of any file system in downloaded documentation. To work on persistent data I have to write a whole list out with xencode() and read it in with xdecode(). There are other ways to import and export lists. In general, I think that Icon is better equipped for this than most other programming languages are. In SNOBOL4/SPITBOL (predecessor languages to Icon) there is a SAVE() function which allows the entire workspace (program and data) to be written to disk for reloading later, and that's a way to instantly save (and later restore) even very complex data structures without having to develop a separate importable/exportable disk-file-based format for them. > I read in the Dec. 1, 1998 Icon Newsletter the article titled "Database Connectivity": "Work is beginning at UT San Antonio, with generous support from the National Library of Medicine, on a high-level database interface to Icon. The initial implementation will emphasize Windows Icon ...". > Is this done yet? If not, is there even a primitive file system available, with a B-tree index method and data file access routines? With the increasing emphasis on multi-user transaction processing, it's perhaps true that it's becoming more appropriate and desirable to provide a more general interface to an external SQL (or other) database system... rather than trying to keep the whole database system within the individual program. > Icon is a nice language; very powerful! I couldn't agree more!!! Despite the fact that for my own personal use, I find SNOBOL4/SPITBOL (which has many of the same concepts, although a very different overall look) to be a very attractive alternative. I end up using S*BOL much more than Icon. NT SPITBOL produces true .EXE files, compiles and executes VERY quickly, reliably handles exceedingly large amounts of data, and is very robust. It also provides for the eval() and code() functions which are missing from Icon (allowing you to extend the program and reference variables symbolically in expressions at runtime). Anyhow, Clint is quite active on this list, and will surely know more about the status of Icon for Windows... good luck! Gordon Peterson http://web2.airmail.net/gep2/ Support the Anti-SPAM Amendment! Join at http://www.cauce.org/ 12/19/98: the day the Conservatives demonstrated their scorn for their fraudulent sham of representative government. Voters, remember it! From icon-group-sender Wed Oct 6 12:29:10 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id MAA12810 for icon-group-addresses; Wed, 6 Oct 1999 12:26:46 -0700 (MST) Message-Id: <199910061926.MAA12810@baskerville.CS.Arizona.EDU> Date: Wed, 6 Oct 1999 10:19:55 -0700 (MST) From: Gregg Townsend To: icon-group Subject: Version 2.1 of Jcon Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Version 2.1 of Jcon, a Java-based implementation of Icon, is now available for free downloading from http://www.cs.arizona.edu/icon/jcon/ Version 2.1 includes minor feature additions, documentation edits, and bug fixes. Changes include the following: * A directory can be read by opening it as a file. * JPEG images can be written under Java 2 implementations. * Java class files can be bundled with a Jcon program for easier dynamic loading. * The runtime system can be bundled with a Jcon program to make it completely self-contained. * Large integers now work with to-by, seq(), limitation (e1 \ e2), and exponentiation (e1 ^ e2). * A zero increment value is diagnosed by seq(). * &host no longer spawns a shell invocation of the "uname" utility. * The runtime package name has been changed from "rts" to "jcon". All programs must be recompiled. The release notes can be viewed at http://www.cs.arizona.edu/icon/jcon/doc/relnotes.htm A compiled version of the current (9.3.2) Icon Program Library for Jcon 2.1 is also available from the Jcon web page. --------------------------------------------------------------------------- Gregg Townsend Staff Scientist The University of Arizona gmt@cs.arizona.edu Computer Science Tucson, Arizona, USA From icon-group-sender Thu Oct 7 12:26:03 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id MAA28331 for icon-group-addresses; Thu, 7 Oct 1999 12:25:00 -0700 (MST) Message-Id: <199910071925.MAA28331@baskerville.CS.Arizona.EDU> Date: Thu, 07 Oct 1999 09:33:25 -0700 From: Steve Wampler X-Accept-Language: en To: icon-group@optima.CS.Arizona.EDU CC: Steve Wampler Subject: Re: A small puzzle Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO This is a multi-part message in MIME format. --------------D3D91CF3B7EB1333F3CB751F Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Steve Wampler wrote: > > Write an Icon program to generate the pairings in a round-robin > tournament. The program should accept the player names as > command line arguments (see the example below). > Ok, I don't think anyone else is going to submit a response, so here's a quick summary. Two people submitted working solutions - Gregg Townsend and Andru Luvisi. Andru's solution needs a (very) minor modification to meet the requirement of using names from the command-line arguments, but that's a pretty trivial change (I've made it in the attachment). Gregg's solution is pretty interesting, it's crafted from scratch and uses a mapping to single characters to allow string scanning and cset operations - it's also the best-commented. The use of csets limits the tournament to at most 255 players, which is probably ok in most real-world situations. Gregg's solution is also attached. One person gave a nice graph-theory-based analysis of the problem with an algorithm for the solution, but without actual code. The analysis is good, though the algorithm is mildly wasteful of space. (I won't repost the algorithm here since it has already shown up in this group, but you might take a look at it and see if you can identify the wasted space...). No one tried either of the two challenges: (a) add an option to specify the number of 'real' courts and (b) arrange the ordering so the last round pairs players in the same order they appear on the command line. It's probably just as well that no one did (a), as Andru pointed out, the ugliness is when the number of courts exceeds the number of players. I've included in my code a solution to (b) - the same strategy could be applied to Andru's solution, but would need a different initial pattern. My code is similar to Andru's, using the same basic algorithm (which is a varient of the graph-based algorithm already posted. You might look to see how the use of the space is improved. Can you figure out how to use still less space?) After seeing how nicely Gregg's code was commented, I went back and added some comments... ---------------------------------------------------------------- # Generate the pairings for each round of a round-robin tournament. # # Usage: roundrobin list-of-players... # procedure main(args) if *args = 0 then args := ["alice", "bonnie", "carole"] doRoundRobin(args) end # Do the scheduling for the tournament. # # This implementation produces an 'interesting' final round. If the # order of the names given on the command line corresponds to the # seeding order for the tournament, then the final round pairs # the top two seeds, the next two, and so on. This should help # keep the spectators around, allowing you to make more money # on refreshments. If you don't want this, comment out the line: # # names := reorder(names) # procedure doRoundRobin(names) # force an even number of contestents if *names % 2 = 1 then put(names,"bye") names := reorder(names) every outPairs(1 to *names-1, names := adjust(names)) end # Adjust the list of players for the next round. # # The algorithm is "leave the first alone, rotate the rest one position" # procedure adjust(playerList) return playerList[1:2] ||| playerList[3:0] ||| playerList[2:3] end # Display the pairings for a single round. # procedure outPairs(i, names) write("Round ",i) every c := 1 to (*names/2) do { # pair from edges toward center write("\tCourt ", right(c,2), ": ", names[c], " vs ", names[-c]) } end # Reorder the names so the first call to adjust() produces an ordering # that ensures the final round pairs the players in the original order # procedure reorder(names) every new := put([], names[(1 to *names by 2) | (*names to 2 by -2)]) return new end ------------------------------------------------------- I hope some of you had fun thinking about this problem! -- Steve Wampler- SOLIS Project, National Solar Observatory swampler@noao.edu --------------D3D91CF3B7EB1333F3CB751F Content-Type: text/plain; charset=us-ascii; name="andru.icn" Content-Disposition: inline; filename="andru.icn" Content-Transfer-Encoding: 7bit procedure main(args) every gameset := turnament(args) do every write((left((pair := !gameset)[1], 5) || left(pair[2], 5)) | ""); end procedure turnament(people) local i; local stationary_player, gameset; stationary_player := (*people % 2 = 0 & get(people)) | "Buy"; every 1 to *people do { gameset := [ [ stationary_player, people[*people] ] ]; every gameset |||:= [[people[ i := 1 to (*people - 1) / 2 ], people[-i-1]]]; suspend gameset; push(people, pull(people)); } fail; end --------------D3D91CF3B7EB1333F3CB751F Content-Type: text/plain; charset=us-ascii; name="gregg.icn" Content-Disposition: inline; filename="gregg.icn" Content-Transfer-Encoding: 7bit ## rrobin.icn -- generate round-robin pairings # # usage: rrobin name... # # 1-Oct-1999 / gmt (inspired by a Steve Wampler puzzle challenge) # # This program generates an optimal set of pairings for a round-robin # tournament. For an even number N of players, N-1 rounds on N/2 # courts are needed. For N odd, N rounds on N/2 courts are required, # with a "bye" on an additional "court" at each round. procedure main(args) local n, ct, labels, round, name1, name2 if *args > 255 then stop("too many names") labels := (&cset -- ' ')[1+:*args] n := 0 every round := pairs(labels) do round ? { write("Round ", n +:= 1) ct := 0 while =" " do { name1 := args[upto(move(1), labels)] name2 := args[upto(move(1), labels)] write("\tCourt ", ct +:= 1, ": ", name1, " vs ", name2) } if name1 := args[upto(labels -- round, labels)] then write("\tCourt ", ct +:= 1, ": bye vs ", name1) } end ## pairs(players) -- generate pairings for round-robin tournament # # The characters of the string "players" label contestants to be paired # in a round-robin tournament. This procedure generates an optimal set # of rounds such that at the end each player is paired exactly once with # each other player. Characters in "players" must be unique and must not # include the space character (' '); thus a maximum of 255 contestants # can be handled. # # Output is a sequence of strings where each string represents one # round of disjoint pairings. Each pairing consists of three # characters: a space followed by the labels of the two contestants. # # 1-Oct-1999 / gmt procedure pairs(players) if *players < 2 then fail else if *players = 2 then return " " || players else if *players % 2 = 1 then suspend oddpairs(players) else suspend evenpairs(players) end ## oddpairs(players) -- generate pairings for an odd number of contestants # # With an odd number N of players, the optimum solution requires N rounds # on N/2 courts with one "bye" in each round. A regular pattern produces # the pairings: Each round pairs 1 vs N, 2 vs N-1, 3 vs N-2, etc., # designating a different player as #1 for each of N rounds. procedure oddpairs(players) local n, i, j, round n := *players every i := 1 to n do { round := "" every j := 1 to n / 2 do round ||:= " " || players[j] || players[n - j] players := players[2:0] || players[1] suspend round } end ## evenpairs(players) -- generate pairings for an even number of contestants # # With an even number N of players, N-1 rounds on N/2 courts are needed. # There are no byes. First, the players are divided into two groups, # and the pairings within each group are enumerated in parallel. If the # groups are odd-sized, there is a bye within each group at each round; # the two unoccupied players play each other across group boundaries. # After the intra-group competition, the remaining combinations of # cross-group pairings are enumerated. procedure evenpairs(players) local half, odd, grp1, grp2, p1, p2, round, step, i half := *players / 2 odd := half % 2 grp1 := players[1+:half] grp2 := players[0-:half] every put(p1 := [], pairs(grp1)) every put(p2 := [], pairs(grp2)) while round := get(p1) || get(p2) do { if odd = 1 then round ||:= " " || (players -- round) suspend round } grp2 := grp2 || grp2 every step := odd to half - 1 do { round := "" every i := 1 to half do round ||:= " " || grp1[i] || grp2[i + step] suspend round } end --------------D3D91CF3B7EB1333F3CB751F-- From icon-group-sender Thu Oct 7 16:24:27 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id QAA08802 for icon-group-addresses; Thu, 7 Oct 1999 16:22:41 -0700 (MST) Message-Id: <199910072322.QAA08802@baskerville.CS.Arizona.EDU> Date: Thu, 7 Oct 1999 16:19:32 -0700 (MST) From: Gregg Townsend To: icon-group Subject: Technical Report on Jcon Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO A technical report describing Jcon is now available: Todd A. Proebsting and Gregg M. Townsend A New Implementation of the Icon Language We describe Jcon, a new, Java-based implementation of the Icon programming language. The implementation includes a compiler and runtime system. The runtime system is novel in its concise and efficient object-oriented implementation of a dynamically typed language, as well as its simple mechanism for realizing Icon generators. 245KB PostScript: ftp://ftp.cs.arizona.edu/reports/1999/TR99-13.ps 192KB PDF: http://www.cs.arizona.edu/icon/jcon/impl.pdf --------------------------------------------------------------------------- Gregg Townsend Staff Scientist The University of Arizona gmt@cs.arizona.edu Computer Science Tucson, Arizona, USA From icon-group-sender Thu Oct 14 07:53:31 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id HAA17829 for icon-group-addresses; Thu, 14 Oct 1999 07:51:22 -0700 (MST) Message-Id: <199910141451.HAA17829@baskerville.CS.Arizona.EDU> Date: 14 Oct 99 09:53:05 BST From: rjhare@ed.ac.uk Subject: &time keyword To: icon-group@optima.CS.Arizona.EDU Organisation: Edinburgh Parallel Computing Centre Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Anyone know where Icon gets the value it uses for the &time keyword on Unix systems? My time values on my local machine (which was rebuilt last weekend) are suddenly out by 1 hour... Thanks. Roger Hare From icon-group-sender Fri Oct 15 07:24:40 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id HAA18956 for icon-group-addresses; Fri, 15 Oct 1999 07:24:00 -0700 (MST) Message-Id: <199910151424.HAA18956@baskerville.CS.Arizona.EDU> Date: Thu, 14 Oct 1999 19:09:34 -0700 (MST) From: Gregg Townsend To: icon-group@optima.CS.Arizona.EDU, rjhare@ed.ac.uk Subject: Re: &time keyword Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Date: 14 Oct 99 09:53:05 BST From: rjhare@ed.ac.uk Subject: &time keyword Anyone know where Icon gets the value it uses for the &time keyword on Unix systems? My time values on my local machine (which was rebuilt last weekend) are suddenly out by 1 hour... Do you mean &clock? &time measures elapsed processor time. Icon v9.3.2 calls the POSIX localtime() function for &clock, &date, and &dateline. This is influenced, among other things, by the setting of the TZ environment variable. What's your machine architecture and OS? What does &version report? --------------------------------------------------------------------------- Gregg Townsend Staff Scientist The University of Arizona gmt@cs.arizona.edu Computer Science Tucson, Arizona, USA From icon-group-sender Fri Oct 15 12:49:00 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id MAA00812 for icon-group-addresses; Fri, 15 Oct 1999 12:48:08 -0700 (MST) Message-Id: <199910151948.MAA00812@baskerville.CS.Arizona.EDU> Date: Fri, 15 Oct 1999 09:08:44 -0700 (MST) From: Gregg Townsend To: icon-group, rjhare@ed.ac.uk Subject: Re: &time keyword Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO From rjhare@holyrood.ed.ac.uk Fri Oct 15 01:09:42 1999 Icon Version 9.3. November 25, 1996 - I haven't updated... None of my comments apply to that older version; you'd have to check the source code to see how it did it. The clock and time code was rewritten for Icon 9.3.2 and we found out afterward that the rewrite fixed at least two previously unknown problems in that area. --------------------------------------------------------------------------- Gregg Townsend Staff Scientist The University of Arizona gmt@cs.arizona.edu Computer Science Tucson, Arizona, USA From icon-group-sender Mon Oct 18 08:55:28 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id IAA04021 for icon-group-addresses; Mon, 18 Oct 1999 08:53:29 -0700 (MST) Message-Id: <199910181553.IAA04021@baskerville.CS.Arizona.EDU> Date: 16 Oct 99 06:50:59 BST From: rjhare@ed.ac.uk Subject: Re: &time keyword To: Gregg Townsend cc: icon-group@optima.CS.Arizona.EDU Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO > Do you mean &clock? &time measures elapsed processor time. Yes, I did indeed mean &clock. A slip of the digit! My apologies. The problem is now sorted out - for some reason, the TZ environment variable was not being set on my login - only on my login, and no-one knows why! It is said locally that if you want some-one to break the system, send for Roger. I appear to have done it again... Thanks for the replies. Roger Hare From icon-group-sender Thu Oct 21 08:00:13 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id HAA16777 for icon-group-addresses; Thu, 21 Oct 1999 07:58:13 -0700 (MST) Message-Id: <199910211458.HAA16777@baskerville.CS.Arizona.EDU> Date: Wed, 20 Oct 1999 19:21:24 -0700 From: Blake Chapman Subject: List subscription insert/removal To: icon-group@optima.CS.Arizona.EDU Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Icon Project, I am trying to figure out how to insert a new element into a list, and remove an element from the middle of a list (not the end). In answer to this question previously Gordon Peterson sent a reply. I tried what he said and it doesn't work. My original question, that he answered, was "I find no routines to pluck one element out of the middle of a list, or insert one in. Are there such routines?". His answer was: "Perhaps not, since those functions are really pretty trivial (you can use subscript ranges to specify sublists, making that kind of thing a simple expression).". I assume he meant that I can insert an element into a list the same way I can insert a character into a string variable. So I tried it, 4 ways; none of them worked, they all produce a run-time error and abort. Here is the program. Though I use mere charactes or 1-char strings as list elements, it is just to try out list manipulation... procedure main() local s # it will be a list s:= ["a", "b", "c", "d"] WriteL(s) # this writes "abcd" as it should # Next, I want to insert "x" as a list element between "b" and "c" .... # didn't work: s[3:3]:="x" # didn't work: s[3:3] := ["x"] # didn't work: s[3+:0] := ["x"] s[3+:0] := "x" # didn't work; I get a run-time error and program abort WriteL(s) end procedure WriteL(L) local i, len len := *L i := 1 while i <= len do { writes(L[i]) ; i +:= 1 } write() end I get the following error message when I run the above: Run-time error 111 File E:\icon\wsource\sublist.icn; Line 28 [the line: s[3+:0] := "x" ] variable expected offending value: list_3 = [] Traceback: main() {list_3 = [] := "x"} from line 28 in E:\icon\wsource\sublist.icn Can you tell me how to accomplish what I want? Thank You, Blake Chapman From icon-group-sender Thu Oct 21 15:23:09 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id PAA04497 for icon-group-addresses; Thu, 21 Oct 1999 15:17:38 -0700 (MST) Message-Id: <199910212217.PAA04497@baskerville.CS.Arizona.EDU> From: "Frank Lhota" To: "Blake Chapman" , Subject: Re: List subscription insert/removal Date: Thu, 21 Oct 1999 11:20:28 -0000 X-Priority: 3 X-MSMail-Priority: Normal X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO I think what Gordon Peterson had in mind was using subscript ranges along with list catenation, e.g., s := s[1:3] ||| [ "x" ] ||| s[3:0] There is probably a more efficient way to do this, but this approach is certainly straightforward. ----- Original Message ----- From: Blake Chapman To: Sent: Thursday, October 21, 1999 2:21 AM Subject: List subscription insert/removal > Icon Project, > > I am trying to figure out how to insert a new element into a list, > and remove an element from the middle of a list (not the end). > In answer to this question previously Gordon Peterson sent > a reply. I tried what he said and it doesn't work. > > My original question, that he answered, was > "I find no routines to pluck one element out of the middle of a list, or insert > one in. Are there such routines?". > > His answer was: > "Perhaps not, since those functions are really pretty trivial (you can use > subscript ranges to specify sublists, making that kind of thing a simple > expression).". > > I assume he meant that I can insert an element into a list the same way > I can insert a character into a string variable. So I tried it, 4 ways; none > of them worked, they all produce a run-time error and abort. Here is > the program. Though I use mere charactes or 1-char strings as list > elements, it is just to try out list manipulation... > > procedure main() > local s # it will be a list > > s:= ["a", "b", "c", "d"] > WriteL(s) # this writes "abcd" as it should > # Next, I want to insert "x" as a list element between "b" and "c" .... > # didn't work: s[3:3]:="x" > # didn't work: s[3:3] := ["x"] > # didn't work: s[3+:0] := ["x"] > s[3+:0] := "x" # didn't work; I get a run-time error and program abort > WriteL(s) > end > > procedure WriteL(L) > local i, len > len := *L > i := 1 > while i <= len do { writes(L[i]) ; i +:= 1 } > write() > end > > I get the following error message when I run the above: > > Run-time error 111 > File E:\icon\wsource\sublist.icn; Line 28 [the line: s[3+:0] := "x" ] > variable expected > offending value: list_3 = [] > Traceback: > main() > {list_3 = [] := "x"} from line 28 in E:\icon\wsource\sublist.icn > > Can you tell me how to accomplish what I want? > > Thank You, > Blake Chapman > > From icon-group-sender Thu Oct 21 15:43:50 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id PAA05509 for icon-group-addresses; Thu, 21 Oct 1999 15:42:36 -0700 (MST) Message-Id: <199910212242.PAA05509@baskerville.CS.Arizona.EDU> Date: Thu, 21 Oct 1999 09:01:50 -0700 From: Steve Wampler X-Accept-Language: en CC: icon-group@optima.CS.Arizona.EDU Subject: Re: List subscription insert/removal Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Blake Chapman wrote: > > Icon Project, > > I am trying to figure out how to insert a new element into a list, > and remove an element from the middle of a list (not the end). > In answer to this question previously Gordon Peterson sent > a reply. I tried what he said and it doesn't work. > > My original question, that he answered, was > "I find no routines to pluck one element out of the middle of a list, or insert > one in. Are there such routines?". ... > procedure main() > local s # it will be a list > > s:= ["a", "b", "c", "d"] > WriteL(s) # this writes "abcd" as it should > # Next, I want to insert "x" as a list element between "b" and "c" .... > # didn't work: s[3:3]:="x" > # didn't work: s[3:3] := ["x"] > # didn't work: s[3+:0] := ["x"] > s[3+:0] := "x" # didn't work; I get a run-time error and program abort > WriteL(s) > end Unfortunately, sublists are not variables, as you've seen with your test cases. So trying to assign to a sublist isn't going to work, no matter how you try and construct it. I'm not sure why sublists are implemented this way, but can imagine all sorts of difficulties that might arise from implementing it otherwise. (I've often thought that it would be nice to implement lists so they are more consistent with strings, but the result, while perhaps quite nice, would no longer be Icon... Perhaps someone with more time on their hands would like to think about this more? (List scanning would become easier to implement, among other things.) Anyway, you have to implement the operations you want by constructing new lists: procedure replace(a, start, stop, value) return a[1:start] ||| value ||| a[stop:0] end where the call would be: s := replace(s, 3, 3, ["x"]) I agree that this is not as clean as one might hope for, but I don't think there's any way around this. Because of the call-by-value semantics of Icon, you have to do the "pluck" (where I assume you mean to remove the elements from the list when you pluck them) as a two step process: a := s[3:5] s := replace(s, 3, 5, []) -- Steve Wampler- SOLIS Project, National Solar Observatory swampler@noao.edu From icon-group-sender Thu Oct 21 15:50:06 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id PAA05811 for icon-group-addresses; Thu, 21 Oct 1999 15:49:56 -0700 (MST) Message-Id: <199910212249.PAA05811@baskerville.CS.Arizona.EDU> From: gep2@terabites.com Date: Thu, 21 Oct 1999 13:52:24 -0500 Subject: List subscription insert/removal To: icon-group@optima.CS.Arizona.EDU Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO > I am trying to figure out how to insert a new element into a list, and remove an element from the middle of a list (not the end). In answer to this question previously Gordon Peterson sent a reply. I tried what he said and it doesn't work. It does if you do it right. :-) > My original question, that he answered, was "I find no routines to pluck one element out of the middle of a list, or insert one in. Are there such routines?". > His answer was: "Perhaps not, since those functions are really pretty trivial (you can use subscript ranges to specify sublists, making that kind of thing a simple expression).". > I assume he meant that I can insert an element into a list the same way I can insert a character into a string variable. So I tried it, 4 ways; none of them worked, they all produce a run-time error and abort. Here is the program. Though I use mere charactes or 1-char strings as list elements, it is just to try out list manipulation... > procedure main() local s # it will be a list > s:= ["a", "b", "c", "d"] WriteL(s) # this writes "abcd" as it should # Next, I want to insert "x" as a list element between "b" and "c" .... # didn't work: s[3:3]:="x" # didn't work: s[3:3] := ["x"] # didn't work: s[3+:0] := ["x"] s[3+:0] := "x" # didn't work; I get a run-time error and program abort WriteL(s) end > procedure WriteL(L) local i, len len := *L i := 1 while i <= len do { writes(L[i]) ; i +:= 1 } write() end > I get the following error message when I run the above: Run-time error 111 File E:\icon\wsource\sublist.icn; Line 28 [the line: s[3+:0] := "x" ] variable expected offending value: list_3 = [] Traceback: main() {list_3 = [] := "x"} from line 28 in E:\icon\wsource\sublist.icn > Can you tell me how to accomplish what I want? Try sectioning the list and concatenating (if you have the Icon book, 1st edition, this is on pages 52 and 53). In particular, for your test example above, the code might look like: s := s[1:2] ||| ["x"] ||| s[3:0] The book states (page 53, but anyhow in the description of List Sections): "In particular, a[i:j] is a list that is distinct from 'a', and assignment cannot be made to it to change 'a'." If you don't have a copy of the Icon book, you *really* ought to get a copy. It really is VERY important if you plan to make effective use of the language, and will pretty instantly answer most of this kind of question. Gordon Peterson http://web2.airmail.net/gep2/ Support the Anti-SPAM Amendment! Join at http://www.cauce.org/ 12/19/98: the day the Conservatives demonstrated their scorn for their fraudulent sham of representative government. Voters, remember it! From icon-group-sender Tue Oct 26 14:52:47 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id OAA11594 for icon-group-addresses; Tue, 26 Oct 1999 14:50:33 -0700 (MST) Message-Id: <199910262150.OAA11594@baskerville.CS.Arizona.EDU> X-Authentication-Warning: agate-ether.berkeley.edu: news set sender to using -f From: anyone@No-Such-Domain.anywhere (see.signature) X-Newsgroups: comp.lang.icon Subject: differences in Icon versions X-Newsreader: slrn (0.9.4.3 UNIX) Date: 26 Oct 1999 17:28:19 +0100 X-Trace: 26 Oct 1999 17:28:19 +0100, flex111.dnwl.wau.nl To: icon-group@optima.CS.Arizona.EDU Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Hi, my question relates to differences in the basic versions of ICON. I do have the book "The Icon Progr. Language" (1983). It is quite old, but i am wondering if the stuff relating to generators, string scanning, co-expressions and list processing changed substantially. thanks, Marc -- ------------------------------------------------------------------------------ email: marc dot hoffmann at users dot whh dot wau dot nl ------------------------------------------------------------------------------ From icon-group-sender Tue Oct 26 16:31:01 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id QAA15379 for icon-group-addresses; Tue, 26 Oct 1999 16:30:46 -0700 (MST) Message-Id: <199910262330.QAA15379@baskerville.CS.Arizona.EDU> X-Authentication-Warning: agate-ether.berkeley.edu: news set sender to using -f From: "Sean R. McCorkle" X-Newsgroups: comp.lang.icon Subject: csets and sets of characters Date: Tue, 26 Oct 1999 16:20:41 -0400 To: icon-group@optima.CS.Arizona.EDU Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO In writing an Icon version of a command line options parser, like getopt() in C & Perl, I decided to first convert the input string of option characters (ie. "abc:12:") into two sets of characters, one for options that take arguments, and one for options which take no arguments. This is easy using Icon sets, but it seems more natural somehow to use the built-in cset datatype. But I don't see how to test for members in csets (member( 'abc', "b" ) generates a run time error). Any sage advice out there about when to use sets and/or csets? Also, if anybody has any examples of command line options parsers, or if there's one I've overlooked the standard libs or literature, I'd sure be grateful if someone could point 'em out to me. (I'm a real novice at Icon) Thank you all, -- ------------------------------------------------------------------------------ Sean R. McCorkle mccorkle@bnl.gov Biology Department, Genome Group (516) 344-4270 phone Brookhaven National Laboratory (516) 344-3407 fax Upton, New York 11973 "Oh plunge your hands in water, Plunge them in up to the wrist, Stare, stare in the basin, And wonder what you've missed." - W.H. Auden From icon-group-sender Tue Oct 26 16:31:24 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id QAA15432 for icon-group-addresses; Tue, 26 Oct 1999 16:31:12 -0700 (MST) Message-Id: <199910262331.QAA15432@baskerville.CS.Arizona.EDU> X-Authentication-Warning: agate-ether.berkeley.edu: news set sender to using -f From: gmt@optima.CS.Arizona.EDU (Gregg Townsend) X-Newsgroups: comp.lang.icon Subject: Re: csets and sets of characters Date: 26 Oct 1999 15:16:05 -0700 To: icon-group@optima.CS.Arizona.EDU Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Sean R. McCorkle wrote: > > ...But I don't see how to test for members in csets any(c,s) succeeds if the character s is in the cset c. > Also, if anybody has any examples of command line options parsers, > or if there's one I've overlooked the standard libs or literature, > I'd sure be grateful if someone could point 'em out to me. The "standard" parser from the Icon Program Library can be found at http://www.cs.arizona.edu/icon/library/procs/options.htm --------------------------------------------------------------------------- Gregg Townsend Staff Scientist The University of Arizona gmt@cs.arizona.edu Computer Science Tucson, Arizona, USA From icon-group-sender Wed Oct 27 07:56:18 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id HAA09400 for icon-group-addresses; Wed, 27 Oct 1999 07:55:41 -0700 (MST) Message-Id: <199910271455.HAA09400@baskerville.CS.Arizona.EDU> X-Sender: whm@pop.primenet.com Date: Tue, 26 Oct 1999 21:38:01 -0700 To: icon-group@optima.CS.Arizona.EDU From: "William H. Mitchell" Subject: Re: csets and sets of characters Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO At 03:16 PM 10/26/99 -0700, Gregg Townsend wrote: >Sean R. McCorkle wrote: >> >> ...But I don't see how to test for members in csets > >any(c,s) succeeds if the character s is in the cset c. For those who prefer the scenic route: *s = *(c++s) From icon-group-sender Wed Oct 27 07:57:44 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id HAA09494 for icon-group-addresses; Wed, 27 Oct 1999 07:57:38 -0700 (MST) Message-Id: <199910271457.HAA09494@baskerville.CS.Arizona.EDU> From: gep2@terabites.com Date: Wed, 27 Oct 1999 01:43:11 -0500 Subject: csets and sets of characters To: icon-group@optima.CS.Arizona.EDU Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO > In writing an Icon version of a command line options parser, like getopt() in C & Perl, I decided to first convert the input string of option characters (ie. "abc:12:") into two sets of characters, one for options that take arguments, and one for options which take no arguments. This is easy using Icon sets, but it seems more natural somehow to use the built-in cset datatype. But I don't see how to test for members in csets (member( 'abc', "b" ) generates a run time error). Any sage advice out there about when to use sets and/or csets? It SOUNDS like you're trying to write it the way you'd write it in C or Perl, and that's usually a bad sign. Usually what I think you really want to do is instead to use string scanning to process your options. This might be very different of course depending on just what you're trying to do, but I'd think you'd want something more based on something like tab(any(noargparms) | (any(argparms) many("0123456789"))) Sorry to not provide a more concrete example, but it really does depend on just what you're trying to accomplish... and what you want your command line to look like. Gordon Peterson http://web2.airmail.net/gep2/ Support the Anti-SPAM Amendment! Join at http://www.cauce.org/ 12/19/98: the day the Conservatives demonstrated their scorn for their fraudulent sham of representative government. Voters, remember it! From icon-group-sender Fri Nov 5 10:56:47 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id KAA21852 for icon-group-addresses; Fri, 5 Nov 1999 10:53:23 -0700 (MST) Message-Id: <199911051753.KAA21852@baskerville.CS.Arizona.EDU> X-Authentication-Warning: agate.berkeley.edu: news set sender to using -f From: Andrew McGhie X-Newsgroups: comp.lang.icon Subject: How do I create an array of records?? Date: Mon, 01 Nov 1999 10:48:44 +0000 X-Trace: glencoe.hw.ac.uk 941453140 29905 137.195.187.207 (1 Nov 1999 10:45:40 GMT) X-Complaints-To: news To: icon-group@optima.CS.Arizona.EDU Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO I've just started programming with Icon and was wondering how to create an array of records, for instance a database of people. I've declared a record as follows: record Person(surname, forename, age, height) but what do I do after this? Or is there a better was to do it? Thanks for your time ANDY. From icon-group-sender Fri Nov 5 11:00:16 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id KAA22015 for icon-group-addresses; Fri, 5 Nov 1999 10:58:32 -0700 (MST) Message-Id: <199911051758.KAA22015@baskerville.CS.Arizona.EDU> X-Authentication-Warning: agate.berkeley.edu: news set sender to using -f From: Steve Wampler X-Newsgroups: comp.lang.icon Subject: Re: How do I create an array of records?? Date: Fri, 05 Nov 1999 08:17:34 -0700 X-Trace: noao.edu 941815056 33041 140.252.38.6 (5 Nov 1999 15:17:36 GMT) X-Complaints-To: abuse@noao.edu X-Accept-Language: en To: icon-group@optima.CS.Arizona.EDU Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Andrew McGhie wrote: > > I've just started programming with Icon and was wondering how to create > an array of records, for instance a database of people. > I've declared a record as follows: > record Person(surname, forename, age, height) > but what do I do after this? Or is there a better was to do it? Hmmm, you have lots of ways to go at this point. For example, if you really just want an array of records, use a list: db := list() # create the 'array' (db declared global) procedure addPerson(surname, forename, age, height) put(db, Person(surname, forename, age, height)) end However, it's more likely you'll want to have some way to quickly look up entries in the database, so you might prefer to have several tables for quickly locating items using different keys: dbNames := table() dbAge := table() dbHeight := table() (Note for the more Icon literate - this could be written as: every (dbNames | dbAge | dbHeight) := table() but not as: dbNames := dbAge := dbHeight := table() do you see why?) procedure addPerson(surname, forename, age, height) person := Person(surname, forename, age, height) /(dbNames[surname]) := [] # Use lists to allow /(dbAge[age]) := [] # for collisions /(dbHeight[height]) := [] put(dbNames[surname], person) put(dbAge[age], person) put(dbHeight[height], person) end Of course, if you're writing a "real" application, you would want something considerably more sophisticated and with some sanity checks along the way - and probably want to separate the database 'operations' [store, search, retrieve, etc] from the actual items being stored, as in: procedure addPerson(surname, forename, age, height) person := Person(surname, forename, age, height) dbStore(person) end -- Steve Wampler- SOLIS Project, National Solar Observatory swampler@noao.edu From icon-group-sender Fri Nov 5 17:06:17 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id RAA04185 for icon-group-addresses; Fri, 5 Nov 1999 17:04:16 -0700 (MST) Message-Id: <199911060004.RAA04185@baskerville.CS.Arizona.EDU> X-Authentication-Warning: agate.berkeley.edu: news set sender to using -f X-Newsgroups: comp.lang.icon From: jrinkel@no.email.com (Jay Rinkel) Subject: Imbeddable Icon? X-Newsreader: News Xpress 2.01 X-Trace: typ11.nn.bcandid.com 941841136 216.180.15.69 (Fri, 05 Nov 1999 17:32:16 EST) Date: Fri, 05 Nov 1999 22:31:51 GMT To: icon-group@optima.CS.Arizona.EDU Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Hi! I was wondering if Icon was designed to be set up as a control/scripting language to run inside an existing C/C++/Java program? Seems like I read that Icon had some limited support for calling external routines but the Icon interpreter was considered to be the main executable while anything it calls was considered to be "support" type routines. What would be nice is to have the ability to imbed an Icon interpreter inside the desired application and the application can call what ever procedure of the icon "program" it wanted. Then the ability to map Icon procedure names to functions/methods of the host application would also be nice. Is this currently possible? If not, has there been any thought in making a version of the interpreter which could be imbedded as I mentioned? I have been programming in Icon (mostly from a casual standpoint to build little "helper" programs) off and on for about 5 years and I personally see a great possibility in allowing Icon to be used as a scripting language for other applications. Jay Rinkel From icon-group-sender Wed Nov 10 09:44:51 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id JAA29118 for icon-group-addresses; Wed, 10 Nov 1999 09:42:51 -0700 (MST) Message-Id: <199911101642.JAA29118@baskerville.CS.Arizona.EDU> X-Authentication-Warning: agate.berkeley.edu: news set sender to using -f From: Anders Holtsberg X-Newsgroups: comp.lang.icon Subject: List question Date: Wed, 10 Nov 1999 10:17:23 +0100 X-Accept-Language: en To: icon-group@optima.CS.Arizona.EDU Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO --------------2D064CE7C06019CDC4A897F9 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit A string can be changed in place s[4:6] = " hello " A list can be appended at the end and at the beginning every put(listA, !listB) But does the language definition forbid listA[5+:0] := listB or what is the handy way to delete and insert elements in a list supplied as an argument? If I have procedure f(mylist) put(mylist, "hello") # This is OK mylist[5+:0] := ["hello"] # Run time error. The book states # that run time error is indeed expected. mylist := mylist[1:5] ||| ["hello"] ||| mylist[5:0] # Here the caller is not affected! 1) Have I understood? Is it impossible to write a routine listinsert(A,B,i) and that we have to write A:=listinsert(A,B,i) 2) What was the language design objectives to rule out listA[i:j] := listB There is no semantic problem , listA[i] is an element and listA[i+:1] is a sublist (or rather today only a list of its own since it cannot be a left-value). 3) I figure there are dark corners here since I saw in a list library that mr Griswold himself thought about the difficulties in similarity/differences between string filosophy and list filosophy. Comments anybody? (the code is from top of my head, I only have Icon at home just now) Andy -- __________________________________________________________________ Anders Holtsberg Matematisk statistik Telefon 046-2224953 andersh@maths.lth.se Matematikcentrum Telefax 046-2224998 www.maths.lth.se Lunds universitet Box 118, 22100 Lund --------------2D064CE7C06019CDC4A897F9 Content-Type: text/html; charset=us-ascii Content-Transfer-Encoding: 7bit  
A string can be changed in place

   s[4:6] = " hello "

A list can be appended at the end and at the beginning

  every put(listA, !listB)

But does the language definition forbid

  listA[5+:0] := listB

or what is the handy way to delete and insert elements
in a list supplied as an argument? If I have

  procedure f(mylist)

     put(mylist, "hello") # This is OK
     mylist[5+:0] := ["hello"] # Run time error. The book states
    #  that run time error is indeed expected.
     mylist := mylist[1:5] ||| ["hello"] ||| mylist[5:0]  # Here the caller is not affected!

1) Have I understood? Is it impossible to write a routine listinsert(A,B,i)
     and that we have to write A:=listinsert(A,B,i)
2) What was the language design objectives to rule out
            listA[i:j] := listB
      There is no semantic problem , listA[i] is an element and listA[i+:1] is a
      sublist (or rather today only a list of its own since it cannot be a left-value).
3) I figure there are dark corners here since I saw in a list library that
     mr Griswold himself thought about the difficulties in similarity/differences
     between string filosophy and list filosophy.

Comments anybody?

(the code is from top of my head, I only have Icon at home just now)

Andy

-- 
__________________________________________________________________
Anders Holtsberg        Matematisk statistik   Telefon 046-2224953 
andersh@maths.lth.se    Matematikcentrum       Telefax 046-2224998
www.maths.lth.se        Lunds universitet      Box 118, 22100 Lund
  --------------2D064CE7C06019CDC4A897F9-- From icon-group-sender Wed Nov 10 09:46:47 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id JAA29298 for icon-group-addresses; Wed, 10 Nov 1999 09:46:36 -0700 (MST) Message-Id: <199911101646.JAA29298@baskerville.CS.Arizona.EDU> X-Authentication-Warning: agate.berkeley.edu: news set sender to using -f From: Anders Holtsberg X-Newsgroups: comp.lang.icon Subject: Re: List question Date: Wed, 10 Nov 1999 11:53:34 +0100 To: icon-group@optima.CS.Arizona.EDU Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Sorry folks. I just found the very recent discussion on this topic on Dejanews. But still: why not let mylist[5+:0] := anotherlist be a legal construct? I e the only change would be to let mylist[i:j] produce an l-value instead of an r-value, it would break no code at all, would it? Is the implementation difficult? Are there filosophical or implementation problems? (I'm not nagging you guys: I can try to do the work if you think the change in semantics is OK). Anders Holtsberg -- __________________________________________________________________ Anders Holtsberg Matematisk statistik Telefon 046-2224953 andersh@maths.lth.se Matematikcentrum Telefax 046-2224998 www.maths.lth.se Lunds universitet Box 118, 22100 Lund From icon-group-sender Wed Nov 10 09:48:02 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id JAA29359 for icon-group-addresses; Wed, 10 Nov 1999 09:47:40 -0700 (MST) Message-Id: <199911101647.JAA29359@baskerville.CS.Arizona.EDU> X-Authentication-Warning: agate.berkeley.edu: news set sender to using -f From: Steve Wampler X-Newsgroups: comp.lang.icon Subject: Re: List question Date: Wed, 10 Nov 1999 08:44:04 -0700 X-Trace: noao.edu 942248646 36323 140.252.38.6 (10 Nov 1999 15:44:06 GMT) X-Complaints-To: abuse@noao.edu X-Accept-Language: en To: icon-group@optima.CS.Arizona.EDU Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Anders Holtsberg wrote: > > Sorry folks. I just found the very recent discussion on > this topic on Dejanews. But still: why not let > > mylist[5+:0] := anotherlist > > be a legal construct? I e the only change would be to > let mylist[i:j] produce an l-value instead of an r-value, > it would break no code at all, would it? Correct, this change should have no impact on existing code. > Is the implementation difficult? Are there filosophical > or implementation problems? (I'm not nagging you guys: I can > try to do the work if you think the change in semantics is OK). I imagine others will disagree, but I'd like to see at least an experimental version of Icon with this change in it. I assume Anders means to differentiate list sectioning from list subscripting and have any list section produce an l-value. This change would bring us one step closer to providing list-scanning. In fact, it would be possible to then produce a PDCO to experiment with list-scanning. However, it does require a non-trivial implementation - you'd have to essentially reproduce internally the same types of operations that people now have to use externally (though you could apply some heuristics). For example, implementing: a[3:5] := [a,b,c,d] would require producing a new list, as if the user had done: a := a[1:3] ||| [a,b,c,d] ||| a[5:0] (because list element storage is sequential in memory) thus adding a single element in the middle of a list could have surprisingly high runtime cost. It has this cost currently, but the fact that the user has to explicitly code it means it's not a surprise... On the other hand: a[3:5] := [] could (possibly, depending on the desired semantics, see below) be done in place on the original list, as could a[3:5] := [1] and a[3:5] := [1,2]. There are also a few major semantic issues to resolve. How close to the behavior of strings should list section assignment go? Strings and lists have some fundamental differences that should be considered carefully. In particular, note that, depending on the implementation, there could be a major difference between a[3:5] := [a,b,c,d] and a := a[1:3] ||| [a,b,c,d] ||| a[5:0] (Suppose the assignment b := a is done prior to each of the above statements. What should the value of b be?). So list section assignment does mean that programmers would have to think very carefully about how they are using lists. Of course, this is true currently; the following code catches people sometimes... a := [1,2,3,4] b := a a[2] := 5 Extending the above behavior to list sectioning is where the direct implementation becomes complicated. You'd have to change how lists are represented and provide "list qualifiers" much as strings are implemented using string qualifiers. Altering the semantics of list processing to provide even closer semantics to string processing would be very difficult to implement and would break existing code (because if you're going to "fix" list sectioning this way, you'd want to also "fix" list element assignment as well). I don't think I would be very keen on that drastic of a change. -- Steve Wampler- SOLIS Project, National Solar Observatory swampler@noao.edu From icon-group-sender Wed Nov 17 16:30:51 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id QAA03599 for icon-group-addresses; Wed, 17 Nov 1999 16:28:53 -0700 (MST) Message-Id: <199911172328.QAA03599@baskerville.CS.Arizona.EDU> X-Authentication-Warning: agate.berkeley.edu: news set sender to using -f From: Kostas Oikonomou X-Newsgroups: comp.lang.icon Subject: Strange table behavior Date: Wed, 17 Nov 1999 17:48:20 -0500 To: icon-group@optima.CS.Arizona.EDU Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO When I run this program procedure main() local T T := table([]) put(T[1], "A") write("*T = ", *T) write(T[1][1]) end I get *T = 0 A Can anyone explain to me what's happening here? Does it have to do with T being a table of lists? Kostas From icon-group-sender Thu Nov 18 08:16:37 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id IAA26926 for icon-group-addresses; Thu, 18 Nov 1999 08:15:55 -0700 (MST) Message-Id: <199911181515.IAA26926@baskerville.CS.Arizona.EDU> X-Authentication-Warning: agate.berkeley.edu: news set sender to using -f X-Newsgroups: comp.lang.icon From: jrinkel@no.email.com (Jay Rinkel) Subject: Re: Strange table behavior X-Newsreader: News Xpress 2.01 X-Trace: typ11.nn.bcandid.com 942884478 216.180.15.233 (Wed, 17 Nov 1999 19:21:18 EST) Date: Thu, 18 Nov 1999 00:20:08 GMT To: icon-group@optima.CS.Arizona.EDU Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO In article <383330B4.58AE@att.com>, Kostas Oikonomou wrote: >When I run this program > >procedure main() > local T > T := table([]) > put(T[1], "A") > write("*T = ", *T) > write(T[1][1]) >end > >I get > >*T = 0 >A > > >Can anyone explain to me what's happening here? Does it have to do with >T being a table of lists? > > Kostas Please see the article at the following web page: it is an article on the Icon Programming language web site and specifically addresses this issue. It explains the situation much better than I can here! http://www.cs.arizona.edu/icon/progcorn/pc_inl21.htm Jay Rinkel From icon-group-sender Thu Nov 18 08:17:23 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id IAA26980 for icon-group-addresses; Thu, 18 Nov 1999 08:17:13 -0700 (MST) Message-Id: <199911181517.IAA26980@baskerville.CS.Arizona.EDU> From: swampler@noao.edu (Steve Wampler) Date: Wed, 17 Nov 1999 18:03:59 MST To: Kostas Oikonomou Subject: Re: Strange table behavior Cc: icon-group@optima.CS.Arizona.EDU Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO On Nov 17 at 5:48pm, Kostas Oikonomou writes: } When I run this program } } procedure main() } local T } T := table([]) } put(T[1], "A") } write("*T = ", *T) } write(T[1][1]) } end } } I get } } *T = 0 } A } } Can anyone explain to me what's happening here? Does it have to do with } T being a table of lists? I can explain it, but I can't decide if it should be classified as a bug or a "feature"...(right now I'm leaning toward "feature") First: T := table([]) This creates a table with a specific list as the default value (note, you probably didn't mean this, see below). Let's call this particular list L_001, so we can see what happens later. If you were to ask for the size of the table at this time, you'd expect to see the value 0, because you haven't assigned anything to the table yet. Now: put(T[1], "A") This asks for the value of T[1]. Since you haven't assigned anything to the table yet, you get back the default value, which is L_001 in this case. The string "A" is put into the list L_001, increasing the size of this list by 1. *Note that you have not yet assigned anything to the table!* So: write("*T = ", *T) outputs the size of the table. Since nothing has been assigned yet, it's still 0. Finally: write(T[1][1]) this first gets the value of the element T[1]. Since nothing has been assigned to the table yet, you get the default value, good old list L_001. Then the first element of L_001 is printed, producing the "A". The output is correct, the size of the table has never changed, because nothing has ever been assigned to the table! The fact that something was assigned to the list that was created and used as the default value for the table doesn't change this fact. Ok, now - why isn't T := table([]) what you want. Again, breaking it down: [] creates a list (L_001, say). table(L_001) says to create a table and make list L_001 the default value. Note that it doesn't say "create a new list each time a new table element is needed". It says "use the list (L_001)" whenever you need the default value". So, for example: put(T[1], "A") put(T[2], "B") put(T[3], "C") write(T[4][2]) would output "B" and write(*(T["aslkdjfsa"]) would output "3"! (It's the same list being produced as the default value, regardless of the reference key.) What you want to do is something like: T := table() /T[1] := [] # create a brand new list and assign it only to T[1] # if nothing has ever been assigned to T[1]. put(T[1], "A") # put the A into this brand new list I hope this helps! -- -- Steve Wampler- SOLIS Project, National Solar Observatory swampler@noao.edu From icon-group-sender Thu Nov 18 08:18:01 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id IAA27016 for icon-group-addresses; Thu, 18 Nov 1999 08:17:41 -0700 (MST) Message-Id: <199911181517.IAA27016@baskerville.CS.Arizona.EDU> From: Chris.D.Tenaglia@jci.com Subject: Re: Strange table behavior To: Kostas Oikonomou Cc: icon-group@optima.CS.Arizona.EDU Date: Thu, 18 Nov 1999 08:25:52 -0600 X-Priority: 3 (Normal) X-MIMETrack: Serialize by Router on jwimkrs1.na.jci.com/NA/Johnson_Controls(Release 5.0.1a (Intl)|17 August 1999) at 11/18/99 08:29:31 AM Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO T is a table. The default value is an empty list. T[1] is a table entry with the value A *T does not reference a specific entry, so it picks the default empty list, returning 0 for it's length. *T[1] would return 1 Chris Tenaglia. Kostas Oikonomou on 11/17/99 04:48:20 PM To: icon-group@optima.CS.Arizona.EDU cc: Subject: Strange table behavior When I run this program procedure main() local T T := table([]) put(T[1], "A") write("*T = ", *T) write(T[1][1]) end I get *T = 0 A Can anyone explain to me what's happening here? Does it have to do with T being a table of lists? Kostas From icon-group-sender Fri Nov 19 08:17:56 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id IAA25791 for icon-group-addresses; Fri, 19 Nov 1999 08:16:16 -0700 (MST) Message-Id: <199911191516.IAA25791@baskerville.CS.Arizona.EDU> From: swampler@noao.edu (Steve Wampler) Date: Thu, 18 Nov 1999 19:14:49 MST To: icon-project@optima.CS.Arizona.EDU, icon-group@optima.CS.Arizona.EDU Subject: Uh, nevermind...(re: proposed change to Icon table reference semantics) Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Earlier today I posted a suggested change to the way default-valued table references would work. Clint Jeffery was kind enough to gently point out that the suggestion wasn't, uh, top-quality. In fact, it wouldn't even solve the original problem it was addressing. (I'd pass Clint's explanation on, but it might be more fun for people to see if they can figure out why it really wouldn't help after all!) If you're curious, send me email and I'll explain the error of my ways. Anyway, I withdraw the proposal! -- -- Steve Wampler- SOLIS Project, National Solar Observatory swampler@noao.edu From icon-group-sender Mon Dec 6 08:19:56 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id IAA16800 for icon-group-addresses; Mon, 6 Dec 1999 08:18:18 -0700 (MST) Message-Id: <199912061518.IAA16800@baskerville.CS.Arizona.EDU> X-Authentication-Warning: agate.berkeley.edu: news set sender to using -f From: glass X-Newsgroups: comp.lang.icon Subject: Text input vidget on Windows 98 Date: Sun, 05 Dec 1999 04:28:04 -0600 X-Trace: condor.cns.iit.edu 944389371 214753 255.255.255.255 (5 Dec 1999 10:22:51 GMT) X-Complaints-To: postmaster@iit.edu X-Accept-Language: en To: icon-group@optima.CS.Arizona.EDU Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO I am unable to persuade the text input vidget to work. The environment is Windows Icon 9.3.1 running on a W98 computer. All the keyboard events while the mouse cursor is in the text input vidget are ignored. I found them in a "missed" handler in ProcessEvent() or GetEvents(). The text in the vidget is not updated in response to key presses. Pressing return or enter results in a missed event. The text input call back function is not called. Mouse clicks within the text input vidget are *not* "missed", only the keyboard events. With the mouse, I can move the I-beam cursor and select text. An experiment I tried was to use VSetState() to change the text. That works. The call back function still is not called, however. I'm new at this--this is the first time I am using VIB--so I may be missing something obvious. But the other vidgets I am using seem to work, and I can't persuade the text input vidget to work in even a tiny one- or two-vidget screen. -- Michael Glass (Yes, I read the caveat about the text input vidget confusing users by not providing enough visual feedback, and calling the call back function only on ) From icon-group-sender Mon Dec 6 08:23:20 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id IAA16906 for icon-group-addresses; Mon, 6 Dec 1999 08:23:08 -0700 (MST) Message-Id: <199912061523.IAA16906@baskerville.CS.Arizona.EDU> X-Authentication-Warning: agate.berkeley.edu: news set sender to using -f From: Charles Shirley X-Newsgroups: comp.lang.icon Subject: Low GDI resources while running Win Icon Date: Sun, 05 Dec 1999 07:35:58 -0700 X-Trace: bgtnsc01.worldnet.att.net 944404552 10692 12.74.0.49 (5 Dec 1999 14:35:52 GMT) X-Complaints-To: abuse@worldnet.att.net X-Accept-Language: en To: icon-group@optima.CS.Arizona.EDU Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO While running a program in Windows Icon 9.3.1 under Windows 98, I was warned by Norton System Doctor that GDI (Graphics Device Interface) resources--that is, memory-- were getting low. When I stopped the program and checked GDI resources, they were 60-70% free. When I re-started the program and worked with it for a while, resources dropped until they hit the 20% mark where Norton complained and Win 98 started responding slowly. The program uses dialog boxes to do vocabulary tagging. For example, at every occurrence of "to" in a text, a dialog box displays a segment of the text and provides buttons to indicate whether "to" is a preposition or part of an infinitive. The low-GDI warning appears after 200 or so repetitions. This behavior seems like a memory leak. Could there be something I am doing or not doing to cause the problem? For example, might it help to force a garbage collection every 100-200 repetitions? Charles Shirley, cgshirley@worldnet.att.net From icon-group-sender Fri Dec 10 09:51:29 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id JAA04487 for icon-group-addresses; Fri, 10 Dec 1999 09:50:48 -0700 (MST) Message-Id: <199912101650.JAA04487@baskerville.CS.Arizona.EDU> From: jeffery@big-bill.CS.UNLV.EDU To: icon-group@optima.CS.Arizona.EDU Subject: simple string compression, anyone? Date: Thu, 09 Dec 1999 18:59:57 -0800 Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Does anyone have Icon procedures that compress and decompress strings? Richard Goerwitz contributed a Huffman program to the Icon Program Library that might be adaptable for my purpose, but perhaps there are some other routines out there that would make good library procedures. I grepped around in the Icon Program Library and didn't see anything else. Cheers, Clint Jeffery, jeffery@cs.unlv.edu From icon-group-sender Wed Dec 15 12:35:02 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id MAA23339 for icon-group-addresses; Wed, 15 Dec 1999 12:33:48 -0700 (MST) Message-Id: <199912151933.MAA23339@baskerville.CS.Arizona.EDU> X-Authentication-Warning: agate.berkeley.edu: news set sender to using -f From: Chuck Meyers X-Newsgroups: comp.lang.icon Subject: icon to c? Date: Wed, 15 Dec 1999 06:54:02 -0800 X-Accept-Language: en To: icon-group@optima.CS.Arizona.EDU Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Is there a tranlation program that will convert icon to c? chuck.meyers@lmco.com From icon-group-sender Wed Dec 15 16:36:04 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id QAA01394 for icon-group-addresses; Wed, 15 Dec 1999 16:34:12 -0700 (MST) Message-Id: <199912152334.QAA01394@baskerville.CS.Arizona.EDU> Date: Wed, 15 Dec 1999 13:01:21 -0700 (MST) From: Gregg Townsend To: chuck.meyers@lmco.com, icon-group@optima.CS.Arizona.EDU Subject: Re: icon to c? Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO From: Chuck Meyers Is there a tranlation program that will convert icon to c? Not to *readable* C. There was once a compiler (no longer supported) that used C as an intermediate step, but you couldn't do anything with that C code and it worked only in its specialized environment. --------------------------------------------------------------------------- Gregg Townsend Staff Scientist The University of Arizona gmt@cs.arizona.edu Computer Science Tucson, Arizona, USA From icon-group-sender Wed Dec 15 16:38:19 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id QAA01600 for icon-group-addresses; Wed, 15 Dec 1999 16:38:01 -0700 (MST) Message-Id: <199912152338.QAA01600@baskerville.CS.Arizona.EDU> From: "Frank Lhota" To: "Chuck Meyers" , Subject: Re: icon to c? Date: Wed, 15 Dec 1999 15:19:39 -0000 X-Priority: 3 X-MSMail-Priority: Normal X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Yes, the Icon native compiler (iconc) converts an Icon program into C, then uses the local C compiler to finish the job. The idea is to use C as a universal back end. Be forewarned that the C program produced by iconc is not very readable. ----- Original Message ----- From: Chuck Meyers To: Sent: Wednesday, December 15, 1999 2:54 PM Subject: icon to c? > Is there a tranlation program that will convert icon to c? > > > chuck.meyers@lmco.com > > > From icon-group-sender Thu Dec 16 08:04:48 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id IAA01344 for icon-group-addresses; Thu, 16 Dec 1999 08:03:52 -0700 (MST) Message-Id: <199912161503.IAA01344@baskerville.CS.Arizona.EDU> X-Authentication-Warning: agate.berkeley.edu: news set sender to using -f From: Federico Balbi X-Newsgroups: comp.lang.icon Subject: Re: icon to c? Date: Wed, 15 Dec 1999 17:49:12 -0600 X-Trace: ringer.cs.utsa.edu 945301747 23582 129.115.120.1 (15 Dec 1999 23:49:07 GMT) X-Complaints-To: usenet@ringer.cs.utsa.edu To: icon-group@optima.CS.Arizona.EDU Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Hi, there's iconc that is supposed to be the icon compiler. It translates a .icn file in C and produce an executable. ---------------------------------------------------------------------------- Federico Balbi - University of Texas at San Antonio e-mail: fbalbi@lonestar.utsa.edu - URL: http://www.geocities.com/fedebalbi On 15 Dec 1999, Chuck Meyers wrote: > Is there a tranlation program that will convert icon to c? > > > chuck.meyers@lmco.com From icon-group-sender Fri Dec 17 08:40:46 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id IAA25895 for icon-group-addresses; Fri, 17 Dec 1999 08:39:30 -0700 (MST) Message-Id: <199912171539.IAA25895@baskerville.CS.Arizona.EDU> Date: Thu, 16 Dec 1999 22:07:13 -0700 From: Anthony Hewitt X-Accept-Language: en To: icon group Subject: icon to c Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO How about icn2c in the IPL? -- Anthony V. Hewitt anthony.hewitt@ibm.net =============================================== not -------------------------- (invert failure) not expr produces the null value if expr fails, but fails if expr succeeds From icon-group-sender Tue Dec 21 08:16:02 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id IAA17126 for icon-group-addresses; Tue, 21 Dec 1999 08:14:13 -0700 (MST) Message-Id: <199912211514.IAA17126@baskerville.CS.Arizona.EDU> X-Authentication-Warning: agate.berkeley.edu: news set sender to using -f From: "Walther Senders" X-Newsgroups: comp.lang.icon Subject: SGML support in ICON Date: Tue, 21 Dec 1999 09:52:26 +0100 X-Trace: buty.wanadoo.nl 945766126 55094 194.134.112.99 (21 Dec 1999 08:48:46 GMT) X-Complaints-To: The appropriate party according to NNTP-Posting-Host: X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.00.2314.1300 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 To: icon-group@optima.CS.Arizona.EDU Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Hi all, does somebody know of a library with routines for SGML-support in ICON? Regards, Walther Senders Daidalos BV The Netherlands. From icon-group-sender Wed Dec 22 14:16:16 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id OAA15934 for icon-group-addresses; Wed, 22 Dec 1999 14:11:17 -0700 (MST) Message-Id: <199912222111.OAA15934@baskerville.CS.Arizona.EDU> From: Art Eschenlauer To: "'dgamey@ca.ibm.com'" , icon-group@optima.CS.Arizona.EDU Subject: RE: Y2k and Icon? Date: Wed, 22 Dec 1999 12:04:03 -0600 Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO I saw no reply to this question. What is the Y2K readiness of Icon implementations? I'm particularly interested in the DOS Command Line implementation. -----Original Message----- From: dgamey@ca.ibm.com [mailto:dgamey@ca.ibm.com] Sent: Tuesday, May 18, 1999 3:13 PM To: icon-group@optima.CS.Arizona.EDU Subject: Y2k and Icon? Hi, I haven't seen anything on Icon's Y2K readiness. Did I miss it? What's the status? I expect I'll have to check all of my IPL contributions, is there a target date for this kind of activity? David From icon-group-sender Thu Dec 23 16:21:54 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id QAA00893 for icon-group-addresses; Thu, 23 Dec 1999 16:20:54 -0700 (MST) Message-Id: <199912232320.QAA00893@baskerville.CS.Arizona.EDU> Date: Thu, 23 Dec 1999 09:58:31 -0700 (MST) From: Gregg Townsend To: icon-group Cc: art.eschenlauer@sufsys.com, dgamey@ca.ibm.com Subject: RE: Y2k and Icon? Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO From: Art Eschenlauer I saw no reply to this question. What is the Y2K readiness of Icon implementations? I'm particularly interested in the DOS Command Line implementation. We have not performed a systematic evaluation of any Icon implementation with respect to Y2K bugs, so we can't make a definitive statement. I am not aware of any problems in the current release (9.3.2), but that doesn't mean there aren't any, or that something won't turn up. As with most free software, Icon is distributed as-is, without warranty, and we cannot make any guarantees. --------------------------------------------------------------------------- Gregg Townsend Staff Scientist The University of Arizona gmt@cs.arizona.edu Computer Science Tucson, Arizona, USA From icon-group-sender Fri Dec 24 15:37:00 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id PAA23876 for icon-group-addresses; Fri, 24 Dec 1999 15:36:03 -0700 (MST) Message-Id: <199912242236.PAA23876@baskerville.CS.Arizona.EDU> From: "Evans" To: Subject: REBOL Date: Fri, 24 Dec 1999 12:40:37 -0600 X-Priority: 3 (Normal) X-MSMail-Priority: Normal Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Dear Icon Group, Dr. Dobb's just ran an article on the new REBOL language. I am curious to know what the Icon Consortium thinks of this language in comparison to Icon. http://www.rebol.com/inthenews.html http://www.rebol.com/quotes.html REBOL is an interpreted language with an English-like syntax and is geared mostly toward Internet functionality. It also has strong data manipulation features akin to Icon's. That is the most I can say at first glance, and leads to my question: Where do the philosophies of REBOL and Icon diverge? While I grasp the key underlying aspects of Icon, I can't get my head around REBOL. It appears to me that in some vague sense the philosophies behind the two languages have much in common. To take one concrete example, Unicon/Icon2 claims to be a worthy replacement for Perl for a variety of reasons. However REBOL makes exactly the same claim, and is here now for all platforms while Unicon/Icon2 sits in perpetual beta state and only for Unix. The author of REBOL is a well-known character in Silicon Valley with a lot of experience. He researched over 50 languages before starting the REBOL project. The REBOL project has attracted venture capital, but the core version is freeware. The commercial vision is to have REBOL running every Internet-capable device as the core messaging engine. Your Internet Toaster will speak REBOL to your watch. The major claimed benefit of REBOL is "dialects" but I fail to grasp how these work. If you can explain them to me in addition to the comparison with Icon, double thanks are yours. The REBOL literature seems a little sparse about this feature. Evidently it is connected with the REBOL "parse" function. Somewhere on the REBOL pages I also read that REBOL serves as its own meta-language, or something equally cryptic. I need a computer scientist to hold my hand at this point because I lost my beanie cap. An interesting aspect of REBOL as it touches on Icon is that REBOL already incorporates the port/socket/IO features that were supposed to be the new-and-improved aspects of Icon2/Unicon. This overlap is another area for comparison and contrast. Internet functionality is a major theme of this language. In summary, my questions are 1) Do you think the driving computer-science philosophies behind REBOL and Icon are very similar? 2) Where do they differ? 3) Is Icon's destiny pointing in the direction of REBOL? Sincerely, Mark Evans From icon-group-sender Thu Dec 30 15:35:44 1999 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id PAA25047 for icon-group-addresses; Thu, 30 Dec 1999 15:31:24 -0700 (MST) Message-Id: <199912302231.PAA25047@baskerville.CS.Arizona.EDU> X-Authentication-Warning: agate.berkeley.edu: news set sender to using -f From: Federico Balbi X-Newsgroups: comp.lang.icon Subject: sleep Date: Wed, 29 Dec 1999 16:46:39 -0600 X-Trace: ringer.cs.utsa.edu 946507553 7812 129.115.120.1 (29 Dec 1999 22:45:53 GMT) X-Complaints-To: usenet@ringer.cs.utsa.edu To: icon-group@optima.CS.Arizona.EDU Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Does Icon have a sleep() function to avoid busy-waiting? Thanks ---------------------------------------------------------------------------- Federico Balbi - University of Texas at San Antonio e-mail: fbalbi@lonestar.utsa.edu - URL: http://www.geocities.com/fedebalbi