From icon-group-sender Fri Jul 14 12:39:50 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id MAA04760 for icon-group-addresses; Fri, 14 Jul 2000 12:36:40 -0700 (MST) Message-Id: <200007141936.MAA04760@baskerville.CS.Arizona.EDU> Date: Fri, 14 Jul 2000 11:59:11 -0500 From: Albert Wagner X-Accept-Language: en To: Icon Subject: Installation on RH6.1 Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 1336 I have just attempted to install Icon9.3.2 for Unix (unix.tgz) on a Redhat6.1 system. "make Status name=intel_linux" gave no errors; "make X-Configure name=intel_linux" gave the following: : : gcc -Wl,-E -ldl -o iconx xcnv.o xdata.o xdef.o xerrmsg.o xextcall.o xfconv.o xfload.o xfmath.o xfmisc.o xfmonitr.o xfscan.o xfstr.o xfstranl.o xfstruct.o xfsys.o xfwindow.o ximain.o ximisc.o xinit.o xinterp.o xinvoke.o xkeyword.o xlmisc.o xoarith.o xoasgn.o xocat.o xocomp.o xomisc.o xoref.o xoset.o xovalue.o xralc.o xrcoexpr.o xrcomp.o xrdebug.o xrlocal.o xrlrgint.o xrmemmgt.o xrmisc.o xrstruct.o xrsys.o xrwinrsc.o xrgfxsys.o xrwinsys.o xrwindow.o xfxtra.o ../common/long.o ../common/time.o ../common/save.o ../common/rswitch.o ../common/redirerr.o ../common/xwindow.o ../common/alloc.o -L../../bin -lXpm -L/usr/X11/lib -lX11 -lm /usr/bin/ld: cannot open -lX11: No such file or directory collect2: ld returned 1 exit status make[3]: *** [iconx] Error 1 make[3]: Leaving directory `/root/pkg/lang/icon/src/runtime' make[2]: *** [interp_all] Error 2 make[2]: Leaving directory `/root/pkg/lang/icon/src/runtime' make[1]: *** [Icon-icont] Error 2 make[1]: Leaving directory `/root/pkg/lang/icon' make: *** [Icon] Error 2 I don't know enough about make files to know how to fix this. Any help greatly appreciated. -- Small is Beautiful From icon-group-sender Mon Jul 17 08:04:25 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id IAA11409 for icon-group-addresses; Mon, 17 Jul 2000 08:03:05 -0700 (MST) Message-Id: <200007171503.IAA11409@baskerville.CS.Arizona.EDU> X-Newsgroups: comp.lang.icon Subject: Re: Installation on RH6.1 From: tkb@tkb.mpl.com (T. Kurt Bond) Date: 15 Jul 2000 15:31:24 -0400 X-Newsreader: Gnus v5.7/Emacs 20.4 X-Original-NNTP-Posting-Host: 198.77.4.83 X-Trace: 15 Jul 2000 15:31:47 -0400, 198.77.4.83 X-Original-NNTP-Posting-Host: 198.77.1.4 To: icon-group@optima.CS.Arizona.EDU Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 1534 Albert Wagner writes: > I have just attempted to install Icon9.3.2 for Unix (unix.tgz) on a > Redhat6.1 system. "make Status name=intel_linux" gave no errors; "make > X-Configure name=intel_linux" gave the following: > : > : > gcc -Wl,-E -ldl -o iconx xcnv.o xdata.o xdef.o xerrmsg.o xextcall.o > xfconv.o xfload.o xfmath.o xfmisc.o xfmonitr.o xfscan.o xfstr.o > xfstranl.o xfstruct.o xfsys.o xfwindow.o ximain.o ximisc.o xinit.o > xinterp.o xinvoke.o xkeyword.o xlmisc.o > xoarith.o xoasgn.o xocat.o xocomp.o xomisc.o xoref.o xoset.o xovalue.o > xralc.o xrcoexpr.o xrcomp.o xrdebug.o xrlocal.o xrlrgint.o xrmemmgt.o > xrmisc.o xrstruct.o xrsys.o xrwinrsc.o xrgfxsys.o xrwinsys.o xrwindow.o > xfxtra.o ../common/long.o ../common/time.o ../common/save.o > ../common/rswitch.o ../common/redirerr.o ../common/xwindow.o > ../common/alloc.o -L../../bin -lXpm -L/usr/X11/lib -lX11 -lm > /usr/bin/ld: cannot open -lX11: No such file or directory > collect2: ld returned 1 exit status > make[3]: *** [iconx] Error 1 > make[3]: Leaving directory `/root/pkg/lang/icon/src/runtime' > make[2]: *** [interp_all] Error 2 > make[2]: Leaving directory `/root/pkg/lang/icon/src/runtime' > make[1]: *** [Icon-icont] Error 2 > make[1]: Leaving directory `/root/pkg/lang/icon' > make: *** [Icon] Error 2 > > I don't know enough about make files to know how to fix this. Any help > greatly appreciated. Look for /usr/X11/lib in the Makefiles and change it to /usr/X11R6/lib. -- T. Kurt Bond, tkb somewhere near tkb.mpl.com From icon-group-sender Mon Jul 17 08:14:59 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id IAA11751 for icon-group-addresses; Mon, 17 Jul 2000 08:14:47 -0700 (MST) Message-Id: <200007171514.IAA11751@baskerville.CS.Arizona.EDU> From: Albert Wagner X-Newsgroups: comp.lang.icon Subject: Re: Installation on RH6.1 Date: Sun, 16 Jul 2000 13:19:27 -0500 X-Complaints-To: newsabuse@supernews.com X-Accept-Language: en To: icon-group@optima.CS.Arizona.EDU Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 1675 Thanks, Kurt. That worked. "T. Kurt Bond" wrote: > > Albert Wagner writes: > > > I have just attempted to install Icon9.3.2 for Unix (unix.tgz) on a > > Redhat6.1 system. "make Status name=intel_linux" gave no errors; "make > > X-Configure name=intel_linux" gave the following: > > : > > : > > gcc -Wl,-E -ldl -o iconx xcnv.o xdata.o xdef.o xerrmsg.o xextcall.o > > xfconv.o xfload.o xfmath.o xfmisc.o xfmonitr.o xfscan.o xfstr.o > > xfstranl.o xfstruct.o xfsys.o xfwindow.o ximain.o ximisc.o xinit.o > > xinterp.o xinvoke.o xkeyword.o xlmisc.o > > xoarith.o xoasgn.o xocat.o xocomp.o xomisc.o xoref.o xoset.o xovalue.o > > xralc.o xrcoexpr.o xrcomp.o xrdebug.o xrlocal.o xrlrgint.o xrmemmgt.o > > xrmisc.o xrstruct.o xrsys.o xrwinrsc.o xrgfxsys.o xrwinsys.o xrwindow.o > > xfxtra.o ../common/long.o ../common/time.o ../common/save.o > > ../common/rswitch.o ../common/redirerr.o ../common/xwindow.o > > ../common/alloc.o -L../../bin -lXpm -L/usr/X11/lib -lX11 -lm > > /usr/bin/ld: cannot open -lX11: No such file or directory > > collect2: ld returned 1 exit status > > make[3]: *** [iconx] Error 1 > > make[3]: Leaving directory `/root/pkg/lang/icon/src/runtime' > > make[2]: *** [interp_all] Error 2 > > make[2]: Leaving directory `/root/pkg/lang/icon/src/runtime' > > make[1]: *** [Icon-icont] Error 2 > > make[1]: Leaving directory `/root/pkg/lang/icon' > > make: *** [Icon] Error 2 > > > > I don't know enough about make files to know how to fix this. Any help > > greatly appreciated. > > Look for /usr/X11/lib in the Makefiles and change it to /usr/X11R6/lib. > > -- > T. Kurt Bond, tkb somewhere near tkb.mpl.com -- Small is Beautiful From icon-group-sender Wed Jul 19 13:01:13 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id MAA08404 for icon-group-addresses; Wed, 19 Jul 2000 12:59:03 -0700 (MST) Message-Id: <200007191959.MAA08404@baskerville.CS.Arizona.EDU> X-Sender: glastafari@pop.ntlworld.com (Unverified) Date: Wed, 19 Jul 2000 18:49:37 +0000 To: icon-group@optima.CS.Arizona.EDU From: Philip Newton Subject: help needed in ProIcon Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 133 Dear Sir/Madam, Do you know the precise explanation of the "parse stack overflow" error? Yours sincerely, Dr Philip Newton From icon-group-sender Fri Jul 21 13:19:35 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id NAA05061 for icon-group-addresses; Fri, 21 Jul 2000 13:17:40 -0700 (MST) Message-Id: <200007212017.NAA05061@baskerville.CS.Arizona.EDU> Date: Fri, 21 Jul 2000 11:01:33 -0500 From: "Charles Hethcoat" To: Subject: Unicon for NT Content-Disposition: inline X-Guinevere: 1.0.13 ; Oceaneering Int'l X-MIME-Autoconverted: from quoted-printable to 8bit by baskerville.CS.Arizona.EDU id JAA27370 Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 494 I downloaded the Unicon package from UNLV and found that the Windows version requires MS nmake to build. I don't have nmake. As I understand it, nmake comes only with some expensive MS development tools, effectively making Unicon nonfree. True or not? Please tell me that this situation is only temporary, and that the release version of NT Unicon will be as free as the Unix version is (and as the Windows versions of Icon are). Am I missing something here? Thanks. Charles Hethcoat From icon-group-sender Fri Jul 21 17:20:44 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id RAA11557 for icon-group-addresses; Fri, 21 Jul 2000 17:20:16 -0700 (MST) Message-Id: <200007220020.RAA11557@baskerville.CS.Arizona.EDU> To: "Charles Hethcoat" Cc: icon-group@optima.CS.Arizona.EDU, unicon-group@cs.unlv.edu Subject: Re: Unicon for NT Date: Fri, 21 Jul 2000 16:09:27 -0700 From: Clinton L Jeffery Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 746 Charles Hethcoat recently asked whether Unicon for NT requires Microsoft's commercial nmake program, and whether Unicon for NT is somehow less "free" than Icon for NT or Unicon for Unix. The answer is: the *source* distribution you downloaded at the moment has only one NT configuration, which is for Visual C++. A binary distribution for NT is in preparation, so yes Charles, the situation is temporary. Also, I would love to see (and will assist anyone who wants to work on) new NT configurations for other C compilers, especially free and semi-free C compilers (e.g. gcc, lcc). Cheers, Clint And now my mantra :-): if its about Unicon, route the discussion to unicon-group@cs.unlv.edu; if its about Icon more generally, use icon-group. From icon-group-sender Sun Jul 23 10:50:54 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id KAA06086 for icon-group-addresses; Sun, 23 Jul 2000 10:49:53 -0700 (MST) Message-Id: <200007231749.KAA06086@baskerville.CS.Arizona.EDU> From: "mco" X-Newsgroups: comp.lang.icon Subject: Re: Unicon for NT X-Newsreader: Microsoft Outlook Express 4.72.3612.1700 X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3612.1700 Date: Fri, 21 Jul 2000 22:57:45 -0400 X-Complaints-To: abuse@globetrotter.net X-Trace: news.globetrotter.net 964234719 142.169.163.84 (Fri, 21 Jul 2000 22:58:39 EDT) To: icon-group@optima.CS.Arizona.EDU Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 944 Charles, warning: bad english ahead I read on another news-group that ms/nmake is available free for download. But, :-), i dont remember which one ! So i will search it and send/post a link. I guess, as it is free, i may also send it to you by email. What compiler and make are you using ? Trying to help. Marc, cotemark@globetrotter.net Charles Hethcoat wrote in message <200007212017.NAA05061@baskerville.CS.Arizona.EDU>... >I downloaded the Unicon package from UNLV and found that the Windows version requires MS nmake to build. I don't have nmake. As I understand it, nmake comes only with some expensive MS development tools, effectively making Unicon nonfree. True or not? > >Please tell me that this situation is only temporary, and that the release version of NT Unicon will be as free as the Unix version is (and as the Windows versions of Icon are). > >Am I missing something here? Thanks. > >Charles Hethcoat > > > From icon-group-sender Sun Jul 23 10:51:26 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id KAA06195 for icon-group-addresses; Sun, 23 Jul 2000 10:51:10 -0700 (MST) Message-Id: <200007231751.KAA06195@baskerville.CS.Arizona.EDU> From: "Todd Nathan" X-Newsgroups: comp.lang.icon Subject: Icon for MacOSX Date: Sun, 23 Jul 2000 05:30:06 -0500 X-Trace: news.sdf 964360474 27911 216.173.110.132 (23 Jul 2000 13:54:34 GMT) X-Complaints-To: news@news.sdf X-Newsreader: Microsoft Outlook Express Macintosh Edition - 4.5 (0410) To: icon-group@optima.CS.Arizona.EDU Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 234 Hi, Is anyone working on ICON for Mac OS X? If not, is there a need/desire for such a port? Also, is there a working with bridges to native windows for NeXT/OPENSTEP (yes I know this would be old, but does it exist)? Thanks. \t From icon-group-sender Mon Jul 24 07:50:54 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id HAA05120 for icon-group-addresses; Mon, 24 Jul 2000 07:50:07 -0700 (MST) Message-Id: <200007241450.HAA05120@baskerville.CS.Arizona.EDU> From: "Todd Nathan" X-Newsgroups: comp.lang.icon Subject: deep write()? Date: Sun, 23 Jul 2000 21:26:35 -0500 X-Trace: news.sdf 964417861 30542 216.173.110.132 (24 Jul 2000 05:51:01 GMT) X-Complaints-To: news@news.sdf X-Newsreader: Microsoft Outlook Express Macintosh Edition - 4.5 (0410) To: icon-group@optima.CS.Arizona.EDU Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 473 Is there a deep write method. Just come came across what I suspect there to be a weakness inherent in the function write(). No knowing how to do repeated recursive diggin, how would someone write a deep write... The following fails. procedure main () car1 := ["buick", "skylark", 1978, 2450] car2 := ["bmw", "535is", 1987, 3000] inventory := [car1, car2] write (inventory) end I would like to see the 'write (inventory)' work as a deep write.... Thanks, \t From icon-group-sender Mon Jul 24 07:52:55 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id HAA05257 for icon-group-addresses; Mon, 24 Jul 2000 07:52:44 -0700 (MST) Message-Id: <200007241452.HAA05257@baskerville.CS.Arizona.EDU> From: "Marc Côté" X-Newsgroups: comp.lang.icon Subject: Unicon and nmake, Unicon port to LCC Win32 X-Newsreader: Microsoft Outlook Express 4.72.3612.1700 X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3612.1700 Date: Mon, 24 Jul 2000 02:08:25 -0400 X-Complaints-To: abuse@globetrotter.net X-Trace: news.globetrotter.net 964418966 142.169.162.100 (Mon, 24 Jul 2000 02:09:26 EDT) To: icon-group@optima.CS.Arizona.EDU Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 1892 Hi, At http://sources.redhat.com/ml/cygwin/1999-05/msg00737.html I found: Microsoft has very nicely made available nmake15.exe, which is the NT3.5 vc++ 2.0 version of nmake. You can retrieve this from either ftp://ftp.microsoft.com/Softlib/MSLFILES/NMAKE15.EXE or ftp://unix.hensa.ac.uk/mirrors/ftp.microsoft.com/Softlib/MSLFILES/NMAKE15.EX E About porting Unicon: I found the idea fun, interesting an challenging. So i downloaded Unicon and LCC Win32. I have an NT 4.0 (SP 4) workstation. I use MSVC 5.0 (SP 3). My version of MDAC was very old, so i installed a more recent one. [ Note: one of the pdf has a bad crc and gdbm.h is read-only. ] I then tried to build Unicon with MSVC5.0, rtt.exe display usage info ( no real test ) mwiconx.exe can't read interpreter file header wiconx.exe crash wicont.exe display usage information ( no more test ). and there are no other exe in the bin dir. I then tried to compile with LCC Win32, Wow, now the real fun begun. The lcc-make program is not very happy with the !include directives So, i decided to continue with nmake. I had to produce a new set of makefiles for lcc. I had also to modify some of the sources files to make them compile. For now i have: src\preproc\ compile ok, pp.exe seems ok src\common, compile ok src\icont does not compile src\iconc does not compile src\wincap does not compile ( lcc gives errors when msvc give warnings ) i am lookin for wincap32. src\rtt compile, produce an exe which do not crash but not ok... I am hooked, i cant stop, i must see the end of this.... When i will have a complete set of makefiles, i will come back, with some answers and some questions. This means that the configurations files for LCC Win32 are on their way ! For sure, i'll see the end of it ! Cheers. Marc Côté. From icon-group-sender Mon Jul 24 07:53:33 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id HAA05323 for icon-group-addresses; Mon, 24 Jul 2000 07:53:18 -0700 (MST) Message-Id: <200007241453.HAA05323@baskerville.CS.Arizona.EDU> From: "Todd Nathan" X-Newsgroups: comp.lang.icon Subject: Q: about cset and set writing Date: Mon, 24 Jul 2000 03:06:24 -0500 X-Trace: news.sdf 964438249 31493 216.173.110.132 (24 Jul 2000 11:30:49 GMT) X-Complaints-To: news@news.sdf X-Newsreader: Microsoft Outlook Express Macintosh Edition - 4.5 (0410) To: icon-group@optima.CS.Arizona.EDU Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 148 Seems that a cset is printable by 'write()', which makes sense. How does one go about writing a normal set, is there a way to do this easily? \t From icon-group-sender Mon Jul 24 09:03:31 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id JAA07299 for icon-group-addresses; Mon, 24 Jul 2000 09:03:07 -0700 (MST) Message-Id: <200007241603.JAA07299@baskerville.CS.Arizona.EDU> Date: Mon, 24 Jul 2000 08:26:37 -0700 From: Steve Wampler X-Accept-Language: en To: Todd Nathan , icon-group Subject: Re: Q: about cset and set writing Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 529 Todd Nathan wrote: > > Seems that a cset is printable by 'write()', which makes > sense. How does one go about writing a normal set, is > there a way to do this easily? > > \t Since sets in Icon can contain themselves, you've got the same problem as with the "deep write" question. If you *know* you don't have self-referential sets, then you can add a clause to the "deepImage()" procedure in my last message to handle sets as well as lists. -- Steve Wampler- SOLIS Project, National Solar Observatory swampler@noao.edu From icon-group-sender Mon Jul 24 09:06:18 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id JAA07432 for icon-group-addresses; Mon, 24 Jul 2000 09:06:10 -0700 (MST) Message-Id: <200007241606.JAA07432@baskerville.CS.Arizona.EDU> Date: Mon, 24 Jul 2000 08:36:08 -0700 From: Steve Wampler X-Accept-Language: en To: icon-group Subject: Fixing my own error... Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 341 I misspoke in the response to "deep write" - "write()" does not call "image()" on arguments that cannot be converted to type "string" - it produces a runtime error instead. Sorry for the confusion! (the "deepWrite()" method given still works as advertised) -- Steve Wampler- SOLIS Project, National Solar Observatory swampler@noao.edu From icon-group-sender Mon Jul 24 09:07:26 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id JAA07485 for icon-group-addresses; Mon, 24 Jul 2000 09:07:17 -0700 (MST) Message-Id: <200007241607.JAA07485@baskerville.CS.Arizona.EDU> Date: Mon, 24 Jul 2000 08:24:06 -0700 From: Steve Wampler X-Accept-Language: en To: Todd Nathan , icon-group Subject: Re: deep write()? Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 2276 Todd Nathan wrote: > > Is there a deep write method. > > Just come came across what I suspect there to be a weakness > inherent in the function write(). No knowing how to do repeated > recursive diggin, how would someone write a deep write... > > The following fails. > > procedure main () > > car1 := ["buick", "skylark", 1978, 2450] > car2 := ["bmw", "535is", 1987, 3000] > > inventory := [car1, car2] > > write (inventory) > > end When write() encounters an argument that can't be converted to type string, it uses the image() function to display it. What you're really asking for is a "deep" image() function. Because Icon structures can contain *anything* including references to themselves, a deep image is non-trivial, though possible. Consider, for example, what the output should be if the above line: inventory := [car1, car2] were followed by put(inventory, inventory) (perfectly legal code, if meaningless in this context...) What should the deep image (and hence write()) produce? A general purpose deep image has got to be able to handle the above. It's probably simpler to write a special-purpose one yourself if you are *absolutely* certain your structures are not cyclic graphs. > I would like to see the 'write (inventory)' work as a deep > write.... Well, here's one to deep write a list, assuming the list is acyclic. (Handling a cyclic structure is left as an exercise... :) procedure deepWrite(args[]) outfile := &output every arg := !args do { case type(arg) of { "file": outfile := arg default: writes(outfile, deepImage(arg)) } } write(outfile) end procedure deepImage(arg) local resultString if string(arg) then return string(arg) case type(arg) of { "list": { resultString := "[" every resultString ||:= deepImage(!arg) || "," resultString[-1] := "]" # change last , to ] return resultString } default: return image(arg) # cop out on other structures } end Note that this code *depends* on any list passed to deepImage as being acyclic - it *won't* work on cyclic structures! -- Steve Wampler- SOLIS Project, National Solar Observatory swampler@noao.edu From icon-group-sender Mon Jul 24 11:35:24 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id LAA11894 for icon-group-addresses; Mon, 24 Jul 2000 11:33:13 -0700 (MST) Message-Id: <200007241833.LAA11894@baskerville.CS.Arizona.EDU> Date: Mon, 24 Jul 2000 09:16:10 -0700 (MST) From: Gregg Townsend To: icon-group@optima.CS.Arizona.EDU, todd@palomablanca.net Subject: Re: Icon for MacOSX Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 774 From: "Todd Nathan" Is anyone working on ICON for Mac OS X? If not, is there a need/desire for such a port? As far as I know, nobody is actively working on a Mac port of any sort. There are occasional queries and expressions of desire. Also, is there a working with bridges to native windows for NeXT/OPENSTEP (yes I know this would be old, but does it exist)? That's a platform for which I've never heard any interest expressed. There was an Icon port to the original NeXT cube, without graphics. --------------------------------------------------------------------------- Gregg Townsend Staff Scientist The University of Arizona gmt@cs.arizona.edu Computer Science Tucson, Arizona, USA From icon-group-sender Mon Jul 24 11:36:42 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id LAA12054 for icon-group-addresses; Mon, 24 Jul 2000 11:36:34 -0700 (MST) Message-Id: <200007241836.LAA12054@baskerville.CS.Arizona.EDU> Date: Mon, 24 Jul 2000 10:48:44 -0700 From: Steve Wampler X-Accept-Language: en To: icon-group Subject: deepImage that handles empty lists... Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 689 I just noticed that deepImage() doesn't handle empty lists correctly. Here's a fixed version... procedure deepImage(arg) local resultString if string(arg) then return string(arg) case type(arg) of { "list": { resultString := "[" every resultString ||:= deepImage(!arg) || "," if (resultString[-1] == ",") then { resultString[-1] := "" } resultString ||:= "]" return resultString } default: return image(arg) # cop out on other structures } end -- Steve Wampler- SOLIS Project, National Solar Observatory swampler@noao.edu From icon-group-sender Tue Jul 25 12:45:21 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id MAA11202 for icon-group-addresses; Tue, 25 Jul 2000 12:43:49 -0700 (MST) Message-Id: <200007251943.MAA11202@baskerville.CS.Arizona.EDU> Date: Tue, 25 Jul 2000 10:51:38 -0400 From: "Steve Graham" To: Subject: Another puzzle Content-Disposition: inline X-MIME-Autoconverted: from quoted-printable to 8bit by baskerville.CS.Arizona.EDU id HAA17436 Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 567 Folks: Here's a puzzle which seems an ideal challenge for Icon: Make your way from WISH to HOPE in seven steps, changing one letter at a time to form the interim words. WISH _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ HOPE Steve Graham --------------------------------------------------------------------------------------- Steve Graham Senior Programmer/Analyst LabCorp Phone: (972) 437-5255, ext 5224 Fax: (972) 454-1050 Mail: grahams@labcorp.com --------------------------------------------------------------------------------------- From icon-group-sender Tue Jul 25 12:49:42 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id MAA11353 for icon-group-addresses; Tue, 25 Jul 2000 12:49:34 -0700 (MST) Message-Id: <200007251949.MAA11353@baskerville.CS.Arizona.EDU> From: Kim Scarborough X-Newsgroups: comp.lang.icon Subject: radcon.icn? Date: Tue, 25 Jul 2000 13:53:56 -0500 X-Trace: news.enteract.com 964551219 33866 216.80.78.55 (25 Jul 2000 18:53:39 GMT) X-Complaints-To: abuse@enteract.com X-Accept-Language: en To: icon-group@optima.CS.Arizona.EDU Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 272 I am attempting to compile a very old icon program that needs the radcon.icn library. I've found references to it, but I can't find the actual file for the life of me. Anyone know where I can track it down, or could anyone possibly post it? I doubt it's more than 20K... From icon-group-sender Tue Jul 25 16:29:17 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id QAA12309 for icon-group-addresses; Tue, 25 Jul 2000 16:28:11 -0700 (MST) Message-Id: <200007252328.QAA12309@baskerville.CS.Arizona.EDU> From: Brian.C.Monsell@ccmail.census.gov X-Lotus-FromDomain: BOC To: Kim Scarborough cc: icon-group@optima.CS.Arizona.EDU Date: Tue, 25 Jul 2000 15:55:52 -0400 Subject: Re: radcon.icn? Content-Disposition: inline Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 2388 --0__=6EbkAH6jHWDlbXHYJhsRknMZEuepo5i0d0fcfkgpnLViWK9UlCyGWM5D Content-type: text/plain; charset=us-ascii Content-Disposition: inline Here is the module... (See attached file: Radcon.icn) --0__=6EbkAH6jHWDlbXHYJhsRknMZEuepo5i0d0fcfkgpnLViWK9UlCyGWM5D Content-type: application/octet-stream; name="Radcon.icn" Content-Disposition: attachment; filename="Radcon.icn" Content-Transfer-Encoding: base64 IyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMj IyMjIyMjIyMjIyMjIyMjIyMjIw0KIw0KIwlOYW1lOglyYWRjb24uaWNuDQojDQojCVRpdGxlOglS YWRpeCBjb252ZXJzaW9uDQojDQojCUF1dGhvcjoJUmFscGggRS4gR3Jpc3dvbGQNCiMNCiMJRGF0 ZToJSnVuZSAxMCwgMTk4OA0KIw0KIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMj IyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIw0KIyAgDQojICBUaGUgZm9s bG93aW5nIHByb2NlZHVyZXMgY29udmVydCBudW1iZXJzIGZyb20gb25lIHJhZGl4IHRvDQojICBh bm90aGVyLiBUaGUgbGV0dGVycyBmcm9tIGEgdG8geiBhcmUgdXNlZCBmb3IgYGBkaWdpdHMnJyBn cmVhdGVyDQojICB0aGFuIDkuIEFsbCB0aGUgY29udmVyc2lvbiBwcm9jZWR1cmVzIGZhaWwgaWYg dGhlIGNvbnZlcnNpb24gY2FuLQ0KIyAgbm90IGJlIG1hZGUuDQojICANCiMgICAgICAgZXhiYXNl MTAoaSxqKSAgY29udmVydCBiYXNlLTEwIGludGVnZXIgaSB0byBiYXNlIGoNCiMgIA0KIyAgICAg ICBpbmJhc2UxMChzLGkpICBjb252ZXJ0IGJhc2UtaSBpbnRlZ2VyIHMgdG8gYmFzZSAxMA0KIyAg DQojICAgICAgIHJhZGNvbihzLGksaikgIGNvbnZlcnQgYmFzZS1pIGludGVnZXIgcyB0byBiYXNl IGoNCiMgIA0KIyAgTGltaXRhdGlvbjoNCiMNCiMgICAgIFRoZSBtYXhpbXVtIGJhc2UgYWxsb3dl ZCBpcyAzNi4NCiMgIA0KIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMj IyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIw0KDQpwcm9jZWR1cmUgZXhiYXNlMTAo aSxqKQ0KICAgc3RhdGljIGRpZ2l0cw0KICAgbG9jYWwgcywgZCwgc2lnbg0KICAgaW5pdGlhbCBk aWdpdHMgOj0gJmRpZ2l0cyB8fCAmbGNhc2UNCiAgIGlmIGkgPSAwIHRoZW4gcmV0dXJuIDANCiAg IGlmIGkgPCAwIHRoZW4gew0KICAgICAgc2lnbiA6PSAiLSINCiAgICAgIGkgOj0gLWkNCiAgICAg IH0NCiAgIGVsc2Ugc2lnbiA6PSAiIg0KICAgcyA6PSAiIg0KICAgd2hpbGUgaSA+IDAgZG8gew0K ICAgICAgZCA6PSBpICUgag0KICAgICAgaWYgZCA+IDkgdGhlbiBkIDo9IGRpZ2l0c1tkICsgMV0N CiAgICAgIHMgOj0gZCB8fCBzDQogICAgICBpIC86PSBqDQogICAgICB9DQogICByZXR1cm4gc2ln biB8fCBzDQplbmQNCg0KcHJvY2VkdXJlIGluYmFzZTEwKHMsaSkNCiAgIGlmIHNbMV0gPT0gIi0i IHRoZW4gcmV0dXJuICItIiB8fCBpbnRlZ2VyKGkgfHwgInIiIHx8IHNbMjowXSkNCiAgIGVsc2Ug cmV0dXJuIGludGVnZXIoaSB8fCAiciIgfHwgcykNCmVuZA0KDQpwcm9jZWR1cmUgcmFkY29uKHMs aSxqKQ0KICAgcmV0dXJuIGV4YmFzZTEwKGluYmFzZTEwKHMsaSksaikNCmVuZA0K --0__=6EbkAH6jHWDlbXHYJhsRknMZEuepo5i0d0fcfkgpnLViWK9UlCyGWM5D-- From icon-group-sender Wed Jul 26 08:05:24 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id IAA06748 for icon-group-addresses; Wed, 26 Jul 2000 08:04:54 -0700 (MST) Message-Id: <200007261504.IAA06748@baskerville.CS.Arizona.EDU> From: Bob Ardler To: icon-group@optima.CS.Arizona.EDU Date: Wed, 26 Jul 2000 11:58:40 +0100 Subject: Alternative representation of reals User-Agent: Pluto/2.02b (RISC-OS/3.60) Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 970 In Jun'00 Kostas Oikonomou twice posted enquiries about comparison of reals. No response and nor is this, but maybe of interest:- In a hobbyists' magazine Gavin Wraith explains that because the fixed-length (exponent,mantissa) representation of reals can accumulate rounding errors; and because memory size and understanding of garbage-collection and heap management now permit it, variable-length representations have been sought. He commends the "latest and most promising" real number format from Abbas Edalat and P.J.Potts at Imperial College, described in http://theory.doc.ic.ac.uk:80/~ae/ and http://theory.doc.ic.ac.uk:80/~pjp "Prototype implementations in Haskell, Miranda, C++ and Java are now available." The representation will enable comparison as well as other real arithmetic - not as in Knuth. There is a fairly readable detailing (in Miranda) at http://theory.doc.ic.ac.uk/~pjp/thesis.m -- Bob Ardler, ardler@argonet.co.uk From icon-group-sender Mon Jul 31 08:23:52 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id IAA03027 for icon-group-addresses; Mon, 31 Jul 2000 08:20:30 -0700 (MST) Message-Id: <200007311520.IAA03027@baskerville.CS.Arizona.EDU> Date: Sat, 29 Jul 2000 16:24:51 -0700 (MST) From: Gregg Townsend To: icon-group Subject: Version 9.3.3 of Icon Program Library available Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 1068 Version 9.3.3 of the Icon program library is now available in source and compiled form from: http://www.cs.arizona.edu/icon/ipl93.htm The corresponding on-line documentation can be viewed at: http://www.cs.arizona.edu/icon/library/ipl.htm This program library update reflects all the changes that have accumulated since the release of version 9.3.2 in July, 1999, and includes several new programs and procedures. Among these are the USGS map viewer and associated procedures described in the last issue of the Icon newsletter: http://www.cs.arizona.edu/icon/inl/inl60/inl60.htm#USGS The map viewer has its own web page and can be downloaded separately: http://www.cs.arizona.edu/icon/oddsends/dlgvu/ No corresponding update is planned for the Icon translator and runtime system. Version 9.3.2 remains the current version. --------------------------------------------------------------------------- Gregg Townsend Staff Scientist The University of Arizona gmt@cs.arizona.edu Computer Science Tucson, Arizona, USA From icon-group-sender Fri Aug 18 16:51:15 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id QAA00578 for icon-group-addresses; Fri, 18 Aug 2000 16:48:14 -0700 (MST) Message-Id: <200008182348.QAA00578@baskerville.CS.Arizona.EDU> From: "Ian Trudel" To: "Icon Project Group" Subject: [Icon][WinNT] external C functions. Date: Fri, 18 Aug 2000 16:35:49 -0400 X-Priority: 3 X-MSMail-Priority: Normal X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6600 Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 522 Hello everyone, has anyone worked with external C functions using Icon's callout()/loadfunc() ? I'm just searching for some Icon/C examples. Of course, I have been on Icon's website but the exemples are kinda *NIX based and I've figured out icall.h wasn't enough (at least, not under NT). I'm currently using Icon Version 9.3.1 with Microsoft Visual C++ 6.0 with lastest Service Pack under Microsoft Windows NT 4.0 Workstation, Service Pack 6a high encryption. Thanks, Ian Trudel mailto:ian.trudel@tr.cgocable.ca From icon-group-sender Mon Aug 21 16:29:07 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id QAA13124 for icon-group-addresses; Mon, 21 Aug 2000 16:27:58 -0700 (MST) Message-Id: <200008212327.QAA13124@baskerville.CS.Arizona.EDU> Date: Mon, 21 Aug 2000 14:53:35 -0700 (MST) From: Gregg Townsend To: ian.trudel@tr.cgocable.ca, icon-group@optima.CS.Arizona.EDU Subject: Re: [Icon][WinNT] external C functions. Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 829 > From: "Ian Trudel" > Date: Fri, 18 Aug 2000 16:35:49 -0400 > has anyone worked with external C functions using Icon's > callout()/loadfunc() ? I'm just searching for some Icon/C examples. Of > course, I have been on Icon's website but the exemples are kinda *NIX based > and I've figured out icall.h wasn't enough (at least, not under NT). I don't believe that loadfunc() is implemented in the Windows port of Icon. The callout() approach is awfully cumbersome -- it involves editing the source of Icon and rebuilding the system -- but it may be your only option. --------------------------------------------------------------------------- Gregg Townsend Staff Scientist The University of Arizona gmt@cs.arizona.edu Computer Science Tucson, Arizona, USA From icon-group-sender Tue Aug 22 07:39:52 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id HAA13214 for icon-group-addresses; Tue, 22 Aug 2000 07:39:32 -0700 (MST) Message-Id: <200008221439.HAA13214@baskerville.CS.Arizona.EDU> Delivered-To: fixup-icon-group@CS.arizona.edu@fixme Date: Mon, 21 Aug 2000 20:12:46 -0600 From: Cheyenne Wills X-Accept-Language: en To: icon-group@optima.CS.Arizona.EDU Subject: Re: [Icon][WinNT] external C functions. Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 6815 This is a multi-part message in MIME format. --------------30657AAB585C0267D4C3A50B Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Well.. here is some code that I hacked a long time ago to implement dynamically loaded functions for OS/2. You might be able to hack at it to work under WinNT. Basically your code was loaded into a DLL and the Icon runtime could call out to it.. Anyway... enjoy... ---[fload.r]--- --------------30657AAB585C0267D4C3A50B Content-Type: text/plain; charset=us-ascii; name="fload.r" Content-Disposition: inline; filename="fload.r" Content-Transfer-Encoding: 7bit /* * File: fload.r * Contents: loadfunc. * * This file contains loadfunc(), the dynamic loading function for * Unix systems having the interface. * * from Icon: * p := loadfunc(filename, funcname) * p(arg1, arg2, ...) * * in C: * int func(int argc, dptr argv) * return -1 for failure, 0 for success, >0 for error * argc is number of true args not including argv[0] * argv[0] is for return value; others are true args */ #ifdef LoadFunc #ifndef RTLD_LAZY /* normally from */ #define RTLD_LAZY 1 #endif /* RTLD_LAZY */ #ifdef FreeBSD /* Sorry, no dlerror() on FreeBSD. Fake it. */ char *dlerror(void) { int no; if (0 == dlctl(NULL, DL_GETERRNO, &no)) return(strerror(no)); else return(NULL); } #endif /* __FreeBSD__ */ #if COMPILER int glue Params(( int argc, dptr dargv, dptr rslt, continuation succ_count)); #else int glue Params(( int argc, dptr dargv) ); #endif /* COMPILER */ #if OS2 int makefunc Params((dptr d, char *name, void *funcptr)); #else int makefunc Params((dptr d, char *name, int (*func)() )); #endif /* OS2 */ "loadfunc(filename,funcname) - load C function dynamically." function{0,1} loadfunc(filename,funcname) if !cnv:C_string(filename) then runerr(103, filename) if !cnv:C_string(funcname) then runerr(103, funcname) abstract { return proc } body { #if OS2 unsigned long modhandle; int rc; #passthru int (* _System funcaddr)(int argc, dptr dargv); rc = _loadmod(filename,&modhandle); if (rc) { runerr(216); } rc = DosQueryProcAddr( modhandle, 0, funcname, &funcaddr ); if (rc) { _freemod(modhandle); runerr(216); } if (!makefunc(&result, funcname, (void *)funcaddr ) ) { _freemod(modhandle); runerr(305); } return result; } #else /* OS2 */ int (*func)(); static char *curfile; static void *handle; char errbuf[1000]; /* * Get a library handle, reusing it over successive calls. */ if (!handle || !curfile || strcmp(filename, curfile) != 0) { if (curfile) free((pointer)curfile); /* free the old file name */ curfile = salloc(filename); /* save the new name */ handle = dlopen(filename, RTLD_LAZY); /* get the handle */ } /* * Load the function. Diagnose both library and function errors here. */ if (handle) func = (int (*)())dlsym(handle, funcname); if (!handle || !func) { fprintf(stderr, "\nloadfunc(\"%s\",\"%s\"): %s\n", filename, funcname, dlerror()); runerr(216); } /* * Build and return a proc descriptor. */ if (!makefunc(&result, funcname, func)) runerr(305); return result; } #endif /* OS2 */ end /* * makefunc(d, name, func) -- make function descriptor in d. * * Returns 0 if memory could not be allocated. */ int makefunc(d, name, func) dptr d; char *name; #if OS2 void *func; #else int (*func)(); #endif /* OS2 */ { struct b_proc *blk; blk = (struct b_proc *)malloc(sizeof(struct b_proc)); if (!blk) return 0; blk->title = T_Proc; blk->blksize = sizeof(struct b_proc); #if COMPILER blk->ccode = glue; /* set code addr to glue routine */ #else /* COMPILER */ blk->entryp.ccode = glue; /* set code addr to glue routine */ #endif /* COMPILER */ blk->nparam = -1; /* varargs flag */ blk->ndynam = -1; /* treat as built-in function */ blk->nstatic = 0; blk->fstatic = 0; blk->pname.dword = strlen(name); blk->pname.vword.sptr = salloc(name); blk->lnames[0].dword = 0; blk->lnames[0].vword.sptr = (char *)func; /* save func addr in lnames[0] vword */ d->dword = D_Proc; /* build proc descriptor */ d->vword.bptr = (union block *)blk; return 1; } /* * This glue routine is called when a loaded function is invoked. * It digs the actual C code address out of the proc block, and calls that. */ #if COMPILER int glue(argc, dargv, rslt, succ_cont) int argc; dptr dargv; dptr rslt; continuation succ_cont; { int i, status, (*func)(); struct b_proc *blk; struct descrip r; tended struct descrip p; dargv--; /* reset pointer to proc entry */ for (i = 0; i <= argc; i++) deref(&dargv[i], &dargv[i]); /* dereference args including proc */ blk = (struct b_proc *)dargv[0].vword.bptr; /* proc block address */ func = (int (*)())blk->lnames[0].vword.sptr; /* entry point address */ p = dargv[0]; /* save proc for traceback */ dargv[0] = nulldesc; /* set default return value */ status = (*func)(argc, dargv); /* call func */ if (status == 0) { *rslt = dargv[0]; Return; /* success */ } if (status < 0) Fail; /* failure */ r = dargv[0]; /* save result value */ dargv[0] = p; /* restore proc for traceback */ if (is:null(r)) RunErr(status, NULL); /* error, no value */ RunErr(status, &r); /* error, with value */ } #else /* COMPILER */ int glue(argc, dargv) int argc; dptr dargv; { int status; #if OS2 #passthru int (* _System func)(int argc, dptr dargv); void *funcptr; #else int (*func)(); #endif /* OS2 */ struct b_proc *blk; struct descrip r; tended struct descrip p; blk = (struct b_proc *)dargv[0].vword.bptr; /* proc block address */ #if OS2 funcptr = (void *)blk->lnames[0].vword.sptr; /* entry point address */ func = funcptr; #else func = (int (*)())blk->lnames[0].vword.sptr; /* entry point address */ #endif p = dargv[0]; /* save proc for traceback */ dargv[0] = nulldesc; /* set default return value */ status = (*func)(argc, dargv); /* call func */ if (status == 0) Return; /* success */ if (status < 0) Fail; /* failure */ r = dargv[0]; /* save result value */ dargv[0] = p; /* restore proc for traceback */ if (is:null(r)) RunErr(status, NULL); /* error, no value */ RunErr(status, &r); /* error, with value */ } #endif /* COMPILER */ #else /* LoadFunc */ static char junk; /* avoid empty module */ #endif /* LoadFunc */ --------------30657AAB585C0267D4C3A50B-- From icon-group-sender Tue Aug 29 07:47:34 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id HAA05105 for icon-group-addresses; Tue, 29 Aug 2000 07:44:28 -0700 (MST) Message-Id: <200008291444.HAA05105@baskerville.CS.Arizona.EDU> X-Priority: 3 (Normal) Date: Tue, 29 Aug 2000 11:22:21 +0200 (CEST) From: Guido Milanese To: icon-group@optima.CS.Arizona.EDU Subject: Help: menus Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 4536 This message is in MIME format --_=XFMail.1.4.0.Linux:000829112221:1385=_ Content-Type: text/plain; charset=iso-8859-1 Dear Experts, I am sorry to ask a question on a topic extensively covered in the manuals, but I'm afraid I missed something essential. I have recently written a program to search textbases. The program works already quite well from command line -- as soon as it will be finished and tested, I'll make it available in the public domain. Personally, I prefer to work from command line, both in Windows and Linux, but some friends, who are likely to use the program, ask for a GUI. OK. Tried it with VIB. I easily built a window with 3 menus: _____________________ | | | File | Search | Help | _____|________|______| I know it is rather obvious... but how on earth should I use the code produced by VIB? I append it as attach file, so that I won't bother those who do not want to answer my question. The only change I did was to add a "case" instruction in one of the menus, just to test it with a simple output on terminal, but nothing happens. Obviously I should do... soething else, but I do not know what! I am confident in a kind answer from some expert, or even from normal users... Thanks in advance, Guido (from Italy) --_=XFMail.1.4.0.Linux:000829112221:1385=_ Content-Disposition: attachment; filename="try.icn" Content-Description: try.icn Content-Type: application/octet-stream; name=try.icn; SizeOnDisk=2198 Content-Transfer-Encoding: base64 IyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMj IyMjIyMjIyMjIyMjIyMjIyMjIwojCiMJRmlsZTogICAgIHRyeS5pY24KIwojCVN1YmplY3Q6ICBQ cm9ncmFtIHRvIC4uLgojCiMJQXV0aG9yOiAgIAojCiMJRGF0ZTogICAgIEF1Z3VzdCAyOSwgMjAw MAojCiMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMj IyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMKIwojCiMKIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMj IyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIwojCiMgIFJl cXVpcmVzOgojCiMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMj IyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMKIwojICBMaW5rczogdnNldHVwCiMKIyMjIyMj IyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMj IyMjIyMjIyMjIyMjIwoKIyAgVGhpcyB2aWIgaW50ZXJmYWNlIHNwZWNpZmljYXRpb24gaXMgYSB3 b3JraW5nIHByb2dyYW0gdGhhdCByZXNwb25kcwojICB0byB2aWRnZXQgZXZlbnRzIGJ5IHByaW50 aW5nIG1lc3NhZ2VzLiAgVXNlIGEgdGV4dCBlZGl0b3IgdG8gcmVwbGFjZQojICB0aGlzIHNrZWxl dGFsIHByb2dyYW0gd2l0aCB5b3VyIG93biBjb2RlLiAgUmV0YWluIHRoZSB2aWIgc2VjdGlvbiBh dAojICB0aGUgZW5kIGFuZCB1c2UgdmliIHRvIG1ha2UgYW55IGNoYW5nZXMgdG8gdGhlIGludGVy ZmFjZS4KCmxpbmsgdnNldHVwCgpwcm9jZWR1cmUgbWFpbihhcmdzKQogICBsb2NhbCB2aWRnZXRz LCByb290LCBwYXVzZWQKCiAgIChXT3BlbiAhIHVpX2F0dHMoKSkgfCBzdG9wKCJjYW4ndCBvcGVu IHdpbmRvdyIpCiAgIHZpZGdldHMgOj0gdWkoKQkJCQkjIHNldCB1cCB2aWRnZXRzCiAgIHJvb3Qg Oj0gdmlkZ2V0c1sicm9vdCJdCgogICBwYXVzZWQgOj0gMQkJCQkJIyBmbGFnIG5vIHdvcmsgdG8g ZG8KICAgcmVwZWF0IHsKICAgICAgIyBoYW5kbGUgYW55IGV2ZW50cyB0aGF0IGFyZSBhdmFpbGFi bGUsIG9yCiAgICAgICMgd2FpdCBmb3IgZXZlbnRzIGlmIHRoZXJlIGlzIG5vIG90aGVyIHdvcmsg dG8gZG8KICAgICAgd2hpbGUgKCpQZW5kaW5nKCkgPiAwKSB8IFxwYXVzZWQgZG8gewogICAgICAg ICBQcm9jZXNzRXZlbnQocm9vdCwgUXVpdENoZWNrKQogICAgICAgICB9CiAgICAgICMgaWYgPHBh dXNlZD4gaXMgc2V0IG51bGwsIGNvZGUgY2FuIGJlIGFkZGVkIGhlcmUKICAgICAgIyB0byBwZXJm b3JtIHVzZWZ1bCB3b3JrIGJldHdlZW4gY2hlY2tzIGZvciBpbnB1dAogICAgICB9CmVuZAoKcHJv Y2VkdXJlIG1lbnVfY2IxKHZpZGdldCwgdmFsdWUpCiAgIHJldHVybgplbmQKCnByb2NlZHVyZSBt ZW51X2NiMih2aWRnZXQsIHZhbHVlKQogICByZXR1cm4KZW5kCgpwcm9jZWR1cmUgbWVudV9jYjMo dmlkZ2V0LCB2YWx1ZSkKICAgY2FzZSB2YWx1ZSBvZiB7IkluZGV4IiAgIDogICB3cml0ZSgiSXRl bSAxIikKICAgICAgICAgICAgICAgICAgIkFib3V0IiAgIDogICB3cml0ZSgiSXRlbSAyIikKICAg ICAgICAgICAgICAgICAgIkNvbnRhY3QiIDogICB3cml0ZSgiSXRlbSAzIikKICAgICAgICAgICAg ICAgICB9CiAgIHJldHVybgplbmQKCiM9PT08PHZpYjpiZWdpbj4+PT09CW1vZGlmeSB1c2luZyB2 aWI7IGRvIG5vdCByZW1vdmUgdGhpcyBtYXJrZXIgbGluZQpwcm9jZWR1cmUgdWlfYXR0cygpCiAg IHJldHVybiBbInNpemU9MTM2LDI3NiIsICJiZz1wYWxlIGdyYXkiXQplbmQKCnByb2NlZHVyZSB1 aSh3aW4sIGNiaykKcmV0dXJuIHZzZXR1cCh3aW4sIGNiaywKICAgWyI6U2l6ZXI6OjowLDAsMTM2 LDI3NjoiLF0sCiAgIFsibWVudTE6TWVudTpwdWxsOjowLDAsMzYsMjE6RmlsZSIsbWVudV9jYjEs CiAgICAgIFsiT3BlbiIsIlJlbW92ZSJdXSwKICAgWyJtZW51MjpNZW51OnB1bGw6OjM1LDAsNTAs MjE6U2VhcmNoIixtZW51X2NiMiwKICAgICAgWyJCcm93c2UiLCJGaW5kIiwiT3B0aW9ucyJdXSwK ICAgWyJtZW51MzpNZW51OnB1bGw6Ojg1LDAsMzYsMjE6SGVscCIsbWVudV9jYjMsCiAgICAgIFsi SW5kZXgiLCJBYm91dCIsIkNvbnRhY3QiXV0sCiAgICkKZW5kCiM9PT08PHZpYjplbmQ+Pj09PQll bmQgb2Ygc2VjdGlvbiBtYWludGFpbmVkIGJ5IHZpYgo= --_=XFMail.1.4.0.Linux:000829112221:1385=_-- End of MIME message From icon-group-sender Tue Aug 29 12:33:46 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id MAA13916 for icon-group-addresses; Tue, 29 Aug 2000 12:33:24 -0700 (MST) Message-Id: <200008291933.MAA13916@baskerville.CS.Arizona.EDU> X-Priority: 3 (Normal) Date: Tue, 29 Aug 2000 18:38:42 +0200 (CEST) From: Guido Milanese To: icon-group@optima.CS.Arizona.EDU Subject: RE: Help: menus Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 465 Dear all, this morning I sent a message asking help about menus. I think I have solved the problem, but let me say that the Icon graphics manual is a bit difficult to understand about how to use menus! Thanks to you all, G. ------------------------------------------- E-Mail: Guido Milanese Homepage: http://fly.to/arsantiqua 29-Aug-00 - XFMail on Linux + + + + + + NON NOBIS DOMINE + + + + + + ------------------------------------------- From icon-group-sender Thu Aug 31 09:08:20 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id JAA16238 for icon-group-addresses; Thu, 31 Aug 2000 09:06:38 -0700 (MST) Message-Id: <200008311606.JAA16238@baskerville.CS.Arizona.EDU> From: "Frank J. Lhota" X-Newsgroups: comp.lang.icon Subject: SlickEdit Macros for Icon 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 X-Abuse-Info: Please be sure to forward a copy of ALL headers X-Abuse-Info: Otherwise we will be unable to process your complaint properly X-Complaints-To: support@usenetserver.com Date: Thu, 31 Aug 2000 11:37:04 -0400 To: icon-group@optima.CS.Arizona.EDU Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 218 Does anyone know of a SlickEdit macro package for Icon language sensitive editing? If so, please share its location with this group. If I cannot find one without too much hassle, I'll write my own and post it here. From icon-group-sender Mon Sep 4 13:30:29 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id NAA02563 for icon-group-addresses; Mon, 4 Sep 2000 13:28:58 -0700 (MST) Message-Id: <200009042028.NAA02563@baskerville.CS.Arizona.EDU> From: "Frank J. Lhota" X-Newsgroups: comp.lang.icon Subject: SlickEdit Macros for Icon Date: 31 Aug 2000 12:10:01 -0400 X-Newsgroups: comp.lang.icon 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 X-Abuse-Info: Please be sure to forward a copy of ALL headers X-Abuse-Info: Otherwise we will be unable to process your complaint properly X-Complaints-To: support@usenetserver.com X-Filter: mailagent [version 3.0 PL68] for efeustel@cs.ida.org To: icon-group@optima.CS.Arizona.EDU Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 219 Does anyone know of a SlickEdit macro package for Icon language sensitive editing? If so, please share its location with this group. If I cannot find one without too much hassle, I'll write my own and post it here. From icon-group-sender Mon Sep 4 13:31:19 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id NAA02634 for icon-group-addresses; Mon, 4 Sep 2000 13:30:48 -0700 (MST) Message-Id: <200009042030.NAA02634@baskerville.CS.Arizona.EDU> From: Leonard X-Newsgroups: comp.lang.icon Subject: newbie questions Date: Sat, 02 Sep 2000 05:13:38 -0600 X-Orig-Message-ID: Abuse-Reports-To: abuse at airmail.net to report improper postings NNTP-Proxy-Relay: library2.airnews.net NNTP-Posting-Time: Sat Sep 2 06:13:15 2000 X-Newsreader: Forte Agent 1.8/32.548 To: icon-group@optima.CS.Arizona.EDU Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 719 Hello; I have some experience programming in Fortran, but would now like to do some windows gui programming in a more modern language. >From what I have read, I like Icon's strings processing features, as well as the fact that the size of strings / lists do not have to be specified when writing a program. now... Can an Icon program be compiled into a stand-alone executable, to be used on computers without Icon installed? If so... How much memory overhead does the Icon interpreter have? How does the program execution speed compare to a similar program written in C++ or Java? Are there files system functions to check for the existence of, copy, move and rename specified files / folders? Thanks Leonard From icon-group-sender Mon Sep 4 13:44:10 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id NAA02942 for icon-group-addresses; Mon, 4 Sep 2000 13:43:57 -0700 (MST) Message-Id: <200009042043.NAA02942@baskerville.CS.Arizona.EDU> From: Guido Milanese X-Newsgroups: comp.lang.icon Subject: Graphics: TextList problem Date: Sat, 02 Sep 2000 21:44:25 +0200 X-Accept-Language: it, en To: icon-group@optima.CS.Arizona.EDU Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 1507 I noticed that the participants to this discussion group are all almost all at "high level"... and therefore I always hesitate before asking simple questions. However, I take the libery to post a simple question on graphics. I would like to use the TextList instruction to display the contents of a file or of long variables. I used VIB and I obtain this code, slightly edited: #===<>=== modify using vib; do not remove this marker line procedure ui_atts() return ["size=600,401", "bg=pale gray"] end procedure ui(win, cbk) return vsetup(win, cbk, [":Sizer:::0,0,600,400:",], ["list:List:r::116,89,400,50:",list_cb], ) end #===<>=== end of section maintained by vib The callback procedure (but is it necessary?) is procedure list_cb(vidget, value) return end and I setup windows this way: VSetItems(vidgets["list"], ["a", "b", "c", "d"]) But if I substitute this test list with real data, I see that output terminates at each newline char: I read a file in untranslated mode, save input as a variable (e.g. testvar), and write as such: VSetItems(vidgets["list"], [testvar]) but output stops after the first newline (I tested the output in a "normal" window and it's all OK). How can I do? Thanks! Guido (Italy) ------------------------------------------------------ Guido Milanese Vocal Ensemble "Ars Antiqua" gmilanese@mclink.it http://fly.to/arsantiqua Salita del Passero 11 I-16126 Genova GE, Italy * Sed nomini tuo da gloriam * From icon-group-sender Mon Sep 4 13:44:52 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id NAA02996 for icon-group-addresses; Mon, 4 Sep 2000 13:44:43 -0700 (MST) Message-Id: <200009042044.NAA02996@baskerville.CS.Arizona.EDU> From: Cherniavsky Beni X-Newsgroups: comp.lang.icon Subject: Icon-based shell? Date: Sun, 03 Sep 2000 20:02:54 GMT X-Article-Creation-Date: Sun Sep 03 20:02:54 2000 GMT X-Http-User-Agent: Mozilla/4.05 [en] (WinNT; I) X-Http-Proxy: 1.0 x64.deja.com:80 (Squid/1.1.22) for client 143.185.1.11 X-MyDeja-Info: XMYDJUIDscben To: icon-group@optima.CS.Arizona.EDU Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 472 I've been long thinking that iterators could be very handy when doing quick jobs, whick is what you do at the shell (unless it's command.com, in which case you don't). DUEL, which is a C-like interpreter inspired by Icon and integrated into GDB, proves that it can be good in interactive use. Does anybody know of or have ideas about a shell that would have iterators? -- Cherniavsky Beni Sent via Deja.com http://www.deja.com/ Before you buy. From icon-group-sender Tue Sep 5 08:08:44 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id IAA25783 for icon-group-addresses; Tue, 5 Sep 2000 08:08:25 -0700 (MST) Message-Id: <200009051508.IAA25783@baskerville.CS.Arizona.EDU> Date: Tue, 5 Sep 2000 17:38:56 +1100 (EST) From: Rohan McLeod To: Leonard cc: icon-group@optima.CS.Arizona.EDU Subject: Re: newbie questions Content-ID: Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 4634 This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. Send mail to mime@docserver.cac.washington.edu for more info. --231439950-658434473-968135323=:6463 Content-Type: TEXT/PLAIN; CHARSET=US-ASCII Content-ID: Leonard; since you don't seem to be getting much attention from the resident guru's and the list doesn't seem to have enormous traffic;I thought I might share my understandings on some of the matters you have raised....the blind leading the blind! On Sat, 2 Sep 2000, Leonard wrote: > Hello; > I have some experience programming in Fortran, but would now like to do > some windows gui programming in a more modern language. > The executables that come "out" of Icon are for a command line interface; you would seem to need something called "VIB " if you want gui. > >From what I have read, I like Icon's strings processing features, as > well as the fact that the size of strings / lists do not have to be > specified when writing a program. now... > > Can an Icon program be compiled into a stand-alone executable, to be > used on computers without Icon installed? In the past (say prior to ver 8.7 see the attachment) there were two ways of producing an executable: 1/via the Icon compiler "iconc" (see Ipd191.doc)."iconc" would convert the source code to the language "C" which could then be compiled to to an executable via a suitable "C" compiler(either manually or by a command line switch.)Whether this intermediate step was for cross- platform accessibility or to avoid having to write a "*.icn->*.exe" compiler or both... I don't know. Anyway iconc is now no longer supported.(see attachment) 2/via an attached interpreter which means that your smallest program is about 300k(compare Icon9\bin\noname.exe 310kb with Icon\bin\noname.icn 1kb) ps One of the reasons I am still a novice Icon programmer is because it has no direct "*.icn->*.exe" compiler! > > If so... > > How much memory overhead does the Icon interpreter have? > > How does the program execution speed compare to a similar program > written in C++ or Java? > Checkout http://www.idiom.com/free-compilers > Are there files system functions to check for the existence of, copy, > move and rename specified files / folders? > > > Thanks > Leonard > --231439950-658434473-968135323=:6463 Content-Type: TEXT/PLAIN; CHARSET=US-ASCII; NAME="iconc90.wri" Content-ID: Content-Description: Content-Transfer-Encoding: BASE64 Li4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4u Li4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLihwYXN0ZSkNDQozLl9fRGlmZmVy ZW5jZXNfaW5fTGFuZ3VhZ2VfRmVhdHVyZXMNDQoNDQogICBUaGUgY29tcGls ZXIgaXMgZGVzaWduZWQgdG8gYmUgY29tcGF0aWJsZSB3aXRoIHRoZSBpbnRl cnByZXRlcg0NCmZvciBWZXJzaW9uIDguNyBvZiBJY29uLiBUaGlzIGdvYWwg Y2Fubm90IGJlIGNvbXBsZXRlbHkgcmVhbGl6ZWQNDQpiZWNhdXNlIHNldmVy YWwgZmVhdHVyZXMgb2YgdGhlIGxhbmd1YWdlIG1ha2Ugb3B0aW1pemF0aW9u cyBkaWYtDQ0KZmljdWx0LiBUaG9zZSBmZWF0dXJlcyB0aGF0IGNhdXNlIHBy b2JsZW1zIGFuZCBhcmUgbm90IGNvbnNpZGVyZWQNDQplc3NlbnRpYWwgdG8g dGhlIGxhbmd1YWdlIGhhdmUgZWl0aGVyIGJlZW4gcmVtb3ZlZCBvciBtYWRl IGF2YWlsLQ0NCmFibGUgb25seSB0aHJvdWdoIGNvbXBpbGVyIG9wdGlvbnMu DQ0KDQ0KICAgRGVidWdnaW5nLCBzdHJpbmcgaW52b2NhdGlvbiwgbGlua2lu ZyBjb2RlIGZyb20gb3RoZXIgSWNvbg0NCnByb2dyYW1zLCBhbmQgZXh0ZXJu YWwgZnVuY3Rpb25zIGFyZSBoYW5kbGVkIHNvbWV3aGF0IGRpZmZlcmVudGx5 DQ0KDQ0KDQ0KDQ0KSVBEMTkxYSAgICAgICAgICAgICAgICAgICAgICAgLSA0 IC0gICAgICAgICAgICAgICAgICBKdWx5IDQsIDE5OTINDQoNDQouLi4uLi4u Li4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4u Li4uLi4uLi4uLi4uLi4uLi4uLihwYXN0ZSkNDQoNDQpGcm9tIC0gVGh1IEp1 biAwMSAxMjo0Nzo0NSAyMDAwDQ0Kcm9oYW5AbWljb20uYXNuLmF1DQ0KU3Vi amVjdDogUmU6IHNpbGx5IHF1ZXN0aW9uIGFib3V0IGljb25jDQ0KDQ0KICAg IHdoYXQgc3lzdGVtcyBpcyBhbiBJY29uIGNvbXBpbGVyIGF2YWlsYWJsZSBm b3IgYW5kDQ0KICAgIHdoZXJlIChVUkw/KSBjYW4gSSBmaW5kIGJpbmFyaWVz ID8NDQoNDQpCZWNhdXNlIG9mIGxpbWl0ZWQgcmVzb3VyY2VzLCB3ZSBubyBs b25nZXIgc3VwcG9ydCB0aGUgY29tcGlsZXIgb3IgcHJvZHVjZQ0NCmJpbmFy aWVzIGZvciBpdC4gIE1vc3QgcGVvcGxlIGZvdW5kIHRoYXQgdXNpbmcgdGhl IGNvbXBpbGVyIHdhc24ndCB3b3J0aA0NCnRoZSBleHRyYSBjb21wbGlhdGlv biB0aW1lIG9yIHRoZSBoYXNzbGVzIGludm9sdmVkLg0NCg0NCiAgIC0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQ0NCiAgIEdyZWdnIFRvd25zZW5k ICAgICAgICAgU3RhZmYgU2NpZW50aXN0ICAgICAgVGhlIFVuaXZlcnNpdHkg b2YgQXJpem9uYQ0NCiAgIGdtdEBjcy5hcml6b25hLmVkdSAgICAgQ29tcHV0 ZXIgU2NpZW5jZSAgICAgVHVjc29uLCBBcml6b25hLCBVU0ENDQo= --231439950-658434473-968135323=:6463-- From icon-group-sender Tue Sep 5 16:22:43 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id QAA20637 for icon-group-addresses; Tue, 5 Sep 2000 16:20:40 -0700 (MST) Message-Id: <200009052320.QAA20637@baskerville.CS.Arizona.EDU> X-Priority: 3 (Normal) Date: Tue, 05 Sep 2000 23:46:50 +0200 (CEST) From: Guido Milanese To: icon-group@baskerville.CS.Arizona.EDU Subject: About a previous question Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 755 I posted a message some days ago on the Usenet group, but I got no answer at all. The problem was: I wanted to use the TextList instruction to display the contents of a file or of long strings containing newlines; I noticed that the output was broken just after the fist newline char (all OK using a standard WWrites() instruction). Now I think I found a good solution: if the problem is of interest to any of you, please drop me a line and I'll be glad to discuss the procedure I have designed. Best regards, G. ------------------------------------------- E-Mail: Guido Milanese Homepage: http://fly.to/arsantiqua 04-Sep-00 - XFMail on Linux + + + + + + NON NOBIS DOMINE + + + + + + ------------------------------------------- From icon-group-sender Wed Sep 20 13:42:33 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id NAA16646 for icon-group-addresses; Wed, 20 Sep 2000 13:39:44 -0700 (MST) Message-Id: <200009202039.NAA16646@baskerville.CS.Arizona.EDU> From: symbiot@my-deja.com X-Newsgroups: comp.lang.icon Subject: Runtime environment for Icon Date: Wed, 20 Sep 2000 15:22:39 GMT X-Article-Creation-Date: Wed Sep 20 15:22:39 2000 GMT X-Http-User-Agent: Mozilla/4.0 (compatible; MSIE 5.0; Windows 95; DigExt) X-Http-Proxy: 1.0 SRVPROXY, 1.0 x53.deja.com:80 (Squid/1.1.22) for client 208.51.185.226 X-MyDeja-Info: XMYDJUIDsymbiot To: icon-group@optima.CS.Arizona.EDU Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 625 Greetings: A little while ago (on the order of years), I came across a source for a freeware runtime and debugging environment for ICON. I thought I had saved the url, but can't seem to find it. I've preformed some search engine inquiries and have not found it either. All I recall is that it was NOT the Univ of AZ Icon site. Does anyone know where such a utility is available (for Win 98 and NT)? Your assistance is greatly appreciated!! Thanx! -- "Wife who put husband in doghouse, soon find him in cathouse." -- Wisdom of the Tao Sent via Deja.com http://www.deja.com/ Before you buy. From icon-group-sender Wed Sep 20 13:45:15 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id NAA16804 for icon-group-addresses; Wed, 20 Sep 2000 13:43:31 -0700 (MST) Message-Id: <200009202043.NAA16804@baskerville.CS.Arizona.EDU> X-Sender: glastafari@pop.ntlworld.com Date: Wed, 20 Sep 2000 16:51:36 +0100 To: Icon Group From: Suzdal Subject: parse stack overflow Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 400 Being totally new to Icon (using Mac version 2.0.5), please don't all laugh in derision at this question: I keep getting a "parse stack overflow" error when I try to compile my program (perhaps because I've got a lot of conditional/comparison lines). Perhaps I should increase the "Parse tree space," but I can't get it above 65535. Any help would be welcome. -Suzdal suzdal@altavista.net From icon-group-sender Thu Sep 21 12:29:24 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id MAA20110 for icon-group-addresses; Thu, 21 Sep 2000 12:27:37 -0700 (MST) Message-Id: <200009211927.MAA20110@baskerville.CS.Arizona.EDU> From: Atle X-Newsgroups: comp.lang.icon Subject: Re: parse stack overflow Date: Thu, 21 Sep 2000 18:15:45 +0200 X-Trace: news0.skynet.be 969552316 4866 195.238.29.187 (21 Sep 2000 16:05:16 GMT) X-Complaints-To: abuse@skynet.be X-Accept-Language: en To: icon-group@optima.CS.Arizona.EDU Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 668 Suzdal wrote: > > Being totally new to Icon (using Mac version 2.0.5), please don't all > laugh in derision at this question: I keep getting a "parse stack > overflow" error when I try to compile my program (perhaps because > I've got a lot of conditional/comparison lines). Perhaps I should > increase the "Parse tree space," but I can't get it above 65535. Any > help would be welcome. I'm a newbie like yourself, the rest seem to be experts. There are two compilers, and only the one requiring a runtime seems to be actively supported. Icon does not say much about syntax errors, so there may be a missing semicolon out there. This may not help much ... Atle From icon-group-sender Fri Sep 22 12:44:51 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id MAA27049 for icon-group-addresses; Fri, 22 Sep 2000 12:43:38 -0700 (MST) Message-Id: <200009221943.MAA27049@baskerville.CS.Arizona.EDU> Date: Fri, 22 Sep 2000 09:44:57 -0500 From: "Charles Hethcoat" To: Subject: Re: parse stack overflow Content-Disposition: inline X-Guinevere: 1.0.13 ; Oceaneering Int'l X-MIME-Autoconverted: from quoted-printable to 8bit by baskerville.CS.Arizona.EDU id HAA17719 Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 788 >>> Suzdal 00-09-20 10:51:36 AM >>> wrote: > I keep getting a "parse stack overflow" error when I try to compile my program (perhaps because I've got a lot of conditional/comparison lines). My first reaction is that I would like to see the program. If it is reasonably sized, perhaps you could post it to the group? Maybe there is another way to code your problem that would be less stack-expensive. > Perhaps I should increase the "Parse tree space," but I can't get it above 65535. I don't know much about the Mac. Do you mean to imply that you _should_ be able to get it above that level, or is this a hard limit of some sort? If the latter is true, then recoding the program may be your only option. Charles Hethcoat Oceaneering Space Systems From icon-group-sender Fri Sep 22 16:43:16 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id QAA03787 for icon-group-addresses; Fri, 22 Sep 2000 16:42:51 -0700 (MST) Message-Id: <200009222342.QAA03787@baskerville.CS.Arizona.EDU> To: "Charles Hethcoat" Cc: icon-group@optima.CS.Arizona.EDU, suzdal@altavista.net Subject: Re: parse stack overflow Date: Fri, 22 Sep 2000 14:54:41 -0700 From: Clinton L Jeffery Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 945 Recently suzdal@altavista.net wrote of parse stack overflows in his big program. I will take a crack at providing a better answer than I have heard so far. Very old versions of Icont have a number of static limits built-in to them that could be raised, within certain bounds, using command-line options. If the command-line options can't be raised high enough for your large program, the best options are to (a) move to a newer version of Icon, or (b) break your program into more, smaller procedures. There are sometimes other extreme measures that can be taken, but if either (a) or (b) works for you they are your best option. The static compiler limits were gone by Icon Version 9, and maybe gone by Icon Version 8, someone else could say for sure on that. Suzdal, I would be surprised if there is not a newer version of Mac Icon available to you than what you are currently using. Cheers, and good luck! Clint jeffery@cs.unlv.edu From icon-group-sender Mon Sep 25 08:14:05 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id IAA09393 for icon-group-addresses; Mon, 25 Sep 2000 08:12:25 -0700 (MST) Message-Id: <200009251512.IAA09393@baskerville.CS.Arizona.EDU> From: rohan@micom.asn.au Date: Mon, 25 Sep 2000 12:55:38 +1100 (EST) To: Leonard cc: icon-group@optima.CS.Arizona.EDU Subject: newbie questions Content-ID: Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 3533 Leonard; since you don't seem to be getting much attention from the resident guru's and the list doesn't seem to have enormous traffic;I thought I might share my understandings on some of the matters you have raised....the blind leading the blind! Who knows it may even stimulate a responce On Sat, 2 Sep 2000, Leonard wrote: > Hello; > I have some experience programming in Fortran, but would now like to do > some windows gui programming in a more modern language. > The executables that come "out" of Icon are for a command line interface; you would seem to need something called "VIB " if you want gui. > >From what I have read, I like Icon's strings processing features, as > well as the fact that the size of strings / lists do not have to be > specified when writing a program. now... > [A> Can an Icon program be compiled into a stand-alone executable, to be > used on computers without Icon installed? In the past (say prior to ver 8.7 see insert (1)below) there were two ways of producing an executable: 1/via the Icon compiler "iconc" (see Ipd191.doc)."iconc" would convert the source code to the language "C" which could then be compiled to to an executable via a suitable "C" compiler(either manually or by a command line switch.)Whether this intermediate step was for cross- platform accessibility or to avoid having to write a "*.icn->*.exe" compiler or both... I don't know. Anyway iconc is now no longer supported.(see insert (2)below) 2/via an attached interpreter which means that your smallest program is about 300k(compare Icon9\bin\noname.exe 310kb with Icon\bin\noname.icn 1kb) ps One of the reasons I am still a novice Icon programmer is because it has no direct "*.icn->*.exe" compiler! ..........................................................insert (1) >From - Thu Jun 01 12:47:45 2000 rohan@micom.asn.au Subject: Re: silly question about iconc what systems is an Icon compiler available for and where (URL?) can I find binaries ? Because of limited resources, we no longer support the compiler or produce binaries for it. Most people found that using the compiler wasn't worth the extra compliation time or the hassles involved. Gregg Townsend Staff Scientist The University of Arizona gmt@cs.arizona.edu Computer Science Tucson, Arizona, USA ..........................................................insert (1) ..........................................................insert (2) 3.__Differences_in_Language_Features The compiler is designed to be compatible with the interpreter for Version 8.7 of Icon. This goal cannot be completely realized because several features of the language make optimizations dif- ficult. Those features that cause problems and are not considered essential to the language have either been removed or made avail- able only through compiler options. Debugging, string invocation, linking code from other Icon programs, and external functions are handled somewhat differently IPD191a - 4 - July 4, 1992 ..........................................................insert (2) > > If so... > > How much memory overhead does the Icon interpreter have? > > How does the program execution speed compare to a similar program > written in C++ or Java? > Checkout http://www.idiom.com/free-compilers > Are there files system functions to check for the existence of, copy, > move and rename specified files / folders? > > > Thanks > Leonard > From icon-group-sender Tue Sep 26 08:17:21 2000 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id IAA20174 for icon-group-addresses; Tue, 26 Sep 2000 08:15:52 -0700 (MST) Message-Id: <200009261515.IAA20174@baskerville.CS.Arizona.EDU> From: suzdal@altavista.net (Suzdal) X-Newsgroups: comp.lang.icon Subject: Re: parse stack overflow Date: Tue, 26 Sep 2000 09:07:35 +0100 X-Complaints-To: abuse@ntlworld.com X-Trace: news2-win.server.ntlworld.com 969955673 62.255.10.27 (Tue, 26 Sep 2000 09:07:53 BST) To: icon-group@optima.CS.Arizona.EDU Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Content-Length: 810 In article <200009222342.QAA03787@baskerville.CS.Arizona.EDU>, Clinton L Jeffery wrote: > Recently suzdal@altavista.net wrote of parse stack overflows in his big > program. I will take a crack at providing a better answer than I have > heard so far. ... >Suzdal, I would be surprised if there is not a newer version of > Mac Icon available to you than what you are currently using. > > Cheers, and good luck! > > Clint jeffery@cs.unlv.edu I think you could be right, my program is not elegantly written enough! (Though, having said that, you'd think it could cope better.) Thanks for the comments - I'd love to know if there *is* a newer Mac version than mine available (I have v. 2.0.5), and if so, how to obtain it. This might handle this problem, conceivably. Suzdal From icon-group-sender Thu Mar 1 08:42:46 2001 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id f21FgdQ22692 for icon-group-addresses; Thu, 1 Mar 2001 08:42:39 -0700 (MST) Message-Id: <200103011542.f21FgdQ22692@baskerville.CS.Arizona.EDU> Date: Thu, 01 Mar 2001 09:12:54 -0500 From: "Steve Graham" To: , Subject: Re: New Scientist puzzle Content-Disposition: inline X-MIME-Autoconverted: from quoted-printable to 8bit by baskerville.CS.Arizona.EDU id f21EDg820252 Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 802 Thanks for the clarification, Bob. The code is in MUMPS (or M as it is also called). Outside the U.S. it is used mostly in business applications, while inside the U.S. it is mostly used in medical settings. >>> Bob Ardler 02/27/01 03:30PM >>> Steve Graham wrote: >...the further requirement that each uniquely determines the other. >Could you explain that? I take it to mean 1-1 correspondence in that any VIER with more than one matching NEUN is discarded, likewise any NEUN matching more than one VIER. So for example VIER=1369 is eliminated because it pairs with 4624 and 5625; NEUN=1521 fails as it matches 4536 and 7056. All but the one solution pair can be thus deleted. (Is that code SPITBOL?) -- Bob Ardler, ardler@argonet.co.uk From icon-group-sender Thu Mar 1 08:43:25 2001 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id f21FhLc22736 for icon-group-addresses; Thu, 1 Mar 2001 08:43:21 -0700 (MST) Message-Id: <200103011543.f21FhLc22736@baskerville.CS.Arizona.EDU> Date: Thu, 01 Mar 2001 09:59:23 -0500 From: "Steve Graham" To: , Subject: Re: New Scientist puzzle Content-Disposition: inline X-MIME-Autoconverted: from quoted-printable to 8bit by baskerville.CS.Arizona.EDU id f21Exu821117 Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 2038 Cary, Nice, compact, understandable solution. Steve >>> Cary Coutant 02/28/01 06:05PM >>> My solution recognizes that map() can do most of the work for you: map("62419409", "62419409", "VIERNEUN") == "VIERNEUN" map("VIERNEUN", "VIERNEUN", "62419409") == "62419409" These two tests verify that each letter is used, and that each digit maps to a different letter. I then made a list of candidate solutions that satisfy the first condition, and used two tables to cross-reference the numbers to find the solution(s) where one number uniquely determines the other. Interestingly, the puzzle works in English with one minor change. "FOUR NINE" doesn't have a solution, but "FIVE NINE" does. -cary procedure main(args) local pat1, pat2, pats local t1, t2, solutions local num1, num2, nums local soln # Get patterns from the command line pat1 := args[1] | "VIER" pat2 := args[2] | "NEUN" pats := pat1 || pat2 # Initialize cross-reference tables # and list of solutions t1 := table(0) # t1[n] counts solutions of form (n,x) t2 := table(0) # t2[n] counts solutions of form (x,n) solutions := [] # Generate all possible solutions and check against patterns every num1 := gen_squares(*pat1) & num2 := gen_squares(*pat2) do { nums := num1 || num2 if map(pats, pats, nums) == nums & map(nums, nums, pats) == pats then { t1[num1] +:= 1 t2[num2] +:= 1 put(solutions, [num1, num2]) } } # Look for solutions where each number # uniquely determines the other while soln := get(solutions) do if t1[soln[1]] = t2[soln[2]] = 1 then write(soln[1], " ", soln[2]) end # Generate squares of given length procedure gen_squares(len) local n, inc n := 1 inc := 3 repeat { if *n > len then fail if *n = len then suspend string(n) n +:= inc inc +:= 2 } end From icon-group-sender Thu Mar 1 17:33:52 2001 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id f220Wso11597 for icon-group-addresses; Thu, 1 Mar 2001 17:32:54 -0700 (MST) Message-Id: <200103020032.f220Wso11597@baskerville.CS.Arizona.EDU> Date: Thu, 01 Mar 2001 15:56:45 -0500 From: "Steve Graham" To: , Subject: Re: New Scientist puzzle Content-Disposition: inline X-MIME-Autoconverted: from quoted-printable to 8bit by baskerville.CS.Arizona.EDU id f21L21803991 Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 7176 Gordon and all, Based upon some comments, I've discarded the brute force approach. Here's the new code. VIERNEUN ; N HI,I,LO,NEUN,SQN,SQV,VIER S LO=1000**.5 S:LO\1'=LO LO=LO\1+1 S HI=9999**.5 S:HI\1'=HI HI=HI\1-1 F I=LO:1:HI D . Q:$$VIER(I**2) Q:$$NEUN(I**2) S SQV="" F S SQV=$O(VIER(SQV)) Q:SQV="" D . S SQN="" . F S SQN=$O(NEUN(SQN)) Q:SQN="" D . . I $E(SQV,3)=$E(SQN,2),SQV'[$E(SQN),SQV'[$E(SQN,3) S VIER(SQV)=VIE" D UNIQUE Q ; VIER(NUM) ; N A,FLGS,I S FLGS="0000000000" F I=1:1:4 S A=$A(NUM,I)-47,$E(FLGS,A)=$E(FLGS,A)+1 I $TR($TR(FLGS,0),1)="" S VIER(NUM)="" Q 1 Q 0 ; NEUN(NUM) ; I $E(NUM)=$E(NUM,4),$E(NUM)'=$E(NUM,2),$E(NUM,1,2)'[$E(NUM,3) S NEUN(NU1 Q 0 ; UNIQUE ; N FLG,SQN,SQV S (FLG,SQN)="" F S SQN=$O(NEUN(SQN)) Q:SQN="" I NEUN(SQN)=1 D Q:FLG . S SQV="" . F S SQV=$O(NEUN(SQN,SQV)) Q:SQV="" I VIER(SQV)=1 S FLG=SQV_","_SQNQ D . I FLG W !,$P(FLG,","),",",$P(FLG,",",2) Q . W !,"NO ANSWERS" Q 6241,9409 === >>> 02/27/01 04:36PM >>> >>> VIER and NEUN represent 4-digit squares, each letter denoting a >distinct digit. You are asked to find the value of each, given the >further requirement that each uniquely determines the other. You can >solve by looking at the squares of 32 through 99, but following my >policy of writing bad Basic in Icon I wrote boring tests to eliminate >pattern breaches. >>> Since patterns are involved, wondered how iconians would do it at the >usual 1/5 the length and 1/20 the time. (Solution - this one's enigma >1123 -in the form sqrt(VIER * NEUN) to enigma@newscientist.com giving >your postal address.) >>> (Horrible thought: it can't be done by *maths*, can it?) >>Hmmmm... my program in SPITBOL finds nine solutions before the "further >condition" is applied. As specified, just one afterwards. >>My final program is 8 SPITBOL statements, including the END statement.... I >could actually reduce it to three. :-) > What is the "FURTHER" condition that you mention? I don't see how one can uniquely determine the other. It took me a while to figure that out, too. If you look at your nine solutions (which are presumably the same nine that my first program found... I didn't bother checking), you'll notice that in eight of them, either the first square or the last square appears more than once in the set of all solutions. What the problem asks for is the one solution where _both_ the first square and the last square are unique in the set of solutions. > I would be interested in seeing your solution. I'll post it at the end of this message. It's longer in bytes than yours, (but might not be, once your program is fixed to solve the rest of the problem!). Mine almost certainly runs faster than yours does. :-) > Here is mine (with solutions) in the language I use in my daily work (Guess what it is). Hmmm.... haven't a clue, but then again I've never been much of a language wonk... despite having still used a lot of them over the years! > I have included the square root of each solution in parentheses: Not a bad touch, although it's easy enough to find anyhow. >VIERNEUN ; > ; > F I=1000:1:9999 D > .I I**.5\1=(I**.5) D > ..S X=$E(I),Y=$E(I,2),Z=$E(I,3),A=$E(I,4) > ..I X'=Y,X'=Z,X'=A,Y'=Z,Y'=A,Z'=A D > ...F J=1000:1:9999 D > ....I I'=J,J**.5\1=(J**.5),$E(I,3)=$E(J,2),$E(J)=$E(J,4),I'[$E(J),I'[$E(J,3) D > .....W !,I," (",I**.5,"), ",J," (",J**.5,")" > >>D +1 > >1369 (37), 4624 (68) >1369 (37), 5625 (75) >1764 (42), 5625 (75) >4356 (66), 1521 (39) >4761 (69), 5625 (75) >6241 (79), 9409 (97) >7056 (84), 1521 (39) >7569 (87), 1681 (41) >7569 (87), 4624 (68) Here, as promised, is my original solution in SPITBOL: sq = 31 tb = table() sqp1 = fence breakx(",") "," len(1) $ n *notany(n) $ e + *notany(n e) $ u *n "," + *?(sqs ? fence breakx(",") "," *notany(n e u) $ v + *notany(n e u v) $ i e *notany(n e u v i) $ r "," + *?(solbuf = solbuf ";" v i e r "," n e u n) fail) solp = fence breakx(";") ";" break(",") $ n1 "," len(4) $ n2 sup = solp *?(tb[n1] = tb[n1] + 1) *?(tb[n2] = tb[n2] + 1) fail lp = solp *eq(tb[n1],1) *eq(tb[n2],1) *?(output = n1 "," n2) fail sqsfill sqs = ((sqs "," (((sq = sq + 1) le(sq,99)) * sq)), + (sqs ? sqp1), (solbuf ? sup), (solbuf ? lp)) :s(sqsfill) end Although it's certainly true that our world of PCs today, execution times can vary WIDELY depending on what microprocessor you're running on (I happened to run mine on a relatively glacial, by today's standards, Pentium 233MMX), it's still interesting perhaps to provide the output and execution statistics from my program: [quote] 6241,9409 Normal end In file play1.spt In line 13 In statement 8 Run time (millisec) 3 Stmts executed 76 MCSec / Stmt 39 Regenerations 0 Memory used (bytes) 83976 Memory left (bytes) 47092 [end quote] Actually, on looking at this today, I see a couple of ways to make it still shorter and faster, which is significant enough to probably justify changing it.... so here's the revised version (which is now down to five statements including the END statement, and could be further reduced notationally to three... but that change probably isn't 'worth' making): sq = 31 sqp1 = fence breakx("x") ("x" (len(1) $ n *notany(n) $ e + *notany(n e) $ u *n) $ n2) $ xn2 + *?(sqs ? fence breakx("x") ("x" (*notany(n e u) $ v + *notany(n e u v) $ i e *notany(n e u v i) $ r) $ n1) $ xn1 + *?(solbuf = solbuf "X" n1 xn2) + *?($xn1 = $xn1 + 1) *?($xn2 = $xn2 + 1) fail) lp = fence breakx("X") ("X" len(4) $ n1) $ xn1 ("x" len(4) $ n2) $ xn2 + *eq($xn1,1) *eq($xn2,1) *?(output = n1 "," n2) fail sqsfill sqs = ((sqs "x" (((sq = sq + 1) le(sq,99)) * sq)), + (sqs ? sqp1), (solbuf ? lp)) :s(sqsfill) end and the output from the last run: [quote] 6241,9409 Normal end In file play3.spt In line 12 In statement 5 Run time (millisec) 0 Stmts executed 73 MCSec / Stmt 0 Regenerations 0 Memory used (bytes) 88440 Memory left (bytes) 42628 [end quote] Notice one huge difference between your approach and mine... mine is basically treating the problem as a pattern matching one and does virtually everything in character mode using the recursion and backtracking of the pattern matcher, while yours is doing a LOT of arithmetic. It'll be interesting to see your program after you've handled the "uniquely determines" condition. I'll also be curious to see how you end up changing your program after having looked at my solution. :-) Gordon Peterson http://personal.terabites.com/ Support the Anti-SPAM Amendment! Join at http://www.cauce.org/ 12/19/98: Partisan Republicans scornfully ignore the voters they "represent". 12/09/00: the date the Republican Party took down democracy in America. From icon-group-sender Fri Mar 2 17:07:52 2001 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id f2307Q626330 for icon-group-addresses; Fri, 2 Mar 2001 17:07:26 -0700 (MST) Message-Id: <200103030007.f2307Q626330@baskerville.CS.Arizona.EDU> Date: Fri, 02 Mar 2001 15:16:32 -0600 From: gep2@terabites.com Subject: Re: New Scientist puzzle To: memoryalpha@juno.com, ardler@argonet.co.uk, icon-group@cs.arizona.edu Cc: gep2@terabites.com, Steve_Graham@labcorp.com, NLiber@wmsgaming.com, cary@cup.hp.com Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 1410 That one is VERY elegant, Steve. Nice!! I really like the use of the csets... a good example of Icon expressiveness at work. It would be interesting to see if the people offering New Scientist solutions in "those other" programming languages get the hint that S*BOL and Icon might be worth looking into. ;-) Does anybody know if the magazine is going to publish the prettiest solutions? On Fri, 2 Mar 2001, memoryalpha@juno.com wrote: ># Bob: Here's a (non-PDF'ed) variant of the file I sent you on 28 Feb: > >procedure main() # Written by Steve Hunter 1 March 2000 > ># All 4 digits distinct? push onto v-list; ># 3 of the 4 digits distinct, with first-digit = last-digit? push onto >n-list: >v_l := []; n_l := [] >every s := string((32 to 99)^2) do > push(case *cset(s) of {4: v_l; (s[1]==s[-1], 3): n_l}, s) > >v_t := table(); n_t := table() >every (*((v:=!v_l) ++ (n:=!n_l)) = 6, v[-2] == n[2]) do { > /v_t[v] := set(); insert(v_t[v], n) > /n_t[n] := set(); insert(n_t[n], v) >} > ># Only print the 1-to-1 pairing(s) >every 1 = *(n_ms := v_t[v:=key(v_t)]) = *n_t[n:=!n_ms] do write(v, ", ", >n) >end Gordon Peterson http://personal.terabites.com/ Support the Anti-SPAM Amendment! Join at http://www.cauce.org/ 12/19/98: Partisan Republicans scornfully ignore the voters they "represent". 12/09/00: the date the Republican Party took down democracy in America. From icon-group-sender Mon Mar 5 08:33:40 2001 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id f25FVYM25023 for icon-group-addresses; Mon, 5 Mar 2001 08:31:34 -0700 (MST) Message-Id: <200103051531.f25FVYM25023@baskerville.CS.Arizona.EDU> From: "Steve Graham" X-Newsgroups: comp.lang.icon Subject: Re: Is Interest in Icon Drying Up? X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.00.2919.6600 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6600 Date: Sun, 04 Mar 2001 18:42:52 GMT X-Complaints-To: abuse@home.net X-Trace: news2.rdc2.tx.home.com 983731372 65.10.83.189 (Sun, 04 Mar 2001 10:42:52 PST) To: icon-group@cs.arizona.edu Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 562 Frank, I see a lot more traffic on the Icon e-mail list. I cannot find the reference right now, but e-mailing the icon group should yield it. Steve === "Frank J. Lhota" wrote in message news:3a9d56d0$0$24372@wodc7nh6.news.uu.net... > For the past year, I've noticed that a severe dropoff of traffic on this > newsgroup. Right now, the only posts I see are the spam posts that have > nothing to do with Icon. > > Has interest in Icon really dropped off so suddenly? Or has the Icon > community turned to another forum? > > From icon-group-sender Mon Mar 5 08:36:01 2001 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id f25FZvU25422 for icon-group-addresses; Mon, 5 Mar 2001 08:35:57 -0700 (MST) Message-Id: <200103051535.f25FZvU25422@baskerville.CS.Arizona.EDU> X-Newsgroups: comp.lang.icon From: "Shmuel (Seymour J.) Metz" Subject: Re: Unicode Version of Icon Mail-Copies-To: nobody X-Cise: "Tony Schliesser" X-CompuServe-Customer: Yes X-Coriate: NCAE@NewAmerica.org X-Ecrate: Bob Germer X-Punge: Micro$oft X-Sanguinate: themvsguy@email.com X-Terminate: SPA(GIS) X-Newsreader: MR/2 Internet Cruiser Edition for OS/2 v2.25/25 Date: Sun, 04 Mar 2001 17:38:19 -0500 X-Complaints-To: abuse@verio.net X-Trace: iad-read.news.verio.net 983751492 206.55.10.86 (Mon, 05 Mar 2001 00:18:12 GMT) To: icon-group@cs.arizona.edu Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 1008 In , on 02/13/2001 at 11:35 PM, "David Feustel" said: >What features of Unicode do you want to be able to work with that you >cannot use currently? Translation between an 8-bit character set and Unicode. String scanning for UCS-16, UCS-32 and UTF-8 text. Input of Icon source code in UCS-16, UCS-32 or UTF-8, including allowing all of the alphabetic characters in labels. Proper handling of bidirectional text. -- ----------------------------------------------------------- Shmuel (Seymour J.) Metz, SysProg and JOAT Atid/2 Team OS/2 Team PL/I Any unsolicited commercial junk E-mail will be subject to legal action. I reserve the right to publicly post or ridicule any abusive E-mail. I mangled my E-mail address to foil automated spammers; reply to domain acm dot org user shmuel to contact me. Do not reply to spamtrap@library.lspace.org ----------------------------------------------------------- From icon-group-sender Tue Mar 6 08:17:26 2001 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id f26FFok03729 for icon-group-addresses; Tue, 6 Mar 2001 08:15:50 -0700 (MST) Message-Id: <200103061515.f26FFok03729@baskerville.CS.Arizona.EDU> Subject: Re: New Scientist puzzle Date: Mon, 5 Mar 2001 18:20:57 -0800 x-sender: cary@adlmail.cup.hp.com From: Cary Coutant To: "Icon-group" Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 2621 After doing a solution in Icon, I got to thinking that this problem would be fun to solve in APL. After dusting off my APL programming skills (dormant for 26 years now), I wasn't able to come up with something as elegant as I had hoped for. (Some may question the use of "elegant" in the same sentence as "APL.") My apologies for going so far off topic, but we've already seen a solution in MUMPS (another language I haven't seen for 26 years), and I thought this would be another interesting contrast to Icon. What I wanted to do was something like this (with accomodation for the ASCII character set): Start with a function F that compares two numbers X and Y and returns a boolean indicating whether they match the pattern. The trick in line [2] is exactly the same trick I used with map() in my Icon solution. del R <- X F Y; NUMS [1] NUMS <- (((rho PAT1), 0) format X), ((rho PAT2), 0) format Y [2] R <- and / (PATS[NUMS iota NUMS]=PATS), NUMS[PATS iota PATS]=NUMS del The function VIER takes a vector of squares (line [4]), and forms the outer result (line [5]) of that vector with itself, using my function F. This would produce a matrix of booleans indicating each pair of squares that satisfies the pattern (the first condition). In line [6], I plus-reduce the matrix row-wise and column-wise, check for rows and columns that have only one solution, expand those reduced vectors out again, then and everything together to form a matrix with only a single 1. Lines 7 and 8 print the two squares corresponding to that entry. del VIER; SQ; M [1] PAT1 <- 'VIER' [2] PAT2 <- 'NEUN' [3] PATS <- PAT1,PAT2 [4] SQ <- (31 drop iota 99) * 2 [5] M <- SQ jot . F SQ [6] M <- M & ((rho M) rho 1 = + bar/ M) & transpose (reverse rho M) rho 1 = +/M [7] (or / M) / SQ [8] (or bar/ M) / SQ del Unfortunately, APL doesn't support outer result with user-defined functions. (To me, that's like not supporting user-defined generators in Icon!) I ended up writing a function XMATCH that produced the outer result using traditional looping techniques. Then I had one more problem. The version of APL I was using (CAPLIB for DOS, running on a Mac under Virtual PC) crashed when I tried to make the 68-by-68 result matrix. I ended up having to filter the list of squares into two lists: VSQ containing only those squares that matched the pattern "VIER", and NSQ containing only those squares that matched the pattern "NEUN". With the smaller matrix to deal with, it was able to come up with the solution. It was a fun exercise, though! -cary From icon-group-sender Tue Mar 6 12:31:52 2001 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id f26JUmA14033 for icon-group-addresses; Tue, 6 Mar 2001 12:30:48 -0700 (MST) Message-Id: <200103061930.f26JUmA14033@baskerville.CS.Arizona.EDU> Date: Tue, 06 Mar 2001 10:42:10 -0500 From: "Steve Graham" To: , Subject: Re: New Scientist puzzle Content-Disposition: inline X-MIME-Autoconverted: from quoted-printable to 8bit by baskerville.CS.Arizona.EDU id f26Fi7804551 Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 2852 Cary, This puzzle seems to have taken on a life of its own, especially in the comp.lang.apl forum. Over 30 posts. Thanks for both of your submissions. Steve >>> Cary Coutant 03/05/01 08:20PM >>> After doing a solution in Icon, I got to thinking that this problem would be fun to solve in APL. After dusting off my APL programming skills (dormant for 26 years now), I wasn't able to come up with something as elegant as I had hoped for. (Some may question the use of "elegant" in the same sentence as "APL.") My apologies for going so far off topic, but we've already seen a solution in MUMPS (another language I haven't seen for 26 years), and I thought this would be another interesting contrast to Icon. What I wanted to do was something like this (with accomodation for the ASCII character set): Start with a function F that compares two numbers X and Y and returns a boolean indicating whether they match the pattern. The trick in line [2] is exactly the same trick I used with map() in my Icon solution. del R <- X F Y; NUMS [1] NUMS <- (((rho PAT1), 0) format X), ((rho PAT2), 0) format Y [2] R <- and / (PATS[NUMS iota NUMS]=PATS), NUMS[PATS iota PATS]=NUMS del The function VIER takes a vector of squares (line [4]), and forms the outer result (line [5]) of that vector with itself, using my function F. This would produce a matrix of booleans indicating each pair of squares that satisfies the pattern (the first condition). In line [6], I plus-reduce the matrix row-wise and column-wise, check for rows and columns that have only one solution, expand those reduced vectors out again, then and everything together to form a matrix with only a single 1. Lines 7 and 8 print the two squares corresponding to that entry. del VIER; SQ; M [1] PAT1 <- 'VIER' [2] PAT2 <- 'NEUN' [3] PATS <- PAT1,PAT2 [4] SQ <- (31 drop iota 99) * 2 [5] M <- SQ jot . F SQ [6] M <- M & ((rho M) rho 1 = + bar/ M) & transpose (reverse rho M) rho 1 = +/M [7] (or / M) / SQ [8] (or bar/ M) / SQ del Unfortunately, APL doesn't support outer result with user-defined functions. (To me, that's like not supporting user-defined generators in Icon!) I ended up writing a function XMATCH that produced the outer result using traditional looping techniques. Then I had one more problem. The version of APL I was using (CAPLIB for DOS, running on a Mac under Virtual PC) crashed when I tried to make the 68-by-68 result matrix. I ended up having to filter the list of squares into two lists: VSQ containing only those squares that matched the pattern "VIER", and NSQ containing only those squares that matched the pattern "NEUN". With the smaller matrix to deal with, it was able to come up with the solution. It was a fun exercise, though! -cary From icon-group-sender Wed Mar 7 08:08:56 2001 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id f27F7VI15154 for icon-group-addresses; Wed, 7 Mar 2001 08:07:31 -0700 (MST) Message-Id: <200103071507.f27F7VI15154@baskerville.CS.Arizona.EDU> From: "Steve Graham" X-Newsgroups: comp.lang.apl,comp.lang.forth,comp.lang.icon,comp.lang.lisp,comp.lang.mumps,comp.lang.scheme,comp.lang.smalltalk Subject: Re: New Scientist Puzzle X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.00.2919.6600 X-MIMEOLE: Produced By Microsoft MimeOLE V5.00.2919.6600 Date: Wed, 07 Mar 2001 01:07:48 GMT X-Complaints-To: abuse@home.net X-Trace: news2.rdc2.tx.home.com 983927268 65.10.83.189 (Tue, 06 Mar 2001 17:07:48 PST) To: icon-group@cs.arizona.edu Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 2204 Stefano, I'm been quite pleased with the reception which this puzzle has received, particularly in the APL newsgroup. You can see a compilation of most of the solutions at http://members.home.net/js.graham/vierneun.html Best of luck. Steve Graham P.S. Would anyone be interested in another, slightly more complex puzzle??? === "Stefano Lanzavecchia" wrote in message news:9832qa$bbb$1@pegasus.tiscalinet.it... > To all the peopl who have posted solutions. > I am collecting them and will publish a few, in particular the APL and J > ones but some written in other languages as well for comparison, hopefully > not to feed a silly language flame war, on a small magazine of the British > APL Association, for which I am now the editor. > You can have a look at an online version of the magazine at this webpage: > http://www.vector.org.uk/ where you can find sample of articles published in > the printed version. As you can see while a serious magazine, it's also > reasonably informal, therefore there is no shame at all involved in having > published code which could be thought as less than optimal. Instead, there's > a good chance that a version quickly hacked together would have some > pedagogic and exemplar value because it shows what the language is capable > of when put to the edges. > > Anyway, my question is: if the author of any of the solution appeared in > these newsgroups (I have APL, J, K, MUMPS, Common Lisp, Dylan, Smalltalk, > Perl, Python from which to choose from) strongly objects to have his > solution published against his or her name, to please let me know and I will > remove the solution from my pool. Otherwise I'll work on the assumption that > by posting a message in a public newsgroups the author implicitely indicated > that, while not necessary proud, does not mind to see his work published for > public consumption. > > By the way, it's quite likely that the readers of Vector are less than the > sums of the readers of these newgroups... > > Thank you everybody, and I hope you shared my fun in the solution of the > little puzzle and in the comparison of the different languages. > -- > WildHeart'2k1 (at home) > > From icon-group-sender Wed Mar 7 08:13:17 2001 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id f27FDDo15367 for icon-group-addresses; Wed, 7 Mar 2001 08:13:13 -0700 (MST) Message-Id: <200103071513.f27FDDo15367@baskerville.CS.Arizona.EDU> From: "Wade Humeniuk" X-Newsgroups: comp.lang.apl,comp.lang.forth,comp.lang.icon,comp.lang.lisp,comp.lang.mumps,comp.lang.scheme,comp.lang.smalltalk Subject: Re: New Scientist Puzzle Date: Tue, 6 Mar 2001 18:29:08 -0700 X-Trace: news3.cadvision.com 983932117 3919 207.148.137.216 (7 Mar 2001 02:28:37 GMT) X-Complaints-To: news@cadvision.com X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4133.2400 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 To: icon-group@cs.arizona.edu Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 3219 You missed Marc Battyani's solution. The Lisp versions you included look a little verbose. --------------->>>>>> I should work, but couldn't resist... A Lisp version: (let ((sqrs (loop for i from (ceiling (sqrt 1000)) upto (isqrt 9999) collect (format nil "~d" (* i i)))) (vns '())) (dolist (vier sqrs) (dolist (neun sqrs) (when (and (char= (aref neun 0)(aref neun 3)) (char= (aref vier 2)(aref neun 1)) (char/= (aref vier 0)(aref vier 1)(aref vier 2) (aref vier 3)(aref neun 0)(aref neun 2))) (push (list vier neun) vns)))) (loop for (v n) in vns do (if (= 1 (count v vns :key #'first)(count n vns :key #'second)) (format t "~%Found ~a ~a~%~%" v n)))) Found 6241 9409 Marc "Steve Graham" wrote in message news:ERfp6.359416$ge4.127024410@news2.rdc2.tx.home.com... > Stefano, > > I'm been quite pleased with the reception which this puzzle has received, > particularly in the APL newsgroup. You can see a compilation of most of the > solutions at http://members.home.net/js.graham/vierneun.html > > Best of luck. > > > Steve Graham > > P.S. Would anyone be interested in another, slightly more complex puzzle??? > > === > > "Stefano Lanzavecchia" wrote in message > news:9832qa$bbb$1@pegasus.tiscalinet.it... > > To all the peopl who have posted solutions. > > I am collecting them and will publish a few, in particular the APL and J > > ones but some written in other languages as well for comparison, hopefully > > not to feed a silly language flame war, on a small magazine of the British > > APL Association, for which I am now the editor. > > You can have a look at an online version of the magazine at this webpage: > > http://www.vector.org.uk/ where you can find sample of articles published > in > > the printed version. As you can see while a serious magazine, it's also > > reasonably informal, therefore there is no shame at all involved in having > > published code which could be thought as less than optimal. Instead, > there's > > a good chance that a version quickly hacked together would have some > > pedagogic and exemplar value because it shows what the language is capable > > of when put to the edges. > > > > Anyway, my question is: if the author of any of the solution appeared in > > these newsgroups (I have APL, J, K, MUMPS, Common Lisp, Dylan, Smalltalk, > > Perl, Python from which to choose from) strongly objects to have his > > solution published against his or her name, to please let me know and I > will > > remove the solution from my pool. Otherwise I'll work on the assumption > that > > by posting a message in a public newsgroups the author implicitely > indicated > > that, while not necessary proud, does not mind to see his work published > for > > public consumption. > > > > By the way, it's quite likely that the readers of Vector are less than the > > sums of the readers of these newgroups... > > > > Thank you everybody, and I hope you shared my fun in the solution of the > > little puzzle and in the comparison of the different languages. > > -- > > WildHeart'2k1 (at home) > > > > > > From icon-group-sender Wed Mar 7 08:13:27 2001 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id f27FDO215386 for icon-group-addresses; Wed, 7 Mar 2001 08:13:24 -0700 (MST) Message-Id: <200103071513.f27FDO215386@baskerville.CS.Arizona.EDU> From: "Marcel Hendrix" X-Newsgroups: comp.lang.apl,comp.lang.forth,comp.lang.icon,comp.lang.lisp,comp.lang.mumps,comp.lang.scheme,comp.lang.smalltalk Subject: Re: New Scientist Puzzle Date: Wed, 7 Mar 2001 10:22:07 +0100 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4133.2400 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 Cache-Post-Path: dibbs3.eur.cis.philips.com!unknown@130.144.179.47 X-Cache: nntpcache 2.4.0b5 (see http://www.nntpcache.org/) X-Trace: 983956936 newnews.nl.uu.net 11019 192.68.44.34 To: icon-group@cs.arizona.edu Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 767 "Steve Graham" wrote in message news:ERfp6.359416$ge4.127024410@news2.rdc2.tx.home.com... > I'm been quite pleased with the reception which this puzzle has received, > particularly in the APL newsgroup. You can see a compilation of most of the > solutions at http://members.home.net/js.graham/vierneun.html It is interesting to look at the solution strategies followed. Unfortunately I can't read (most) of them... It would be nice if there were explanations of the diverse approaches for non-multilinguists to read. For instance, APL has a 5 line solution, but seems to use a monstrous array on which it does pattern matching? I could (and would like to) learn a great deal by implementing such strategies in other languages. -marcel From icon-group-sender Wed Mar 7 13:37:55 2001 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id f27KbUA24245 for icon-group-addresses; Wed, 7 Mar 2001 13:37:30 -0700 (MST) Message-Id: <200103072037.f27KbUA24245@baskerville.CS.Arizona.EDU> From: "WildHeart'2k1" X-Newsgroups: comp.lang.apl,comp.lang.forth,comp.lang.icon,comp.lang.lisp,comp.lang.mumps,comp.lang.scheme,comp.lang.smalltalk Subject: Re: New Scientist Puzzle Date: Wed, 7 Mar 2001 17:28:13 +0100 X-Trace: stargate1.inet.it 983982495 158020 194.185.164.88 (7 Mar 2001 16:28:15 GMT) X-Complaints-To: usenet@stargate1.inet.it X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4133.2400 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 To: icon-group@cs.arizona.edu Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 1697 > It is interesting to look at the solution strategies followed. Unfortunately > I can't read (most) of them... It would be nice if there were explanations of > the diverse approaches for non-multilinguists to read. As far as I can tell, apart from minor details, the Python, Smalltalk and Dylan (and the Ocaml I derived mixing the 3 I just mentioned) are pretty much the same. The prolog solution is interesting because it almost literally (in English) implement the statement of the problem. > For instance, APL has a 5 line solution, but seems to use a monstrous > array on which it does pattern matching? I could (and would like to) > learn a great deal by implementing such strategies in other languages. The APL and J solutions (and the K derived from the latter), while harder to read, also implement the statement quite literally but only to trained eyes. In particular the array mentioned is of moderate size. In one of the solutions proposed, the outer product of all the possible squares is still only a less than 5000 elements array (68*68). I would be glad to get into the details of the APL or J solutions, but once I tried and I quickly figured out that it would require too many details on the languages themselves. J (and K) and all its documentation and tutorials can be downloaded for free from the web pages of the vendors producing the interpreters and, if interested, I recommend the download. The installation procedure is, in both cases, very easy and quite unintrusive and the documentation includes primers which explain a good deal about the language and can guide a beginner to become proficient enough to understand the solutions proposed. -- WildHeart'2k1 From icon-group-sender Wed Mar 7 13:38:30 2001 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id f27KcRU24299 for icon-group-addresses; Wed, 7 Mar 2001 13:38:27 -0700 (MST) Message-Id: <200103072038.f27KcRU24299@baskerville.CS.Arizona.EDU> From: "Geoff Summerhayes" X-Newsgroups: comp.lang.apl,comp.lang.forth,comp.lang.icon,comp.lang.lisp,comp.lang.mumps,comp.lang.scheme,comp.lang.smalltalk Subject: Re: New Scientist Puzzle Date: Wed, 7 Mar 2001 15:32:00 -0500 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 X-Complaints-To: newsabuse@supernews.com To: icon-group@cs.arizona.edu Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 1907 "WildHeart'2k1" wrote in message news:985niv$4qa4$1@stargate1.inet.it... > > > The prolog solution is interesting because it almost literally (in English) > implement the statement of the problem. > Unfortunately, the Prolog solution has a flaw in it that isn't exposed because the problem only has one solution. write/1 doesn't allow backtracking, the program as it stood only produced the first solution it came across. My revised solution follows, I've altered the digit-picking logic to do the comparisons automatically instead of having to hand-code them, takes longer but is scalable. create_number/3 is also more general than before. I've also altered some of the variable names to make the logic a little clearer. leading_digit(X,L,[X|L]) :- member(X,[1,2,3,4,5,6,7,8,9]), \+ member(X,L). digit(X,L,[X|L]) :- member(X,[0,1,2,3,4,5,6,7,8,9]), \+ member(X,L). pure_square(A) :- B is round(sqrt(A)), A is B * B. create_number([],N,N). create_number([H|T],N,NR):- N1 is N*10+H, create_number(T,N1,NR). passes_criteria(V,I,E,R,N,U,VIER,NEUN) :- create_number([V,I,E,R],0,VIER), create_number([N,E,U,N],0,NEUN), pure_square(VIER),pure_square(NEUN). possible_solutions(VIER,NEUN) :- leading_digit(V,[],L), leading_digit(N,L,L1), digit(I,L1,L2), digit(E,L2,L3), digit(R,L3,L4), digit(U,L4,_), passes_criteria(V,I,E,R,N,U,VIER,NEUN). count_matches(_,[],0). count_matches([X,Y],[[X,_]|T],V):-!,count_matches([X,Y],T,V1),V is V1 + 1. count_matches([X,Y],[[_,Y]|T],V):-!,count_matches([X,Y],T,V1),V is V1 + 1. count_matches(A,[_|T],V):-count_matches(A,T,V). solve(V,N):- bagof([X,Y],possible_solutions(X,Y),Possibles), member([V,N],Possibles), count_matches([V,N],Possibles,Count), 1 is Count. % d:/prolog/lisp.prolog compiled 0.00 sec, 5,780 bytes ?- solve(VIER,NEUN). VIER = 6241 NEUN = 9409 ; No ?- ---Geoff--- From icon-group-sender Wed Mar 7 16:27:05 2001 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id f27NQsQ29271 for icon-group-addresses; Wed, 7 Mar 2001 16:26:54 -0700 (MST) Message-Id: <200103072326.f27NQsQ29271@baskerville.CS.Arizona.EDU> Date: Wed, 07 Mar 2001 15:17:25 -0600 From: gep2@terabites.com Subject: Re: New Scientist puzzle To: icon-group@cs.arizona.edu Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 10857 > It is interesting to look at the solution strategies followed. Unfortunately I can't read (most) of them... It would be nice if there were explanations of the diverse approaches for non-multilinguists to read. > For instance, APL has a 5 line solution, but seems to use a monstrous array on which it does pattern matching? I could (and would like to) learn a great deal by implementing such strategies in other languages. OK... a couple of days ago I posted a more detailed look at and explanation of my SPITBOL solution to the SNOBOL4 list... I'll repost it here. (It was a reply to a post giving another alternative solution in generic SNOBOL4). <---- Begin Forwarded Message ----> Return-Path: Date: Mon, 5 Mar 2001 02:00:51 -0600 (CST) Reply-To: snobol4@mercury.dsu.edu From: gep2@terabites.com To: Multiple recipients of list Subject: Re: New Scientist puzzle >> Here, as promised, is my original solution in SPITBOL: > > > sq = 31 > sqp1 = fence breakx("x") ("x" (len(1) $ n *notany(n) $ e > + *notany(n e) $ u *n) $ n2) $ xn2 > + *?(sqs ? fence breakx("x") ("x" (*notany(n e u) $ v > + *notany(n e u v) $ i e *notany(n e u v i) $ r) $ n1) $ xn1 > + *?(solbuf = solbuf "X" n1 xn2) > + *?($xn1 = $xn1 + 1) *?($xn2 = $xn2 + 1) fail) > lp = fence breakx("X") ("X" len(4) $ n1) $ xn1 ("x" len(4) $ n2) $ xn2 > + *eq($xn1,1) *eq($xn2,1) *?(output = n1 "," n2) fail > sqsfill sqs = ((sqs "x" (((sq = sq + 1) le(sq,99)) * sq)), > + (sqs ? sqp1), (solbuf ? lp)) :s(sqsfill) > end > > and the output from the last run: > > [quote] > > 6241,9409 > Not knowing anything about the spitbol extensions I find your solution hard to follow. Actually, it's pretty simple... there's only one goto and one label (other than the END) in the whole program. There are three SPITBOL extensions: 1) Embedded pattern match. (subject ? pattern) which returns (on success) the portion of the subject matched by the pattern. You can also use replacement like any normal S*BOL pattern match, in which case the returned value is the subject after the replacement (or maybe just the new value of the replaced portion? I'm not really sure as I'm writing this...) 2) Embedded assignment. (subject = object) which returns the value of the subject. This is very, very useful for creating side effects during a pattern match (including generating debug output, for instance). 3) Alternative evaluation. (expr1, expr2, expr3, ...) which evaluates each of the expressions in turn, and returns the value of the first one which succeeds. Subsequent expressions are not evaluated. > Isn't it awfully complicated for such a simple problem? Actually, no, it's really pretty simple. One really nice thing about doing stuff like this is that you're able to use the pattern matcher to do recursion and iteration, often without having to resort to explicit labels and loop counters. One of the things that I did in my solution was to precompute all the squares, so that no multiplication (indeed, no arithmetic at all other than the tallying the solutions) is necessary during the final portion of the program. (Your solution involves computing all the squares repeatedly for every qualifying value of nn). One of the other things I did was to prebuild the patterns, which is something I'm relatively in the habit of doing even though the efficiency gain (in this program at least) is certainly negligible, both because of all the unevaluated expressions in the pattern, and since each of the patterns is only invoked ONE time anyhow! It does help clarify the program, though, because the structure of the alternative evaluation expression at sqsfill is more apparent. I qualified the "neun" term first, since that one has only three varying digits and that (probably) truncates more of the possible solutions earlier in the computation. One thing which I did that apparently wasn't necessary was to make sure that the indirection used an alpha character at the beginning of the name, thus following normal variable naming conventions. The fact that your solution works proves that it isn't necessary to do that. Also my solution drops potential candidates out of further consideration earlier than yours does, since you break out solutions into all four of the component characters even when the second one might already disqualify the candidate. One minor problem with your solution is that if there WERE another solution pair where both neun and vier values were unique. your program would only print the first one. It's pretty simple to fix that, though. Your solution would run faster if you'd use *differ(a,b) instead of *ne(a,b) since ne() forces each string [OK, character] to be converted to integer before the comparison can be done. In my programs, I tend to use stuff like FENCE BREAKX("X") "X" instead of just "X" (which is running in unanchored mode) because I believe it's usually faster to use BREAKX than it is to have the pattern matcher abandon the position and step down the string to try again. (Admittedly I haven't benchmarked that in quite a long time). Here's a running commentary...: sq = 31 Merely initalizes the loop counter. Would sure like to have eliminated that, but it would add more complexity elsewhere. The following pattern is where most of the magic happens. When it's running, the string SQS consists of the four-digit squares, separated by "x" characters. The pattern matches each of the four-digit squares in turn, starting at the beginning of the string, and looks for one matching the "neun" rule. When it finds such, it then fires off an embedded pattern match, starting again at the beginning of the list of squares, to find a square matching the "vier" rule. If it finds a pair that work, it tacks them onto the end of the solution buffer SOLBUF (in the form "Xvierxneun") and tallies the number of times each square is used via indirection. The "fail" forces the next vier to be found, if there is one, and ultimately forces the embedded pattern match to fail, which forces the outer pattern match to resume looking for another neun square. Ultimately, however, the sqp1 pattern is still doomed to fail because the embedded pattern match looking for the vier term cannot succeed. But that's okay, because meanwhile it's built the solution buffer which contains all the candidate pairs. > sqp1 = fence breakx("x") ("x" (len(1) $ n *notany(n) $ e > + *notany(n e) $ u *n) $ n2) $ xn2 > + *?(sqs ? fence breakx("x") ("x" (*notany(n e u) $ v > + *notany(n e u v) $ i e *notany(n e u v i) $ r) $ n1) $ xn1 > + *?(solbuf = solbuf "X" n1 xn2) > + *?($xn1 = $xn1 + 1) *?($xn2 = $xn2 + 1) fail) The next pattern processes the solution buffer. It looks for each "X", then four characters, then "x", four more characters. Here I'm actually guilty of the same thing I chastised you about; I really should have moved the *eq($xn1,1) before the matching of "x" etc, which would have allowed the matcher to step to the next solution pair sooner. Note that here I'm using the fact that variable names are not case-sensitive (which I thought was really cute while I was doing it, although now that I'm looking at it I'm wondering if that's true when using indirection). Anyhow, when it finds a solution pair of squares which are both unique, it outputs the pair and then again hits a fail, which forces the pattern matcher to try for another "X" and solution pair until it reaches the end of the solution buffer... at which point it is, like pattern sqp1, doomed to failure. > lp = fence breakx("X") ("X" len(4) $ n1) $ xn1 ("x" len(4) $ n2) $ xn2 > + *eq($xn1,1) *eq($xn2,1) *?(output = n1 "," n2) fail Now that the patterns are built, it mostly remains just to use them. But first we have to build the string sqs containing all the squares. The following statement uses an alternative evaluation expression... the first subexpression succeeds for values of sq in the range to produce four-digit squares, appending those to the string sqs separated by "x" characters. The success of that subexpression causes the GOTO to repeat the complete expression until the first subexpression fails (after sq exceeds 99) at which point the next two alternatives are tried in turn. The first one finds all the solution pairs using pattern sqp1 (as described above), builds the solbuf solution buffer, and ultimately fails which forces the final subexpression to be tried. That final subexpression does a pattern match in the solution buffer to find and print all solution pairs meeting the "both squares unique" rule. Ultimately, it too fails which causes the program to end. > sqsfill sqs = ((sqs "x" (((sq = sq + 1) le(sq,99)) * sq)), > + (sqs ? sqp1), (solbuf ? lp)) :s(sqsfill) > end > Here's mine in standard SNOBOL4: [quote] &fullscan = 1 nn = 31 AGAIN nn = lt(nn, 99) nn + 1 :F(DONE) (nn * nn) len(1) $ v len(1) $ i len(1) $ e len(1) $ r fence + *ne(v, i) *ne(v, e) *ne(v, r) *ne(i, e) *ne(i, r) *ne(e, r) + :F(AGAIN) mm = 31 AGAIN2 mm = lt(mm, 99) mm + 1 :F(AGAIN) (mm * mm) len(1) $ n e len(1) $ u *n fence + *ne(n, v) *ne(n, i) *ne(n, e) *ne(n, r) *ne(n, u) + *ne(e, u) *ne(u, v) *ne(u, i) *ne(u, r) + :F(AGAIN2) $(v i e r) = $(v i e r) + 1 $(n e u n) = $(n e u n) + 1 result = result '|' v i e r ':' n e u n :(AGAIN2) DONE result '|' (len(4) $ vier ':' len(4) $ neun) . output + *eq($vier, 1) *eq($neun, 1) END maskull:Snobol>snobol4 test49.sno The Macro Implementation of SNOBOL4 in C (C-MAINBOL) Version 0.99.4 by Philip L. Budne, August 11, 1997 SNOBOL4 (Version 3.11, May 19, 1975) Bell Telephone Laboratories, Incorporated No errors detected in source program 6241:9409 Normal termination at level 0 test49.sno:16: Last statement executed was 11 [end quote] Certainly a reasonable solution, in any case!! Not bad at all. It's been interesting over on the Icon list to see how they've been handling this one using Icon and MUMPS. One of the fairly neat solutions observes that they can use map() (like S*BOL's REPLACE()) to do all the testing in just two operations... of course, those might be slower operations. It would be interesting to benchmark it both ways. There has also been some use of character set variables which neatly determines (for example) for the "vier" term that all four digits are unique. <---- End Forwarded Message ----> Gordon Peterson http://personal.terabites.com/ Support the Anti-SPAM Amendment! Join at http://www.cauce.org/ 12/19/98: Partisan Republicans scornfully ignore the voters they "represent". 12/09/00: the date the Republican Party took down democracy in America. From icon-group-sender Thu Mar 8 08:01:36 2001 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id f28F16o23529 for icon-group-addresses; Thu, 8 Mar 2001 08:01:06 -0700 (MST) Message-Id: <200103081501.f28F16o23529@baskerville.CS.Arizona.EDU> From: Michael Horsch X-Newsgroups: comp.lang.apl,comp.lang.forth,comp.lang.icon,comp.lang.lisp,comp.lang.mumps,comp.lang.scheme,comp.lang.smalltalk Subject: Re: New Scientist Puzzle Date: Wed, 07 Mar 2001 18:21:01 -0600 X-Trace: tribune.usask.ca 984010861 9817 128.233.128.5 (8 Mar 2001 00:21:01 GMT) X-Complaints-To: usenet@tribune.usask.ca X-Accept-Language: en To: icon-group@cs.arizona.edu Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 1038 I coded up a Prolog + CLP(FD) solution. I have a well-documented version of it available, but since no one else provided comments, I won't either. :-) The CLP(FD) engine I am using is provided by Sicstus Prolog. The run time is about 40msec on a Sparc Ultra10. % sictus prolog file: vn.pl :- use_module(library(clpfd)). :- use_module(library(lists)). solve(P,Q) :- setof((PP,QQ), pair(PP,QQ), Pairs), unique(Pairs, (P,Q)). unique(Pairs, (P,Q)) :- select((P,Q), Pairs, Rs), \+ member((P,_), Rs), \+ member((_,P), Rs), \+ member((Q,_), Rs), \+ member((_,Q), Rs). pair(P,Q) :- domain([V,I,E,R,N,U], 0, 9), P #= V*1000 + I*100 + E*10 + R, Q #= N*1000 + E*100 + U*10 + N, V #> 0, N #> 0, domain([X1,X2,Y1,Y2], 0, 9), X #= X1*10 + X2, Y #= Y1*10 + Y2, X1 #> 0, Y1 #> 0, P #= X*X, Q #= Y*Y, all_different([V,I,E,R,N,U]), labeling([], [P,Q]). % eof Mike -- Michael C. Horsch Department of Computer Science University of Saskatchewan http://www.cs.usask.ca/faculty/horsch/home.shtml From icon-group-sender Thu Mar 8 08:01:52 2001 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id f28F1mo23598 for icon-group-addresses; Thu, 8 Mar 2001 08:01:48 -0700 (MST) Message-Id: <200103081501.f28F1mo23598@baskerville.CS.Arizona.EDU> Date: Wed, 07 Mar 2001 20:40:02 -0600 From: Viktors Berstis X-Accept-Language: en To: Icon-group , snobol4@mercury.dsu.edu Subject: Re: New Scientist puzzle Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 2966 OK, I could no longer resist either. Here is my solution in old fashioned SNOBOL4: d = LEN(1); DEFINE('c(x)'); &FULLSCAN = 1; t = TABLE(); i = 32 a j = 32 b ((i * i) ' ' (j * j)) + ((d $ V d $ I d $ E d $ R) . vier ' ' (d $ N *E d $ U *N) . neun *c(1023456789)) . z :F(x) a = a '=' z '.' r a '=' (vier ' ' t<'v' vier> | t<'n' neun> ' ' neun) '.' = :S(r) t<'n' neun> = LEN(4) t<'v' vier> = LEN(4) x j = j + 1 LT(j,99) :S(b) i = i + 1 LT(i,99) :S(a) OUTPUT = 'Answer' a :(END) c x ANY(N E U V I R) = :S(c) EQ(SIZE(x),4) :S(RETURN)F(FRETURN) END Also, here is a more general version for any two words, which don't need to be the same length along with comments (the above program can be derived from this one): * Specify two words w1 and w2 which are both squares - need not be the same length w1 = 'VIER'; w2 = 'NEUN' * Another puzzle: * w1 = 'FIVE'; w2 = 'NINE' * Shorthand for LEN(1) dg = LEN(1) * Turn length heuristic off for pattern matching &FULLSCAN = 1 * Table to keep track of unique solutions tb = TABLE() * Define the functions used DEFINE('c(xx)') DEFINE('bldpat(wd)') * Compute low and high limits of square roots to index thru for each word (funny char should be hat:) lo1 = CONVERT(('1' DUPL('0',SIZE(w1) - 1)) ^ 0.5 + 1,'INTEGER') hi1 = CONVERT(DUPL('9',SIZE(w1)) ^ 0.5,'INTEGER') lo2 = CONVERT(('1' DUPL('0',SIZE(w2) - 1)) ^ 0.5 + 1,'INTEGER') hi2 = CONVERT(DUPL('9',SIZE(w2)) ^ 0.5,'INTEGER') * Build checking patterns for both words p1 = EVAL(bldpat(w1)) p2 = EVAL(bldpat(w2)) * Start of two nested loops j1 = lo1 a j2 = lo2 * Test a pair of squares b ((j1 * j1) ' ' (j2 * j2)) (p1 . vier ' ' p2 . neun *c(1023456789)) . zz :F(x) * Now need to test to see if solution unique ans = ans '=' zz '.' * Remove prior candidates that use the same number for one word or the other r ans '=' (vier ' ' tb<'v' vier> | tb<'n' neun> ' ' neun) '.' = :S(r) * Remember numbers encountered as candidates tb<'v' vier> = LEN(SIZE(w2)) tb<'n' neun> = LEN(SIZE(w1)) * Next iterations x j2 = j2 + 1 LT(j2,hi2) :S(b) j1 = j1 + 1 LT(j1,hi1) :S(a) * Print answer(s) if any OUTPUT = 'Answer' ans :(END) * Function to check that two letters didn't get assigned to the same digit c xx ANY(EVAL(cc)) = :S(c) * xx contains the digits not assigned to the letters, following checks count: EQ(SIZE(xx),10 - SIZE(seen)) :S(RETURN)F(FRETURN) * Function to build test pattern for word wd bldpat wd dg . let = :F(RETURN) seen let :f(new) bldpat = bldpat '*' let ' ' :(bldpat) * Remember letters we have already seen (matched) new seen = seen let * cc will form argument for ANY in c function cc = cc let ' ' bldpat = bldpat 'dg $ ' let ' ' :(bldpat) END -Viktors From icon-group-sender Mon Mar 12 08:24:07 2001 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id f2CFMdA11579 for icon-group-addresses; Mon, 12 Mar 2001 08:22:40 -0700 (MST) Message-Id: <200103121522.f2CFMdA11579@baskerville.CS.Arizona.EDU> From: Bob Ardler To: Steve Hunter Cc: Icon-group Date: Sun, 11 Mar 2001 12:23:16 +0000 (GMT) Subject: Re: New Scientist puzzle User-Agent: Pluto/2.02d (RISC-OS/3.60) Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 941 Steve, On 06 Mar, you wrote: > Did you get the versions I sent on Sunday? Thank you, yes. > How did my version that uses a single call to map() compare in > speed? That would presumably be the one in the .icn file mkwdmacl. To use that I'd have to substitute something for the preprocessor calls. OTOH the machine-generated wrdsig01 was the fastest yet in ratio 22:24:29:254:299 Am now cursing myself for posting the original enquiry, breaking the golden rule: save this kind of thing for when life is in coasting mode. In compensation will read no more email for the next few decades. Spinoffs: (1) "Enigmatist" of the New Scientist shall have the entire thread by Royal Mail. Revenge is sweet. (2) You may use any language you like on Icon-group so long as (i) your street cred is immense, (ii) it isn't Ada, Basic or C (3) Some *very* nice Icon tricks demonstrated, much appreciated. -- Bob Ardler, ardler@argonet.co.uk From icon-group-sender Mon Mar 12 08:26:49 2001 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id f2CFQkM11692 for icon-group-addresses; Mon, 12 Mar 2001 08:26:46 -0700 (MST) Message-Id: <200103121526.f2CFQkM11692@baskerville.CS.Arizona.EDU> From: jwormsley@debitek.com (Jeffrey A. Wormsley) X-Newsgroups: comp.lang.apl,comp.lang.forth,comp.lang.icon,comp.lang.lisp,comp.lang.mumps,comp.lang.scheme,comp.lang.smalltalk Subject: Re: New Scientist Puzzle Date: Mon, 12 Mar 2001 15:03:36 -0000 User-Agent: Xnews/03.09.22 Cache-Post-Path: real.nextlec.net!unknown@102-1.du-92.mt0.cha1.dialup.nextlec.net X-Cache: nntpcache 2.3.3 (see http://www.nntpcache.org/) X-Complaints-To: newsabuse@supernews.com To: icon-group@cs.arizona.edu Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 1977 Can't help be throw a very verbose and fly right at it Delphi solution in... Certaily isn't 5 lines like the K solution, but then I can't read the K solution ;^). unit Main; interface uses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls; type TForm1 = class(TForm) Memo1: TMemo; Button1: TButton; procedure Button1Click(Sender: TObject); private { Private declarations } Function Match(I,J : Integer): Boolean; Procedure FindMatches; public { Public declarations } end; var Form1: TForm1; implementation {$R *.DFM} Function TForm1.Match(I,J : Integer): Boolean; Var S : String; K, L : Byte; Begin Result := False; // Assume no match S := IntToStr(Sqr(I)) + IntToStr(Sqr(J)); // Build string If (S[3] <> S[6]) or (S[5] <> S[8]) then // Check the E's and N's Exit; // Exit if not matched S := S[1] + S[2] + S[3] + S[4] + S[5] + S[7]; // Remove dup E's and N's For K := 1 to Length(S) - 1 Do // Scan for dups For L := K + 1 to Length(S) Do If S[K] = S[L] then // If dup found Exit; // Exit Result := True; // Good match if this far End; Procedure TForm1.FindMatches; Var I, J, A, B : Byte; Begin For I := 34 to 89 do Begin A := I div 10; B := I mod 10; // Get digits If A <> B then // Can't work if equal Begin J := A + (B * 10); // Transpose digits If Match(I,J) then // Check for match Memo1.Lines.Add( 'VIER = ' + IntToStr(Sqr(I)) + ' NEUN = ' + IntToStr(Sqr(J)) + ' (' + IntToStr(I) + ',' + IntToStr(J) + ')'); End; End; End; procedure TForm1.Button1Click(Sender: TObject); begin FindMatches; end; end. Jeff. From icon-group-sender Mon Mar 12 12:43:04 2001 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id f2CJgiY18384 for icon-group-addresses; Mon, 12 Mar 2001 12:42:44 -0700 (MST) Message-Id: <200103121942.f2CJgiY18384@baskerville.CS.Arizona.EDU> Date: Mon, 12 Mar 2001 10:35:58 -0600 From: gep2@terabites.com Subject: Re: New Scientist Puzzle To: icon-group@cs.arizona.edu Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 2911 Several things I don't understand about your solution in Delphi. 1) Why do you only loop to 89 and not 99? 2) What's with the A<>B thing? 3) I don't see where/if your solution addresses the "uniquely identifies" constraint. 4) Why do you only check I & J values that are digit-wise mirror images of each other? That doesn't look 'right', either. Can you explain? <---- Begin Forwarded Message ----> Return-Path: From: jwormsley@debitek.com (Jeffrey A. Wormsley) Subject: Re: New Scientist Puzzle Date: Mon, 12 Mar 2001 15:03:36 -0000 To: icon-group@CS.Arizona.EDU Can't help be throw a very verbose and fly right at it Delphi solution in... Certaily isn't 5 lines like the K solution, but then I can't read the K solution ;^). unit Main; interface uses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls; type TForm1 = class(TForm) Memo1: TMemo; Button1: TButton; procedure Button1Click(Sender: TObject); private { Private declarations } Function Match(I,J : Integer): Boolean; Procedure FindMatches; public { Public declarations } end; var Form1: TForm1; implementation {$R *.DFM} Function TForm1.Match(I,J : Integer): Boolean; Var S : String; K, L : Byte; Begin Result := False; // Assume no match S := IntToStr(Sqr(I)) + IntToStr(Sqr(J)); // Build string If (S[3] <> S[6]) or (S[5] <> S[8]) then // Check the E's and N's Exit; // Exit if not matched S := S[1] + S[2] + S[3] + S[4] + S[5] + S[7]; // Remove dup E's and N's For K := 1 to Length(S) - 1 Do // Scan for dups For L := K + 1 to Length(S) Do If S[K] = S[L] then // If dup found Exit; // Exit Result := True; // Good match if this far End; Procedure TForm1.FindMatches; Var I, J, A, B : Byte; Begin For I := 34 to 89 do Begin A := I div 10; B := I mod 10; // Get digits If A <> B then // Can't work if equal Begin J := A + (B * 10); // Transpose digits If Match(I,J) then // Check for match Memo1.Lines.Add( 'VIER = ' + IntToStr(Sqr(I)) + ' NEUN = ' + IntToStr(Sqr(J)) + ' (' + IntToStr(I) + ',' + IntToStr(J) + ')'); End; End; End; procedure TForm1.Button1Click(Sender: TObject); begin FindMatches; end; end. Jeff. <---- End Forwarded Message ----> Gordon Peterson http://personal.terabites.com/ Support the Anti-SPAM Amendment! Join at http://www.cauce.org/ 12/19/98: Partisan Republicans scornfully ignore the voters they "represent". 12/09/00: the date the Republican Party took down democracy in America. From icon-group-sender Tue Mar 20 16:41:05 2001 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id f2KNdbI04632 for icon-group-addresses; Tue, 20 Mar 2001 16:39:37 -0700 (MST) Message-Id: <200103202339.f2KNdbI04632@baskerville.CS.Arizona.EDU> From: "John Sampson" To: Subject: isort question Date: Tue, 20 Mar 2001 20:09:47 -0000 X-Priority: 3 X-MSMail-Priority: Normal X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 527 Hello - I am trying to understand the description of the library procedure isort, which I believe allows sorting according to criteria supplied by the user. My aim is to sort a list of strings according to the number of instances of a character in each string (using charcnt). I do not understand the role of the argument y to isort. A simple example might help - has anyone an example I can look at? Has anything been written about it, e.g. in Icon Analyst? Any advice would be much appreciated. Regards _John Sampson_ From icon-group-sender Tue Mar 20 17:11:34 2001 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id f2L0BOo05653 for icon-group-addresses; Tue, 20 Mar 2001 17:11:24 -0700 (MST) Message-Id: <200103210011.f2L0BOo05653@baskerville.CS.Arizona.EDU> Date: Tue, 20 Mar 2001 18:05:20 -0500 From: "Steve Graham" To: Subject: Einstein's Riddle Content-Disposition: inline X-MIME-Autoconverted: from quoted-printable to 8bit by baskerville.CS.Arizona.EDU id f2KN5f803888 Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 1483 My company originally posted this puzzle on an inhouse newsletter aimed at the MicroFocus COBOL programming staff. While I never saw a COBOL solution, I would be interested in an Icon/SNOBOL4/SPITBOL version. I would think that this kind of puzzle would be inherently easy in Icon, et al considering its backtracking mechanism. Steve === Einstein's Riddle Albert Einstein wrote this riddle this century [ed. 20th century]. He said 98% of the world could not solve it. There are 5 houses in 5 different colors. In each house lives a person with a different nationality. The 5 owners drink a certain type of beverage, smoke a certain brand of cigar, and keep a certain pet. No owners have the same pet, smoke the same brand of cigar or drink the same beverage. The question is: "Who owns the fish?" Hints: The Brit lives in the red house. The Sweed keeps dogs as pets. The Dane drinks tea. The green house is on the left of the white house. The green house's owner drinks coffee. The person who smokes Pall Mall rears birds. The owner of the yellow house smokes Dunhill. The man living in the center house drinks milk. The Norwegian lives in the first house. The man who smokes Blends lives next to the one who keeps cats. The man who keeps the horse lives next to the man who smokes Dunhill. The owner who smokes Bluemasters drinks beer. The German smokes Prince. The Norwegian lives next to the blue house. The man who smokes Blends has a neighbor who drinks water. From icon-group-sender Tue Apr 3 08:16:15 2001 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id f33FEhA13772 for icon-group-addresses; Tue, 3 Apr 2001 08:14:43 -0700 (MST) Message-Id: <200104031514.f33FEhA13772@baskerville.CS.Arizona.EDU> To: icon-group@cs.arizona.edu Cc: unicon-group@Egr.UNLV.EDU Subject: cheap monitoring and visualization book! :-) Date: Tue, 03 Apr 2001 00:29:35 -0700 From: Clinton L Jeffery Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 368 Wow, some copies of "Program Monitoring and Visualization", my book about Icon's monitoring facilities, are on sale for just over half price ($35) at www.powells.com in their Springer Physics & Computer book sale. This is probably a good price, unless you are on my "Free Copy if They Ever Ask" list, in which case you can do better. :-) Clint jeffery@cs.unlv.edu From icon-group-sender Wed Apr 11 09:11:24 2001 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id f3BG9rE01772 for icon-group-addresses; Wed, 11 Apr 2001 09:09:53 -0700 (MST) Message-Id: <200104111609.f3BG9rE01772@baskerville.CS.Arizona.EDU> Date: 11 Apr 2001 11:42:37 BST From: rjhare@ed.ac.uk Subject: Cyclic numbers To: icon-group@cs.arizona.edu Organisation: Edinburgh Parallel Computing Centre Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 606 I just received a message from a colleague: > 142857 is a cyclic number, the numbers of which always appear in the > same order but rotated around when multipled by any number from 1 to 6. > > 142857 * 2 = 285714 > 142857 * 3 = 428571 > 142857 * 4 = 571428 > 142857 * 5 = 714285 > 142857 * 6 = 857142 > > So can you find any more numbers like this? Is there a simple algorithm > for finding them or is this another good application for parallel > machines? I don't remember seeing this one in the Icon mailing list before - anyone got any ideas? Roger Hare Edinburgh Parallel Computing Centre From icon-group-sender Thu Apr 12 18:06:07 2001 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id f3D14gM10281 for icon-group-addresses; Thu, 12 Apr 2001 18:04:42 -0700 (MST) Message-Id: <200104130104.f3D14gM10281@baskerville.CS.Arizona.EDU> Date: Thu, 12 Apr 2001 16:47:11 -0400 (EDT) From: WHITSTON@ltu.edu Subject: Question on Sorting To: ICON-GROUP@cs.arizona.edu Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 380 To all: Last year there was an e-mail message containing the N^4 sort which I would like to use in my Data Structures class. I have mis-placed the message. Does anyone know where I could find the message (and this time I will save it multiple times...)? Thanks for you assistance in this matter Howard Whitston Adjunct Professor Lawrence Tech. University whitston@ltu.edu From icon-group-sender Mon Apr 16 08:24:59 2001 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id f3GFML223379 for icon-group-addresses; Mon, 16 Apr 2001 08:22:21 -0700 (MST) Message-Id: <200104161522.f3GFML223379@baskerville.CS.Arizona.EDU> Date: Mon, 16 Apr 2001 17:11:20 +1000 From: Kim Bastin X-Accept-Language: en,pl,cs X-Newsgroups: comp.lang.icon Subject: Winicon question X-Trace: 16 Apr 2001 18:45:03 +1000, ppp04.angel.comcen.com.au To: icon-group@cs.arizona.edu Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 741 Starting to play with the graphics facilities in Winicon - the MSoft Windows version of Icon. I managed to link the necessary library files anc produce a dialog box with OpenDialog. But either I am missing some important things, or there is some serious problem with the implementation, because in the editable line, none of the cursor keys are recognised. They all produce numbers - "3" or "4" - except Del which is treated as if it were Backspace. I tried adding $include "keysyms.icn", but this didn't help. Can anyone point me in the right direction? I have found Icon useful for writing various small routines which could equally well run under DOS, but I would like to try some more sophisticated interfacing. Thanks Kim Bastin From icon-group-sender Thu Apr 26 08:27:30 2001 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id f3QFOqU08842 for icon-group-addresses; Thu, 26 Apr 2001 08:24:52 -0700 (MST) Message-Id: <200104261524.f3QFOqU08842@baskerville.CS.Arizona.EDU> Date: Wed, 25 Apr 2001 18:55:31 -0500 From: gep2@terabites.com Subject: [ICON]Answer.... for someone else ;) To: icon-group@cs.arizona.edu Cc: Rafal.Sulejman@extern.oppenheim.de Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 5152 Passing along by request this interesting reply to the "rotating numbers" thread.... <---- Begin Forwarded Message ----> From: Rafal.Sulejman@extern.oppenheim.de To: gep2@terabites.com Subject: [ICON]Answer.... for someone else ;) Date: Wed, 25 Apr 2001 21:21:24 +0200 Hi, Greetings from Koeln/Germany. ;) It's for someone from icon-group@... AFAIK you're subscribed, too. Because I cannot [it's only beginning of my CANNOTS list ;((( ] subscribe (read:answer) using this address -- pls. fwd :) Few weeks ago on the icon-group someone wrote: > > >> 142857 is a cyclic number, the numbers of which always appear in the > > >> same order but rotated around when multipled by any number from 1 to 6. > > >> > > >> 142857 * 2 = 285714 > > >> 142857 * 3 = 428571 > > >> 142857 * 4 = 571428 > > >> 142857 * 5 = 714285 > > >> 142857 * 6 = 857142 > > >> > > >> So can you find any more numbers like this? Is there a simple algorithm > > >> for finding them or is this another good application for parallel > > >> machines? > > I forwarded this message to _other_ group (over 100 msg in thread!!!!!). One of the most relevant answers is: > > The reason this number has such magical properties is because it is the > > number (1/7) * 100_000. The fraction 1/7 has a repeating series of digits > > "142857". And, when you multiply this fraction by 2, 3, 4, ..., the > > digits appear in a shuffled order; thus, 142857 is just an employment of > > 1/7's magic. > > But this does not explain _why_ it happens. > E.g. why does it work with 1/7 and not with 1/3, 1/11, 1/13... ? > > To make the question more general: > Find all integers a, n with 1 < a < n such that the digits of the > fraction a/n are a rotation of the digits of the fraction 1/n. > > Examples: > (a,n) = (2,7), (3,7), ... , (6,7); (10,11); (3,13), (4,13), (9,13), ... > > I don't know how difficult is this question. > When you've solved it in base 10 you can try it in arbitrary base D. Sure! First I had to narrow down the problem a bit to make it manageable. Now that I know more, I suppose I could give it a wider shot, but I'm tired and underequipped, anyways. Task: find number-pairs D,n where for n applies: for every m in [1,n[, the period in numeric representation of m/n in base D is the period of 1/n with sufficient rotating shift. For example: 1/7 = 0.142857... 2/7 = 0. 285714... 3/7 = 0. 428571... And so on. So, obviously, one such (D,n) is (10,7). And now on the findings: Any 1/n whose numeric representation's period is n-1 digits in length is rotating. I also know that if there's no trailing sequence, that is, the period starts right after decimal (D'mal) point, then the complete rotation (all m/n) is only possible if the period is n-1 digits. And you can find rotating (D,n):s like this: For some (D,n), find smallest p for which it is true that: (D^p-1) % n = 0 [% is integer modulo, like in C] In other words, that (D^p-1) is divisible with n. Now, if p=n-1 then (D,n) is the rotating pair that we were looking for. That much I could prove so far. On the hunches department: All n, regardless of D, that I could find, are primes. If it's true that (D^(n-1)-1) % n = 0 but n-1 is not the smallest power that executes that, then it's not completely rotating but it seems it /might/ be still rotating for some parts. Other way to find these numbers, likely more CPU-intensive (isn't there a builtin modulo instruction in x86 cpus or something?) but can handle much larger numbers: f(0)=1 f(x)=(D*f(x-1)) % n If the first value of f after x=0 is at n-1, then (D,n) is rotating. -- If my ranting is too confusing, I've attached a code to find for such pairs. Thank you for your disinterest, if someone would care for a proof, ask. It's amateurish and I've forgotten half of it, I'll probably forget the other half by tomorrow. -Kaatunut /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/ #include #include int main(int argc,char* argv[]) { char buff[400]; int Dm,DM,nm,nM; int D,n; printf("D search range start? "); fgets(buff,400,stdin); Dm=strtol(buff,NULL,0); printf("D end (-1 for endless)? "); fgets(buff,400,stdin); DM=strtol(buff,NULL,0); printf("n start? "); fgets(buff,400,stdin); nm=strtol(buff,NULL,0); printf("n end (-1 for endless)? "); fgets(buff,400,stdin); nM=strtol(buff,NULL,0); for (D=Dm;DM==-1 || D<=DM;++D) for (n=nm;nM==-1 || n <---- End Forwarded Message ----> Gordon Peterson http://personal.terabites.com/ Support the Anti-SPAM Amendment! Join at http://www.cauce.org/ 12/19/98: Partisan Republicans scornfully ignore the voters they "represent". 12/09/00: the date the Republican Party took down democracy in America. From icon-group-sender Wed May 16 07:33:38 2001 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id f4GEWOk07908 for icon-group-addresses; Wed, 16 May 2001 07:32:24 -0700 (MST) Message-Id: <200105161432.f4GEWOk07908@baskerville.CS.Arizona.EDU> Date: Tue, 15 May 2001 21:35:37 -0700 (US Mountain Standard Time) From: Andrew Carr To: Icon Group Mailing List Subject: Question about entering text/password X-X-Sender: acarr@deimos.email.arizona.edu Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 559 Good Morning, I am trying to write a program that requires a password, now I have been able to read the password from input but it echoes to the screen as plain text. For example: username: Foo password: Bar What I want to do is either: password: *** -or- password: Much like Unix in the last case. Right now I'm just reading the field with a password := read() command, I'm pretty sure that someone would know how to do it. Thank you -- -- Andrew Carr acarr@email.arizona.edu *** NEW EMAIL ADDRESS!!!! *** AIM: Andyrew480 ICQ: 3100804 From icon-group-sender Fri May 18 16:28:41 2001 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id f4INRMg16724 for icon-group-addresses; Fri, 18 May 2001 16:27:22 -0700 (MST) Message-Id: <200105182327.f4INRMg16724@baskerville.CS.Arizona.EDU> From: Chris.D.Tenaglia@jci.com Subject: Re: Question about entering text/password To: acarr@email.arizona.edu Cc: icon-group@cs.arizona.edu Date: Fri, 18 May 2001 15:11:41 -0500 X-MIMETrack: Serialize by Router on jwimkrs1.na.jci.com/NA/Johnson_Controls(Release 5.0.6a |January 17, 2001) at 05/18/2001 03:27:36 PM Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 2137 Here's a code snipit I did on DOS Icon. kbhit and getch do not behave the same on all platforms. They work good on solaris and tru-64, but not on hp-ux. ------------------------------------------------------------------------------ Chris Tenaglia, technical analyst, Johnson Controls ____________________________________________ procedure main() username := input("Username:") password := "" writes("Password:") until kbhit() do { press := getch() if press == "\r" then break writes("*") password ||:= press } write("\n\nThe password was ",image(password)) end procedure input(prompt) writes(prompt) return read() end acarr@email.a rizona.edu To: icon-group@CS.Arizona.EDU cc: 05/15/01 Subject: Question about entering text/password 11:35 PM Good Morning, I am trying to write a program that requires a password, now I have been able to read the password from input but it echoes to the screen as plain text. For example: username: Foo password: Bar What I want to do is either: password: *** -or- password: Much like Unix in the last case. Right now I'm just reading the field with a password := read() command, I'm pretty sure that someone would know how to do it. Thank you -- -- Andrew Carr acarr@email.arizona.edu *** NEW EMAIL ADDRESS!!!! *** AIM: Andyrew480 ICQ: 3100804 From icon-group-sender Tue Jun 5 08:33:36 2001 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id f55FUd603178 for icon-group-addresses; Tue, 5 Jun 2001 08:30:39 -0700 (MST) Message-Id: <200106051530.f55FUd603178@baskerville.CS.Arizona.EDU> From: "John Sampson" To: Subject: [Icon-Group] Funny result with strings Date: Tue, 5 Jun 2001 14:57:28 +0100 X-Priority: 3 X-MSMail-Priority: Normal X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 501 Hello - I have been trying out split.icn, a procedure contributed by Hamish Lawson in 1996, which converts a string into a list using a cset of characters as delimiter. I have found that it will not work if the French colon ('|') is the delimiter, although with other characters it will work. I cannot see anything in the code to explain this. Are there characters that have special functions if they are within strings? I tried '\|' instead of '|' but this did not work. Regards _John Sampson_ From icon-group-sender Wed Jun 6 12:28:49 2001 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id f56JROA14730 for icon-group-addresses; Wed, 6 Jun 2001 12:27:24 -0700 (MST) Message-Id: <200106061927.f56JROA14730@baskerville.CS.Arizona.EDU> From: Chris.D.Tenaglia@jci.com Subject: Re: [Icon-Group] Funny result with strings To: jsampson@indexes.u-net.com Cc: icon-group@cs.arizona.edu Date: Wed, 6 Jun 2001 09:59:20 -0500 X-MIMETrack: Serialize by Router on jwimkrs1.na.jci.com/NA/Johnson_Controls(Release 5.0.6a |January 17, 2001) at 06/06/2001 10:15:22 AM Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 1789 Greetings, I've been using this procedure since the 1980's with no problems. It's my favorite and most used procedure. # # parse a string into a list with respect to a delimiter # procedure parse(line,delims) static chars chars := &cset -- delims tokens := [] line ? while tab(upto(chars)) do put(tokens,tab(many(chars))) return tokens end jsampson@indexes .u-net.com To: icon-group@CS.Arizona.EDU cc: 06/05/01 08:57 Subject: [Icon-Group] Funny result with strings AM Hello - I have been trying out split.icn, a procedure contributed by Hamish Lawson in 1996, which converts a string into a list using a cset of characters as delimiter. I have found that it will not work if the French colon ('|') is the delimiter, although with other characters it will work. I cannot see anything in the code to explain this. Are there characters that have special functions if they are within strings? I tried '\|' instead of '|' but this did not work. Regards _John Sampson_ From icon-group-sender Wed Jun 6 12:36:05 2001 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id f56JZvE15012 for icon-group-addresses; Wed, 6 Jun 2001 12:35:57 -0700 (MST) Message-Id: <200106061935.f56JZvE15012@baskerville.CS.Arizona.EDU> Date: Wed, 6 Jun 2001 11:34:53 -0700 (MST) From: Gregg Townsend To: icon-group@cs.arizona.edu, jsampson@indexes.u-net.com Subject: Re: [Icon-Group] Funny result with strings Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 845 > From icon-group-sender@CS.Arizona.EDU Tue Jun 5 08:34:09 2001 > > I have been trying out split.icn, a procedure contributed by Hamish Lawson > in 1996, which converts a string into a list using a cset of characters as > delimiter. I'm not acquainted with that code, so I can't answer questions about it. You might check out the Icon program library; the procedure words(), in the "strings" package, provides a similar facility: http://www.cs.arizona.edu/icon/library/procs/strings.htm Words() generates its results, but you could use it to build a list if that's what you need: every put(L := [], words(s)) --------------------------------------------------------------------------- Gregg Townsend Staff Scientist The University of Arizona gmt@cs.arizona.edu Computer Science Tucson, Arizona, USA From icon-group-sender Wed Jun 6 16:37:20 2001 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id f56NawM23962 for icon-group-addresses; Wed, 6 Jun 2001 16:36:58 -0700 (MST) Message-Id: <200106062336.f56NawM23962@baskerville.CS.Arizona.EDU> From: "John Sampson" To: Subject: Re: [Icon-Group] Funny result with strings Date: Wed, 6 Jun 2001 22:54:23 +0100 X-Priority: 3 X-MSMail-Priority: Normal X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 1431 Hello - Thanks for the advice. Further to my previous, I tried passing a string to Steve Hunter's procedure in the same way as I was passing it to 'split' in my original program (see code below). Here I have used '$' as the delimiter, and changed the procedure code accordingly. It works. Putting the French colon '|' back instead of '$', I find that the same thing happens with 'tug' as with 'split'. The problem, as suggested, must lie with DOS rather than Icon - it arises when the string is read from standard input, i.e. from the DOS prompt from Windows 95. DOS sabotages French colons. In that case I assume it won't matter how making a list is done in Icon - the same problem will arise. The only cure is to change the delimiter or change the operating system. Regards _John Sampson_ #------------------ procedure main() s := read() fr_colon(s) end procedure fr_colon(arg_l) local l arg_l ? every put(l:=[], tug(~'$')) # Steve Hunter's calling procedure changed \/write(!l) end #`tug' stands for: tab(upto()) and generate-cs-spans. # On exhaustion, |&pos| is restored to the on-call value, but, this # still doesn't # qualify as a true matching-expression, because |tug|() doesn't return # the entire # contiguous span between the on-entry |&pos| and (each) post-eval # |&pos|. procedure tug(cs) # Written by Steve Hunter local Li cs := cset(cs) suspend tab(|(upto(cs,,Li)\1)) & tab(Li := many(cs)) end From icon-group-sender Tue Jun 12 16:31:12 2001 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id f5CNTLg04809 for icon-group-addresses; Tue, 12 Jun 2001 16:29:21 -0700 (MST) Message-Id: <200106122329.f5CNTLg04809@baskerville.CS.Arizona.EDU> Date: Tue, 12 Jun 2001 15:00:58 -0700 (MST) From: Gregg Townsend To: icon-group Subject: Announcing version 9.4 of Icon Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 610 Version 9.4.0 of Icon is now available for Unix systems. This version incorporates an updated Icon program library and searches it automatically when linking Icon programs. The Version 9.4.0 library is also available separately for use with Icon 9.3.2 for Windows, which remains current, or with other versions of Icon. For more information, see http://www.cs.arizona.edu/icon/v940/ --------------------------------------------------------------------------- Gregg Townsend Staff Scientist The University of Arizona gmt@cs.arizona.edu Computer Science Tucson, Arizona, USA From icon-group-sender Thu Jun 14 12:32:00 2001 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id f5EJUgk22886 for icon-group-addresses; Thu, 14 Jun 2001 12:30:42 -0700 (MST) Message-Id: <200106141930.f5EJUgk22886@baskerville.CS.Arizona.EDU> From: Maria Koutsikou X-Newsgroups: comp.lang.icon Subject: help help help Date: Thu, 14 Jun 2001 14:44:26 +0100 X-Complaints-To: news@uea.ac.uk X-Accept-Language: en To: icon-group@cs.arizona.edu Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 347 I am not sure if this is going to the right group or not, but I have a question, which I am sure to some of you will seem really silly. I am reading in a text file and converting the string of numbers into a string of integers. My only problems is that I can not read in the next line. It gets stuck at the first line. Can anyone help with this? From icon-group-sender Mon Jun 18 08:22:16 2001 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id f5IFKbM17638 for icon-group-addresses; Mon, 18 Jun 2001 08:20:37 -0700 (MST) Message-Id: <200106181520.f5IFKbM17638@baskerville.CS.Arizona.EDU> From: deborah_fairwater@hotmail.com (Deborah Fairwater) X-Newsgroups: comp.lang.icon Subject: code needed! Date: Sat, 16 Jun 2001 21:53:04 +0100 X-Complaints-To: abuse@ntlworld.com To: icon-group@cs.arizona.edu Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 160 Help - I need the icon code that will look at an input text file and replace single spaces between sentences with double spaces - can anyone help? Thank you. From icon-group-sender Tue Jun 19 07:42:51 2001 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id f5JEeOE05083 for icon-group-addresses; Tue, 19 Jun 2001 07:40:24 -0700 (MST) Message-Id: <200106191440.f5JEeOE05083@baskerville.CS.Arizona.EDU> Date: Mon, 18 Jun 2001 20:09:28 -0400 From: ptho X-Accept-Language: en To: Deborah Fairwater CC: icon-group@cs.arizona.edu Subject: Re: code needed! Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 657 Hmmm. That depends on what your document looks like. Otherwise, try the sentence identifiers in the Icon Programming Library and the string replacement procedures in the strings.icn file in the same place. But for a retake on sanity: I usually have the opposite problem as variable-width fonts don't display double spaces well and it doesn't matter at all if the double spaces are displayed in a browser--so why go back to a dropped practice? Phillip Thomas Deborah Fairwater wrote: > Help - I need the icon code that will look at an input text file and > replace single spaces between sentences with double spaces - can anyone > help? > > Thank you. From icon-group-sender Tue Jun 19 07:44:54 2001 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id f5JEido06712 for icon-group-addresses; Tue, 19 Jun 2001 07:44:39 -0700 (MST) Message-Id: <200106191444.f5JEido06712@baskerville.CS.Arizona.EDU> From: Chris.D.Tenaglia@jci.com Subject: Re: code needed! To: deborah_fairwater@hotmail.com Cc: icon-group@cs.arizona.edu Date: Tue, 19 Jun 2001 09:10:02 -0500 X-MIMETrack: Serialize by Router on jwimkrs1.na.jci.com/NA/Johnson_Controls(Release 5.0.6a |January 17, 2001) at 06/19/2001 09:27:18 AM Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 1556 # # file : padsent.icn # desc : add extra space to end of each sentence # use : padsent outfile # procedure main() while line := read() do { work := reverse(line) text := "" every i := 1 to *work do { text ||:= work[i] if (work[i] == " ") & (work[i+1] == ".") then text ||:= " " if (work[i] == " ") & (work[i+1] == "?") then text ||:= " " if (work[i] == " ") & (work[i+1] == "!") then text ||:= " " } write(reverse(text)) } end deborah_fairwater@h otmail.com To: icon-group@CS.Arizona.EDU cc: 06/16/01 03:53 PM Subject: code needed! Help - I need the icon code that will look at an input text file and replace single spaces between sentences with double spaces - can anyone help? Thank you. From icon-group-sender Tue Jun 19 13:15:51 2001 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id f5JKDd612699 for icon-group-addresses; Tue, 19 Jun 2001 13:13:39 -0700 (MST) Message-Id: <200106192013.f5JKDd612699@baskerville.CS.Arizona.EDU> Date: Tue, 19 Jun 2001 08:24:44 -0700 From: Steve Wampler X-Accept-Language: en To: deborah_fairwater@hotmail.com CC: icon-group@cs.arizona.edu Subject: Re: code needed! Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 1912 Chris.D.Tenaglia@jci.com wrote: > > # > # file : padsent.icn > # desc : add extra space to end of each sentence > # use : padsent outfile > # > procedure main() > > while line := read() do > { > work := reverse(line) > text := "" > every i := 1 to *work do > { > text ||:= work[i] > if (work[i] == " ") & (work[i+1] == ".") then text ||:= " " > if (work[i] == " ") & (work[i+1] == "?") then text ||:= " " > if (work[i] == " ") & (work[i+1] == "!") then text ||:= " " Just to show an alternative formulation, the above three lines lines could also be written as: if work[i+:2] == (" ." | " ?" | " !") then text ||:= " " But a full-up string scanning solution might be useful and wouldn't need the string reversals: # Danger, Will Robinson - untested code follows! procedure main() every write(repair(!&input)) end procedure repair(line, sentenceEnders) # setup default sentence-ending punctuation if 2nd argument is missing /sentenceEnders := '.?!' s := "" line ? { while s ||:= tab(upto(sentenceEnders)) || move(1) do { # Don't add a second blank if it's already there s ||:= =" " || (=" " | " ") } s ||:= tab(0) } return s end > } > write(reverse(text)) > } > end > > > deborah_fairwater@h > otmail.com To: icon-group@CS.Arizona.EDU > cc: > 06/16/01 03:53 PM Subject: code needed! > > > > Help - I need the icon code that will look at an input text file and > replace single spaces between sentences with double spaces - can anyone > help? > > Thank you. -- Steve Wampler- SOLIS Project, National Solar Observatory swampler@noao.edu From icon-group-sender Tue Jul 3 13:37:30 2001 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id f63KY0s05063 for icon-group-addresses; Tue, 3 Jul 2001 13:34:00 -0700 (MST) Message-Id: <200107032034.f63KY0s05063@baskerville.CS.Arizona.EDU> From: Art Eschenlauer To: "'icon-group@CS.Arizona.EDU'" Subject: Software testing for Icon? Date: Mon, 25 Jun 2001 11:33:50 -0500 Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 718 One concern that I expect people to raise with respect to using Icon in the "mainstream" is, "Icon cannot be trusted because it does not typecheck arguments at compile time. How can you protect against programmer errors in the arguments passed during infrequently-executed invocations?" I don't think that the response (however true) that C++ has compile-time type-checking and yet still is notorious for null pointer errors, etc, will convince anybody. This raises two questions in my mind regarding Icon: 1. Should one adopt a "defensive programming style", always checking the arguments passed to each routine? 2. What work has been done on developing rigorous software-testing methodology for Icon programs? From icon-group-sender Tue Jul 3 13:49:54 2001 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id f63KnoQ05408 for icon-group-addresses; Tue, 3 Jul 2001 13:49:50 -0700 (MST) Message-Id: <200107032049.f63KnoQ05408@baskerville.CS.Arizona.EDU> Date: Tue, 03 Jul 2001 10:10:09 +1000 From: dodod X-Accept-Language: en X-Newsgroups: comp.lang.icon Subject: Examples ? To: icon-group@cs.arizona.edu Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 220 i just started studying the examples comming with icon 9.3 i would like to find more examples showing how icon can interact with ms-dos (e.g to set/read environment variables, list processing, etc) Could anyone help ? From icon-group-sender Tue Jul 3 13:50:40 2001 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id f63KobY05483 for icon-group-addresses; Tue, 3 Jul 2001 13:50:37 -0700 (MST) Message-Id: <200107032050.f63KobY05483@baskerville.CS.Arizona.EDU> From: Maria Koutsikou X-Newsgroups: comp.lang.icon Subject: Why is this an invalid expression???? Date: Tue, 03 Jul 2001 11:35:23 +0100 X-Complaints-To: news@uea.ac.uk X-Accept-Language: en To: icon-group@cs.arizona.edu Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 1201 I was typing out the following procedure, to call in the main procedure, but when I compiled it, I got an error message saying : "end" : invalid expression (indicating the line where the following procedure ends). Since when is an "end" at the end of a procedure an invalid expression? Can anyone tell me what I'm doing wrong? procedure ivs(j, k, m) numbers := [1, 2, 3, 4, 5, -3, -15] lista := [] listb := [] listc := [] listd := [] inv := [] n := (*numbers) i := 1 every i := 1 to j-1 do { temp := write(numbers[i]) put(lista,temp) i +:= 1 every write(!lista) { every i := k+1 to m do { tempb := write(numbers[i]) put(listb,tempb) i +:= 1 every write(!listb) } every i := j+1 to k do { tempc := write(numbers[i]) put(listc,tempc) i +:=1 every write(!listc) } every i := m+1 to n do{ tempd := write(numbers[i]) put(listd,tempd) i +:=1 every write(!listd) } j := (*listc - 1) while (i >=1) do { put(inv,listc[j]) j -:= 1 } invsft := lista ||| listb ||| inv ||| listd return invsft end -- Maria Koutsikou University of East Anglia School of Information Systems Bioinformatics Lab Ext. 2602 From icon-group-sender Tue Jul 3 13:50:57 2001 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id f63KosM05505 for icon-group-addresses; Tue, 3 Jul 2001 13:50:54 -0700 (MST) Message-Id: <200107032050.f63KosM05505@baskerville.CS.Arizona.EDU> Date: Tue, 03 Jul 2001 21:10:32 +1000 From: Kim Bastin X-Accept-Language: en,pl,cs X-Newsgroups: comp.lang.icon Subject: Re: Why is this an invalid expression???? To: icon-group@cs.arizona.edu Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 1064 Maria Koutsikou wrote: > > I was typing out the following procedure, to call in the main procedure, > but when I compiled it, I got an error message saying : "end" : invalid > expression (indicating the line where the following procedure ends). > Since when is an "end" at the end of a procedure an invalid expression? > Can anyone tell me what I'm doing wrong? > > procedure ivs(j, k, m) > > numbers := [1, 2, 3, 4, 5, -3, -15] > lista := [] > listb := [] > listc := [] > listd := [] > inv := [] > n := (*numbers) > i := 1 > every i := 1 to j-1 do { > temp := write(numbers[i]) > put(lista,temp) > i +:= 1 > every write(!lista) > { ^ The problem is here. You meant to type "}". The usual cause of an error with "end" is unbalanced brackets. (I haven't inspected the rest of the code, so I don't know if there are any other problems.) Kim Bastin From icon-group-sender Tue Jul 3 13:51:13 2001 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id f63Kp4M05527 for icon-group-addresses; Tue, 3 Jul 2001 13:51:04 -0700 (MST) Message-Id: <200107032051.f63Kp4M05527@baskerville.CS.Arizona.EDU> From: "cactuspad53" To: Subject: Help Date: Tue, 3 Jul 2001 08:06:54 -0700 Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 379 I can't get icon to print my source code or to print anything to my = printer. I have a Compaq Presario, AMD Athlon 500 processor connected to an HP = 712C printer. Even the foloiwng code does nothing: procedure main( ) p :=3D open( "PRN", "w") write( p, "hello" ) close(p) end Is there a setup required to get icon to recognize the printer? Thank you, Jim De Leo From icon-group-sender Tue Jul 3 13:51:34 2001 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id f63KpNw05551 for icon-group-addresses; Tue, 3 Jul 2001 13:51:23 -0700 (MST) Message-Id: <200107032051.f63KpNw05551@baskerville.CS.Arizona.EDU> From: Damien Doligez X-Newsgroups: comp.programming,comp.lang.apl,comp.lang.c,comp.lang.c++,comp.lang.dylan,comp.lang.eiffel,comp.lang.forth,comp.lang.functional,comp.lang.icon,comp.lang.lisp,comp.lang.misc,comp.lang.modula2,comp.lang.modula3,comp.lang.oberon,comp.lang.objective-c,comp.lang.perl.misc,comp.lang.prolog,comp.lang.python,comp.lang.sather,comp.lang.scheme,comp.lang.smalltalk,comp.lang.tcl Subject: Announce: ICFP programming contest Date: 3 Jul 2001 15:37:49 GMT X-Complaints-To: usenet@inria.fr To: icon-group@cs.arizona.edu Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 1595 We are pleased to announce: The Fourth Annual ICFP PROGRAMMING CONTEST July 26-29, 2001 http://cristal.inria.fr/ICFP2001/prog-contest/ Convinced your favorite programming language provides unbeatable productivity? Convinced you and your friends are world-class programmers? If so, we're providing you the opportunity to prove it! We are pleased to announce the Fourth Annual ICFP Programming Contest to be held in conjunction with the 2001 International Conference on Functional Programming (ICFP 2001). All programmers are invited to enter the contest, either individually or in teams; we especially encourage students to enter. You may use any programming language (or combination of languages) to show your skill. On Thursday, July 26, 2001 at 15:00 UTC, we will publish a challenge task on the Web site and by e-mail to registered participants. Teams will have until Sunday, 29 July 2001, 15:00 UTC (72 hours) to implement a program to perform this task and submit it to the contest judges. We've designed the contest for direct, head-to-head comparison of language technology and programming skill. We have a range of prizes for the winners: cash awards, special student prizes, and, of course, unlimited bragging rights. For more information about the contest, prizes, and registration, point your browser to: http://cristal.inria.fr/ICFP2001/prog-contest/ For more information about ICFP 2001, see: http://cristal.inria.fr/ICFP2001/ -- Damien Doligez, Luc Maranget, Pierre Weis From icon-group-sender Thu Jul 5 08:57:06 2001 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id f65FttA19157 for icon-group-addresses; Thu, 5 Jul 2001 08:55:55 -0700 (MST) Message-Id: <200107051555.f65FttA19157@baskerville.CS.Arizona.EDU> Date: Tue, 03 Jul 2001 17:37:42 -0600 From: "Cheyenne Wills" To: icon-group@cs.arizona.edu Cc: "cactuspad53" X-Accept-Language: en Subject: Re: Help Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 724 What your problem is, is that PRN is the name of a file. PRN: (or LPT1:) is the MS-DOS name of the printer. So.. procedure main() p := open( "PRN:", "w") write( p, "Hello") end In fact MS-DOS has a whole bunch of device driver names that can be accessed via the dev: format. Cheyenne cactuspad53 wrote: > > I can't get icon to print my source code or to print anything to my = > printer. > I have a Compaq Presario, AMD Athlon 500 processor connected to an HP = > 712C printer. > Even the foloiwng code does nothing: > procedure main( ) > p :=3D open( "PRN", "w") > write( p, "hello" ) > close(p) > end > > Is there a setup required to get icon to recognize the printer? > Thank you, > Jim De Leo From icon-group-sender Thu Jul 5 08:57:30 2001 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id f65FvRk19199 for icon-group-addresses; Thu, 5 Jul 2001 08:57:27 -0700 (MST) Message-Id: <200107051557.f65FvRk19199@baskerville.CS.Arizona.EDU> Date: Tue, 03 Jul 2001 17:44:12 -0600 From: "Cheyenne Wills" To: "'icon-group@CS.Arizona.EDU'" Cc: "Art Eschenlauer" X-Accept-Language: en Subject: Re: Software testing for Icon? Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 1443 There are many other types of languages that do not do compile time type checking (Rexx, Lisp, etc.) However there are ways of runtime checking procedure foobar(parm1) parm1 := integer(parm1) | stop("parm1 cannot be converted to an integer") return parm1 * 42 end Yes.. this is defensive programming and for anything that is critical, I would strongly suggest that defensive programming is the best bet (in fact I would say that in today's world the lack of defensive programming is what gets a lot of people into trouble, everything from buffer overruns to not checking the status of values returned to see the function worked or didn't). Cheyenne Art Eschenlauer wrote: > > One concern that I expect people to raise with respect to using Icon in the > "mainstream" is, "Icon cannot be trusted because it does not typecheck > arguments at compile time. How can you protect against programmer errors in > the arguments passed during infrequently-executed invocations?" I don't > think that the response (however true) that C++ has compile-time > type-checking and yet still is notorious for null pointer errors, etc, will > convince anybody. > > This raises two questions in my mind regarding Icon: > > 1. Should one adopt a "defensive programming style", always checking the > arguments passed to each routine? > > 2. What work has been done on developing rigorous software-testing > methodology for Icon programs? From icon-group-sender Thu Jul 5 08:57:41 2001 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id f65Fvbc19225 for icon-group-addresses; Thu, 5 Jul 2001 08:57:37 -0700 (MST) Message-Id: <200107051557.f65Fvbc19225@baskerville.CS.Arizona.EDU> Date: Wed, 04 Jul 2001 12:39:33 +1000 From: Kim Bastin X-Accept-Language: en,pl,cs X-Newsgroups: comp.lang.icon Subject: Re: Why is this an invalid expression???? To: icon-group@cs.arizona.edu Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 823 Andrew Hamm wrote: > > Maria Koutsikou wrote in message <3B419FEB.7E66DB07@sys.uea.ac.uk>... > >I was typing out the following procedure, to call in the main procedure, > >but when I compiled it, I got an error message saying : "end" : invalid > >expression (indicating the line where the following procedure ends). > >Since when is an "end" at the end of a procedure an invalid expression? > >Can anyone tell me what I'm doing wrong? > > > >[SNIP] > > Well spotted to Kim. I don't know if you program without indentation, or > whether it's merely your news reader program which killed off your > indentation. But if it's you, it's time to learn good indenting habits! I'm quite not sure what you mean. The code I responded to was certainly indented. It must be your newsreader that's killing the indents. Kim Bastin From icon-group-sender Thu Jul 5 08:57:57 2001 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id f65FvmY19261 for icon-group-addresses; Thu, 5 Jul 2001 08:57:48 -0700 (MST) Message-Id: <200107051557.f65FvmY19261@baskerville.CS.Arizona.EDU> Date: Wed, 04 Jul 2001 17:58:53 +1000 From: Kim Bastin X-Accept-Language: en,pl,cs X-Newsgroups: comp.lang.icon Subject: Re: Why is this an invalid expression???? To: icon-group@cs.arizona.edu Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 785 Andrew Hamm wrote: > > Kim Bastin wrote in message <3B4281E5.B4BA40DE@mel.comcen.com.au>... > >Andrew Hamm wrote: > > > >I'm quite not sure what you mean. The code I responded to was certainly > >indented. It must be your newsreader that's killing the indents. > > > hmm - it's never done that before???? How strange! I don't suppose you could > check whether it's by tab chars in this instance? > > I saw it all flattened to the left, and guessed that Maria must be making > life difficult for herself. My apologies, Maria. But the vi trick with % > does help you to catch your own missing braces and parenths... I don't see tab characters in Netscape, but the indents go by increments of 8 spaces, so I guess they could have been made with tab characters originally. Kim Bastin From icon-group-sender Thu Jul 5 08:58:19 2001 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id f65Fw7c19281 for icon-group-addresses; Thu, 5 Jul 2001 08:58:07 -0700 (MST) Message-Id: <200107051558.f65Fw7c19281@baskerville.CS.Arizona.EDU> Date: Wed, 4 Jul 2001 10:13:14 +0100 (BST) From: Hugh Sasse Staff Elec Eng X-Sender: hgs@neelix To: Art Eschenlauer cc: "'icon-group@CS.Arizona.EDU'" Subject: Re: Software testing for Icon? Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 1753 On Mon, 25 Jun 2001, Art Eschenlauer wrote: > One concern that I expect people to raise with respect to using Icon in the > "mainstream" is, "Icon cannot be trusted because it does not typecheck > arguments at compile time. How can you protect against programmer errors in > the arguments passed during infrequently-executed invocations?" I don't This assumes static typing. This often comes up on the Ruby-Talk list (See below http://www.ruby-lang.org/ for info on the mailing list, which can be searched from there.) I think this is true for other dynamic languages. It is argued that the flexibility is worth this particular cost, and also that development is speeded up because of not having to declare everything up front. No-one has cited studies to support this yet, though. > think that the response (however true) that C++ has compile-time > type-checking and yet still is notorious for null pointer errors, etc, will > convince anybody. > > This raises two questions in my mind regarding Icon: > > 1. Should one adopt a "defensive programming style", always checking the > arguments passed to each routine? The concept of "design by contract" may be useful, even if not implememted in the language. You agree to use my function subject to your providing the right args, and provided you do that I'll give you the correct results. If you don't provide the right args, then there is nothing in the contract that forces me to give you the right answer. It is a business model. > > 2. What work has been done on developing rigorous software-testing > methodology for Icon programs? I don't know. With Icon not being OO, I'm not sure if one can apply unit testing to it, but it has been done somehow in C, so maybe... > > Hugh From icon-group-sender Thu Jul 5 08:59:04 2001 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id f65Fwok19320 for icon-group-addresses; Thu, 5 Jul 2001 08:58:50 -0700 (MST) Message-Id: <200107051558.f65Fwok19320@baskerville.CS.Arizona.EDU> From: Chris.D.Tenaglia@jci.com Subject: Re: Help To: olfaceless@netzero.net Cc: icon-group@cs.arizona.edu Date: Thu, 5 Jul 2001 08:29:49 -0500 X-MIMETrack: Serialize by Router on jwimkrs1.na.jci.com/NA/Johnson_Controls(Release 5.0.6a |January 17, 2001) at 07/05/2001 08:52:00 AM Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 1619 I wrote such a DOS tool. I call mine lp.icn procedure main(param) printer := open("lpt1","w") file := open(param[1]) while line := read(file) do { write(printer,line) } # write(printer,"\f") if type(file) == "file" then close(file) close(printer) end Chris Tenaglia, technical analyst, Johnson Controls olfaceless@ne tzero.net To: icon-group@CS.Arizona.EDU cc: 07/03/01 Subject: Help 10:06 AM I can't get icon to print my source code or to print anything to my = printer. I have a Compaq Presario, AMD Athlon 500 processor connected to an HP = 712C printer. Even the foloiwng code does nothing: procedure main( ) p :=3D open( "PRN", "w") write( p, "hello" ) close(p) end Is there a setup required to get icon to recognize the printer? Thank you, Jim De Leo From icon-group-sender Thu Jul 5 08:59:40 2001 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id f65FxDw19347 for icon-group-addresses; Thu, 5 Jul 2001 08:59:13 -0700 (MST) Message-Id: <200107051559.f65FxDw19347@baskerville.CS.Arizona.EDU> From: Chris.D.Tenaglia@jci.com Subject: Re: Software testing for Icon? To: art.eschenlauer@sufsys.com Cc: icon-group@cs.arizona.edu Date: Thu, 5 Jul 2001 09:06:57 -0500 X-MIMETrack: Serialize by Router on jwimkrs1.na.jci.com/NA/Johnson_Controls(Release 5.0.6a |January 17, 2001) at 07/05/2001 09:25:08 AM Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 2353 This is probably because the variables are not typed. The data in the variables and the operation on the variables indicates the type. procedure example(arg1,arg2,arg3) arg1, arg2, and arg3 could be any type. The emphasis shifts from the compiler to programmer. But this issue has never surfaced in companies I've been at. Their usual anti-icon argument is that it's not supported by Sun, HP, or Compaq in our software support contracts. So we're locked into VMS DCL or Posix shell script. I can justify icon in rare cases when a scripting solution becomes huge and convoluted, or using Xwindows, or it implements much better with set() algorythms. Chris Tenaglia, technical analyst, Johnson Controls art.eschenlauer@ sufsys.com To: icon-group@CS.Arizona.EDU cc: 06/25/01 11:33 Subject: Software testing for Icon? AM One concern that I expect people to raise with respect to using Icon in the "mainstream" is, "Icon cannot be trusted because it does not typecheck arguments at compile time. How can you protect against programmer errors in the arguments passed during infrequently-executed invocations?" I don't think that the response (however true) that C++ has compile-time type-checking and yet still is notorious for null pointer errors, etc, will convince anybody. This raises two questions in my mind regarding Icon: 1. Should one adopt a "defensive programming style", always checking the arguments passed to each routine? 2. What work has been done on developing rigorous software-testing methodology for Icon programs? From icon-group-sender Fri Jul 6 09:39:50 2001 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id f66Gcbo19262 for icon-group-addresses; Fri, 6 Jul 2001 09:38:37 -0700 (MST) Message-Id: <200107061638.f66Gcbo19262@baskerville.CS.Arizona.EDU> Date: Fri, 6 Jul 2001 14:28:00 +1200 (NZST) From: "Richard A. O'Keefe" To: art.eschenlauer@sufsys.com, icon-group@cs.arizona.edu Subject: Re: Software testing for Icon? Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 4722 One concern that I expect people to raise with respect to using Icon in the "mainstream" is, "Icon cannot be trusted because it does not typecheck arguments at compile time." Neither does Perl. Doesn't seem to have slowed Perl down any. Neither do TCL, Python, Smalltalk, Scheme. For that matter, NEITHER DOES JAVA, practically speaking. In effect, any time you stuff something in a collection object, you lose all compile-time information about its type. All of these languages *do* type-check arguments at run-time. Oh yes, you can add Javascript and Visual Basic (some variables are type-checked at compile time, some are not.) If anyone tries that argument on you, ask them whether that stops them using Java or Visual Basic. There is another fairly major point, which is "what kind of type system are we comparing against?" For example, can it express the following constraint I actually used today in a design: data Tree k v = Leaf | Node k v (Tree k v) (Tree k v) size :: Tree k v -> Int size (Leaf) = 0 size (Node _ _ l r) = size l + size r well_ordered :: (Ord k) => Tree k v -> Bool well_ordered (Leaf) = True well_ordered (Node k _ l r) = well_ordered l && well_ordered r && all_less l && all_grtr r where all_less (Leaf) = True all_less (Node x _ l r) = x < k && all_less l && all_less r all_grtr (Leaf) = True all_grtr (Node x _ l r) = x > k && all_grtr l && all_grtr r well_shaped :: Tree k v -> Bool well_shaped (Node _ _ l r) = sl <= sr && sr <= sl + 1 where { sl = size l; sr = size r } well_shaped (Leaf) = True Now, here's the constraint I want: "type GoodTree k v = Tree k v SUCH THAT well_ordered && well_shaped" It so happens that the language (Haskell) that I've used above CAN'T express that constraint. You cannot express "is a size balanced binary search tree" in the type language. This kind of thing is EXTREMELY common. Part of your requirements can be expressed in the type system, but ONLY part. The fact that your program has got through the compiler's type checking is *N*O* guarantee that you will not get a *conceptual* type error at run time. It really is not a contest between "no type checking" (Icon) and "strong type checking" (C++, say), but subspaces of constraint space, where C++ (with ALL of its type checking) falls in the "unbelievably weak" part of constraint space. Your interlocutor might be tempted to say "well of COURSE the compiler doesn't type check class invariants, that's what modules and encapsulation are for", to which you reply "yes, that's why Icon has them." "How can you protect against programmer errors in the arguments passed during infrequently-executed invocations?" The question is "do you need to?" What is the evidence that the risk of such errors, for the kinds of applications you write, is high enough to spend any of your programming budget on? I don't think that the response (however true) that C++ has compile-time type-checking and yet still is notorious for null pointer errors, etc, will convince anybody. Especially as "type-STATE checking" (null-vs-non-null, for example) *could* be handled by well understood type-checking-like approaches. As a simple example, suppose that there were two families of types: T *x; possibly-null pointer to T T ^y; non-null pointer to T and that x = y; was always allowed, but y = x; would require an explicit run-time-checking cast Then you could define char ^strcpy(char ^dst, char const ^src) {...} This raises two questions in my mind regarding Icon: 1. Should one adopt a "defensive programming style", always checking the arguments passed to each routine? That's an economic question. Does the observed frequency of such errors in your code justify the development-time cost of writing such tests? What is the performance penalty of such tests? Don't forget, the REAL checks you need include checks for well-formedness of conceptual type, not just the things you might have checked in C++. The usual rule of thumb is "check on entry to module, not on module-internal calls", so even if you do decide to have such checks, you would by no means put them in every procedure. 2. What work has been done on developing rigorous software-testing methodology for Icon programs? The usual sort of path coverage stuff (which is very very hard to achieve anyway) is blown out of the water by exceptions, which add invisible paths all over the place. Icon backtracking does much the same thing. However, the notion of statement coverage is still pretty useful. From icon-group-sender Fri Jul 6 09:40:09 2001 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id f66Ge3k19325 for icon-group-addresses; Fri, 6 Jul 2001 09:40:04 -0700 (MST) Message-Id: <200107061640.f66Ge3k19325@baskerville.CS.Arizona.EDU> Date: Fri, 6 Jul 2001 16:38:32 +1200 (NZST) From: "Richard A. O'Keefe" To: art.eschenlauer@sufsys.com, hgs@dmu.ac.uk Subject: Re: Software testing for Icon? Cc: icon-group@cs.arizona.edu Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 752 Hugh Sasse Staff Elec Eng wrote: I don't know. With Icon not being OO, I'm not sure if one can apply unit testing to it, but it has been done somehow in C, so maybe... That's a strange comment. Unit testing has *nothing* to do with OO. People were unit-testing Fortran and COBOL long before OO was born in 1967. OO has been pretty disastrous for testing, because you _can't_ test code thoroughly. The next subclass to come along may wreck everything. (Except in Eiffel, if you're careful.) It is much much _easier_ to do unit testing in Icon than in C++ or Java. (Yes, I'm aware of CppUnit. I have it. It still falls foul of the fact that subclassing means that the code you tested is not the code your client is running.) From icon-group-sender Fri Jul 6 09:40:39 2001 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id f66GeYw19372 for icon-group-addresses; Fri, 6 Jul 2001 09:40:34 -0700 (MST) Message-Id: <200107061640.f66GeYw19372@baskerville.CS.Arizona.EDU> Date: Fri, 6 Jul 2001 11:00:37 +0100 (BST) From: Hugh Sasse Staff Elec Eng X-Sender: hgs@neelix To: "Richard A. O'Keefe" cc: art.eschenlauer@sufsys.com, icon-group@cs.arizona.edu Subject: Re: Software testing for Icon? Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 1446 On Fri, 6 Jul 2001, Richard A. O'Keefe wrote: > Hugh Sasse Staff Elec Eng wrote: > I don't know. With Icon not being OO, I'm not sure if one can apply > unit testing to it, but it has been done somehow in C, so maybe... > > That's a strange comment. Unit testing has *nothing* to do with OO. Oh. Once again I have "set DISPLAY_IGNORANCE=GLOBAL" :-). I have only come across unit testing through "eXtreme Programming", and in that case the "unit" is an object or class. > People were unit-testing Fortran and COBOL long before OO was born in 1967. So what was the "unit" in these cases? > > OO has been pretty disastrous for testing, because you _can't_ test code > thoroughly. The next subclass to come along may wreck everything. (Except > in Eiffel, if you're careful.) It is much much _easier_ to do unit testing > in Icon than in C++ or Java. (Yes, I'm aware of CppUnit. I have it. It > still falls foul of the fact that subclassing means that the code you tested > is not the code your client is running.) Where can I find more info about this? Inheritance can do subtle things, and I'd like to be more aware of this than I am. These remarks are intersting because part of the reason for the popularity of OO is the encapsulation of objects, which ought to make testing easier because of isolating errors. If interacting objects are held inside another object this can be scaled somewhat. > Hugh From icon-group-sender Mon Jul 9 08:45:41 2001 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id f69FhoI20335 for icon-group-addresses; Mon, 9 Jul 2001 08:43:50 -0700 (MST) Message-Id: <200107091543.f69FhoI20335@baskerville.CS.Arizona.EDU> Date: Sun, 8 Jul 2001 00:49:58 -0500 (CDT) From: John Paolillo To: icon-group@cs.arizona.edu Subject: Icon under XDarwin? Cc: paolillo@indiana.edu Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 1064 Dear Iconographers, Has anyone yet compiled Icon 9.4 to run under XDarwin? For those who may not know, this is the XFree86 port of X-windows for Darwin, the BSD 4.3 variant that Mac OS X runs on top of. XDarwin is now a standard part of the XFree86 distribution. One of our tech support people here did manage to compile Icon 9.4 without either co-expressions or X-windows support; this was before the XDarwin port was available and he is now quite busy on other tasks, so I can't really ask him to try to recompile it. I'd be happy to attempt it myself, and probably will at some point, but in my previous attempts I have found the business with coexpression support to be the major hangup in compiling Icon -- since the makefiles seem to expect an rswitch.X, where X = "c" | "s", and since they don't always seem to expect the same thing, I have found that I run into roadblocks on architectures like this that don't have a package yet. I'd be happy to accept any pointers anyone might suggest. John Paolillo ("here" = Indiana University, not UTA) From icon-group-sender Mon Jul 9 08:46:03 2001 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id f69FjvQ20423 for icon-group-addresses; Mon, 9 Jul 2001 08:45:57 -0700 (MST) Message-Id: <200107091545.f69FjvQ20423@baskerville.CS.Arizona.EDU> From: janpeter.deruiter@uni-koeln.de X-Newsgroups: comp.lang.icon Subject: emacs icon mode Date: Mon, 09 Jul 2001 11:53:30 +0200 X-Complaints-To: newsmgr@rrz.uni-koeln.de X-Accept-Language: en To: icon-group@cs.arizona.edu Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 114 Hi, Does anyone out there know of an icon-mode for Gnu Emacs including syntax coloring? Thanks in advance, JP From icon-group-sender Mon Jul 9 16:20:05 2001 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id f69NJcY02440 for icon-group-addresses; Mon, 9 Jul 2001 16:19:38 -0700 (MST) Message-Id: <200107092319.f69NJcY02440@baskerville.CS.Arizona.EDU> Date: Mon, 9 Jul 2001 08:58:19 -0700 (MST) From: Gregg Townsend To: icon-group@cs.arizona.edu, johnp@ling.uta.edu Cc: paolillo@indiana.edu Subject: Re: Icon under XDarwin? Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 688 > Date: Sun, 8 Jul 2001 00:49:58 -0500 (CDT) > From: John Paolillo > > Has anyone yet compiled Icon 9.4 to run under XDarwin?... > I have found the business with coexpression support to be > the major hangup in compiling Icon -- since the makefiles > seem to expect an rswitch.X,... You might try copying the rswitch.s file from the "ppc_aix" configuration. It should work *if* the assemblers and the calling sequences are compatible. --------------------------------------------------------------------------- Gregg Townsend Staff Scientist The University of Arizona gmt@cs.arizona.edu Computer Science Tucson, Arizona, USA From icon-group-sender Mon Jul 9 16:20:18 2001 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id f69NKBk02510 for icon-group-addresses; Mon, 9 Jul 2001 16:20:11 -0700 (MST) Message-Id: <200107092320.f69NKBk02510@baskerville.CS.Arizona.EDU> Date: Mon, 9 Jul 2001 09:03:18 -0700 (MST) From: Gregg Townsend To: icon-group@cs.arizona.edu, janpeter.deruiter@uni-koeln.de Subject: Re: emacs icon mode Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 394 There's an Icon mode for emacs in ftp://ftp.cs.arizona.edu/icon/contrib/emacs/iconmode.txt I don't know anything about it myself so I can't answer questions about it. --------------------------------------------------------------------------- Gregg Townsend Staff Scientist The University of Arizona gmt@cs.arizona.edu Computer Science Tucson, Arizona, USA From icon-group-sender Mon Jul 9 16:21:31 2001 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id f69NLTo02565 for icon-group-addresses; Mon, 9 Jul 2001 16:21:29 -0700 (MST) Message-Id: <200107092321.f69NLTo02565@baskerville.CS.Arizona.EDU> From: Doug Hockin X-Newsgroups: comp.lang.icon Subject: Re: emacs icon mode Date: 09 Jul 2001 18:36:52 GMT X-Accept-Language: en To: icon-group@cs.arizona.edu Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 255 The version of GNU emacs I have, 20.6, has a icon.el file in lisp/progmodes. It came with the standard source distribution but if you don't have it I could send it to you. I've never used it - it's been a long time since I programmed in Icon. -- Doug From icon-group-sender Tue Jul 10 07:29:05 2001 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id f6AES1M16895 for icon-group-addresses; Tue, 10 Jul 2001 07:28:01 -0700 (MST) Message-Id: <200107101428.f6AES1M16895@baskerville.CS.Arizona.EDU> To: Gregg Townsend cc: icon-group@cs.arizona.edu, janpeter.deruiter@uni-koeln.de, wgg@cs.ucsd.edu Subject: Re: emacs icon mode Date: Mon, 09 Jul 2001 17:05:51 -0700 From: William Griswold Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 522 When I launch GNU Emacs 20.6 with an Icon file, it comes up in Icon mode automatically. Looks pretty good. --bill >There's an Icon mode for emacs in > ftp://ftp.cs.arizona.edu/icon/contrib/emacs/iconmode.txt > >I don't know anything about it myself so I can't answer questions >about it. > > --------------------------------------------------------------------------- > Gregg Townsend Staff Scientist The University of Arizona > gmt@cs.arizona.edu Computer Science Tucson, Arizona, USA > From icon-group-sender Wed Jul 11 08:44:59 2001 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id f6BFhlo17444 for icon-group-addresses; Wed, 11 Jul 2001 08:43:47 -0700 (MST) Message-Id: <200107111543.f6BFhlo17444@baskerville.CS.Arizona.EDU> From: icon-project@cs.arizona.edu X-Newsgroups: comp.lang.icon,comp.answers,news.answers Subject: Icon Programming Language FAQ Date: 10 Jul 2001 17:09:39 -0700 To: icon-group@cs.arizona.edu Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 13617 Archive-name: comp-lang-icon-faq Posting-Frequency: monthly Frequently Asked Questions about the Icon programming language http://www.cs.arizona.edu/icon/faq.htm Last updated June 12, 2001. Learning about Icon A1. What is Icon? A2. What is Icon good for? A3. What is the Icon program library? A4. Where can I learn more about Icon? A5. How about comprehensive documentation? Implementations B1. What platforms support Icon? B2. How do I get started with Icon? B3. Is there a Unicode version of Icon? B4. What happened to the compiler? Administration C1. What is the Icon Project? C2. How often is the on-line material updated? C3. Where did Icon come from? C4. Where is Icon going? Support D1. Is there a users' group for Icon? D2. How do I get technical support? Programming E1. Why doesn't read() work with every? E2. Why doesn't string invocation such as "foo"() work? E3. How can I call a C function? E4. Can I open a bidirectional pipe? _________________________________________________________________ Learning about Icon A1. What is Icon? Icon is a very high level general-purpose programming language with extensive features for processing strings (text) and data structures. Icon is an imperative, procedural language with a syntax that is reminiscent of C and Pascal, but with semantics at a much higher level. Icon has a novel expression-evaluation mechanism that integrates goal-directed evaluation and backtracking with conventional control structures. It has a string scanning facility for pattern matching that avoids the tedious details usually associated with analyzing strings. Icon's built-in data structures include sets and tables with associative lookup, lists that can be used as vectors or stacks and queues, and records. Icon is a strongly, though not statically, typed language. It provides transparent automatic type conversion: For example, if an integer is used in an operation that requires a string, the integer is automatically converted to a string. Several implementations of Icon have high-level graphics facilities with an easily programmed window interface. Icon manages storage automatically. Objects are created as needed during program execution and space is reclaimed by garbage collection as needed. The sizes of strings and data structures are limited only by the amount of available memory. A2. What is Icon good for? As a general-purpose programming language with a large computational repertoire, Icon can be used for most programming tasks. It's especially strong at building software tools, for processing text, and for experimental and research applications. Icon is designed to make programming easy; it emphasizes the value of programmer's time and the importance of getting programs to work quickly. Consequently, Icon is used both for short, one-shot tasks and for very complex applications. A3. What is the Icon program library? The library is a collection of programs and procedures written in Icon. User contributions are welcome and form a significant portion of the library. Library procedures effectively augment the built-in functions available to an Icon program. A wide variety of procedures currently exists, and most graphically-based programs are built around library procedures. The programs in the library range from simple demonstrations to handy tools to complex graphical applications. The library is a resource for both new and experienced programmers. In addition to their basic utility, its programs and procedures serve as examples of how things can be written in Icon. A4. Where can I learn more about Icon? Here are some good places to start. * Ralph Griswold's overview: http://www.cs.arizona.edu/icon/docs/ipd266.htm * Dave Hanson's introduction: http://www.cs.arizona.edu/icon/intro.htm * John Shipman's tutorial: http://www.nmt.edu/tcc/help/lang/icon/ A5. How about comprehensive documentation? The definitive work is The Icon Programming Language (third edition) by Griswold and Griswold (Peer-to-Peer Communications, 1996). It contains both tutorial and reference material. Graphics facilities are described in Graphics Programming in Icon by Griswold, Jeffery, and Townsend (Peer-to-Peer Communications, 1998). Again, both tutorial and reference material is included. Icon's internals are detailed in The Implementation of the Icon Programming Language by Griswold and Griswold (Princeton, 1986). Remaining copies are available from The Icon Project. Although considerable changes have occurred since Version 6, described in the book, the basic structure is the same, and technical reports describing recent implementation changes are included. The Icon Programming Language Handbook, by Thomas W. Christopher, is available on the web at http://www.toolsofcomputing.com/IconHandbook/. There is a large amount of additional information at the Icon web site, http://www.cs.arizona.edu/icon, but there is no complete on-line documentation. _________________________________________________________________ Implementations B1. What platforms support Icon? Current implementations with graphics support are available for Unix and Windows. Somewhat older versions, without graphics, are available for the Macintosh and other systems. Jcon, an alternative Java-based implementation for Unix, is also available. These Icon implementations were developed at the University of Arizona, with significant contributions from volunteers around the world. B2. How do I get started with Icon? Version 9.4 of Icon for Unix can be downloaded from http://www.cs.arizona.edu/icon/v940/. Source and binary packages are available, each with the complete Icon program library. Version 9.3 of Icon for Windows is compatible at the source level with version 9.4. It can be downloaded from http://www.cs.arizona.edu/icon/v93w.htm. The Version 9.4 library can be obtained separately from http://www.cs.arizona.edu/icon/v940/. For older implementations, start at http://www.cs.arizona.edu/icon/implver.htm. Jcon is at http://www.cs.arizona.edu/icon/jcon/. B3. Is there a Unicode version of Icon? No. Icon is defined in terms of 8-bit characters, and changing this presents several design challenges that would likely break existing programs. Also, modifying the C implementation is probably infeasible, but a Unicode version of Jcon might be possible. B4. What happened to the compiler? For a while, Unix distributions included both an interpreter and a compiler; but the interpreter is is usually fast enough even for production work, and most people found that using the compiler wasn't worth the extra compilation time or the hassles involved. We no longer advertise the compiler or produce binaries for it. It is still part of the source code distribution, and we have not deliberately broken it, but we no longer support it and we cannot offer help if problems arise. _________________________________________________________________ Administration C1. What is the Icon Project? The Icon Project is a name used by the group that distributes and supports the Icon programming language. The project maintains the Icon web site at http://www.cs.arizona.edu/icon. A non-commercial organization, the project derives support from the University of Arizona, revenue from book sales, and user contributions. C2. How often is the on-line material updated? New material is added when it's available. Established implementations usually are updated only when there's a new version. This typically is every year or two. The Icon program library is updated on a similar schedule. C3. Where did Icon come from? Icon is the latest in a series of high-level programming languages designed to facilitate programming tasks involving strings and structures. The original language, SNOBOL, was developed at Bell Telephone Laboratories in the early 1960s. SNOBOL evolved into SNOBOL4, which is still in use. Subsequent languages were developed at the University of Arizona with support from the National Science Foundation. Although it has similar objectives and many similar capabilities, Icon bears little superficial resemblance to SNOBOL4. The name Icon is not an acronym, nor does it stand for anything in particular, although the word iconoclastic was mentioned when the name was chosen. The name predates the now common use of icon to refer to small images used in graphical user interfaces. This sometimes misleads people into thinking that that Icon is designed to create or manipulate icons, but there's no good solution to that problem. C4. Where is Icon going? We continue to use Icon on a daily basis, but no significant changes are planned. We expect to support the Unix version for the forseeable future, and to distribute ports to other systems as supplied by volunteers. The Unicon project is developing an object-oriented language based on Icon. For more information, see http://unicon.sourceforge.net. An earlier object-oriented extension to Icon, Idol, can be found in the Icon program library. _________________________________________________________________ Support D1. Is there a users' group for Icon? There is no official Icon users' group, but The Icon Project maintains a moderated "Icon-group" electronic mailing list. To subscribe (or unsubscribe), send a message to icon-group-request@cs.arizona.edu. There is a gateway between Icon-group and comp.lang.icon, an unmoderated newsgroup for discussing issues related to Icon. The gateway, which exchanges messages between the two systems, is imperfect and not under the control of the Icon Project. The newsgroup generally provides faster response than the mailing list and is less intrusive, but it sometimes suffers from inappropriate postings. The Icon Project usually sends its announcements and other messages to the mailing list. D2. How do I get technical support? The Icon Project is not a commercial organization, and its capacity for providing technical support is limited. Please use the appropriate resource when you need assistance: * For programming assistance, submit a query to the mailing list or newsgroup (see above). * For porting assistance or Unix problems, contact icon-project@cs.arizona.edu. * For problems with the Windows implementation, contact the implementor, jeffery@cs.unlv.edu. * For general information, additional documentation, or mail orders, visit the Icon web site: http://www.cs.arizona.edu/icon. _________________________________________________________________ Programming E1. Why doesn't read() work with every? every s := read() do {...} doesn't loop because read() produces a single value and then fails if resumed. Other "consumer" procedures such as get() and pop() work the same way. Use a while loop with these procedures, and save every for use with generators such as !x or key(T). E2. Why doesn't string invocation such as "foo"() work? String invocation works if the procedure is present; the catch is that the linker removes unreferenced procedures. To ensure a procedure's presence, reference it in the main() procedure. A simple reference suffices, as in refs := [foo, bar, baz]; it's not necessary to actually call it. (Why does the linker remove unreferenced procedures? Because this can save huge amounts of memory for programs that use the library.) E3. How can I call a C function? You can't call an arbitrary C function, but if you're willing to write a function to Icon's specifications, there are two approaches. Under Unix, which provides loadfunc(), you can load one or more functions from a shared library, and afterwards treat them as if they had been written in Icon. Some examples can be found in the cfuncs and packs/loadfuncs directories of the Icon program library. The more cumbersome approach is to add code to the Icon interpreter and rebuild it; some hooks are provided for this purpose. Both approaches are discussed in Calling C Functions from Icon, http://www.cs.arizona.edu/icon/docs/ipd240.htm. The Jcon implementation allows Icon programs to call Java code that is written to Jcon specifications. E4. Can I open a bidirectional pipe? No, this is not possible. Although the concept is simple -- write a line to a program via a pipe, then read that program's output -- it probably wouldn't work. Most I/O libraries don't write anything to a pipe until they've filled a buffer, and the most likely consequence would be a deadlock, with each program waiting for the other to send more data. _________________________________________________________________ This FAQ is edited by Gregg Townsend, with contributions from Ralph Griswold, Cliff Hathaway, Clint Jeffery, Bob Alexander, and Todd Proebsting. From icon-group-sender Fri Jul 13 16:24:15 2001 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id f6DNMMc24431 for icon-group-addresses; Fri, 13 Jul 2001 16:22:22 -0700 (MST) Message-Id: <200107132322.f6DNMMc24431@baskerville.CS.Arizona.EDU> From: RBrown1653@aol.com Date: Fri, 13 Jul 2001 16:06:33 EDT Subject: ICON 9.3 To: icon-group@cs.arizona.edu Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 620 I downloaded Icon from the net.extracted it to C:\WINICON and then setup to D:\LANG\WINICON. I created a shortcut to it and also made a batch file of the 'set' statements. After runing the batch program, I ran the shortcut to WI. When I opened a sample program and tried to run it I got nothing. No errors and it said it was finished, but did not 'produce'. Am I doing something wrong or dumb. or maybe both? I had a DOS based ICON program about 5 years ago, but I took it off my machine and my backup machine broke. Can someone offer a suggestion? Do the 'set' statements have to go into my autoexec.bat? From icon-group-sender Mon Jul 16 08:11:57 2001 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id f6GF5e619804 for icon-group-addresses; Mon, 16 Jul 2001 08:05:40 -0700 (MST) Message-Id: <200107161505.f6GF5e619804@baskerville.CS.Arizona.EDU> Date: Fri, 13 Jul 2001 16:51:49 -0700 (MST) From: Gregg Townsend To: icon-group, pete, ralph Subject: Icon v9.4 download statistics Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 268 The Web and FTP logs show these totals for Icon 9.4 downloads in the month or so it has been out: 203 source packages 274 binary packages 119 Linux 52 AIX 43 Solaris 38 Digital 22 Irix The Icon web page has logged over 22000 visits so far this year. From icon-group-sender Wed Jul 18 16:32:07 2001 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id f6INTFQ26558 for icon-group-addresses; Wed, 18 Jul 2001 16:29:15 -0700 (MST) Message-Id: <200107182329.f6INTFQ26558@baskerville.CS.Arizona.EDU> Date: Wed, 18 Jul 2001 18:45:06 -0400 From: "Steve Graham" To: Subject: Icon, Linux and Graphics Content-Disposition: inline X-MIME-Autoconverted: from quoted-printable to 8bit by baskerville.CS.Arizona.EDU id f6IMk6625510 Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 131 Can Icon under Linux and X produce graphics? Are there any examples in any library which could demonstrate this? Thanks, Steve From icon-group-sender Thu Jul 19 16:24:25 2001 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id f6JNNvE25015 for icon-group-addresses; Thu, 19 Jul 2001 16:23:57 -0700 (MST) Message-Id: <200107192323.f6JNNvE25015@baskerville.CS.Arizona.EDU> Date: Thu, 19 Jul 2001 13:03:19 -0700 (MST) From: Gregg Townsend To: Steve_Graham@labcorp.com, icon-group@cs.arizona.edu Subject: Re: Icon, Linux and Graphics Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 851 > Can Icon under Linux and X produce graphics? > Are there any examples in any library which could demonstrate this? Yes, it can. There are sample programs of various sizes in the "gprogs" section of the Icon program library: http://www.cs.arizona.edu/icon/library/cgprogs.htm There are more programs in the graphics book and on its CD. The programs described on these web pages are all written in Icon and run on Linux: http://www.cs.arizona.edu/icon/oddsends/bpack/bpack.htm http://www.cs.arizona.edu/icon/oddsends/dlgvu/ http://www.cs.arizona.edu/icon/oddsends/tiger/ http://www.cs.arizona.edu/icon/docs/ipd284.htm --------------------------------------------------------------------------- Gregg Townsend Staff Scientist The University of Arizona gmt@cs.arizona.edu Computer Science Tucson, Arizona, USA From icon-group-sender Thu Jul 26 12:58:55 2001 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id f6QJtw629206 for icon-group-addresses; Thu, 26 Jul 2001 12:55:58 -0700 (MST) Message-Id: <200107261955.f6QJtw629206@baskerville.CS.Arizona.EDU> Date: 26 Jul 2001 16:59:00 BST From: rjhare@ed.ac.uk Subject: Jcon To: icon-group@cs.arizona.edu Organisation: Edinburgh Parallel Computing Centre Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 379 What is the current state of Jcon? Is any further development planned? I have also a very specific question (I will be trying to answer this myself tonight). If I use Jcon to produce a Java version of an Icon program, can I subsequently get that program to run on an EPOC device such as a Psion5 or Ericsson MC218 (I suspect I know the answer already...). Thanks. Roger Hare From icon-group-sender Fri Jul 27 11:14:07 2001 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id f6RIDqM10553 for icon-group-addresses; Fri, 27 Jul 2001 11:13:52 -0700 (MST) Message-Id: <200107271813.f6RIDqM10553@baskerville.CS.Arizona.EDU> Date: Thu, 26 Jul 2001 21:29:37 -0700 (MST) From: Gregg Townsend To: icon-group@cs.arizona.edu, rjhare@ed.ac.uk Subject: Re: Jcon Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 676 > What is the current state of Jcon? Still working the last time I checked. > Is any further development planned? Not at this time. > If I use Jcon to produce a Java version of an Icon program, > can I subsequently get that program to run on an EPOC device > such as a Psion5 or Ericsson MC218 (I suspect I know the answer > already...). I suspect that the Java isn't complete or robust enough, but if you find out otherwise, please tell us all! --------------------------------------------------------------------------- Gregg Townsend Staff Scientist The University of Arizona gmt@cs.arizona.edu Computer Science Tucson, Arizona, USA From icon-group-sender Mon Jul 30 07:57:59 2001 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id f6UEudI15185 for icon-group-addresses; Mon, 30 Jul 2001 07:56:39 -0700 (MST) Message-Id: <200107301456.f6UEudI15185@baskerville.CS.Arizona.EDU> From: Steve Graham X-Accept-Language: en X-Newsgroups: comp.lang.icon Subject: Speed vs Space Date: Sat, 28 Jul 2001 14:17:54 GMT X-Complaints-To: abuse@home.net To: icon-group@cs.arizona.edu Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 243 I have an application where I need to reset a table. The only way I know is to redefine it, e.g. B := table(). Does this eliminate the previous reference? Is there a faster way and/or a better way in terms of memory usage? Thanks, Steve From icon-group-sender Mon Jul 30 07:58:19 2001 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id f6UEwBk15219 for icon-group-addresses; Mon, 30 Jul 2001 07:58:11 -0700 (MST) Message-Id: <200107301458.f6UEwBk15219@baskerville.CS.Arizona.EDU> From: Steve Graham X-Accept-Language: en X-Newsgroups: comp.lang.icon Subject: Error Handling Date: Sat, 28 Jul 2001 14:36:52 GMT X-Complaints-To: abuse@home.net To: icon-group@cs.arizona.edu Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 130 What is the approved method of handling errors? Some may include unbalanced brackets, invalid tags, etc. Thanks, Steve Graham From icon-group-sender Mon Jul 30 07:59:10 2001 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id f6UEx4E15268 for icon-group-addresses; Mon, 30 Jul 2001 07:59:04 -0700 (MST) Message-Id: <200107301459.f6UEx4E15268@baskerville.CS.Arizona.EDU> From: "Lloyd M. Uhler, Jr." X-Newsgroups: comp.lang.icon Subject: VIB TextBox input Date: Fri, 27 Jul 2001 21:50:49 -0500 X-Orig-Message-ID: <3B622889.F5215748@cyberramp.net> Abuse-Reports-To: abuse at airmail.net to report improper postings NNTP-Proxy-Relay: library1-aux.airnews.net NNTP-Posting-Time: Sat Jul 28 09:51:58 2001 X-Accept-Language: en,pdf To: icon-group@cs.arizona.edu Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 2023 VIB TextBox input did not work in ICON Version 9.3.1? Has anyone tried to enter text in a TextBox generated from VIB in Version 9.3.2 od ICON? I would like to confirm it was fixed or not fixed? Type generated code would be: ############################################################################ # # File: C:\WINICON\PGMS\text.icn # # Subject: Program to test TextBox input # # Author: # # Date: June 23, 2001 # ############################################################################ # # # ############################################################################ # # Requires: # ############################################################################ # # Links: vsetup # ############################################################################ # This vib interface specification is a working program that responds # to vidget events by printing messages. Use a text editor to replace # this skeletal program with your own code. Retain the vib section at # the end and use vib to make any changes to the interface. link vsetup procedure main(args) local vidgets, root, paused (WOpen ! ui_atts()) | stop("can't open window") vidgets := ui() # set up vidgets root := vidgets["root"] paused := 1 # flag no work to do repeat { # handle any events that are available, or # wait for events if there is no other work to do while (*Pending() > 0) | \paused do { ProcessEvent(root, QuitCheck) } # if is set null, code can be added here # to perform useful work between checks for input } end procedure text_input_cb1(vidget, value) return end #===<>=== modify using vib; do not remove this marker line procedure ui_atts() return ["size=600,385", "bg=#C0C0C0"] end procedure ui(win, cbk) return vsetup(win, cbk, [":Sizer:::0,0,600,385:",], ["text_input1:Text::18:138,86,203,16:Text:\\=",text_input_cb1], ) end #===<>=== end of section maintained by vib From icon-group-sender Mon Jul 30 08:01:24 2001 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id f6UF1LQ15454 for icon-group-addresses; Mon, 30 Jul 2001 08:01:21 -0700 (MST) Message-Id: <200107301501.f6UF1LQ15454@baskerville.CS.Arizona.EDU> Date: Mon, 30 Jul 2001 10:19:33 -0400 From: "Steve Graham" To: Subject: Icon and ICFP Content-Disposition: inline X-MIME-Autoconverted: from quoted-printable to 8bit by baskerville.CS.Arizona.EDU id f6UEKX614512 Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 615 Folks, Just wanted to report on my use of Icon for the ICFP programming challenge. I found Icon to be well-suited to this task, particularly the string scanning capability and built-in data structures. Most of the problems I experienced with it were due to my lack of familiarity with it (though the red book helped a lot) and using keywords from other languages. Although for a variety of reasons I did not complete the task in time, I did try some test runs on a large file and Icon performed within time. Kudos to all involved in the creation and maintenance of this amazing tool. Steve Graham From icon-group-sender Mon Jul 30 08:01:37 2001 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id f6UF1Ws15473 for icon-group-addresses; Mon, 30 Jul 2001 08:01:32 -0700 (MST) Message-Id: <200107301501.f6UF1Ws15473@baskerville.CS.Arizona.EDU> From: Steve Wampler X-Newsgroups: comp.lang.icon Subject: Re: Speed vs Space Date: Mon, 30 Jul 2001 06:57:46 -0700 X-Complaints-To: abuse@noao.edu To: Steve Graham X-Accept-Language: en To: icon-group@cs.arizona.edu Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 518 Steve Graham wrote: > > I have an application where I need to reset a table. The only way > I know is to redefine it, e.g. B := table(). Does this eliminate the > previous reference? Is there a faster way and/or a better way in terms > of memory usage? That should work fine. If B previously held a table and there are no other references to that table (you haven't done A := B, for example), then the GC will reclaim the storage. -- Steve Wampler- SOLIS Project, National Solar Observatory swampler@noao.edu From icon-group-sender Mon Jul 30 08:01:55 2001 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id f6UF1mo15505 for icon-group-addresses; Mon, 30 Jul 2001 08:01:48 -0700 (MST) Message-Id: <200107301501.f6UF1mo15505@baskerville.CS.Arizona.EDU> From: Steve Wampler X-Newsgroups: comp.lang.icon Subject: Re: VIB TextBox input Date: Mon, 30 Jul 2001 07:02:15 -0700 X-Complaints-To: abuse@noao.edu To: "Lloyd M. Uhler, Jr." X-Accept-Language: en To: icon-group@cs.arizona.edu Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 522 "Lloyd M. Uhler, Jr." wrote: > > VIB TextBox input did not work in ICON Version 9.3.1? Has anyone tried > to enter text in a TextBox generated from VIB in Version 9.3.2 od ICON? > > I would like to confirm it was fixed or not fixed? Type generated code > would be: Hmmm, the code works fine for me, and looks like the TextBoxes I've used in earlier versions as well. Are you remembering to mouse click in the box to give it the "focus"? -- Steve Wampler- SOLIS Project, National Solar Observatory swampler@noao.edu From icon-group-sender Mon Jul 30 12:25:57 2001 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id f6UJPKw22535 for icon-group-addresses; Mon, 30 Jul 2001 12:25:20 -0700 (MST) Message-Id: <200107301925.f6UJPKw22535@baskerville.CS.Arizona.EDU> Date: Mon, 30 Jul 2001 11:06:41 -0400 (EDT) From: Taybin Rutkin X-Sender: trutkin@planck.clarku.edu To: Steve Graham cc: icon-group@cs.arizona.edu Subject: Re: Icon and ICFP Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 424 On Mon, 30 Jul 2001, Steve Graham wrote: > Folks, > > Just wanted to report on my use of Icon for the ICFP programming > challenge. Oh good. I was hoping someone would use Icon for that. > I experienced with it were due to my lack of familiarity with it (though > the red book helped a lot) and using keywords from other languages. What is the red book? I thought I owned all of the Icon books. Taybin Rutkin From icon-group-sender Mon Jul 30 17:11:20 2001 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id f6V07XI29336 for icon-group-addresses; Mon, 30 Jul 2001 17:07:33 -0700 (MST) Message-Id: <200107310007.f6V07XI29336@baskerville.CS.Arizona.EDU> Date: Mon, 30 Jul 2001 15:55:12 -0400 (EDT) From: Taybin Rutkin X-Sender: trutkin@planck.clarku.edu To: icon-group@cs.arizona.edu Subject: icon changes? Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 318 Is there some place that lists the changes that Icon has had over the years? I'm only familiar with version 9.x. Were the changes mostly in the implementation? I'm aware of the switch from fortran and the use of RTL. What I'm really interested in is changes that were made to the language proper. Taybin Rutkin From icon-group-sender Mon Jul 30 17:18:18 2001 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id f6V0ICs29716 for icon-group-addresses; Mon, 30 Jul 2001 17:18:12 -0700 (MST) Message-Id: <200107310018.f6V0ICs29716@baskerville.CS.Arizona.EDU> From: "Ehud Lamm" To: Subject: Best short Icon example Date: Mon, 30 Jul 2001 22:57:42 +0300 X-Priority: 3 X-MSMail-Priority: Normal X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2014.211 Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 778 Hi all, I am in the process of perapring material for a programming languages course. The course is based on the book Essential of Programming Languages, which is based on building interpreters in Scheme implementing many important language constructs. Thus, the course doesn't show example code in different languages. I am, however, creating a short section with example code in some innovative languages. The idea is to give the students "shock treatment" - making them realize that not all language are Pascal/C/Java. I was wondering what would be the best Icon example. I want something short, which solve a concrete problem, and uses some of Icons interesting features (goal directed evaluation, string scanning). Any suggestions? Ehud Lamm http://lambda.weblogs.com From icon-group-sender Mon Jul 30 17:18:33 2001 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id f6V0IUQ29741 for icon-group-addresses; Mon, 30 Jul 2001 17:18:30 -0700 (MST) Message-Id: <200107310018.f6V0IUQ29741@baskerville.CS.Arizona.EDU> Date: Mon, 30 Jul 2001 15:28:18 -0600 (MDT) From: "Cheyenne Wills" To: trutkin@physics.clarku.edu Cc: icon-group@cs.arizona.edu Subject: Re: Icon and ICFP X-Mailerorigin: http://www.fsai.fh-trier.de/~schmitzj/Xclasses/XCmail/ Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 470 The red book is the 2nd edition of the "Icon Programming Language" book, The first edition of the book had white background, the second edition of the book had red background and the third edition (which is the current edition) has a blue background. All three books have a "chessboard" motif on the cover. Cheyenne ---Reply to mail from Taybin Rutkin about Icon and ICFP > What is the red book? I thought I owned all of the Icon books. > > Taybin Rutkin > From icon-group-sender Mon Jul 30 17:18:50 2001 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id f6V0Igk29769 for icon-group-addresses; Mon, 30 Jul 2001 17:18:42 -0700 (MST) Message-Id: <200107310018.f6V0Igk29769@baskerville.CS.Arizona.EDU> Date: Mon, 30 Jul 2001 15:32:13 -0600 (MDT) From: "Cheyenne Wills" To: js.graham@home.com Cc: icon-group@cs.arizona.edu Subject: Re: Speed vs Space X-Mailerorigin: http://www.fsai.fh-trier.de/~schmitzj/Xclasses/XCmail/ Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 694 That is probably the fastest way of "resetting" the table, the memory for the old table will be reclaimed during the next internal garbage collection pass. If you just want to "delete" the space then setting the value to &null (e.g. B := &null) is another method, again the underlying space will be reclaimed during the next garbage collection. Cheyenne ---Reply to mail from Steve Graham about Speed vs Space > I have an application where I need to reset a table. The only way > I know is to redefine it, e.g. B := table(). Does this eliminate the > previous reference? Is there a faster way and/or a better way in terms > of memory usage? > > Thanks, Steve > > > ---End reply From icon-group-sender Mon Jul 30 17:19:06 2001 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id f6V0Ixc29796 for icon-group-addresses; Mon, 30 Jul 2001 17:18:59 -0700 (MST) Message-Id: <200107310018.f6V0Ixc29796@baskerville.CS.Arizona.EDU> Date: Mon, 30 Jul 2001 17:39:41 -0400 (EDT) From: Taybin Rutkin X-Sender: trutkin@planck.clarku.edu To: icon-group@cs.arizona.edu Subject: Re: Icon and ICFP Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 517 On Mon, 30 Jul 2001, Cheyenne Wills wrote: > The red book is the 2nd edition of the "Icon Programming Language" book, > > The first edition of the book had white background, the second edition > of the book had red background and the third edition (which is the current > edition) has a blue background. All three books have a "chessboard" motif > on the cover. Was it that the language changed that much? Or were they revision of how to present the text better? I only own the third edition. Taybin Rutkin From icon-group-sender Tue Jul 31 08:01:07 2001 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id f6VExms14793 for icon-group-addresses; Tue, 31 Jul 2001 07:59:48 -0700 (MST) Message-Id: <200107311459.f6VExms14793@baskerville.CS.Arizona.EDU> Date: Mon, 30 Jul 2001 20:44:41 -0400 (EDT) From: Taybin Rutkin X-Sender: trutkin@planck.clarku.edu To: Ehud Lamm cc: icon-group@cs.arizona.edu Subject: Re: Best short Icon example Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 403 On Mon, 30 Jul 2001, Ehud Lamm wrote: > I was wondering what would be the best Icon example. I want something short, > which solve a concrete problem, and uses some of Icons interesting features > (goal directed evaluation, string scanning). > Any suggestions? How about the 8-queens problem? That problem seems like the Icon language was designed to solve it, it solves so cleanly. Taybin Rutkin From icon-group-sender Tue Jul 31 08:01:23 2001 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id f6VF1JI14907 for icon-group-addresses; Tue, 31 Jul 2001 08:01:20 -0700 (MST) Message-Id: <200107311501.f6VF1JI14907@baskerville.CS.Arizona.EDU> Date: Mon, 30 Jul 2001 19:04:52 -0600 From: "Cheyenne Wills" To: "Taybin Rutkin" Cc: icon-group@cs.arizona.edu X-Accept-Language: en Subject: Re: Icon and ICFP Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 592 Incremental changes to the language... For example, sets were introduced in the 2nd edition (csets were in the 1st ed.), as was the specification for variable number of parameters e.g. procedure foo(a,b[]), and some additional builtin functions that dealt with some system specific operations (like getch, kbhit, etc.). The 3rd edition introduced mostly the graphics builtins and the preprocessor. Cheyenne Taybin Rutkin wrote: > > Was it that the language changed that much? Or were they revision of how > to present the text better? I only own the third edition. > > Taybin Rutkin From icon-group-sender Tue Jul 31 08:01:42 2001 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id f6VF1cU14939 for icon-group-addresses; Tue, 31 Jul 2001 08:01:38 -0700 (MST) Message-Id: <200107311501.f6VF1cU14939@baskerville.CS.Arizona.EDU> From: "Ehud Lamm" To: "Taybin Rutkin" Cc: Subject: Re: Best short Icon example Date: Tue, 31 Jul 2001 11:08:48 +0300 X-Priority: 3 X-MSMail-Priority: Normal X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2014.211 Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 408 > > How about the 8-queens problem? That problem seems like the Icon language > was designed to solve it, it solves so cleanly. > It is a nice example. But the solution in the Icon book, is a bit complicated (r+c-1, expressions etc.) and requires too much explaining - on top of the cool language features. Still, it is a great suggestion. I think I'll use it (unless someone gives a better idea!) Ehud From icon-group-sender Thu Aug 2 08:03:27 2001 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id f72EmqA20441 for icon-group-addresses; Thu, 2 Aug 2001 07:48:52 -0700 (MST) Message-Id: <200108021448.f72EmqA20441@baskerville.CS.Arizona.EDU> Date: Thu, 02 Aug 2001 15:09:07 +1000 From: dodod X-Accept-Language: en X-Newsgroups: comp.lang.icon Subject: list processing To: icon-group@cs.arizona.edu Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 335 hello i need to rename a number of files (approx 120) all files to be renamed are in the same directory i have a list with entries like this: 'name1' 'newname1' 'name2' 'newname2' . . How can i force msdos REName to accept name, newname as parameters ? (i use Icon Version 9.3.2. July 1, 1999 for msdos) Can you give me a hint ? From icon-group-sender Thu Aug 2 12:32:02 2001 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id f72JVWk29688 for icon-group-addresses; Thu, 2 Aug 2001 12:31:32 -0700 (MST) Message-Id: <200108021931.f72JVWk29688@baskerville.CS.Arizona.EDU> From: Chris.D.Tenaglia@jci.com Subject: Re: list processing To: dodo@hotmail.com Cc: icon-group@cs.arizona.edu Date: Thu, 2 Aug 2001 11:02:48 -0500 X-MIMETrack: Serialize by Router on jwimkrs1.na.jci.com/NA/Johnson_Controls(Release 5.07a |May 14, 2001) at 08/02/2001 11:24:48 AM Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 1750 procedure main(param) renlist := param[1] (in := open(renlist)) | stop("Can't read ",renlist) every line := !in do { old := parse(line,'\' ')[1] new:=parse(line,'\' ')[2] command := "ren " || old || " " new write(command) system(command) } close(in) write("Process completed.") end procedure parse(line,delims) static chars chars := &cset -- delims tokens := [] line ? while tab(upto(chars)) do put(tokens,tab(many(chars))) return tokens end dodo@hotmail. com To: icon-group@CS.Arizona.EDU cc: 08/02/01 Subject: list processing 12:09 AM hello i need to rename a number of files (approx 120) all files to be renamed are in the same directory i have a list with entries like this: 'name1' 'newname1' 'name2' 'newname2' . . How can i force msdos REName to accept name, newname as parameters ? (i use Icon Version 9.3.2. July 1, 1999 for msdos) Can you give me a hint ? From icon-group-sender Thu Aug 2 17:06:44 2001 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id f7306VI07739 for icon-group-addresses; Thu, 2 Aug 2001 17:06:31 -0700 (MST) Message-Id: <200108030006.f7306VI07739@baskerville.CS.Arizona.EDU> From: Chris.D.Tenaglia@jci.com Subject: Re: list processing To: icon-group@cs.arizona.edu Cc: dodo@hotmail.com Date: Thu, 2 Aug 2001 15:14:45 -0500 X-MIMETrack: Serialize by Router on jwimkrs1.na.jci.com/NA/Johnson_Controls(Release 5.07a |May 14, 2001) at 08/02/2001 03:34:52 PM Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 2090 oops, I forgot the concatenator on the command := line sorry. Chris.D.Tenagl ia@jci.com To: dodo@hotmail.com cc: icon-group@CS.Arizona.EDU 08/02/01 11:02 Subject: Re: list processing AM procedure main(param) renlist := param[1] (in := open(renlist)) | stop("Can't read ",renlist) every line := !in do { old := parse(line,'\' ')[1] new:=parse(line,'\' ')[2] command := "ren " || old || " " || new write(command) system(command) } close(in) write("Process completed.") end procedure parse(line,delims) static chars chars := &cset -- delims tokens := [] line ? while tab(upto(chars)) do put(tokens,tab(many(chars))) return tokens end dodo@hotmail. com To: icon-group@CS.Arizona.EDU cc: 08/02/01 Subject: list processing 12:09 AM hello i need to rename a number of files (approx 120) all files to be renamed are in the same directory i have a list with entries like this: 'name1' 'newname1' 'name2' 'newname2' . . How can i force msdos REName to accept name, newname as parameters ? (i use Icon Version 9.3.2. July 1, 1999 for msdos) Can you give me a hint ? From icon-group-sender Fri Aug 3 08:22:42 2001 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id f73FLl625695 for icon-group-addresses; Fri, 3 Aug 2001 08:21:47 -0700 (MST) Message-Id: <200108031521.f73FLl625695@baskerville.CS.Arizona.EDU> From: "Andrew Hamm" X-Newsgroups: comp.lang.icon Subject: Re: list processing X-Newsreader: Microsoft Outlook Express 4.72.3110.5 X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3 X-Original-NNTP-Posting-Host: 203.56.2.254 X-Original-Trace: 3 Aug 2001 10:35:44 +1000, 203.56.2.254 Date: Fri, 3 Aug 2001 10:34:03 +1000 To: icon-group@cs.arizona.edu Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 902 dodod wrote in message <3B68E072.D6429622@hotmail.com>... > >i need to rename a number of files (approx 120) >all files to be renamed are in the same directory >i have a list with entries like this: >'name1' 'newname1' >'name2' 'newname2' >. >How can i force msdos REName to accept name, newname as parameters ? >(i use Icon Version 9.3.2. July 1, 1999 for msdos) >Can you give me a hint ? > This is way-off topic, but since you are using Icon I'll smile and answer. msdos rename supports: rename oldname*.* newname*.* HOWEVER - from memory, newname must be the same length as oldname? So that makes it a bit sticky... -- Lamarr: My mind is a raging torrent, flooded with rivulets of thought cascading into a waterfall of creative alternatives. Taggart: Gol-darn it, Mr. Lamarr, you use your tongue purdier than a twenty dollar who.re. Lamarr: Sh!t - kicker... -- Blazing Saddles From icon-group-sender Mon Aug 6 07:58:17 2001 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id f76EtaY24801 for icon-group-addresses; Mon, 6 Aug 2001 07:55:36 -0700 (MST) Message-Id: <200108061455.f76EtaY24801@baskerville.CS.Arizona.EDU> From: "Lloyd M. Uhler, Jr." X-Newsgroups: comp.lang.icon Subject: Re: list processing Date: Sat, 04 Aug 2001 22:14:03 -0500 X-Orig-Message-ID: <3B6CB9FB.BB8178E3@cyberramp.net> Abuse-Reports-To: abuse at airmail.net to report improper postings NNTP-Proxy-Relay: library1-aux.airnews.net NNTP-Posting-Time: Sat Aug 4 10:14:57 2001 X-Accept-Language: en,pdf To: icon-group@cs.arizona.edu Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 426 Generate a BAT file as output from your ICON program! dodod wrote: > hello > i need to rename a number of files (approx 120) > all files to be renamed are in the same directory > i have a list with entries like this: > 'name1' 'newname1' > 'name2' 'newname2' > . > . > > How can i force msdos REName to accept name, newname as parameters ? > (i use Icon Version 9.3.2. July 1, 1999 for msdos) > Can you give me a hint ? From icon-group-sender Mon Aug 6 08:00:06 2001 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id f76EwgM24864 for icon-group-addresses; Mon, 6 Aug 2001 07:58:42 -0700 (MST) Message-Id: <200108061458.f76EwgM24864@baskerville.CS.Arizona.EDU> Date: Mon, 06 Aug 2001 10:35:05 +1000 From: dodod X-Accept-Language: en X-Newsgroups: comp.lang.icon Subject: Re: list processing To: icon-group@cs.arizona.edu Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 43 thank you "Lloyd M. Uhler, Jr." wrote: From icon-group-sender Mon Aug 6 08:01:54 2001 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id f76F0WA24946 for icon-group-addresses; Mon, 6 Aug 2001 08:00:32 -0700 (MST) Message-Id: <200108061500.f76F0WA24946@baskerville.CS.Arizona.EDU> Date: Sun, 05 Aug 2001 20:45:47 +1000 From: Bruce Gordon Rennie X-Newsgroups: comp.lang.icon Subject: Virtual Machine for ICON To: icon-group@cs.arizona.edu Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 849 A question? Is there available a list of each of the virtual machine opcades and their semantics available. I am looking for information other than what is to be found in the source code for the ICON compiler/interpreter. The purpose that I have is to add some of the functionality to a virtual machine I am in the process of designing and building. This virtual machine is based on the FORTH virtual machine - basically a two stack architecture. The design I am working on is, at the machine level, aware of the type that any value has. All values logically being the same size. regards -- Bruce Rennie ( from God's Own Country Downunder ) Disciple of Jesus Christ in Training The Cross of Jesus Christ - Salvation for all men. 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 Mon Aug 6 08:04:06 2001 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id f76F2fA25034 for icon-group-addresses; Mon, 6 Aug 2001 08:02:41 -0700 (MST) Message-Id: <200108061502.f76F2fA25034@baskerville.CS.Arizona.EDU> Date: Mon, 06 Aug 2001 22:11:27 +1000 From: Bruce Gordon Rennie X-Newsgroups: comp.lang.icon Subject: Re: Virtual Machine for ICON To: icon-group@cs.arizona.edu Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 837 Andrew Hamm wrote: > > Bruce Gordon Rennie wrote in message <3B6D23DB.18ABB876@dcsi.net.au>... > > > > > "The Implementation of the Icon Programming Language" book goes into > interesting detail about the opcodes and I believe there is a comprehensive > discussion of all the opcodes. The book should still be available from the > Icon Project. Check out http://www.cs.arizona.edu/icon for a start. > What I am looking for is the current list for ICON V9.x or for UNICON (current version). I believe that the above book covers an earlier version of ICON. I seem to remember getting the book on interlibrary loan some years ago. -- 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 Mon Aug 6 13:22:41 2001 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id f76KL5A24491 for icon-group-addresses; Mon, 6 Aug 2001 13:21:05 -0700 (MST) Message-Id: <200108062021.f76KL5A24491@baskerville.CS.Arizona.EDU> From: slama-h@gmx.net (Heribert Slama) X-Newsgroups: comp.lang.icon Subject: Linux version alwyas wants X11 even if no graphics involved Date: Mon, 06 Aug 2001 18:43:09 GMT X-Newsreader: Forte Free Agent 1.21/16.243 To: icon-group@cs.arizona.edu Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 762 Hi, I have a small experimental setup of Linux (LoopLinux + some Slackware packages) residing in a FAT-file (ext2fs on loopback device;-). No X-Window (X11) installed. I downloaded Icon v9.4.0 plus the basic IPL. When I tried to run simple text-mode programs from the IPL (e.g. animal.icn), the execution stage (iconx, I presume) complained about libX11.so.6 missing :-(( - and stopped. Obviously iconx always tries to contact X11 whether it is actually needed or not. Is there some easy way out? I neither want to install XFree86, nor build a non-graphical version of Icon from the _sources_. (Not enough disk space for this experimantal setup.) TIA, -- Heribert Slama Systems programmer Muttenz, Switzerland (for e-mail use *reply* address only) From icon-group-sender Mon Aug 6 16:52:57 2001 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id f76NpIg21413 for icon-group-addresses; Mon, 6 Aug 2001 16:51:18 -0700 (MST) Message-Id: <200108062351.f76NpIg21413@baskerville.CS.Arizona.EDU> From: gmt@cs.arizona.edu (Gregg Townsend) X-Newsgroups: comp.lang.icon Subject: Re: Linux version alwyas wants X11 even if no graphics involved Date: 6 Aug 2001 13:00:35 -0700 To: icon-group@cs.arizona.edu Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 1070 In article <3b6ee42c.4451231@news.datacomm.ch>, Heribert Slama wrote: > I downloaded Icon v9.4.0 plus the basic IPL. When I tried to run > simple text-mode programs from the IPL (e.g. animal.icn), the > execution stage (iconx, I presume) complained about > libX11.so.6 missing :-(( > - and stopped. > Obviously iconx always tries to contact X11 whether it is actually > needed or not. Iconx is not trying to contact the X server; you're seeing a message from the system loader trying to get all the necessary libraries in place before starting iconx. You might be able to get away with just installing the single libx11.so.6 file. Even if you don't like the idea, rebuilding Icon without graphics is probably the simplest solution. You don't need to use the same machine; you can build it elsewhere and move the binaries. --------------------------------------------------------------------------- Gregg Townsend Staff Scientist The University of Arizona gmt@cs.arizona.edu Computer Science Tucson, Arizona, USA From icon-group-sender Tue Aug 7 08:38:22 2001 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id f77FYXU21261 for icon-group-addresses; Tue, 7 Aug 2001 08:34:33 -0700 (MST) Message-Id: <200108071534.f77FYXU21261@baskerville.CS.Arizona.EDU> From: slama-h@gmx.net (Heribert Slama) X-Newsgroups: comp.lang.icon Subject: Re: Linux version alwyas wants X11 even if no graphics involved Date: Tue, 07 Aug 2001 02:37:39 GMT X-Newsreader: Forte Free Agent 1.21/16.243 To: icon-group@cs.arizona.edu Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 862 On 6 Aug 2001 13:00:35 -0700, in comp.lang.icon, gmt@CS.Arizona.EDU (Gregg Townsend) wrote: >In article <3b6ee42c.4451231@news.datacomm.ch>, >Heribert Slama wrote: > >> [...] >> libX11.so.6 missing :-(( >> [...] > >Iconx is not trying to contact the X server; you're seeing a message >from the system loader trying to get all the necessary libraries in >place before starting iconx. You might be able to get away with >just installing the single libx11.so.6 file. BINGO! Got away with it :-) Text-mode programs work smoothly :-) I'd already considered this, but was afraid to crash my system (which is not a standard Linux distribution and therefore not easily re-built;-) Your message gave me the courage to try it - thanks. Regards, -- Heribert Slama Systems programmer Muttenz, Switzerland (for e-mail use *reply* address only) From icon-group-sender Tue Aug 7 08:51:56 2001 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id f77FkWQ23106 for icon-group-addresses; Tue, 7 Aug 2001 08:46:32 -0700 (MST) Message-Id: <200108071546.f77FkWQ23106@baskerville.CS.Arizona.EDU> Date: Tue, 07 Aug 2001 13:07:16 +0200 From: Anders Holtsberg X-Accept-Language: en To: icon-group@cs.arizona.edu Subject: Sorting Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 1011 What is the simplest way to sort a list of records according to one of the fields? It seems hat this is not a one liner, or is it? My quick hack is this: procedure sortbyfield(thelist, i) t := table(&null) every e := !thelist do t[e[i]] := e; s := sort(t, 1) w := [] every put(w, (!s)[2]) return w end For tables one can give a second argument to the sort procedure, but for lists the second argument is simply ignored. One simple for future enhancement to Icon is to use the above semantics for a two argument call to sort, where the first argument is either a list of records or a list of lists. Even better is to also accept a string as second argument for the case that the first argument is a list of records. Is this sensible? Anders Holtsberg -- _______________________________________________________________ Anders Holtsberg Decuma AB tel +46 709 596305 Ideon Växthuset anders.holtsberg@decuma.se S-223 70 Lund, Sweden From icon-group-sender Tue Aug 7 16:45:42 2001 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id f77NhlE26494 for icon-group-addresses; Tue, 7 Aug 2001 16:43:47 -0700 (MST) Message-Id: <200108072343.f77NhlE26494@baskerville.CS.Arizona.EDU> Date: Tue, 07 Aug 2001 15:20:43 -0700 From: Steve Wampler X-Accept-Language: en To: icon-group@cs.arizona.edu Subject: Re: Sorting Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 1688 Anders Holtsberg wrote: > > What is the simplest way to sort a list of records according to > one of the fields? It seems hat this is not a one liner, or is > it? My quick hack is this: > > procedure sortbyfield(thelist, i) > t := table(&null) > every e := !thelist do t[e[i]] := e; > s := sort(t, 1) > w := [] > every put(w, (!s)[2]) > return w > end Seems like a reasonable approach to me. Of course, it does assume that all the elements in the list are subscriptable [and imagine what happens if there are some strings stuck in there!]. Of course, since you (as the programmer) know the list contains only records it should work quite nicely. > For tables one can give a second argument to the sort procedure, > but for lists the second argument is simply ignored. > > One simple for future enhancement to Icon is to use the above > semantics for a two argument call to sort, where the first > argument is either a list of records or a list of lists. Even > better is to also accept a string as second argument for the > case that the first argument is a list of records. Is this > sensible? I think it's an interesting idea, but probably needs some more work on the details. Since there is no concept of a homogeneous list in Icon, there need to be clearly defined rules on how to sort elements that don't contain anything matching the sort field index - generating a runtime error as the above code does is probably not acceptable in the general case. If you're going to add this to sort for sorting lists, it might be good to also add it to sort for sorting tables as well! -- Steve Wampler- SOLIS Project, National Solar Observatory swampler@noao.edu From icon-group-sender Wed Aug 8 07:53:15 2001 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id f78EqkI18342 for icon-group-addresses; Wed, 8 Aug 2001 07:52:46 -0700 (MST) Message-Id: <200108081452.f78EqkI18342@baskerville.CS.Arizona.EDU> From: "Thomas Christopher" To: Subject: Re: Sorting Date: Tue, 7 Aug 2001 21:10:31 -0500 X-Priority: 3 X-MSMail-Priority: Normal X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 324 > Anders Holtsberg wrote: > > > > What is the simplest way to sort a list of records according to > > one of the fields? It seems hat this is not a one liner, or is > > it? L:=sortf(thelist,i) Thomas W. Christopher Operating Manager, Tools of Computing LLC. http://www.toolsofcomputing.com, tc@toolsofcomputing.com From icon-group-sender Thu Aug 16 12:35:50 2001 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id f7GJVfI02212 for icon-group-addresses; Thu, 16 Aug 2001 12:31:41 -0700 (MST) Message-Id: <200108161931.f7GJVfI02212@baskerville.CS.Arizona.EDU> Date: Thu, 16 Aug 2001 11:21:46 -0500 (CDT) From: "David S. Cargo" To: icon-group@cs.arizona.edu Subject: PLEAC - Programming Language Examples Alike Cookbook Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 714 I just read about PLEAC - Programming Language Examples Alike Cookbook. They have a site on Source Forge: http://pleac.sourceforge.net/ This is kind of a Rosetta Stone for programming languages; it is using several different languages to solve the same set of problems. "The current list of supported languages includes Perl, Merd, Ruby, Haskell, Python, Masd, and Nasm. The Merd and Ruby implementations are both about 25% finished. Python, Haskell, and the assembly languages are trailing at below 10% completion. The project maintainer is seeking help for the implementation of solutions in ocaml, scheme, tcl, and C++/stl." Perhaps contributing to this would give some additional exposure to Icon. dsc From icon-group-sender Wed Aug 22 07:39:16 2001 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id f7MEcLc14160 for icon-group-addresses; Wed, 22 Aug 2001 07:38:21 -0700 (MST) Message-Id: <200108221438.f7MEcLc14160@baskerville.CS.Arizona.EDU> From: icon@steve.iit.edu (Michael Glass) X-Newsgroups: comp.lang.icon Subject: XML parsing in icon or unicon? Date: 21 Aug 2001 21:36:44 -0700 X-Complaints-To: groups-abuse@google.com To: icon-group@cs.arizona.edu Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 400 Is there a simple XML or SGML parser available in icon / unicon? I am writing a Q & D "standoff" markup and display program. It occurred to me that somebody may already have written some procedures to handle simple XML. I did not see anything in the IPL, only the SGML strip-and-format program. I do not need to handle the whole XML mess. Something simplified will do nicely. -- Michael Glass From icon-group-sender Wed Aug 22 12:27:45 2001 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id f7MJRWg26023 for icon-group-addresses; Wed, 22 Aug 2001 12:27:32 -0700 (MST) Message-Id: <200108221927.f7MJRWg26023@baskerville.CS.Arizona.EDU> From: icon@steve.iit.edu (Michael Glass) X-Newsgroups: comp.lang.icon Subject: XML parsing in icon or unicon? Date: 21 Aug 2001 21:36:44 -0700 X-Complaints-To: groups-abuse@google.com To: icon-group@cs.arizona.edu Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 400 Is there a simple XML or SGML parser available in icon / unicon? I am writing a Q & D "standoff" markup and display program. It occurred to me that somebody may already have written some procedures to handle simple XML. I did not see anything in the IPL, only the SGML strip-and-format program. I do not need to handle the whole XML mess. Something simplified will do nicely. -- Michael Glass From icon-group-sender Tue Aug 28 20:33:08 2001 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id f7T3Vbs29791 for icon-group-addresses; Tue, 28 Aug 2001 20:31:37 -0700 (MST) Message-Id: <200108290331.f7T3Vbs29791@baskerville.CS.Arizona.EDU> Date: Wed, 29 Aug 2001 11:54:49 +1100 From: dodod X-Accept-Language: en X-Newsgroups: comp.lang.icon Subject: join To: icon-group@cs.arizona.edu Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 144 hello i would like to write a program to emulate unix join command but i do not know how to start can you give me a hint or an example ? ths From icon-group-sender Mon Sep 3 19:28:47 2001 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id f842RCE25262 for icon-group-addresses; Mon, 3 Sep 2001 19:27:12 -0700 (MST) Message-Id: <200109040227.f842RCE25262@baskerville.CS.Arizona.EDU> Date: Mon, 03 Sep 2001 11:07:37 +1100 From: dodod X-Accept-Language: en X-Newsgroups: comp.lang.icon Subject: Re: join To: icon-group@cs.arizona.edu Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 1712 thanks Andrew Hamm wrote: > > dodod wrote in message <3B8C3D59.AA150BB8@hotmail.com>... > >hello > >i would like to write a program to emulate > >unix join command but i do not know how to start > >can you give me a hint or an example ? > > > possibly start by coding a function which can be used in a coroutine. This > function's job is to suspend with a line from a text file. When used in a > coroutine, it could be activated with a parameter which tells it to either > yield the current line or the next line. In other words, the coroutine could > be used to provide look-ahead or actual read of next line. > > Then, start two separate coroutines using this function, applied to the two > different files. Your main loop could peek at each line, and if it matches, > perform the join otherwise move on. Since the rule in UNIX join is that the > lines must be presented in "increasing collating sequence" (ie sorted on the > key field) then depending on the relative << == or >> of the key fields on > the line, you activate one or the other coroutines to read the next line > from either or both files. > > Hmm - now that I think about it, I dont think the coroutine function needs > to offer look-ahead, and therefore doesn't need the activation flag. > Activate both coroutines prior to the start of your loop, store the results > in a local buffer, and ask for the next row as needed as you progress. > > I suppose it could also be programmed without the use of coroutines, but > where's the fun in that? > > -- > Space Corps Directive #349 > Any officer found to have been slaughtered and replaced by a shape-changing > chameleonic life form shall forfeit all pension rights. > -- Red Dwarf From icon-group-sender Thu Sep 6 12:55:23 2001 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id f86JsQ212824 for icon-group-addresses; Thu, 6 Sep 2001 12:54:26 -0700 (MST) Message-Id: <200109061954.f86JsQ212824@baskerville.CS.Arizona.EDU> From: Steve Wampler X-Newsgroups: comp.lang.icon Subject: Re: join Date: Thu, 06 Sep 2001 09:58:35 -0700 X-Complaints-To: abuse@noao.edu X-Accept-Language: en To: icon-group@cs.arizona.edu Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 1448 Andrew Hamm wrote: > > dodod wrote in message <3B8C3D59.AA150BB8@hotmail.com>... > >hello > >i would like to write a program to emulate > >unix join command but i do not know how to start > >can you give me a hint or an example ? > > .... > I suppose it could also be programmed without the use of coroutines, but > where's the fun in that? A *long* time ago I wrote a short program to "pair" the lines of two files using co-expressions (the basic stuff took 4 statements). Then I realized that the functionality the program was using from the co-expressions behavior is *exactly* the behavior provided by read()... [A question for people: How equivalent are the following approaches? f := open(filename) while line := read(f) do ... close(f) and cf := create (!(f := open(filename)) | (close(f),&fail)) while line := @cf do ... ] Anyway, switching to read() instead of coroutines cut the basic algorithm down to 2 statements. Here's the basic algorithm for this "pairing": # Output pairs of lines from files f1 and f2, where each pair # is joined on a single output line. # procedure pair(f1, f2) while write( read(f1), read(f2)|"") while write( read(f2) ) end join's basic algorithm isn't much worse, but there's a lot of ugliness to handle the fields [still cleaner than in C, I imagine!]. -- Steve Wampler- SOLIS Project, National Solar Observatory swampler@noao.edu From icon-group-sender Thu Sep 13 12:32:09 2001 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id f8DJUsE26090 for icon-group-addresses; Thu, 13 Sep 2001 12:30:54 -0700 (MST) Message-Id: <200109131930.f8DJUsE26090@baskerville.CS.Arizona.EDU> From: Steve Wampler X-Newsgroups: comp.lang.icon Subject: Re: join Date: Thu, 13 Sep 2001 08:41:15 -0700 X-Complaints-To: abuse@noao.edu X-Accept-Language: en To: icon-group@cs.arizona.edu Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 2114 Andrew Hamm wrote: > > Steve Wampler wrote in message <3B97AB3B.12DBFBEE@noao.edu>... > > > >A question for people: How equivalent are the following approaches? > > > > f := open(filename) > > while line := read(f) do ... > > close(f) > > > >and > > > > cf := create (!(f := open(filename)) | (close(f),&fail)) > > while line := @cf do ... > > > > OK - I'll bite. Is this going to be another trick question like comparing > > while expr > > with some sort of generator in the implementation book? can't remember the > alternatives, and my book is at home. Well, it wasn't planned that way, but probably someone with more detailed knowledge of the implementation can find a number of differences at that level! > Anyways, ignoring the lack of error checking, all I can see is that cf is > restartable to repoen the file. Depending on the scope of f, it could be > private to the coexpression and therefore inaccessible. > > What am I missing? I don't think you're missing anything. Here are the things I see as "different" (others will no doubt disagree!): (1) scope of f affects behavior. Just as Andrew says, if f is local when the coexpression is created, then it's inaccessible outside the coexpression. Why is this a difference? Because it means... (2) if you break out of the loop early in the first example, you can still close the file. if you break out of the loop early in the second (and f is inaccessible), the only way to close the file is to exhaust the co-expression, via (say) while @cf which could be a significant performance hit, but... (3) the coexpression version provides automatic closing of the file when you're done reading it. In the first approach, if you forget the close(f) after the while, the file remains open. (4) What happens if you refresh the co-expression before it "finishes"? (Ok, this probably isn't a real difference, but is more likely to sneak up on you than doing the equivalent in the first case...) -- Steve Wampler- SOLIS Project, National Solar Observatory swampler@noao.edu From icon-group-sender Tue Sep 25 12:25:47 2001 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id f8PJOSw06397 for icon-group-addresses; Tue, 25 Sep 2001 12:24:28 -0700 (MST) Message-Id: <200109251924.f8PJOSw06397@baskerville.CS.Arizona.EDU> Date: Wed, 26 Sep 2001 00:05:43 +1000 From: Bruce Gordon Rennie X-Newsgroups: comp.lang.icon Subject: Line limit for ICON on input To: icon-group@cs.arizona.edu Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 1195 To all, I am reading a text file that is very large (over 100 Mbytes) and am using the following simple program to read and then write the file. procedure main() local ifile, cnttab, line, keyword, linesp, keyw, outp write("Translation") (ifile := open("f:\\A\\ForthNG.txt","r")) & write("Have opened file") linesp := 0 cnttab := table(0) outp := open("f:\\a\\forthSumNG.txt","w") while line := read(ifile) do { line ? (if ( ="Date:" ) then write(outp,line)) (((linesp +:= 1 ) % 1000) = 0) & write(".",linesp) if (linesp > 204900) then write(line) } write(".",linesp) end However, it is stopping at line 204931. The purpose is to remove a set of line, of which one is given as an example. But it is not getting past the above line. My estimate is that there is over a million lines in this file. Can anyone shed any light on this. I am using ICON for Windows Version 9.3.1 May 4 1998. Any help appreciated. regards -- Bruce Rennie ( from God's Own Country Downunder ) Disciple of Jesus Christ in Training The Cross of Jesus Christ - Salvation for all men. 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 Tue Sep 25 16:36:17 2001 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id f8PNa4o19725 for icon-group-addresses; Tue, 25 Sep 2001 16:36:04 -0700 (MST) Message-Id: <200109252336.f8PNa4o19725@baskerville.CS.Arizona.EDU> Date: Tue, 25 Sep 2001 15:17:26 -0600 (MDT) X-Authentication-Warning: sunray.CS.NMSU.Edu: jeffery set sender to jeffery@cs.nmsu.edu using -f From: Clint Jeffery To: brennie@dcsi.net.au CC: icon-group@cs.arizona.edu Subject: Re: Line limit for ICON on input Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 610 Bruce, There should be no limits on the number of lines, or length of lines, that can be read from files, subject to available memory on your machine. If a particular implementation has a limit it can be due to a bug in our code, or in the underlying C compiler's library functions. Since you are running Windows Icon I'll be happy to assist you; does the program "hang", or does it halt prematurely, or does it die with some kind of error message? Feel free to e-mail me directly, and if we discover something of general interest we can post it to the group. Regards, Clint Jeffery, jeffery@cs.nmsu.edu From icon-group-sender Tue Sep 25 16:37:17 2001 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id f8PNbEM19765 for icon-group-addresses; Tue, 25 Sep 2001 16:37:14 -0700 (MST) Message-Id: <200109252337.f8PNbEM19765@baskerville.CS.Arizona.EDU> Date: Tue, 25 Sep 2001 14:51:48 -0700 (US Mountain Standard Time) From: Andrew Carr To: Bruce Gordon Rennie cc: Icon Group Mailing List Subject: Re: Line limit for ICON on input X-X-Sender: acarr@deimos.email.arizona.edu Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 421 On Wed, 26 Sep 2001, Bruce Gordon Rennie wrote: > However, it is stopping at line 204931. The purpose is to remove a set of line, 204931 looks kinda like a limiting agent for an int variable, if memory serves me correct... (i.e. int's can only take a number between -x and x, of what x is, I have no clue other than it's a large number) -- Andrew Carr acarr@email.arizona.edu AIM: Andyrew480 ICQ: 3100804 From icon-group-sender Tue Sep 25 16:37:27 2001 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id f8PNbOM19787 for icon-group-addresses; Tue, 25 Sep 2001 16:37:24 -0700 (MST) Message-Id: <200109252337.f8PNbOM19787@baskerville.CS.Arizona.EDU> Date: Tue, 25 Sep 2001 14:01:03 -0700 From: Steve Wampler X-Accept-Language: en To: Bruce Gordon Rennie CC: icon-group@cs.arizona.edu Subject: Re: Line limit for ICON on input Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 2061 Bruce Gordon Rennie wrote: > > To all, > > I am reading a text file that is very large (over 100 Mbytes) and am using the > following simple program to read and then write the file. > > procedure main() > local ifile, cnttab, line, keyword, linesp, keyw, outp > write("Translation") > (ifile := open("f:\\A\\ForthNG.txt","r")) & write("Have opened file") > linesp := 0 > cnttab := table(0) > outp := open("f:\\a\\forthSumNG.txt","w") > while line := read(ifile) do { > line ? (if ( ="Date:" ) then write(outp,line)) > (((linesp +:= 1 ) % 1000) = 0) & write(".",linesp) > if (linesp > 204900) then write(line) > > } > write(".",linesp) > end > > However, it is stopping at line 204931. The purpose is to remove a set of line, > of which one is given as an example. But it is not getting past the above line. > My estimate is that there is over a million lines in this file. Can anyone shed > any light on this. > > I am using ICON for Windows Version 9.3.1 May 4 1998. Any help appreciated. Are you sure this isn't a windows problem? I just ran the following variant of your program on Linux on a 1GB input file (8,388,609 lines) with no problems: procedure main(args) local ifile, cnttab, line, keyword, linesp, keyw, outp write("Translation") inFile := args[1] outFile := args[2] (ifile := open(inFile,"r")) & write("Have opened file") linesp := 0 cnttab := table(0) outp := open(outFile,"w") while line := read(ifile) do { # line ? (if ( ="Date:" ) then write(outp,line)) (((linesp +:= 1 ) % 1000) = 0) & write(".",linesp) # (linesp > 204900) then write(line) } write(".",linesp) end Hmmm, I wonder how many *bytes* you are into the file when it hangs? I bet it's close to some magic power of two... -- Steve Wampler- SOLIS Project, National Solar Observatory swampler@noao.edu From icon-group-sender Wed Sep 26 07:15:31 2001 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id f8QEEYA23847 for icon-group-addresses; Wed, 26 Sep 2001 07:14:34 -0700 (MST) Message-Id: <200109261414.f8QEEYA23847@baskerville.CS.Arizona.EDU> Date: Wed, 26 Sep 2001 13:53:19 +1000 From: Bruce Gordon Rennie To: icon-group@cs.arizona.edu Subject: Thanks for the help on Line limit for ICON on input X-Virus-Scanned: by AMaViS perl-11 Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 1653 Thanks to everyone who has responded. Steve Hunter - your advice about using "ru" on the file open enabled me to read all records (2,425,173). I haven't checked to see if there is a ^Z in the text file as yet (the file was readable by WORD - which could mean anything). The file contains all (well most of them) of the messages from 1998 to now of the comp.lang.forth newsgroup stored using Netscape. So there could be a number of problems in the data stream related to ^Z. Andrew Carr - I though a similar thing about the number of records that were being processed. Clint Jeffery - I'll shortly being installing UNICON onto my machine - I was using it at my last contract with Lucent Technologies here in Australia. You've added some nice facilities into UNICON. I'm looking forward to doing some of the projects I've had on hold for a while in it. Thanks for the encouragement, but it appears to be a problem in my data not in the ICON system. Steve Wampler - I wasn't getting any error messages at all. The program was terminating normally which is why I put the problem up for review. Thank you for testing a file of so many lines. It gave me confidence that the problem was going to be solved. The final status is that all the data has been read and the information that I was removing has been removed. Again, I appreciate your very quick feedback and your help. regards to you all -- Bruce Rennie ( from God's Own Country Downunder ) Disciple of Jesus Christ in Training The Cross of Jesus Christ - Salvation for all men. 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 Thu Sep 27 07:54:17 2001 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id f8REhD616199 for icon-group-addresses; Thu, 27 Sep 2001 07:43:14 -0700 (MST) Message-Id: <200109271443.f8REhD616199@baskerville.CS.Arizona.EDU> From: "Andrew Hamm" X-Newsgroups: comp.lang.icon Subject: Re: Line limit for ICON on input X-Newsreader: Microsoft Outlook Express 4.72.3110.5 X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3 X-Original-NNTP-Posting-Host: 203.56.2.254 X-Original-Trace: 27 Sep 2001 17:46:29 +1000, 203.56.2.254 Date: Thu, 27 Sep 2001 17:44:20 +1000 To: icon-group@cs.arizona.edu Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 1050 Bruce Gordon Rennie wrote in message <3BB08F37.61F69327@dcsi.net.au>... > >I am reading a text file that is very large (over 100 Mbytes) and am using the >following simple program to read and then write the file. > >[SNIP] > >However, it is stopping at line 204931. The purpose is to remove a set of line, >of which one is given as an example. But it is not getting past the above line. >My estimate is that there is over a million lines in this file. Can anyone shed >any light on this. > >I am using ICON for Windows Version 9.3.1 May 4 1998. Any help appreciated. > I've scrooted your code and it looks fine unless I'm missing something. You are not doing anything with table cnttab - have you snipped out some code that might actually be storing something in that table and eventually overflowing the memory? It's hard to see any reason for the bomb-out. -- Space Corps Directive #592 In an emergency situation involving two or more officers of equal rank, seniority will be granted to whichever officer can program a VCR. -- Red Dwarf From icon-group-sender Fri Sep 28 07:47:07 2001 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id f8SEkBg14957 for icon-group-addresses; Fri, 28 Sep 2001 07:46:11 -0700 (MST) Message-Id: <200109281446.f8SEkBg14957@baskerville.CS.Arizona.EDU> Date: Fri, 28 Sep 2001 12:52:31 +1100 From: dodod X-Accept-Language: en X-Newsgroups: comp.lang.icon Subject: fractals To: icon-group@cs.arizona.edu Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 111 Did anyone try to sketch the Mandelbrot set using icon ? Where can i find an example ? (i am using icon v9.1) From icon-group-sender Fri Sep 28 13:02:12 2001 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id f8SK1WM25205 for icon-group-addresses; Fri, 28 Sep 2001 13:01:32 -0700 (MST) Message-Id: <200109282001.f8SK1WM25205@baskerville.CS.Arizona.EDU> From: Chris.D.Tenaglia@jci.com Subject: Re: fractals To: dodo@hotmail.com Cc: icon-group@cs.arizona.edu Date: Fri, 28 Sep 2001 11:00:33 -0500 X-MIMETrack: Serialize by Router on jwimkrs1.na.jci.com/NA/Johnson_Controls(Release 5.07a |May 14, 2001) at 09/28/2001 11:22:49 AM Content-Disposition: inline Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 4717 --0__=86256AD5005796AB8f9e8a93df938690918c86256AD5005796AB Content-type: text/plain; charset=us-ascii My skills with mandelbrots and fractals is a little rusty. However, here is a sample 'hopalong' along similar lines. This is written for X-windows, and I'm running on Tru64 Unix on an Alpha 1000. I do lots of tweeking of the formulae and retrying to look for prettier designs. If you hit in the telnet window it will start drawing a new shape. Press ^C to break out. (See attached file: hop.icn) Chris Tenaglia, technical analyst, Johnson Controls dodo@hotmail. com To: icon-group@CS.Arizona.EDU cc: 09/27/01 Subject: fractals 08:52 PM Did anyone try to sketch the Mandelbrot set using icon ? Where can i find an example ? (i am using icon v9.1) --0__=86256AD5005796AB8f9e8a93df938690918c86256AD5005796AB Content-type: application/octet-stream; name="hop.icn" Content-Disposition: attachment; filename="hop.icn" Content-transfer-encoding: base64 Iw0KIyBmaWxlIDogaG9wLmljbg0KIyBkZXNjIDogZHJhdyBob3BhbG9uZyBmcmFjdGFscyBpbiB4 d2luZG93cyB3aXRoIGFzc29ydGVkIG1hdGhlbWF0aWNhbA0KIyAgICAgICAgdmFyaWF0aW9ucw0K IyB1c2UgIDogaG9wIGZ1bmN0aW9uIHR3ZWVrZXINCiMNCiMgdXBkYXRlICAgICAgICBieSAgICAg ICAgIHdoYXQNCiMgMTQtanVuLTIwMDAgICB0ZW5hZ2xpYSAgIHlldCBhbm90aGVyIHJld3JpdGUN CiMNCmdsb2JhbCB4LHksYSxiLGMNCnByb2NlZHVyZSBtYWluKHBhcmFtKQ0KICB3aW4gOj0gb3Bl bigiRG9vZGxlciIsIngiLCJnZW9tZXRyeT01MDB4NTAwKzUwMCs1MDAiLCJiZz1ibGFjayIpDQog IGNvbG9ycyA6PSBbInJlZCIsIndoaXRlIiwiYmx1ZSIsInllbGxvdyIsImdyZWVuIiwibWFnZW50 YSIsInB1cnBsZSJdDQogICZyYW5kb20gOj0gbWFwKCZjbG9jaywiOiIsIjYiKQ0KICBhIDo9IHJl YWwoPzEwMCkgLSByZWFsKD81MCkNCiAgYiA6PSByZWFsKD8xMDApIC0gcmVhbCg/NTApDQogIGMg Oj0gcmVhbCg/MTAwKSAtIHJlYWwoPzUwKQ0KICB4IDo9IHJlYWwoPzEwMCkgLSByZWFsKD81MCkN CiAgeSA6PSByZWFsKD8xMDApIC0gcmVhbCg/NTApDQogIGNvdW50ZXIgOj0gMA0KICBjb21tYW5k IDo9IHBhcmFtWzFdDQogIHR3aXRjaCAgOj0gcGFyYW1bMl0NCiAgZnVuY3Rpb246PSBjYXNlIGNv bW1hbmQgb2YgeyAibG9nIiA6IGxvZw0KCQkJICAgICAgICJzaW4iIDogc2luDQoJCQkgICAgICAg ImV4cCIgOiBleHANCgkJCSAgICAgICAic3FyIiA6IHNxcg0KCQkJICAgICAgICJwb2wiIDogcG9s DQoJCQkgICAgICAgZGVmYXVsdCA6IHJvb3QNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAg fQ0KICBhZGp1c3QgIDo9IGNhc2UgdHdpdGNoICBvZiB7ICJsb2ciIDogbG9nDQoJCQkgICAgICAg ImNvcyIgOiBjb3MNCgkJCSAgICAgICAic3FydCI6IHJvb3QNCgkJCSAgICAgICAic3FyIiA6IHNx cg0KCQkJICAgICAgICJwb2wiIDogcG9sDQoJCQkgICAgICAgZGVmYXVsdCA6IHBhc3MNCgkJCSAg ICAgfQ0KICBjb2xvciA6PSA/Y29sb3JzDQogIFdBdHRyaWIod2luLCJmZz0iIHx8IGNvbG9yKQ0K DQogIHJlcGVhdA0KICAgIHsNCiAgICB4eCA6PSByZWFsKHkgLSByZWFsKHNnbih4KSkgKiBmdW5j dGlvbihhYnMoYip4LXkpKSkNCiAgICB5ICA6PSByZWFsKGFkanVzdChhLXgpKQ0KICAgIHggIDo9 IHJlYWwoeHgpDQogICAgY291bnRlciArOj0gMQ0KICAgIGlmIGNvdW50ZXIgPiAxMDAwIHRoZW4N CiAgICAgIHsNCiAgICAgIGNvdW50ZXIgOj0gMA0KICAgICAgY29sb3IgICA6PSA/Y29sb3JzDQog ICAgICBXQXR0cmliKHdpbiwiZmc9IiB8fCBjb2xvcikNCiAgICAgIGlmIGtiaGl0KCkgdGhlbg0K CXsNCglnZXRjaCgpDQoJRXJhc2VBcmVhKHdpbikNCgl4IDo9IHJlYWwoPzEwMCkgLSByZWFsKD81 MCkNCgl5IDo9IHJlYWwoPzEwMCkgLSByZWFsKD81MCkNCglhIDo9IHJlYWwoPzEwMCkgLSByZWFs KD81MCkNCgliIDo9IHJlYWwoPzEwMCkgLSByZWFsKD81MCkNCgljIDo9IHJlYWwoPzEwMCkgLSBy ZWFsKD81MCkNCgl9DQogICAgICB9DQogICAgRHJhd1BvaW50KHdpbix4KzI1MCx5KzI1MCkNCiAg ICBXU3luYygpDQogICAgfQ0KICBlbmQNCg0KIw0KIyByZXR1cm4gdGhlIHNpZ251bSBvZiBhIG51 bWJlci4gMSBtZWFucyBuZWcsIGFuZCAtMSBtZWFuIHBvc2l0aXZlDQojDQpwcm9jZWR1cmUgc2du KG4pDQogIGlmIGludGVnZXIobikgPT0gMCB0aGVuIHJldHVybiAxDQogIHJldHVybiByZWFsKG4g LyAtbikNCiAgZW5kDQoNCiMNCiMgc3F1YXJlIHRoZSBudW1iZXINCiMNCnByb2NlZHVyZSBzcXIo bikNCiAgcmV0dXJuIHNxcnQoYWJzKHJlYWwobikpKQ0KICBlbmQNCg0KIw0KIyBwYXNzIHdpdGgg bm8gY2hhbmdlDQojDQpwcm9jZWR1cmUgcGFzcyhuKQ0KICByZXR1cm4gcmVhbChuKQ0KICBlbmQN Cg0KIw0KIyBwb2xhciBjb29yZGluYXRlIHRyYW5zZm9ybWF0aW9uDQojDQpwcm9jZWR1cmUgcG9s KG4pDQogIHJldHVybiB4KngtbipuDQogIGVuZA0KDQojDQojIHNxdWFyZSByb290IHdpdGggbmVn IHByb3RlY3Rpb24NCiMNCnByb2NlZHVyZSByb290KG4pDQogIHJldHVybiByZWFsKHNxcnQoYWJz KG4pKSkNCiAgZW5kDQoNCg== --0__=86256AD5005796AB8f9e8a93df938690918c86256AD5005796AB-- From icon-group-sender Fri Sep 28 16:32:44 2001 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id f8SNV3M01884 for icon-group-addresses; Fri, 28 Sep 2001 16:31:03 -0700 (MST) Message-Id: <200109282331.f8SNV3M01884@baskerville.CS.Arizona.EDU> Date: Fri, 28 Sep 2001 15:00:50 -0700 (MST) From: Gregg Townsend To: dodo@hotmail.com, icon-group@cs.arizona.edu Subject: Re: fractals Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 485 There are two Mandelbrot programs in the Icon program library: http://www.cs.arizona.edu/icon/library/src/gprogs/mandel1.icn http://www.cs.arizona.edu/icon/library/src/gprogs/mandel2.icn --------------------------------------------------------------------------- Gregg Townsend Staff Scientist The University of Arizona gmt@cs.arizona.edu Computer Science Tucson, Arizona, USA --------------------------------------------------------------------------- From icon-group-sender Mon Oct 1 07:54:54 2001 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id f91Eqak03120 for icon-group-addresses; Mon, 1 Oct 2001 07:52:36 -0700 (MST) Message-Id: <200110011452.f91Eqak03120@baskerville.CS.Arizona.EDU> From: pjayant@vsnl.com (jayant) X-Newsgroups: comp.lang.icon Subject: Opening Icons with ICL extenstion Date: 28 Sep 2001 18:21:59 -0700 X-Complaints-To: groups-abuse@google.com To: icon-group@cs.arizona.edu Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 651 I had a software named Icon Manager which used to open the ICL extension files. In the process of migrating from Windows 3.0 to 95 to 98 to ME, the program seems to have got damaged and now when I try to open the ICL files, I get an error message, saying the iconman.ini configuration file is missing. I need to re-install the software but I do not appear to have have the ICON MANAGER ZIP file. Could anyone suggest from where I could download it? Or if anyone has it, could he/she kindly send it to me as e-mail attachement? I have tried to open the files with Picto 4.5 and such other editors but no success. Thanks. P. Jayant pjayant@vsnl.com From icon-group-sender Mon Oct 1 07:55:40 2001 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id f91Etck03217 for icon-group-addresses; Mon, 1 Oct 2001 07:55:38 -0700 (MST) Message-Id: <200110011455.f91Etck03217@baskerville.CS.Arizona.EDU> From: songthen@hotmail.com (alexis machine) X-Newsgroups: comp.lang.icon Subject: icon decompiler Date: 30 Sep 2001 21:36:03 -0700 X-Complaints-To: groups-abuse@google.com To: icon-group@cs.arizona.edu Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 69 does anyone know where i can get an icon decompier? thanks, alexis From icon-group-sender Mon Oct 15 07:41:34 2001 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id f9FEeHY22068 for icon-group-addresses; Mon, 15 Oct 2001 07:40:18 -0700 (MST) Message-Id: <200110151440.f9FEeHY22068@baskerville.CS.Arizona.EDU> Date: Mon, 15 Oct 2001 10:32:40 +1000 From: dodod X-Accept-Language: en X-Newsgroups: comp.lang.icon Subject: Is anyone using Icon v9.1 ? To: icon-group@cs.arizona.edu Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 7 Why ? From icon-group-sender Mon Oct 15 08:20:13 2001 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id f9FFKAI23521 for icon-group-addresses; Mon, 15 Oct 2001 08:20:10 -0700 (MST) Message-Id: <200110151520.f9FFKAI23521@baskerville.CS.Arizona.EDU> From: anders.holtsberg@decuma.com (Anders Holtsberg) X-Newsgroups: comp.lang.icon Subject: Winicon crashes sometimes. Date: 15 Oct 2001 07:38:53 -0700 X-Complaints-To: groups-abuse@google.com To: icon-group@cs.arizona.edu Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 700 We are running an Icon program on Windows 98. The program is modestly large - a couple of thousand lines long - and it is used for graphically editing chinese characters. The data files are rather large - several megabytes and the program works very well, mostly. The program however crashes rather mysteriously sometimes. By this I mean not the ordinary way in which I write a bug making the interpreter bailing out normally but a memory segmentation fault. It says error on adress 0187:00411A45. It happens during file saveing. We are running Icon version 9.3.1 WI 1.01 and the operating system is Windows 98. It has never crashed on Linux. Has anybody seen this before? Anders Holtsberg From icon-group-sender Mon Oct 15 16:30:29 2001 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id f9FNUBk10975 for icon-group-addresses; Mon, 15 Oct 2001 16:30:11 -0700 (MST) Message-Id: <200110152330.f9FNUBk10975@baskerville.CS.Arizona.EDU> Date: Mon, 15 Oct 2001 15:21:50 -0600 (MDT) X-Authentication-Warning: sunray.CS.NMSU.Edu: jeffery set sender to jeffery@cs.nmsu.edu using -f From: Clint Jeffery To: anders.holtsberg@decuma.com CC: icon-group@cs.arizona.edu Subject: Re: Winicon crashes sometimes. Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 607 Anders, Icon crashes are often related to a stack not being big enough. There are two stacks (C language runtime stack and Icon value stack) that can overflow. I have seen Winicon crash before, and for some applications it will crash on Win95/98 but not crash on WinNT/2000, so the stack may be a bit more fragile on Win95/98. Of course, it might not be a stack problem, it might be a logic bug in the WinIcon runtime. Ways to diagnose: see if it reproduces under WinNT/2000; see if it reproduces under Windows Unicon. If there's anything I can do to help, let me know. Clint jeffery@cs.nmsu.edu From icon-group-sender Tue Oct 16 17:31:42 2001 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id f9H0Tjk22084 for icon-group-addresses; Tue, 16 Oct 2001 17:29:45 -0700 (MST) Message-Id: <200110170029.f9H0Tjk22084@baskerville.CS.Arizona.EDU> From: "John Sampson" To: Subject: French colonic lavage revisited Date: Tue, 16 Oct 2001 23:02:17 +0100 X-Priority: 3 (Normal) X-MSMail-Priority: Normal Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 1136 Hello - I recently had a bit of bother with French colons or vertical strokes or whatever they are called. I have now had another kind of bother. I was using The Semware Editor and Icon 9.3.1 for DOS. On a source file containing the augmented string concatenation operator ICONT gave 'invalid character' error messages. WICONT from Windows Icon did the same. A hex view of the file showed that the vertical strokes were being represented by the byte DD. I then looked at the file using VEDIT, and there were strange characters where the vertical strokes should be. I changed them for vertical strokes and then ICONT translated the file without problems. Now the byte representing them was 7C. Steve Wampler kindly helped me with the previous problem I had, but I am now wondering if there is a DOS bug concerning this character. Or are there two vertical stroke characters, one with a break in it and one without? Different text editors seem to have different opinions about this character (or these characters). I have changed recently from Windows 95 to Windows 98 - I have not had this problem before. Regards _John Sampson_ From icon-group-sender Wed Oct 17 09:02:56 2001 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id f9HG1WI13928 for icon-group-addresses; Wed, 17 Oct 2001 09:01:32 -0700 (MST) Message-Id: <200110171601.f9HG1WI13928@baskerville.CS.Arizona.EDU> Date: Wed, 17 Oct 2001 14:25:05 +1300 (NZDT) From: "Richard A. O'Keefe" To: icon-group@cs.arizona.edu, jsampson@indexes.u-net.com Subject: Re: French colonic lavage revisited Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 2008 "John Sampson" wrote: Steve Wampler kindly helped me with the previous problem I had, but I am now wondering if there is a DOS bug concerning this character. Or are there two vertical stroke characters, one with a break in it and one without? In ISO Latin 1, hence also in Windows CP 1252, there are indeed two vertical stroke characters, one with a break in it (0xA6) and one without (7C). >From the Unicode 3.1.1 MAPPINGS collection: ISO Latin 1: 0x7C 0x007C # VERTICAL LINE 0xA6 0x00A6 # BROKEN BAR In the VENDORS/MICSFT/WINDOWS subcollection of MAPPINGS, grep '^0XDD[ ]' * found CP1250.TXT:0xDD 0x00DD #LATIN CAPITAL LETTER Y WITH ACUTE CP1251.TXT:0xDD 0x042D #CYRILLIC CAPITAL LETTER E CP1252.TXT:0xDD 0x00DD #LATIN CAPITAL LETTER Y WITH ACUTE CP1253.TXT:0xDD 0x03AD #GREEK SMALL LETTER EPSILON WITH TONOS CP1254.TXT:0xDD 0x0130 #LATIN CAPITAL LETTER I WITH DOT ABOVE CP1255.TXT:0xDD #UNDEFINED CP1256.TXT:0xDD 0x0641 #ARABIC LETTER FEH CP1257.TXT:0xDD 0x017B #LATIN CAPITAL LETTER Z WITH DOT ABOVE CP1258.TXT:0xDD 0x01AF #LATIN CAPITAL LETTER U WITH HORN CP874.TXT:0xDD #UNDEFINED CP932.TXT:0xDD 0xFF9D #HALFWIDTH KATAKANA LETTER N CP936.TXT:0xDD #DBCS LEAD BYTE CP949.TXT:0xDD #DBCS LEAD BYTE CP950.TXT:0xDD #DBCS LEAD BYTE and grep 'BROKEN BAR' * found CP1250.TXT:0xA6 0x00A6 #BROKEN BAR CP1251.TXT:0xA6 0x00A6 #BROKEN BAR CP1252.TXT:0xA6 0x00A6 #BROKEN BAR CP1253.TXT:0xA6 0x00A6 #BROKEN BAR CP1254.TXT:0xA6 0x00A6 #BROKEN BAR CP1255.TXT:0xA6 0x00A6 #BROKEN BAR CP1256.TXT:0xA6 0x00A6 #BROKEN BAR CP1257.TXT:0xA6 0x00A6 #BROKEN BAR CP1258.TXT:0xA6 0x00A6 #BROKEN BAR CP932.TXT:0xEEFA 0xFFE4 #FULLWIDTH BROKEN BAR CP932.TXT:0xFA55 0xFFE4 #FULLWIDTH BROKEN BAR CP936.TXT:0xA957 0xFFE4 #FULLWIDTH BROKEN BAR There should not, therefore, be any disagreement about what 0xDD or 0xA6 or BROKEN BAR are in any of the CP125? Windows character sets. From icon-group-sender Thu Oct 18 16:28:12 2001 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id f9INQgs09334 for icon-group-addresses; Thu, 18 Oct 2001 16:26:42 -0700 (MST) Message-Id: <200110182326.f9INQgs09334@baskerville.CS.Arizona.EDU> From: "John Sampson" To: Subject: French colonic lavage - an apology Date: Thu, 18 Oct 2001 20:51:23 +0100 X-Priority: 3 (Normal) X-MSMail-Priority: Normal Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 207 Hello - In my previous posting I confused Steve Wampler with Steve Hunter. I should have mentioned Steve Hunter. My apologies to both gentlemen. [And I try to write programs...] Regards _John Sampson_ From icon-group-sender Mon Oct 29 13:50:32 2001 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id f9TKm8o25219 for icon-group-addresses; Mon, 29 Oct 2001 13:48:08 -0700 (MST) Message-Id: <200110292048.f9TKm8o25219@baskerville.CS.Arizona.EDU> From: icon@steve.iit.edu (Michael Glass) X-Newsgroups: comp.lang.icon Subject: How does one discover which window has the focus? Date: 29 Oct 2001 10:53:31 -0800 X-Complaints-To: groups-abuse@google.com To: icon-group@cs.arizona.edu Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 498 In the Icon graphics facility is there any way to discover which window has the focus? I needed to write my own version of Notice(), the routine that pops up information and error messages as a modal dialog. I would like it to pop up in the current window, not just anywhere on the screen where the user might miss it. (Even better: once you have the current window, you can obtain the current cursor coordinates and have it pop up right by the pointer.) -- Michael Glass icon@steve.iit.edu From icon-group-sender Mon Oct 29 16:41:39 2001 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id f9TNfHA00940 for icon-group-addresses; Mon, 29 Oct 2001 16:41:17 -0700 (MST) Message-Id: <200110292341.f9TNfHA00940@baskerville.CS.Arizona.EDU> Date: Mon, 29 Oct 2001 15:10:09 -0700 X-Authentication-Warning: unicon.cs.nmsu.edu: jeffery set sender to jeffery@cs.nmsu.edu using -f From: Clint Jeffery To: icon@steve.iit.edu CC: icon-group@cs.arizona.edu Subject: Re: How does one discover which window has the focus? Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 287 QueryPointer() returns current cursor position in absolute coordinates if called with no argument. It can be used to open a window right where the mouse is. I am not aware of a way to obtain the focus window information using the Icon graphics facilities. Clint jeffery@cs.nmsu.edu From icon-group-sender Tue Oct 30 16:51:20 2001 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id f9UNnhA13151 for icon-group-addresses; Tue, 30 Oct 2001 16:49:43 -0700 (MST) Message-Id: <200110302349.f9UNnhA13151@baskerville.CS.Arizona.EDU> From: icon@steve.iit.edu (Michael Glass) X-Newsgroups: comp.lang.icon Subject: Re: How does one discover which window has the focus? Date: 30 Oct 2001 12:32:51 -0800 X-Complaints-To: groups-abuse@google.com To: icon-group@cs.arizona.edu Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 416 Clint Jeffery's most useful reply seems not to have gatewayed to the newsgroup, so I thought I'd post it here: QueryPointer() returns current cursor position in absolute coordinates if called with no argument. It can be used to open a window right where the mouse is. I am not aware of a way to obtain the focus window information using the Icon graphics facilities. Clint jeffery -- Michael Glass From icon-group-sender Tue Oct 30 16:51:46 2001 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id f9UNpeE13236 for icon-group-addresses; Tue, 30 Oct 2001 16:51:40 -0700 (MST) Message-Id: <200110302351.f9UNpeE13236@baskerville.CS.Arizona.EDU> From: Chris.D.Tenaglia@jci.com Subject: Trick or Treat? To: icon-group@cs.arizona.edu Date: Tue, 30 Oct 2001 13:25:30 -0600 X-MIMETrack: Serialize by Router on jwimkrs1.na.jci.com/NA/Johnson_Controls(Release 5.07a |May 14, 2001) at 10/30/2001 03:13:05 PM Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 2581 Code snippits for 10/31/2001. Ever wish you had a time machine? I did. Here are two samples. yesterday returns yesterday's date and tomorrow returns tomorrows date. So simple, so useful. -------------- # # file : yesterday.icn # desc : generate yesterday's date mm/dd/yy # use : call from scripts etc,... avoid today! # # update by what # 30-oct-2001 tenaglia initial write # procedure main() last := table() last["01"] := 31 last["02"] := 28 last["03"] := 31 last["04"] := 30 last["05"] := 31 last["06"] := 30 last["07"] := 31 last["08"] := 31 last["09"] := 30 last["10"] := 31 last["11"] := 30 last["12"] := 31 last["-1"] := 31 field := parse(&date,'/') year := field[1] yy := year[3:0] mm := field[2] dd := field[3] if (year % 4) = 0 then last["02"] := 29 dd -:= 1 if dd < 1 then { mm -:= 1 dd := last[right(mm,2,0)] if mm < 1 then { yy -:= 1 mm := 12 } } result := right(mm,2,0) || "/" || right(dd,2,0) || "/" || right(yy,2,0) write(result) end # # parse a string into a list with respect to a delimiter # procedure parse(line,delims) static chars chars := &cset -- delims tokens := [] line ? while tab(upto(chars)) do put(tokens,tab(many(chars))) return tokens end ------------------------------------ # # file : tomorrow.icn # desc : generate tomorrow's date mm/dd/yy # use : call from scripts etc,... avoid today! # # update by what # 30-oct-2001 tenaglia initial write # procedure main() last := table() last["01"] := 31 last["02"] := 28 last["03"] := 31 last["04"] := 30 last["05"] := 31 last["06"] := 30 last["07"] := 31 last["08"] := 31 last["09"] := 30 last["10"] := 31 last["11"] := 30 last["12"] := 31 last["0"] := 31 last["13"] := 31 field := parse(&date,'/') year := field[1] yy := year[3:0] mm := field[2] dd := field[3] if (year % 4) = 0 then last["02"] := 29 dd +:= 1 if dd > last[mm] then { mm +:= 1 dd := "01" if mm > 12 then { yy +:= 1 mm := "01" } } result := right(mm,2,0) || "/" || right(dd,2,0) || "/" || right(yy,2,0) write(result) end # # parse a string into a list with respect to a delimiter # procedure parse(line,delims) static chars chars := &cset -- delims tokens := [] line ? while tab(upto(chars)) do put(tokens,tab(many(chars))) return tokens end -------------------------------- Chris Tenaglia, technical analyst, Johnson Controls From icon-group-sender Thu Nov 8 12:45:09 2001 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id fA8JgQI28608 for icon-group-addresses; Thu, 8 Nov 2001 12:42:26 -0700 (MST) Message-Id: <200111081942.fA8JgQI28608@baskerville.CS.Arizona.EDU> From: Steve Wampler X-Newsgroups: comp.lang.icon Subject: mutual evaluation Date: Thu, 08 Nov 2001 11:08:43 -0700 X-Complaints-To: abuse@noao.edu X-Accept-Language: en To: icon-group@cs.arizona.edu Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 2300 Since this list has been fairly quiet lately, I thought I post a couple of (very) simple code snippets showing uses of mutual evaluation. I was asked recently by someone how to determine the size of a file from within Icon. It's really easy (with the newer releases, at least!) - if f is a file, then where(seek(f,0))-1 produces the number of bytes in a file. [where() and seek() both operate on a file using the same positioning used in Icon when operating on strings... so where(f) returns the position of the file pointer. To get the number of bytes *upto* that position you have to subtract 1.] Ok, but that solution alters the file pointer position within the file, which may not be desirable. Here's a simple function that produces the size of a file while preserving the current file pointer position... procedure fSize(f) return 2(oldp := where(f), where(seek(f,0))-1, seek(f,oldp)) end There's nothing fancy about the use of mutual evaluation here, in fact, a solution without mutual evaluation isn't much more complex: procedure fSize2(f) oldp := where(f) sizef := where(seek(f,0))-1 seek(f, oldp) return sizef end but you do have to add a second local variable (sizef) to hold the result of the middle expression in this case. What if you only have the name of the file? Then: procedure fileSize(fName) return 2(f := open(fName), where(seek(f,0))-1, close(f)) end works. Here, you don't care about the file position but you do want to close the file when done. Note that if the open(fName) fails, the procedure call fails as well. Coding the same thing w/o mutual evaluation can be done as: procedure fileSize2(fName) if f := open(fName) then { sizef := where(seek(f,0))-1 close(f) return sizef } end The idiom in use in these mutual evaluation examples is simple: return 2(initialize, compute, cleanup) which is really pretty clean - most of the time. It's not clean when any of initialize, compute, or cleanup is complex (but *that* can often be solved by encapsulating the complex action in a procedure). What else could be a problem? -- Steve Wampler- SOLIS Project, National Solar Observatory swampler@noao.edu From icon-group-sender Thu Nov 8 16:44:07 2001 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id fA8NgY206161 for icon-group-addresses; Thu, 8 Nov 2001 16:42:34 -0700 (MST) Message-Id: <200111082342.fA8NgY206161@baskerville.CS.Arizona.EDU> Date: Thu, 8 Nov 2001 15:23:30 -0500 (EST) From: Taybin Rutkin X-Sender: trutkin@planck.clarku.edu To: Steve Wampler cc: icon-group@cs.arizona.edu Subject: Re: mutual evaluation Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 536 On Thu, 8 Nov 2001, Steve Wampler wrote: > The idiom in use in these mutual evaluation examples is simple: > > return 2(initialize, compute, cleanup) > > which is really pretty clean - most of the time. It's not clean > when any of initialize, compute, or cleanup is complex (but *that* > can often be solved by encapsulating the complex action in a > procedure). Is 2() a standard library procedure? I don't think I've seen it before. I didn't know that procedures could have a digit as a name. How does it work? Taybin From icon-group-sender Thu Nov 8 16:50:37 2001 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id fA8NnBA06365 for icon-group-addresses; Thu, 8 Nov 2001 16:49:11 -0700 (MST) Message-Id: <200111082349.fA8NnBA06365@baskerville.CS.Arizona.EDU> Date: Thu, 08 Nov 2001 14:08:12 -0700 From: Steve Wampler X-Accept-Language: en To: Taybin Rutkin CC: icon-group@cs.arizona.edu Subject: Re: mutual evaluation Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 2300 Taybin Rutkin wrote: > > On Thu, 8 Nov 2001, Steve Wampler wrote: > > > The idiom in use in these mutual evaluation examples is simple: > > > > return 2(initialize, compute, cleanup) > > > > which is really pretty clean - most of the time. It's not clean > > when any of initialize, compute, or cleanup is complex (but *that* > > can often be solved by encapsulating the complex action in a > > procedure). > > Is 2() a standard library procedure? I don't think I've seen it > before. I didn't know that procedures could have a digit as a name. How > does it work? Ah, mutual evaluation is an Icon language expression evaluation feature, not a procedure. It's covered starting on page 72 of the 3rd ed. of the Icon programming language (and probably appears in all the earlier books - it's been around a while... look for mutual evaluation in the index). It actually helps illustrate how general Icon's expression evaluation mechanims is. The expression syntax: expr0(expr1,expr2,...,exprN) has a couple of uses. If expr0 evaluates to a function or procedure name then that function/procedure is invoked (after evaluating the arguments of course!). If expr0 evaluates to an integer, then the arguments are evaluated and the whole expression returns the result produced by the argument in the position represented by that integer. [Since expr0 evaluates to a "position", 0 means to produce the result of the last argument and omitting expr0 defaults it to 0.] So, for example: write( 1("a","b","c") ) would output "a", while write( 3("a","b","c") ) would output "c", and write( ("a","b","c") ) also outputs "c". Naturally, being Icon, any/all of the expressions can be arbitrarily complex. For example, there's nothing other than a programmer's common sense keeping expr0 be a generator that produces both integers *and* function/ procedure names... (very hard to think of a valid use for that one!) As an aside, it might have been cleaner if I had written: return 3(f := open(fName), seek(f,0), where(f)-1, close(f)) instead of return 2(f := open(fName), where(seek(f,0))-1, close(f)) in the previous message, since the first more clearly shows the steps involved. -- Steve Wampler- SOLIS Project, National Solar Observatory swampler@noao.edu From icon-group-sender Thu Nov 8 17:03:53 2001 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id fA902Es06787 for icon-group-addresses; Thu, 8 Nov 2001 17:02:14 -0700 (MST) Message-Id: <200111090002.fA902Es06787@baskerville.CS.Arizona.EDU> Date: Thu, 8 Nov 2001 16:14:48 -0500 (EST) From: Taybin Rutkin X-Sender: trutkin@planck.clarku.edu To: Steve Wampler cc: icon-group@cs.arizona.edu Subject: Re: mutual evaluation Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 517 On Thu, 8 Nov 2001, Steve Wampler wrote: > As an aside, it might have been cleaner if I had written: > > return 3(f := open(fName), seek(f,0), where(f)-1, close(f)) > > instead of > > return 2(f := open(fName), where(seek(f,0))-1, close(f)) > > in the previous message, since the first more clearly shows > the steps involved. I see. It's been awhile. I thought it looked lambda-esque. I take it that it doesn't short circut? Otherwise, in 2(), it would skip the close(f). Is this correct? Taybin From icon-group-sender Thu Nov 8 17:05:41 2001 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id fA904II06858 for icon-group-addresses; Thu, 8 Nov 2001 17:04:18 -0700 (MST) Message-Id: <200111090004.fA904II06858@baskerville.CS.Arizona.EDU> Date: Thu, 08 Nov 2001 14:23:47 -0700 From: Steve Wampler X-Accept-Language: en To: Taybin Rutkin CC: icon-group@cs.arizona.edu Subject: Re: mutual evaluation Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 1024 Taybin Rutkin wrote: > > On Thu, 8 Nov 2001, Steve Wampler wrote: > > > As an aside, it might have been cleaner if I had written: > > > > return 3(f := open(fName), seek(f,0), where(f)-1, close(f)) > > > > instead of > > > > return 2(f := open(fName), where(seek(f,0))-1, close(f)) > > > > in the previous message, since the first more clearly shows > > the steps involved. > > I see. It's been awhile. I thought it looked lambda-esque. I take it > that it doesn't short circut? Otherwise, in 2(), it would skip the > close(f). Is this correct? > > Taybin Exactly right. The evaluation itself is equivalent to (f := open(fName) & (seek(f,0)) & (where(f)-1) & (close(f)) *except* that the value of expr0 determines which of the conjoined expressions' results gets produced, instead of just producing the result of the last (as the above conjunction sequence does). Normal Icon goal-directed evaluation applies, of course. -- Steve Wampler- SOLIS Project, National Solar Observatory swampler@noao.edu From icon-group-sender Fri Nov 9 12:40:49 2001 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id fA9JeU208015 for icon-group-addresses; Fri, 9 Nov 2001 12:40:30 -0700 (MST) Message-Id: <200111091940.fA9JeU208015@baskerville.CS.Arizona.EDU> Date: Fri, 09 Nov 2001 10:39:28 -0500 From: Mark Otto X-Accept-Language: en To: icon-group@cs.arizona.edu Subject: Re: mutual evaluation X-MIMETrack: Itemize by SMTP Server on FW0HUB1/FWS/DOI(Release 5.0.8 |June 18, 2001) at 11/09/2001 08:42:15 AM, Serialize by Router on FW0HUB1/FWS/DOI(Release 5.0.8 |June 18, 2001) at 11/09/2001 08:42:36 AM, Serialize complete at 11/09/2001 08:42:36 AM Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 739 One part of Taybin's question I don't think was answered. A result from #exp(exp,exp,...) is only returned if all expressions mutually evaluated succeed, so all expressions after the expression returned are evaluted. Here is a short program where the first expression is returned and printed out, but the second mutual expression is also evaluated. procedure main() a:=1 b:=2 write( 1(a,b:=4) ) write(b) end The print out is: 1 4 not: 1 2 Mark -- Mark Otto, Biological Statistician Population and Habitat Assessment Section Migratory Bird Management Division e-mail: M a r k _ O t t o @ F W S . G o v U.S. Fish and Wildlife Service Department of the Interior 11500 American Holly Drive Laurel, Maryland 20708-4016 From icon-group-sender Fri Nov 9 13:04:28 2001 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id fA9K3lc08843 for icon-group-addresses; Fri, 9 Nov 2001 13:03:47 -0700 (MST) Message-Id: <200111092003.fA9K3lc08843@baskerville.CS.Arizona.EDU> Date: Fri, 09 Nov 2001 08:45:33 -0700 From: Steve Wampler X-Accept-Language: en To: Taybin Rutkin , icon-group@cs.arizona.edu Subject: Re: mutual evaluation Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 1737 Steve Wampler wrote, apparently w/o thinking: > > The expression syntax: > > expr0(expr1,expr2,...,exprN) > > has a couple of uses. If expr0 evaluates to a function or procedure name > then that function/procedure is invoked (after evaluating the arguments > of course!). If expr0 evaluates to an integer, then the arguments are > evaluated and the whole expression returns the result produced by the argument > in the position represented by that integer. [Since expr0 evaluates to > a "position", 0 means to produce the result of the last argument and > omitting expr0 defaults it to 0.] Sigh, as was kindly pointed out to me, the last sentence is simply wrong. When expr0 produces an integer, that integer is treated as identifying the position of the argument whose value is to be produced. As such it follows the same rules as other positions (e.g. lists and strings). That means a value of 0 references a non-existant position "one-off" the end of the list of expressions. So, omitting expr0 defaults to -1, not 0, and 0(expr1,expr2,expr3) is equivalent to expr1 & expr2 & expr3 & &fail For example, the following program: procedure main(args) every i := -3 to 3 do write(i, ": ", i("a", "b", "c") | "failed") end outputs: -3: a -2: b -1: c 0: failed 1: a 2: b 3: c Finally, if you want the result of the last expression, you can write either: (expr1, expr2, ...., exprN) or (-1)(expr1, expr2, ...., exprN) but -1(expr1, expr2, ...., exprN) won't work as you might expect, because of precedence rules. My thanks to Steve Hunter for catching this! -- Steve Wampler- SOLIS Project, National Solar Observatory swampler@noao.edu From icon-group-sender Fri Nov 9 13:05:07 2001 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id fA9K55M08936 for icon-group-addresses; Fri, 9 Nov 2001 13:05:05 -0700 (MST) Message-Id: <200111092005.fA9K55M08936@baskerville.CS.Arizona.EDU> Date: Fri, 9 Nov 2001 09:27:31 -0700 (MST) From: Gregg Townsend To: Paterniti@praxis.it, icon-group Subject: Re: Icon debugger? Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 894 > From: Paterniti Michele > Subject: Icon debugger? > > I am experimenting with icon in order to understand what is worth doing with > it, and what one have better do using something else. > My question is: what about an icon debugger? (I mean an interactive step by > step debugger) > I could not find any: was I not clever enough or does it not exist? > It could be a good idea to build one (and maybe I will try to if I had some > time) but it seems there must be some tricks I cannot see if no one have > alredy done it. There's no "official" Icon debugger, but you might want to take a look at "itweak": http://www.soder-labs.com/icon/ --------------------------------------------------------------------------- Gregg Townsend Staff Scientist The University of Arizona gmt@cs.arizona.edu Computer Science Tucson, Arizona, USA From icon-group-sender Mon Nov 19 08:00:22 2001 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id fAJEwZ620749 for icon-group-addresses; Mon, 19 Nov 2001 07:58:35 -0700 (MST) Message-Id: <200111191458.fAJEwZ620749@baskerville.CS.Arizona.EDU> Date: Mon, 19 Nov 2001 11:30:39 +0100 From: Anders Holtsberg X-Accept-Language: en To: icon-group@cs.arizona.edu Subject: Icon file: s3vvcadf Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 1170 Icon on Windows creates temporary files in the root directory of the disk it is running on. They have names like this: -rwxrw---- 1 jonasm users 0 Oct 22 20:16 s214 -rwxrw---- 1 jonasm users 0 Oct 25 13:21 s280 -rwxrw---- 1 jonasa users 0 Oct 18 17:18 s3uk9o15 -rwxrw---- 1 jonasa users 0 Oct 25 17:28 s3vum1h1 -rwxrw---- 1 yukim users 0 Nov 9 16:18 s3vvag1t (Don't be confused of the Unix-printout: the server is running Samba) Now to the questions: - What are they doing there? - What should I do to force WinIcon to use the local disk (or X:\tmp) for temporary files. Is there some environment variable I could use? The problem is that the root of the disk normally should not be writeble but then the WinIcon executables crash. And excuse me if I have asked somthing similar before, I am slightly confused sometimes... Anders Holtsberg -- _______________________________________________________________ Anders Holtsberg Decuma AB tel +46 709 596305 Ideon Växthuset anders.holtsberg@decuma.se S-223 70 Lund, Sweden From icon-group-sender Mon Nov 19 16:28:40 2001 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id fAJNSHw25862 for icon-group-addresses; Mon, 19 Nov 2001 16:28:17 -0700 (MST) Message-Id: <200111192328.fAJNSHw25862@baskerville.CS.Arizona.EDU> Date: Mon, 19 Nov 2001 12:54:57 -0700 X-Authentication-Warning: unicon.cs.nmsu.edu: jeffery set sender to jeffery@cs.nmsu.edu using -f From: Clint Jeffery To: anders.holtsberg@decuma.com CC: icon-group@cs.arizona.edu Subject: Evil Windows Icon temporary files: s3vvcadf Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 1596 The non-command-line version of Windows Icon, since it has no OS-provided console and cannot rely on file redirection (especially stderr) working on various Windows versions, writes the compiler's normal output to a log file, which the IDE then reads in and displays in a scrollable window. The logfiles are supposed to get deleted, but under various abnormal program termination conditions they do not. This code is bad and should be rewritten by a Windows enthusiast to do something more clever, perhaps a pipe can be made to work. Worse yet: the logfiles used to be created using a MS Visual C++ version of the UNIX temporary-file-creating function which always ignored the TEMP and wrote to \, effectively making it useless where \ is not writable. Microsoft crippling their UNIX-compatible library function and adding a new proprietary temporary file function is nothing especially surprising. Anyhow the latest version of Windows Icon has this fixed, you can get it from a link near the bottom of http://unicon.sourceforge.net, or maybe from the Icon web site. Aside: the GNU C Compiler for MS Windows seems to offer a solution to much of the awkwardness found in Windows Icon, where due to MS Visual C++ we have had to provide two copies of the compiler and virtual machine (one with graphics facilities, and one without). I am preparing a version of Windows Unicon based on Icon 9.4 and built using GCC; if anyone wants to work on a straight Windows Icon 9.4 distribution I will be glad to provide configuration files and technical assistance. Clint Jeffery, jeffery@cs.nmsu.edu From icon-group-sender Wed Nov 21 16:33:17 2001 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id fALNVFY14389 for icon-group-addresses; Wed, 21 Nov 2001 16:31:15 -0700 (MST) Message-Id: <200111212331.fALNVFY14389@baskerville.CS.Arizona.EDU> From: captnjameskirk@yahoo.com (John) X-Newsgroups: comp.lang.icon Subject: translation+link question Date: 21 Nov 2001 06:20:16 -0800 X-Complaints-To: groups-abuse@google.com To: icon-group@cs.arizona.edu Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 391 I have Unicon 10.0 under win32. The "translated and linked" executables appear to be large, even for just a Hello World. Using nticont reduced the size somewhat (I assume since it uses a regular console for output), but it's still over 300K for "hello". This makes me wonder if the compiled code is really just linked with an icon vm and it's still being interpreted. Is that right? /John From icon-group-sender Sat Nov 24 15:35:13 2001 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id fAOMVoQ22251 for icon-group-addresses; Sat, 24 Nov 2001 15:31:50 -0700 (MST) Message-Id: <200111242231.fAOMVoQ22251@baskerville.CS.Arizona.EDU> From: Art Eschenlauer To: "'icon-group@CS.Arizona.EDU '" Subject: compact idiom to reference Nth result? e.g., every s := ("a"|"b"| "c"|"d")\3 ; write (s) Date: Thu, 22 Nov 2001 05:40:23 -0600 Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 1101 Is there a compact way to reference the Nth result in the set of results produced by an expression? For example, suppose that I want to obtain the third result produced by the expression ("a"|"b"|"c"|"d"). Thinking in my stone-age procedural way, I would write: procedure main() i := 0 every s := ("a"|"b"|"c"|"d") do { write ("s = "||s) i +:= 1 if i = 3 then { write ("i = "||i) write(s) break } } end I suppose that I could do this with a co-expression: procedure main() E := create ("a"|"b"|"c"|"d") i := 0 while s := ! @E do { write ("s = "||s) i +:= 1 if i = 3 then { write ("i = "||i) write(s) break } } end but I don't think that immediately gives me much benefit. What I'm hoping for is a compact syntax, similar to one of the following examples except that it would actually work! ("a"|"b"|"c"|"d")[3] 3("a"|"b"|"c"|"d") The most compact idiom I have come up with is: every s := ("a"|"b"|"c"|"d")\3 ; write (s) Any suggestions? Is there an idiomatic way to get rid of the variable s for example? From icon-group-sender Sat Nov 24 15:37:48 2001 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id fAOMaPc22339 for icon-group-addresses; Sat, 24 Nov 2001 15:36:25 -0700 (MST) Message-Id: <200111242236.fAOMaPc22339@baskerville.CS.Arizona.EDU> From: daha@best.com (David S. Harrison) X-Newsgroups: comp.lang.icon Subject: Icon on Mac OS X? Date: Thu, 22 Nov 2001 08:53:58 -0800 User-Agent: NewsWatcher-X 2.2.3b1 X-Complaints-To: newsabuse@supernews.com To: icon-group@cs.arizona.edu Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 461 Has anyone worked on the port of Icon 9.X to Mac OS X? I briefly tried to build it on my system and ran into the problem of co-routine switching. There is a little bit of assembler required to do the switch and although I can program well in C/C++, my assembly knowledge of PowerPC is limited. I tried playing around with the ppc_aix config but I haven't made much progress. -- David S. Harrison (daha@best.com) From icon-group-sender Sat Nov 24 15:41:08 2001 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id fAOMdiI22387 for icon-group-addresses; Sat, 24 Nov 2001 15:39:44 -0700 (MST) Message-Id: <200111242239.fAOMdiI22387@baskerville.CS.Arizona.EDU> Date: Thu, 22 Nov 2001 15:38:27 -0700 X-Authentication-Warning: unicon.cs.nmsu.edu: jeffery set sender to jeffery@cs.nmsu.edu using -f From: Clint Jeffery To: captnjameskirk@yahoo.com CC: icon-group@cs.arizona.edu Subject: Re: translation+link question; hello executable size Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 748 Windows Icon compiles and links VM code. The default .EXE extension copies the VM into the .EXE along with the VM code, so your suspicion is correct. If an extension of .CMD is specified (and maybe .BAT also, I forget) the VM is not included, and must be present on the path in order for the program to run. A configuration which produces small .exe's and uses a VM in a .dll was developed awhile back by David Feustel, and I hope to incorporate this under control of a command line option in future releases. There are other size issues in the Icon implementation, but (without speaking for the Icon Project) my belief is that size is not a paramount concern in the design, as it perhaps is for Java, for example. Clint jeffery@cs.nmsu.edu From icon-group-sender Mon Nov 26 07:50:05 2001 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id fAQEmuo26815 for icon-group-addresses; Mon, 26 Nov 2001 07:48:56 -0700 (MST) Message-Id: <200111261448.fAQEmuo26815@baskerville.CS.Arizona.EDU> From: Art Eschenlauer To: "''icon-group@CS.Arizona.EDU ' '" Subject: transmit ( expr @ coexpr_label ) - what is it, and how to use it? Date: Mon, 26 Nov 2001 07:11:10 -0600 Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 1209 >From the Icon help files: x1 @ C : x2 -- transmit value to co-expression x1 @ C activates C, transmitting the value of x1 to it; it produces the outcome of activating C. @C : x -- activate co-expression @C produces the outcome of activating C. I found one example of the first syntax in the first edition of the Icon handbook, but I'm having trouble conceptualizing what it is doing. That example showed use of the &main keyword but no example was given for use of the &source keyword. The example was a "producer-consumer" implementation. Please enlighten me: I thought that co-expressions existed to permit using a result sequence in a different place in the program from where it was defined. The "transmission" syntax suggests that I should extend this conceptualization. What would you suggest? So far, I'm beginning to think of it like this: @C means something like "read from a pipe" - the "outcome" that it produces, x, is the next result in the sequence of results produced by C x1@C means something like "write to a pipe"" - I have no idea what the "outcome" that it produces, x2, is or how that outcome is affected by x1 how can I learn more about coexpressions in Icon? From icon-group-sender Mon Nov 26 19:41:27 2001 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id fAR2eFo27645 for icon-group-addresses; Mon, 26 Nov 2001 19:40:15 -0700 (MST) Message-Id: <200111270240.fAR2eFo27645@baskerville.CS.Arizona.EDU> From: "John Sampson" To: Subject: Icon on Pentium computers Date: Mon, 26 Nov 2001 17:01:07 -0000 X-Priority: 3 (Normal) X-MSMail-Priority: Normal Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 817 Hello - I am running Icon to process large text files. The program I have compiles and runs well using DOS-based Icon provided that Windows is not running. If tweaked to compile and run in Winicon it also runs OK, but the Windows interface, especially file selection, is very clumsy and laborious to use, especially as for health reasons I am trying to avoid mouse use. This is a criticism of Windows rather than Winicon. Can Windows be tweaked to release more memory for DOS-based Icon to use, if run from a command-line console or DOS prompt? Or can Winicon be run from a command-line console? I notice that Winicon sometimes launches its own output console but I don't see what controls whether it does or not. Will it do so automatically if there is output to STDOUT, e.g. write(a)? Regards _John Sampson_ From icon-group-sender Tue Nov 27 09:09:32 2001 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id fARG9Hs24274 for icon-group-addresses; Tue, 27 Nov 2001 09:09:17 -0700 (MST) Message-Id: <200111271609.fARG9Hs24274@baskerville.CS.Arizona.EDU> Date: Mon, 26 Nov 2001 22:59:25 -0700 X-Authentication-Warning: unicon.cs.nmsu.edu: jeffery set sender to jeffery@cs.nmsu.edu using -f From: Clint Jeffery To: jsampson@indexes.u-net.com CC: icon-group@cs.arizona.edu Subject: Re: Icon on Pentium computers Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 540 [John wrote:] >Can Windows be tweaked to release more memory for DOS-based Icon to use, if >run from a command-line console or DOS prompt? Or can Winicon be run from a >command-line console? A windows expert can indeed tweak the amount of memory DOS programs can use, but if you look in your Windows Icon distribution, you will find a bin/ directory and a command-line version of the Icon language in the form of nticont.exe and nticonx.exe; these work great for regular Icon (i.e. text) applications. Cheers, Clint jeffery@cs.nmsu.edu From icon-group-sender Tue Dec 4 17:08:14 2001 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id fB505LU17843 for icon-group-addresses; Tue, 4 Dec 2001 17:05:21 -0700 (MST) Message-Id: <200112050005.fB505LU17843@baskerville.CS.Arizona.EDU> Date: Tue, 04 Dec 2001 17:01:11 -0500 From: "Steve Graham" To: Subject: Bio Informatics Content-Disposition: inline X-MIME-Autoconverted: from quoted-printable to 8bit by baskerville.CS.Arizona.EDU id fB4M1eh14476 Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 204 A fellow in my office is interested in this and has mentioned that Perl is being touted for its abilities to do pattern matching. Wonder if Icon could find a home here and perhaps a boost, too? Steve From icon-group-sender Wed Dec 5 08:08:22 2001 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id fB5F6hw12349 for icon-group-addresses; Wed, 5 Dec 2001 08:06:43 -0700 (MST) Message-Id: <200112051506.fB5F6hw12349@baskerville.CS.Arizona.EDU> From: eka@corp.cirrus.com (Eka Laiman) Subject: Re: Bio Informatics To: icon-group@cs.arizona.edu Date: Tue, 4 Dec 2001 16:29:14 -0800 (PST) Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 900 Steve Graham wrote: > A fellow in my office is interested in this and has mentioned that > Perl is being touted for its abilities to do pattern matching. > Wonder if Icon could find a home here and perhaps a boost, too? I am teaching a class on AWK in the company where I am working. The class is offered as an alternative to PERL. One of the thing which AWK copies from SNOBOL is the pattern matching stuff. I told my students/group that pattern matching and hash array (table) originated in SNOBOL. As ICON is the direct descendant of SNOBOL, I see no reason why ICON cannot do what PERL can - at least in the area of pattern matching. If there is anything which puzzles me is the behaviour of table in ICON especially when we try to build a hash table with tens of thousands of entries, the performance degrades very fast. The "strong hold" of PERL lies in the OS related functions. -eka- From icon-group-sender Wed Dec 5 08:11:24 2001 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id fB5FA0U12466 for icon-group-addresses; Wed, 5 Dec 2001 08:10:00 -0700 (MST) Message-Id: <200112051510.fB5FA0U12466@baskerville.CS.Arizona.EDU> Date: Wed, 5 Dec 2001 09:08:21 -0500 (EST) From: Taybin Rutkin X-Sender: trutkin@planck.clarku.edu To: Steve Graham cc: icon-group@cs.arizona.edu Subject: Re: Bio Informatics Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 487 On Tue, 4 Dec 2001, Steve Graham wrote: > A fellow in my office is interested in this and has mentioned that Perl > is being touted for its abilities to do pattern matching. Wonder if > Icon could find a home here and perhaps a boost, too? What are bio informatics? As far as I can tell, the only pattern matching that Perl is particularly good at is regular expressions, because they are built into the syntax (no language wars, please). Are bio informatics text based? Taybin From icon-group-sender Wed Dec 5 12:54:53 2001 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id fB5Jsco21501 for icon-group-addresses; Wed, 5 Dec 2001 12:54:38 -0700 (MST) Message-Id: <200112051954.fB5Jsco21501@baskerville.CS.Arizona.EDU> Date: Wed, 5 Dec 2001 10:23:19 -0500 (EST) From: Taybin Rutkin X-Sender: trutkin@planck.clarku.edu To: Eka Laiman cc: icon-group@cs.arizona.edu Subject: Re: Bio Informatics Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 298 On Tue, 4 Dec 2001, Eka Laiman wrote: > As ICON is the direct descendant of SNOBOL, I see no reason why ICON > cannot do what PERL can - at least in the area of pattern matching. I would be very interested in seeing a comparsion of Perl's regex capabilities and Icon's string scanning. Taybin From icon-group-sender Wed Dec 5 12:57:32 2001 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id fB5JvTk21640 for icon-group-addresses; Wed, 5 Dec 2001 12:57:29 -0700 (MST) Message-Id: <200112051957.fB5JvTk21640@baskerville.CS.Arizona.EDU> Date: Wed, 5 Dec 2001 11:32:44 -0700 (MST) From: Gregg Townsend To: icon-group Subject: Re: hashtable performance Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 853 > From: eka@corp.cirrus.com (Eka Laiman) > > If there is anything which puzzles me is the behaviour of table in > ICON especially when we try to build a hash table with tens of > thousands of entries, the performance degrades very fast. Until I saw this message, I hadn't realized that increasing memory sizes had caught up with Icon's hashing implementation. Currently, sets and tables start to slow down beyond about 20000 entries. By changing HSegs from 10 to 12 in src/h/cpuconf.h, the threshold can be quadrupled to about 80000. With a few other changes I will raise the threshold to 44 million in the next release of Icon. --------------------------------------------------------------------------- Gregg Townsend Staff Scientist The University of Arizona gmt@cs.arizona.edu Computer Science Tucson, Arizona, USA From icon-group-sender Wed Dec 5 16:29:07 2001 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id fB5NSgU29961 for icon-group-addresses; Wed, 5 Dec 2001 16:28:42 -0700 (MST) Message-Id: <200112052328.fB5NSgU29961@baskerville.CS.Arizona.EDU> From: eka@corp.cirrus.com (Eka Laiman) Subject: Re: Bio Informatics To: trutkin@physics.clarku.edu (Taybin Rutkin) Date: Wed, 5 Dec 2001 12:41:05 -0800 (PST) Cc: icon-group@cs.arizona.edu Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 748 > On Tue, 4 Dec 2001, Eka Laiman wrote: > > As ICON is the direct descendant of SNOBOL, I see no reason why ICON > > cannot do what PERL can - at least in the area of pattern matching. Taybin Rutken wrote: > I would be very interested in seeing a comparsion of Perl's regex > capabilities and Icon's string scanning. I believe that there is "regexp.icn" package in "library" package of ICON which takes PERL regexp syntax and translates them into ICON and execute the codes. I think this provides the prove that ICON can do what PERL can. The superiority of ICON's scanning mechanism is the ability to stop the processing in the middle and resume the execution later. A very important operation especially when we try to do "parsing". -eka- From icon-group-sender Wed Dec 5 16:30:05 2001 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id fB5NU1200030 for icon-group-addresses; Wed, 5 Dec 2001 16:30:02 -0700 (MST) Message-Id: <200112052330.fB5NU1200030@baskerville.CS.Arizona.EDU> Date: Wed, 5 Dec 2001 16:12:54 -0500 (EST) From: Taybin Rutkin X-Sender: trutkin@planck.clarku.edu To: Eka Laiman cc: icon-group@cs.arizona.edu Subject: Re: Bio Informatics Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 714 On Wed, 5 Dec 2001, Eka Laiman wrote: > Taybin Rutken wrote: > > I would be very interested in seeing a comparsion of Perl's regex > > capabilities and Icon's string scanning. > > I believe that there is "regexp.icn" package in "library" package of > ICON which takes PERL regexp syntax and translates them into ICON and > execute the codes. Right. It's easy to do as a library. Python does this as well. I was wondering if Perl's inclusion of it in the definition of the language would give it some special ability. This question would be better answered on a different mailing list, I suspect. That said, I do agree that suspending scanning probably makes Icon's string scanning more powerful. Taybin From icon-group-sender Thu Dec 6 08:27:25 2001 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id fB6FQMU24132 for icon-group-addresses; Thu, 6 Dec 2001 08:26:22 -0700 (MST) Message-Id: <200112061526.fB6FQMU24132@baskerville.CS.Arizona.EDU> Date: Thu, 6 Dec 2001 01:18:29 -0600 (CST) From: John Paolillo To: eka@corp.cirrus.com, trutkin@physics.clarku.edu Subject: Re: Bio Informatics Cc: icon-group@cs.arizona.edu Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 3651 In formal-language theoretic terms, regular expressions allow the definition of finite-state transducers (FST's). These can be thought of as being described by ordinary finite state automata (FSA) with one difference, namely that they have two tapes, an input and an output tape, and state transitions can specify read-actions on the input tape and write actions on the output tape. Some backtracking is normally allowed. All the same, we're pretty far down the Chomsky hierarchy in terms of computational power, with a little bit more than the ability to recognize regular languages (the term used in the Computational Linguistics literature for what FST's compute is "regular relation"). Icon string scanning is indeed more powerful. It is very easy to write parsers that are context-free in their computational power, using no more than the implicit arguments (&subject, &pos, etc.) of the scanning environment. When explicit argument-passing is allowed, it becomes possible to write scanning procedures that are context-sensitive and Turing-equivalent in their computational power. So the relationship between Icon scanning and Perl regexp is that Icon is the more powerful and expressive of the two. This is both a "good" thing and a "bad" thing: scanning expressions that use the context-free or context sensitive expressivity of Icon's scanning expressions may have a worst-case exponential (i.e. intractable) complexity. FST- based scanning is generally more tractable. If built-in regexps are used for scanning, you are basically forced to adopt a strategy from a tractable set of computations. Not a bad thing if you are worried about performance, but frustrating if you need the missing expressivity for something. In computational linguistics, there is renewed interest in FSA and FST-based methods, on account of the tractability issues, even though it is generally recognized that something more (what A. Joshi called "weak context sensitivity") is probably needed to adequately describe human languages. For Bio-informatics, where the main tasks are matching and assembling long gene sequences, where we don't expect to find troubling context-sensitive dependencies (if I have such-and-such a thousand-base sequence, then I should expect an approximate copy of such-and-such another sequence over there...), FSA and FST methods are probably enough. (I doubt that anyone would have tried to use context free methods even, though I could well be wrong.) And since Perl comes plonked into just about any Linux or Unix installation these days, you can get going on your sequencing just by downloading a few scripts from someone's web or ftp site. I think that would be the main reason for people using Perl (rather than, say, Java...) Of course, one can easily write procedures for FSA and FST using Icon's string scanning (I suppose this is how the regexp library routines work?). This would be my preference, for purely idiosyncratic reasons. I just think that the design of the scanning environment in Icon is an elegant and brilliant piece of work. The use of the implicit variables is what I would consider a revolutionary concept in programming language design. Once you understand it, you almost never have to interact with it; it just seamlessly does its work for you while you attend to what is interesting in your program. How unlike Prolog DCG's (which I use a lot now) or even regexps. Besides, you never know when you'll want just a little bit more expressivity... Anyway, I hope this helps, John Paolillo SLIS and Informatics Indiana University http://ella.slis.indiana.edu/~paolillo/ From icon-group-sender Mon Dec 10 09:19:34 2001 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id fBAGHmQ08451 for icon-group-addresses; Mon, 10 Dec 2001 09:17:48 -0700 (MST) Message-Id: <200112101617.fBAGHmQ08451@baskerville.CS.Arizona.EDU> From: espie@schutzenberger.liafa.jussieu.fr (Marc Espie) X-Newsgroups: comp.lang.icon Subject: PhD announce Date: Mon, 10 Dec 2001 15:51:49 +0000 (UTC) X-Complaints-To: newsmaster@jussieu.fr X-Newsreader: trn 4.0-test74 (May 26, 2000) Originator: espie@schutzenberger.liafa.jussieu.fr (Marc Espie) To: icon-group@cs.arizona.edu Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 1623 I'm going to defend my PhD in Paris, on the 18th december. Everything is in french, the subject roughly translates to `On some combinatorial problems and implementation aspects'. As you can see from the abstract, a large portion of this work is derived from using Icon for combinatorial works. I would like to thank all the friends I've made in the Icon project over the years. Abstract: This work first presents a combinatorial study of the Chinese monoid, a ternary monoid related to the plactic monoid and based on the rewritings $cba\equiv bca\equiv cab$. The tools that were developed for this study (Robinson-Schenstedt correspondence, computation of the order of specific classes) lead to a generic framework for combinatorial computations. Some lazy and dynamic evaluation techniques, based upon the notion of generator, as exemplified by the Icon programming language, allow the required computations, while generalizing to other problems. For instance, checking a conjecture over polyzeta was achieved to a larger order than was previously known. In fact, those techniques are somewhat independent of the language, as long as one uses some specific apparatus to translate the generator paradigm into some other language. Finally, this work presents the classical index assignment problem, a classical problem in digital telecommunications. Some partial solution is attained through a new approach merging some heavy-weight numerical computations and a new approach to the model itself. (the french manuscript can be retrieved from http://schutz.liafa.jussieu.fr/espie, if it by chance interests anyone). From icon-group-sender Wed Dec 12 12:56:44 2001 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id fBCJtiI03596 for icon-group-addresses; Wed, 12 Dec 2001 12:55:44 -0700 (MST) Message-Id: <200112121955.fBCJtiI03596@baskerville.CS.Arizona.EDU> From: Paterniti Michele To: John Paolillo , eka@corp.cirrus.com, trutkin@physics.clarku.edu Cc: icon-group@cs.arizona.edu Subject: Icon vs Prolog in parsing Date: Wed, 12 Dec 2001 17:36:57 +0100 Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 369 I am a Prolog programmer, almost new to Icon (which a find by accident, reading a book about languages).I'm tryng to figure out which are the advantages of each of them in parsing. Maybe John Paolillo, that seems so clever on the matter, (or maybe some other person listening on this port) could spend some more words about it. Thanks a lot Michele Paterniti From icon-group-sender Wed Dec 12 16:33:13 2001 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id fBCNWv611359 for icon-group-addresses; Wed, 12 Dec 2001 16:32:57 -0700 (MST) Message-Id: <200112122332.fBCNWv611359@baskerville.CS.Arizona.EDU> From: eka@corp.cirrus.com (Eka Laiman) Subject: Re: Icon vs Prolog in parsing To: icon-group@cs.arizona.edu Date: Wed, 12 Dec 2001 12:09:27 -0800 (PST) Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 682 Michele Paterniti wrote: > I am a Prolog programmer, almost new to Icon (which a find by > accident, reading a book about languages).I'm tryng to figure out > which are the advantages of each of them in parsing. > ............... The advantage of PROLOG over ICON in parsing is: PROLOG provides the back-tracking mechanism automatically - it comes free. Therefore you can describe your parser by simply typing your grammar. On the other hand, if you use "recursive descent method" to write your parser, your parser will pretty much mimic your grammar and hence is not any more difficult than writing it in PROLOG. I have written many parsers using ICON using this method. -eka- From icon-group-sender Mon Dec 17 13:33:14 2001 Return-Path: Received: (from root@localhost) by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id fBHKV2A19320 for icon-group-addresses; Mon, 17 Dec 2001 13:31:02 -0700 (MST) Message-Id: <200112172031.fBHKV2A19320@baskerville.CS.Arizona.EDU> Date: Mon, 17 Dec 2001 10:42:33 -0600 (CST) From: John Paolillo To: eka@corp.cirrus.com, Paterniti@praxis.it Subject: Re: Icon vs Prolog in parsing Cc: icon-group@cs.arizona.edu, paolillo@indiana.edu Errors-To: icon-group-errors@cs.arizona.edu Status: RO Content-Length: 1821 eka@corp.cirrus.com wrote: >Paterniti Michele wrote: >> I am a Prolog programmer, almost new to Icon (which a find by >> accident, reading a book about languages).I'm tryng to figure out >> which are the advantages of each of them in parsing. >> ............... >The advantage of PROLOG over ICON in parsing is: PROLOG provides the >back-tracking mechanism automatically - it comes free. Therefore you >can describe your parser by simply typing your grammar. >.............. Actually, both languages offer forms of built-in backtracking. Icon does this through generators. Not everything is backtrackable in Icon, so some care is needed in writing parsing code to make sure that it will bactrack appropriately. I often find it necessary to write my scanning procedures as one-liners which call each other as needed, to preserve bactrackability. For parsing natural language, Prolog's big advantage is that it offers a built-in mechanism for unification of complex data structures (term unification), while Icon has no such mechanism, and writing one is not at all trivial. For many parsing applications, this may not be important, but for those with a theoretical linguistic bent, it becomes more important since most of the interesting theoretical relations are readily expressed as unifications in a complex data structure. The biggest advantage of Icon is probably its procedural style, which is more intuitive to work with for most programmers than Prolog's hybrid logical/procedural style. I say hybrid, because one cannot write good Prolog code without thinking procedurally, even though the intent of the language designers was to foreground logic (and this otherwise works well for natural language). Hope that helps, John Paolillo SLIS and Informatics, Indiana University