From icon-group-sender Fri Jun 20 18:11:19 1997 Received: from kingfisher.CS.Arizona.EDU by cheltenham.cs.arizona.edu; Mon, 23 Jun 1997 09:19:14 MST Received: by kingfisher.CS.Arizona.EDU; (5.65v3.2/1.1.8.2/08Nov94-0446PM) id AA14600; Mon, 23 Jun 1997 09:19:13 -0700 To: icon-group@cs.arizona.edu Date: Fri, 20 Jun 1997 18:11:19 GMT From: glengk@ix.netcom.com Message-Id: <33aac730.16724298@200.1.1.100> Organization: Netcom Sender: icon-group-request@cs.arizona.edu Subject: Anyone get loadfunc() to work on AIX? Errors-To: icon-group-errors@cs.arizona.edu Status: RO Has anyone been able to call C funtions in dyamic libraries under AIX? Is it possible? Glen Koundry xglengk@ix.netcom.com (NOTE: there is an extra 'x' in front of my e-mail address to stop bulk e-mailers) From icon-group-sender Sat Jun 21 09:47:59 1997 Received: from kingfisher.CS.Arizona.EDU by cheltenham.cs.arizona.edu; Mon, 23 Jun 1997 09:19:29 MST Received: by kingfisher.CS.Arizona.EDU; (5.65v3.2/1.1.8.2/08Nov94-0446PM) id AA14631; Mon, 23 Jun 1997 09:19:29 -0700 Message-Id: <199706211647.JAA01617@orpheus.gemini.edu> From: swampler@noao.edu (Steve Wampler) Date: Sat, 21 Jun 1997 09:47:59 MST X-Mailer: Mail User's Shell (7.2.3 5/22/91) To: tech-talk@aps.anl.gov Subject: EPICS and Icon Cc: icon-group@cs.arizona.edu Errors-To: icon-group-errors@cs.arizona.edu Status: RO I'm pretty sure that I'm the only creature in the universe that cares, but just in case... I've written wrappers to provide access to most of the functionality of EZCA as a dynamically-loadable library for the Icon programming language. Works fine with Icon 9.3 on Solaris and Linux. If anyone is odd enough to be interested, let me know. -- Steve Wampler - swampler@gemini.edu [Gemini 8m Telescopes Project (under AURA)] O Sibile, si ergo, fortibus es inero. Nobile, demis trux. Demis phulla causan dux. From icon-group-sender Wed Jun 25 18:20:55 1997 Received: from kingfisher.CS.Arizona.EDU by cheltenham.cs.arizona.edu; Wed, 25 Jun 1997 16:59:01 MST Received: by kingfisher.CS.Arizona.EDU; (5.65v3.2/1.1.8.2/08Nov94-0446PM) id AA16704; Wed, 25 Jun 1997 16:59:01 -0700 To: icon-group@cs.arizona.edu Date: Wed, 25 Jun 1997 18:20:55 GMT From: Lane Wimberley Message-Id: <33B16186.1EA6@mcc.com> Organization: MCC, Austin TX Sender: icon-group-request@cs.arizona.edu Subject: Process ID availability? Errors-To: icon-group-errors@cs.arizona.edu Status: RO Is there a way to determine process ID in Icon? (... a la getpid() in C) -- Lane Wimberley Microelectronics and Computer Technology Corporation Austin, TX From icon-group-sender Fri Jun 27 06:01:27 1997 Received: from kingfisher.CS.Arizona.EDU by cheltenham.cs.arizona.edu; Fri, 27 Jun 1997 08:25:58 MST Received: by kingfisher.CS.Arizona.EDU; (5.65v3.2/1.1.8.2/08Nov94-0446PM) id AA18317; Fri, 27 Jun 1997 08:25:57 -0700 Posted-Date: Fri, 27 Jun 1997 06:01:27 -0500 (CDT) Date: Fri, 27 Jun 1997 06:01:27 -0500 (CDT) From: Chris Tenaglia To: Lane Wimberley Cc: icon-group@cs.arizona.edu Subject: Re: Process ID availability? In-Reply-To: <33B16186.1EA6@mcc.com> Message-Id: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Errors-To: icon-group-errors@cs.arizona.edu Status: RO The following code seg will return the pid. It assumes that you are running solaris unix and that you aren't running other icon programs in the same session. But it's probably adequate for most applications. procedure getpid() pipe := open("ps -f","pr") every line := !pipe do if find("iconx",line) then pid := parse(line,' ')[2] close(pipe) return pid 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 Chris Tenaglia (system manager) | The future foretold, Medical College of Wisconsin | The past explained, 8701 W. Watertown Plank Rd. | The present largely appologized for. Milwaukee, WI 53226 (414)456-8765 | Organon to the Doctor On Wed, 25 Jun 1997, Lane Wimberley wrote: > Date: Wed, 25 Jun 1997 18:20:55 GMT > From: Lane Wimberley > To: icon-group@cs.arizona.edu > Subject: Process ID availability? > > Is there a way to determine process ID in Icon? (... a la > getpid() in C) > > -- > Lane Wimberley > Microelectronics and Computer Technology Corporation > Austin, TX > From icon-group-sender Fri Jun 27 10:54:19 1997 Received: from kingfisher.CS.Arizona.EDU by cheltenham.cs.arizona.edu; Fri, 27 Jun 1997 12:36:24 MST Received: by kingfisher.CS.Arizona.EDU; (5.65v3.2/1.1.8.2/08Nov94-0446PM) id AA18215; Fri, 27 Jun 1997 12:36:24 -0700 Date: Fri, 27 Jun 1997 10:54:19 -0700 From: Gregg Townsend Message-Id: <9706271754.AA10927@hawk.CS.Arizona.EDU> To: icon-group Subject: Re: Process ID availability Cc: lane@mcc.com Errors-To: icon-group-errors@cs.arizona.edu Status: RO If your Icon platform supports loadable C functions, you can call the getpid() function that's in the Icon Program Library. If you installed the Icon Starter Kit (prebuilt binaries) for Solaris, SunOS, Linux, Digital Unix, or Irix, the function is immediately available for linking: link cfunc procedure main() write(getpid()) end Reading from a pipe is another approach. On systems where the Korn Shell (ksh) is available, the pipe program can be simplified to this: procedure main() write(readpid()) end procedure readpid() pipe := open("exec ksh -c 'echo $PPID'","pr") pid := integer(read(pipe)) close(pipe) return pid end ----------------------------------------------------------------------------- Gregg Townsend Gould-Simpson Building gmt@cs.arizona.edu Staff Scientist 1040 E. 4th St. 32 13 45N 110 57 16W Dept. of Computer Science PO Box 210077 tel: +1 520 621 4325 The University of Arizona Tucson, AZ 85721-0077 fax: +1 520 621 4246 From icon-group-sender Sat Jun 28 07:13:53 1997 Received: from kingfisher.CS.Arizona.EDU by cheltenham.cs.arizona.edu; Mon, 30 Jun 1997 08:22:22 MST Received: by kingfisher.CS.Arizona.EDU; (5.65v3.2/1.1.8.2/08Nov94-0446PM) id AA19571; Mon, 30 Jun 1997 08:22:22 -0700 Posted-Date: Sat, 28 Jun 1997 07:13:53 -0500 (CDT) Date: Sat, 28 Jun 1997 07:13:53 -0500 (CDT) From: Chris Tenaglia To: icon-group@cs.arizona.edu Subject: kbhit & getch Message-Id: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Errors-To: icon-group-errors@cs.arizona.edu Status: RO I wrote a game in icon and it worked well under DEC Ultrix. But it broke when we migrated to solaris. Here's the heart of the game loop: repeat { draw_screen() # draw the screen and score fields animate() # draw/undraw the sprites sense() # sense for shooting (keyboard keys) } ... procedure sense() kbhit() | fail struck := getch() ... end In the past : No Strike : kbhit would fail, then fail out of the procedure On Strike : the keyboard would be polled and the key would be sampled and processing would continue. The getch seemed to turn off the kbhit trap and it would go to No Strike mode again. On the solaris system, it seems that once kbhit is tripped it stays tripped, never fails, and keeps getting stuck on the getch. Is there a different or better way of keyboard sampling or maybe a way to restore the prior behavior? Thanx in advance. Chris Tenaglia (system manager) | The future foretold, Medical College of Wisconsin | The past explained, 8701 W. Watertown Plank Rd. | The present largely appologized for. Milwaukee, WI 53226 (414)456-8765 | Organon to the Doctor From icon-group-sender Wed Jul 2 09:27:28 1997 Received: from kingfisher.CS.Arizona.EDU by cheltenham.cs.arizona.edu; Wed, 2 Jul 1997 12:29:46 MST Received: by kingfisher.CS.Arizona.EDU; (5.65v3.2/1.1.8.2/08Nov94-0446PM) id AA20607; Wed, 2 Jul 1997 12:29:46 -0700 Message-Id: <199707021627.JAA09747@orpheus.gemini.edu> From: swampler@noao.edu (Steve Wampler) Date: Wed, 2 Jul 1997 09:27:28 MST X-Mailer: Mail User's Shell (7.2.3 5/22/91) To: icon-group@cs.arizona.edu Subject: A small puzzle Errors-To: icon-group-errors@cs.arizona.edu Status: RO Recently, the SNOBOL4 mailing list has been playing with ways (in SNOBOL4/SPITBOL) of writing a procedure to return the longest common prefix between strings. This is kinda a fun thing to play with in Icon also, so I thought I'd invite people to post their solutions to this problem. Write a procedure lcp(s1,s2) that returns the longest common prefix of strings s1 and s2. For example, write(lcp("fool","foodchain")) would output "foo", while write(lcp("aardvark","elephant")) would output "" (i.e. th null string). I have two basic solutions I like, one using string scanning (my favorite) and one without string scanning. I also have a couple derivatives that attempt to improve performance through heuristics. -- Steve Wampler - swampler@gemini.edu [Gemini 8m Telescopes Project (under AURA)] O Sibile, si ergo, fortibus es inero. Nobile, demis trux. Demis phulla causan dux. From icon-group-sender Wed Jul 2 17:37:28 1997 Received: from kingfisher.CS.Arizona.EDU by cheltenham.cs.arizona.edu; Wed, 2 Jul 1997 16:58:38 MST Received: by kingfisher.CS.Arizona.EDU; (5.65v3.2/1.1.8.2/08Nov94-0446PM) id AA21177; Wed, 2 Jul 1997 16:58:38 -0700 Date: Wed, 2 Jul 1997 17:37:28 -0500 Message-Id: <199707022237.RAA04514@axp.cmpu.net> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit From: gep2@computek.net Subject: Scripting paper To: icon-group@cs.arizona.edu X-Mailer: SPRY Mail Version: 04.00.06.17 Errors-To: icon-group-errors@cs.arizona.edu Status: RO >Icon types: I thought perhaps Icon devotees would like to take a look at http://www.sunlabs.com/people/john.ousterhout/scripting.html which talks about Perl, Tcl, Java and C as scripting languages. Where, if at all, do we think Icon fits into this picture? One could fairly ask the same question regarding SNOBOL4/SPITBOL and Limbo, for that matter. I think that it's fairly preposterous that a poorly-conceived language like Perl has become so widely used for CGI scripting, despite either S*BOL or Icon being so much better suited. We've discussed this issue before here on this list. I think we ought to put serious effort into making Icon more "CGI-friendly", among other things making the interpreter re-entrant (or at least serially reusable) so that one copy of it can be kept in memory, and run against small code files. Then there should be whatever layers of glue/interface code are needed (if any) to facilitate its use for CGI scripting. In the more general case, I think that Icon is not nearly as limited (i.e. regarding suitability for applications use) as some of these other scripting-flavor languages are. (I thought the author's suggestion that JCL was ever INTENDED as a "scripting language" was fairly ridiculous). I can only presume that languages like S*BOL and Icon would be far more widely used if more people knew about them. Gordon Peterson http://www.computek.net/public/gep2/ Support the Anti-SPAM Amendment! Join at http://www.cauce.org/ From icon-group-sender Wed Jul 2 23:18:27 1997 Received: from kingfisher.CS.Arizona.EDU by cheltenham.cs.arizona.edu; Tue, 8 Jul 1997 08:43:06 MST Received: by kingfisher.CS.Arizona.EDU; (5.65v3.2/1.1.8.2/08Nov94-0446PM) id AA24626; Tue, 8 Jul 1997 08:43:06 -0700 Message-Id: <3.0.1.32.19970702231827.007ba100@alterdial.uu.net> X-Sender: mail08621@alterdial.uu.net X-Mailer: Windows Eudora Pro Version 3.0.1 (32) Date: Wed, 02 Jul 1997 23:18:27 -0500 To: icon-group@cs.arizona.edu From: Jerry Nowlin Subject: Re: A small puzzle Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Errors-To: icon-group-errors@cs.arizona.edu Status: RO > Write a procedure lcp(s1,s2) that returns the longest common > prefix of strings s1 and s2. For example, > > write(lcp("fool","foodchain")) > > would output "foo", while > > write(lcp("aardvark","elephant")) > > would output "" (i.e. the null string). I couldn't resist. I have an Icon solution: # the longest common prefix procedure procedure lcp(a,b); return a ? tab(match(b[1:*b to 0 by -1])); end I also have a (gasp!) perl solution: # the longest common prefix subroutine sub lcp { do { return $_[0] if ($_[1] =~ m/^$_[0]/); } while(chop($_[0])); } I didn't attempt to optimize either to use the shortest string as the pattern, but that would make both more efficient and is trivial to do. It's not as clean looking though and wouldn't fit on one line. I tested both of these on win95 and got the same results. I don't have a good way to compare speed or efficiency though. I reckon Icon wins since it took less characters :-) Jerry Nowlin Jerry Nowlin nowlin@nowlin.com http://www.xnet.com/~nowlin/ From icon-group-sender Wed Jul 2 17:37:28 1997 Received: from kingfisher.CS.Arizona.EDU by cheltenham.cs.arizona.edu; Tue, 8 Jul 1997 08:42:51 MST Received: by kingfisher.CS.Arizona.EDU; (5.65v3.2/1.1.8.2/08Nov94-0446PM) id AA24807; Tue, 8 Jul 1997 08:42:50 -0700 Date: Wed, 2 Jul 1997 17:37:28 -0500 Message-Id: <199707022237.RAA04514@axp.cmpu.net> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit From: gep2@computek.net Subject: Scripting paper To: icon-group@cs.arizona.edu X-Mailer: SPRY Mail Version: 04.00.06.17 Errors-To: icon-group-errors@cs.arizona.edu Status: RO >Icon types: I thought perhaps Icon devotees would like to take a look at http://www.sunlabs.com/people/john.ousterhout/scripting.html which talks about Perl, Tcl, Java and C as scripting languages. Where, if at all, do we think Icon fits into this picture? One could fairly ask the same question regarding SNOBOL4/SPITBOL and Limbo, for that matter. I think that it's fairly preposterous that a poorly-conceived language like Perl has become so widely used for CGI scripting, despite either S*BOL or Icon being so much better suited. We've discussed this issue before here on this list. I think we ought to put serious effort into making Icon more "CGI-friendly", among other things making the interpreter re-entrant (or at least serially reusable) so that one copy of it can be kept in memory, and run against small code files. Then there should be whatever layers of glue/interface code are needed (if any) to facilitate its use for CGI scripting. In the more general case, I think that Icon is not nearly as limited (i.e. regarding suitability for applications use) as some of these other scripting-flavor languages are. (I thought the author's suggestion that JCL was ever INTENDED as a "scripting language" was fairly ridiculous). I can only presume that languages like S*BOL and Icon would be far more widely used if more people knew about them. Gordon Peterson http://www.computek.net/public/gep2/ Support the Anti-SPAM Amendment! Join at http://www.cauce.org/ From icon-group-sender Wed Jul 2 23:33:27 1997 Received: from kingfisher.CS.Arizona.EDU by cheltenham.cs.arizona.edu; Tue, 8 Jul 1997 08:43:27 MST Received: by kingfisher.CS.Arizona.EDU; (5.65v3.2/1.1.8.2/08Nov94-0446PM) id AA24479; Tue, 8 Jul 1997 08:43:26 -0700 Message-Id: <3.0.1.32.19970702233327.007cad30@alterdial.uu.net> X-Sender: mail08621@alterdial.uu.net X-Mailer: Windows Eudora Pro Version 3.0.1 (32) Date: Wed, 02 Jul 1997 23:33:27 -0500 To: icon-group@cs.arizona.edu From: Jerry Nowlin Subject: Re: A small puzzle (never fails) Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Errors-To: icon-group-errors@cs.arizona.edu Status: RO >I couldn't resist. I have an Icon solution: > > # the longest common prefix procedure > procedure lcp(a,b); return a ? tab(match(b[1:*b to 0 by -1])); end Insufficient testing rigor. If the original strings are identical the above loses the last character of the lcp. Try this one: procedure lcp(a,b); return a ? tab(match(b[1:*b+1 to 1 by -1])); end I have to remember Icon starts with 1, not 0 :-) Sorry. Jerry Nowlin Jerry Nowlin nowlin@nowlin.com http://www.xnet.com/~nowlin/ From icon-group-sender Thu Jul 3 06:31:21 1997 Received: from kingfisher.CS.Arizona.EDU by cheltenham.cs.arizona.edu; Tue, 8 Jul 1997 08:44:12 MST Received: by kingfisher.CS.Arizona.EDU; (5.65v3.2/1.1.8.2/08Nov94-0446PM) id AA24754; Tue, 8 Jul 1997 08:44:11 -0700 Posted-Date: Thu, 3 Jul 1997 06:31:21 -0500 (CDT) Date: Thu, 3 Jul 1997 06:31:21 -0500 (CDT) From: Chris Tenaglia To: icon-group@cs.arizona.edu Subject: re:scripting paper Message-Id: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Errors-To: icon-group-errors@cs.arizona.edu Status: RO I read the paper and I kind of thought, what's the point? It's not system vs scripting. I think there will always be a need for low level programming to build operating systems and drivers for new devices. It seems like C is the assembler of the current era. The next level may be applications. Each language is a tool designed to be applied to certain tasks. Icon is a good general tool for file filtering and algorythms. But I wouldn't use it to write a word processor. DEC had a language called TPU that ideally suited to writing editors and word processors. Writing a word processor in perl is even more ridiculous. That would be like screwing in a lightbulb with a chainsaw. I think it's actually a matter of 'beauty'. I have come back to icon programs after years and they are still clear and understandible. Maybe it's because perl programmers didn't know of any better tools, or they have some suite of perl scripts a vendor gave them, or perhaps they have an ill conceived corporate standard they have to adhere to. I have yet to see a perl script that impressed me in regard to design, clarity, and maintainability. I have seen beautiful programs in IBM 360 assembler, BASIC, COBOL, and pascal. I suppose beauty is less important for one time throw away code and machine generated programs. But beauty is such a subjective matter but it's probably worth discussing or even demonstrating. Chris Tenaglia (system manager) | The future foretold, Medical College of Wisconsin | The past explained, 8701 W. Watertown Plank Rd. | The present largely appologized for. Milwaukee, WI 53226 (414)456-8765 | Organon to the Doctor From icon-group-sender Thu Jul 3 15:19:30 1997 Received: from kingfisher.CS.Arizona.EDU by cheltenham.cs.arizona.edu; Tue, 8 Jul 1997 08:44:30 MST Received: by kingfisher.CS.Arizona.EDU; (5.65v3.2/1.1.8.2/08Nov94-0446PM) id AA24966; Tue, 8 Jul 1997 08:44:30 -0700 Date: Thu, 3 Jul 1997 15:19:30 -0500 Message-Id: <199707032019.PAA04723@segfault.cs.utsa.edu> From: Clinton Jeffery To: jthall@lucent.com Cc: icon-group@cs.arizona.edu Subject: Re: Scripting paper Reply-To: jeffery@cs.utsa.edu Errors-To: icon-group-errors@cs.arizona.edu Status: RO Joe Hall asks about a paper from www.sunlabs.com that > talks about Perl, Tcl, Java and C as scripting languages. > Where, if at all, do we think Icon fits into this picture? Joe, I wonder how many different answers you will get; different people use Icon for different purposes. I agree with a lot of Gordon Peterson's comments. I'll post a description of using Icon for CGI scripting, along with a pointer to my CGI library, in a separate message. Below I make a few additional comments on where Icon fits in compared with scripting languages. I think the author of that paper is smart, but patently biased and focused on pushing his own product. He is a commercial vendor of a scripting language that he invented (Tcl) that is good at gluing and bad at data structures and algorithms. From this he concludes that all scripting languages are good at gluing and bad at data structures and algorithms. So according to him Icon, being especially good at data structures and algorithms, must not be a scripting language. But, it isn't a systems programming language, either. What is it? It is a very high level general purpose programming language, used occasionally for scripting, but more often for writing applications. Nevertheless, many or most of the author's arguments for "scripting languages" are true of Icon, and the reason for this is because he is citing general advantages of higher level languages, but claiming by omission that scripting languages have a monopoly on these properties. The paper's author knows about Icon (and other higher level languages besides "scripting languages"), he just doesn't understand them, or else discounts the value of language features that make it easier to write complex algorithms and data structures, since that is not what his product does. This is really unfortunate, since his language (Tcl) certainly has other nice properties, and there is no reason it had to be so lacking in support for general-purpose applications development. Clint Jeffery, jeffery@cs.utsa.edu Division of Computer Science, The University of Texas at San Antonio Research http://www.cs.utsa.edu/research/plss.html From icon-group-sender Fri Jul 4 07:51:24 1997 Received: from kingfisher.CS.Arizona.EDU by cheltenham.cs.arizona.edu; Tue, 8 Jul 1997 08:45:21 MST Received: by kingfisher.CS.Arizona.EDU; (5.65v3.2/1.1.8.2/08Nov94-0446PM) id AA24535; Tue, 8 Jul 1997 08:45:20 -0700 Posted-Date: Fri, 4 Jul 1997 07:51:24 -0500 (CDT) Date: Fri, 4 Jul 1997 07:51:24 -0500 (CDT) From: Chris Tenaglia To: icon-group@cs.arizona.edu Subject: 4th of July Sample 1 Message-Id: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Errors-To: icon-group-errors@cs.arizona.edu Status: RO Here's a sample program to celebrate this 4th of July with. It's not a firecracker program, but just yet another menu. I know, the web seems to make it a moot point but it's a big chunk of code, and I even use it myself. This one is nice though, because it only need to be compiled once. It feeds on menu data files in the format: This is the title line pine:Pine Email ftp:File transfer program [whoami:Who Am I ?w:Currently logged in users lynx:Browse the Web menu games.dat:Games Menu q:quit The ? prefix puts the output in a file viewer. The [ prefix takes small output and puts it in a screen box. The default menu file is menu.dat but you can like to submenus as well. There are variables that let you customize it to your company. You can navigate using the arrows or pressing the first letter of the entry. It works with most vt emulations and a few others. And now for the code! #################### BEGIN PROGRAM ########################### # # file : menu.icn # desc : a generalized menuing system designed for unix # use : menu menu_data # : menu_data is a file with the following items # first line is the title line # subsequent lines contain verb:Description # and menus can call other menus # # update by what # 28-apr-1997 tenaglia initial write # global company,viewer procedure main(param) company := "Medical College of WI" viewer := "see" source := param[1] | "menu.dat" (in := open(source)) | stop("Can't read ",source) username := getenv("USER") title := center(read(in),79) ff := "\"\\f\"" widest := 20 vector := table("") verbs := [] jects := [] while line := read(in) do { action := parse(line,':')[1] description := parse(line,':')[2] vector[description] := action widest <:= *description put(verbs,action) put(jects,description) } close(in) widest +:= 2 if *verbs > 20 then stop("Menu data over 20. Too big!") if widest > 70 then stop("Menu data is too wide!") every i := 1 to *jects do jects[i] := left(jects[i],widest-2) x := (80 - widest) / 2 y := (23 - *verbs + 1) / 2 repeat { write("\e[2J\e[H",company,"| ",&dateline, " | ",&host," | ",username) write("\e[1;7m",title,"\e[0m") uclist(y,x,jects) writes(at(y+1,x+2),"\e[1m",jects[1],"\e[0m") i := 1 r := y+1 c := x+2 repeat { writes(at(r,c),"\e[1;7m",left(jects[i],widest-2),"\e[0m") k := getkey() if k == ("LEFT" | "UP") then { or := r oc := c oi := i i -:= 1 r -:= 1 if i < 1 then { i := 1 ; r := y+1 ; next } writes(at(or,oc),"\e[0m",left(jects[oi],widest-2)) } if k == ("RIGHT" | "DOWN") then { or := r oc := c oi := i i +:= 1 r +:= 1 if i > *jects then { i := *jects ; r := y + *jects ; next } writes(at(or,oc),"\e[0m",left(jects[oi],widest-2)) } if *k = 3 then { or:= r oc:= c oi:= i i := spin(i,k[2],jects) r := y + i (oi = i) | writes(at(or,oc),"\e[0m",left(jects[oi],widest-2)) } if k == "ENTER" then { choice := i ; break } if k == "\"?\"" then { help() write("\e[2J\e[H",company," | ",&dateline, " | ",&host," | ",username) write("\e[1;7m",title,"\e[0m") uclist(y,x,jects) writes(at(y+1,x+2),"\e[1m",jects[1],"\e[0m") next } if k == ff then { write("\e[2J\e[H",company," | ",&dateline, " | ",&host," | ",username) write("\e[1;7m",title,"\e[0m") uclist(y,x,jects) writes(at(y+1,x+2),"\e[1m",jects[1],"\e[0m") } } command := verbs[i] if command == "q" then { while remove("menu.tmp") stop(at(23,1),"Quit") } if any('[]',command) then { command := command[2:0] || " >menu.tmp" system(command) results := [] most := 0 in := open("menu.tmp") every line := !in do { most <:= *line if *results < 10 then put(results,line) } close(in) put(results,center("Press ",most)) c := (80 - most) / 2 r := 12 - (*results / 2) uclist(r,c,results) getch() } if match("?",command) then { command := command[2:0] || " >menu.tmp" system(command) command := viewer || " menu.tmp" system(command) } else { system(command) } } end # # spin the menu to find the next match # procedure spin(i,k,menu) max := *menu + 3 old := i every 1 to max do { i +:= 1 if i > *menu then i := 1 if match(map(k),map(menu[i][1])) then return i } return old end # # instant help from pressing ? # procedure help() write("\e[2J\e[HThe Easy Menu for Unix") write("") write("The menus appear in little boxes and are usable with") write("most types of VT terminal emulation. You can navigate") write("between the entries using the arrows or by pressing") write("the first letter of the entry and then ENTER.") write("") write("In some cases the output would normally just role by,") write("but it was captured to a scratch file and put into a") write("file viewer. The file viewer recognizes the following") write("keys:") write("") write("SPACE = next page") write("BACKSPACE = prior page") write("DOWNARROW = next line") write("UPARROW = prior line") write("RIGHTARROW= move/pan right 20 characters") write("LEFTARROW = move/pan left 20 characters") write("q = quit") write("? = displays this help screen") write("") write("Press any key to continue") getch() 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 # # prompt for an input string # procedure input(prompt) writes(prompt) return read() end # # THIS ROUTINE SETS THE CURSOR TO A GIVEN X (COL) Y(ROW) SCREEN LOCATION # procedure at(y,x) # 11p return "\e[" || y || ";" || x || "f" end # # box input routine for universe client # requires input and at for screen input # procedure ucinput(row,column,prompt) static ur, ul, lr, ll, vb, hb, gon, goff, device initial { device := getenv("TERM") if match(("vt"|"xt"),device) then { ur := "k" # upper right corner ul := "l" # upper left corner lr := "j" # lower right corner ll := "m" # lower left corner vb := "x" # Vertical bar hb := "q" # horizontal bar gon := "\e(0" # graphics mode on goff := "\e(B" # graphic mode off } else { ur := "`" # upper right corner ul := "_" # upper left corner lr := "^" # lower right corner ll := "]" # lower left corner vb := "2" # Vertical bar hb := "K" # horizontal bar gon := "\e[11m" # graphics mode on goff := "\e[10m" # graphic mode off } } width := *prompt + 2 message := gon || vb || goff || center(prompt,width) || gon || vb || goff writes(at(row,column),gon,ul,repl(hb,width),ur,goff) writes(at(row+1,column),message) writes(at(row+2,column),gon,vb,repl(" ",width),gon,vb,goff) writes(at(row+3,column),gon,ll,repl(hb,width),lr,goff) return input(at(row+2,column+3)) end # # display a list in a box in universe client # requires the at video routine # procedure uclist(row,column,lines) static ur, ul, lr, ll, vb, hb, gon, goff, device initial { device := getenv("TERM") if match(("vt"|"xt"),device) then { ur := "k" # upper right corner ul := "l" # upper left corner lr := "j" # lower right corner ll := "m" # lower left corner vb := "x" # Vertical bar hb := "q" # horizontal bar gon := "\e(0" # graphics mode on goff := "\e(B" # graphic mode off } else { ur := "`" # upper right corner ul := "_" # upper left corner lr := "^" # lower right corner ll := "]" # lower left corner vb := "2" # Vertical bar hb := "K" # horizontal bar gon := "\e[11m" # graphics mode on goff := "\e[10m" # graphic mode off } } width := 0 every item := !lines do width <:= *item width +:= 2 heap := copy(lines) writes(at(row,column),gon,ul,repl(hb,width),ur,goff) every point := row+1 to row + *lines do { message := gon || vb || goff || center(pop(heap),width) || gon || vb || goff writes(at(point,column),message) } writes(at(point+1,column),gon,ll,repl(hb,width),lr,goff) end # # output a message box and prompt for any key # requires the at video routines # procedure ucmessage(row,column,prompt) static ur, ul, lr, ll, vb, hb, gon, goff, device initial { device := getenv("TERM") if match(("vt"|"xt"),device) then { ur := "k" # upper right corner ul := "l" # upper left corner lr := "j" # lower right corner ll := "m" # lower left corner vb := "x" # Vertical bar hb := "q" # horizontal bar gon := "\e(0" # graphics mode on goff := "\e(B" # graphic mode off } else { ur := "`" # upper right corner ul := "_" # upper left corner lr := "^" # lower right corner ll := "]" # lower left corner vb := "2" # Vertical bar hb := "K" # horizontal bar gon := "\e[11m" # graphics mode on goff := "\e[10m" # graphic mode off } } width := *prompt + 2 message := gon || vb || goff || center(prompt,width) || gon || vb || goff writes(at(row,column),gon,ul,repl(hb,width),ur,goff) writes(at(row+1,column),message) writes(at(row+2,column),gon,vb,goff,center("Press Any Key",width),gon,vb,goff) writes(at(row+3,column),gon,ll,repl(hb,width),lr,goff) return getch() end # # detects keys from a LAWSON UNIVERSE client # procedure getkey() k := getch() if k == "\x18" then return "F11" if k == "\d" then return "DEL" if k == "\n" then return "ENTER" if k == "\t" then return "TAB" if k == "\r" then return "RETURN" (k == "\e") | (return image(k)) k2 := getch() (k2 == "[") | (k2 == "O") | return image(k || k2) k3 := getch() case k2 of { "[" : case k3 of { "A" : return "UP" "B" : return "DOWN" "C" : return "RIGHT" "D" : return "LEFT" "V" : return "PGUP" "U" : return "PGDN" "4" : { getch() ; return "INS" } default : return image(k || k2 || k3) } "O" : case k3 of { "P" : return "F1" "Q" : return "F2" "R" : return "F3" "S" : return "F4" "T" : return "F5" "U" : return "F6" "V" : return "F7" "W" : return "F8" "X" : return "F9" "Y" : return "F10" "E" : return "STAB" "]" : return "HOME" "^" : return "END" "o" : return "KP-" default : return image(k || k2 || k3) } default : return image(k || k2 || k3) } return "?" || image(k || k2 || k3) end # # pause a sec # procedure pause() rax := ?50 ray := ?20 ucmessage(ray,rax,"Beep!") end ###################### END OF PROGRAM ######################### Chris Tenaglia (system manager) | The future foretold, Medical College of Wisconsin | The past explained, 8701 W. Watertown Plank Rd. | The present largely appologized for. Milwaukee, WI 53226 (414)456-8765 | Organon to the Doctor From icon-group-sender Fri Jul 4 08:02:35 1997 Received: from kingfisher.CS.Arizona.EDU by cheltenham.cs.arizona.edu; Tue, 8 Jul 1997 08:45:36 MST Received: by kingfisher.CS.Arizona.EDU; (5.65v3.2/1.1.8.2/08Nov94-0446PM) id AA24226; Tue, 8 Jul 1997 08:45:35 -0700 Posted-Date: Fri, 4 Jul 1997 08:02:35 -0500 (CDT) Date: Fri, 4 Jul 1997 08:02:35 -0500 (CDT) From: Chris Tenaglia To: icon-group@cs.arizona.edu Subject: 4th of July Sample 2 Message-Id: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Errors-To: icon-group-errors@cs.arizona.edu Status: RO And for our second offering I post a binary file editor. I've used it on files up to 1MB. It views the file in terms of 256 byte sectors. It also assumes some kind of vt terminal emulation. This is getting close to system programming and the code gets thick doing binhex conversions and tracking screen locations. But I pity someone trying to do this in perl, c, or shell script. I suppose there is something you could buy to do this, but I didn't know of any so I wrote this. It took less time than the cost justification paperwork to buy a piece of software. *** danger : binary editing requires that you know what *** *** are doing. Study carefully,test thoroughly *** *** and there's no guarantee. Have fun! *** *** Yes, I have used it successfully on real stuff So on with the code. ######################## BEGIN PROGRAM ####################### # # file : aped.icn # desc : binary editor like the old aped from srt days (unix version) # use : aped file # # update by what # 02-sep-1995 tenaglia initial write # 08-sep-1995 tenaglia port this one to unix # global sctrs, pointer, hex, block, red, green, blue, black, con, coff, file procedure main(param) write(con,blue,"\e[2JAPED V1.0 by Tenaglia") file := param[1] | input("File:") (in := open(file,"ur")) | stop(con,black,at(23,1),"No ",file) sctrs := [] count := 0 green := "\e[1;33;42m" blue := "\e[1;33;44m" red := "\e[1;33;41m" black := "\e[0m" con := "\e[?25h" coff := "\e[?25l" hex := "0123456789ABCDEF" # # load the file into a sector list here # while block := reads(in,256) do { if *block < 256 then { final := *block block := left(block,256,"\000") } put(sctrs,block) count +:= 1 } close(in) writes(con) pointer := 1 # begin at sector 1 repeat if patch(file)=="EXIT" then break # continue patching # # perhaps even write out the changes # (out := open(file,"wu")) | stop(con,black,at(23,1),"Can't write ",file) if *sctrs > 1 then every i := 1 to *sctrs-1 do writes(out,sctrs[i]) tail := sctrs[-1] writes(out,tail[1+:final]) close(out) write(con,black,at(23,1),file," rewritten.") end # # prompt for an input string # procedure input(prompt) writes(con,prompt) return read() 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 # # patch oversees the display and edit of binary data # procedure patch(item) display(item) result := edit() sctrs[pointer] := block case result of { "QUIT" : stop(con,black,at(23,1),"Cancelled.") "SAVE" | "EXIT" : return "EXIT" "N" | "NEXT" : pointer +:= 1 "P" | "PRIOR": pointer -:= 1 "H" | "HOME" : pointer := 1 "?" | "HELP" : help() "$" | "END" : pointer := *sctrs "G" | "GOTO" : pointer := input(at(23,1) || blue || "GOTO SCTR # :") } if pointer < 1 then pointer := 1 if pointer > *sctrs then pointer := *sctrs if match("DUMP",map(result,&lcase,&ucase)) then dump() if match("GOTO",map(result,&lcase,&ucase)) & (*result > 6)then { new := trim(result[6:0]) if new == "" then new := input(at(23,1) || blue || "GOTO SCTR # :") pointer := new } end # # display the 256 byte block # procedure display(object) write(blue,"\e[2J\e[HAPED V.1 Sector ",pointer," of ",*sctrs," of ",object,"\n") block := sctrs[pointer] every i := 1 to 256 do { b := ord(block[i]) b1 := (b / 16) + 1 b2 := b - (b1 * 16) writes(hex[b1],hex[b2]," ") if i%16 = 0 then { base := (pointer - 1) * 256 offset := i - 16 address:= radcon(base + offset,10,16) write(" : ",address) } } end # # update the matrix of hex numbers currently displayed # There are 16 bytes per line, and 16 lines that are updatable # # row = index / 16 +3 # col = index % 16 * 3 # procedure edit() index := 1 hexset := cset(hex) oldrow := 0 oldcol := 0 oldb1 := -1 oldb2 := -1 color := blue writes(coff) repeat { b := ord(block[index]) row := ((index - 1) / 16) + 3 col := ((index - 1) % 16) * 3 + 1 b1 := (b / 16) + 1 b2 := b - (b1 * 16) writes(at(row,col),green,hex[b1],hex[b2]) (oldcol = 0) | writes(at(oldrow,oldcol),blue,hex[oldb1],hex[oldb2]) kee := lawkey() # keyname(kee) if *kee = 1 then kee := map(kee,&lcase,&ucase) case kee of { "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "A" | "B" | "C" | "D" | "E" | "F" : { writes(at(row,col),red,kee) other := map(getch(),&lcase,&ucase) any(hexset,other) | next writes(at(row,col+1),red,other) value := 16 * (find(kee,hex) - 1) + (find(other,hex) - 1) color := if block[index] == char(value) then blue else red block[index] := char(value) index +:= 1 if index > 256 then index := 1 next } "G" : return "GOTO" " " | "N" : return "NEXT" "P" : return "PRIOR" "X" : return "SAVE" "Z" : return "DUMP" "?" : return "HELP" "Q" : return "QUIT" } color := blue case kee of { ":" | "ESCAPE" : return map(input(at(23,1) || blue || "Command:"),&lcase,&ucase) "PAGEDOWN" : return "NEXT" "PAGEUP" : return "PRIOR" "F10" : { writes(at(23,1)) ; return "SAVE" } "HOME" : return "HOME" "END" : return "END" "CTRL_C" : return "QUIT" "RETURN" | "ENTER" : { oldb1 := b1 ; oldb2 := b2 oldrow:= row; oldcol:= col new := 16 * integer((index + 16) / 16) index := new + 1 if index > 256 then index -:= 256 next } "RIGHTARROW" | "SPACE" | "TAB": { oldb1 := b1 ; oldb2 := b2 oldrow := row ; oldcol:= col index +:= 1 if index>256 then index := 1 next } "LEFTARROW" : { oldb1 := b1 ; oldb2 := b2 oldrow := row ; oldcol:= col index -:= 1 if index<1 then index := 256 next } "UPARROW" : { oldb1 := b1 ; oldb2 := b2 oldrow := row ; oldcol:= col index -:= 16 if index<1 then index +:= 256 next } "DOWNARROW" : { oldb1 := b1 ; oldb2 := b2 oldrow := row ; oldcol:= col index +:= 16 if index>256 then index -:= 256 next } } } end # # \ button := getch() # usage > if button == "\000" then button ||:= getch() # / pressed := keyname(button) # # map unusual keys to a string # procedure keyname(str) static keys initial { keys := table("ANY") keys["\000;"] := "F1" keys["\000<"] := "F2" keys["\000="] := "F3" keys["\000>"] := "F4" keys["\000?"] := "F5" keys["\000@"] := "F6" keys["\000A"] := "F7" keys["\000B"] := "F8" keys["\000C"] := "F9" keys["\000D"] := "F10" keys["\000\373"] := "F12" keys["\000H"] := "UPARROW" keys["\000P"] := "DOWNARROW" keys["\000M"] := "RIGHTARROW" keys["\000K"] := "LEFTARROW" keys["\000I"] := "PAGEUP" keys["\000Q"] := "PAGEDOWN" keys["\000G"] := "HOME" keys["\000O"] := "END" keys["\000R"] := "INSERT" keys["\000S"] := "DELETE" keys["\e"] := "ESCAPE" keys["\001"] := "CTRL_A" keys["\002"] := "CTRL_B" keys["\003"] := "CTRL_C" keys["\004"] := "CTRL_D" keys["\005"] := "CTRL_E" keys["\006"] := "CTRL_F" keys["\007"] := "BELL" keys["\010"] := "BACKSPACE" keys["\011"] := "TAB" keys["\012"] := "LINEFEED" keys["\013"] := "CTRL_K" keys["\014"] := "FORMFEED" keys["\015"] := "RETURN" keys["\016"] := "CTRL_N" keys["\017"] := "CTRL_O" keys["\020"] := "CTRL_P" keys["\021"] := "CTRL_Q" keys["\022"] := "CTRL_R" keys["\023"] := "CTRL_S" keys["\024"] := "CTRL_T" keys["\025"] := "CTRL_U" keys["\026"] := "CTRL_V" keys["\027"] := "CTRL_W" keys["\030"] := "CTRL_X" keys["\031"] := "CTRL_Y" keys["\032"] := "CTRL_Z" } return keys[str] end # # THIS ROUTINE SETS THE CURSOR TO A GIVEN X (COL) Y(ROW) SCREEN LOCATION # procedure at(y,x) return "\e[" || y || ";" || x || "f" end # # the next several modules are used to do base conversions # the most common being between 10 and 16 # procedure exbase10(i,j) static digits local s, d, sign initial digits := &digits || &lcase if i = 0 then return 0 if i < 0 then { sign := "-" i := -i } else sign := "" s := "" while i > 0 do { d := i % j if d > 9 then d := digits[d + 1] s := d || s i /:= j } return sign || s end procedure inbase10(s,i) if s[1] == "-" then return "-" || integer(i || "r" || s[2:0]) else return integer(i || "r" || s) end procedure radcon(s,i,j) return exbase10(inbase10(s,i),j) end # # detects keys from a LAWSON UNIVERSE client # procedure lawkey() k := getch() if k == "\x18" then return "F11" if k == "\003" then return "CTRL_C" if k == "\d" then return "DEL" if k == "\n" then return "ENTER" if k == "\t" then return "TAB" if k == "\r" then return "RETURN" if k == " " then return "SPACE" (k == "\e") | (return k) k2 := getch() (k2 == "[") | (k2 == "O") | return image(k || k2) k3 := getch() case k2 of { "[" : case k3 of { "A" : return "UPARROW" "B" : return "DOWNARROW" "C" : return "RIGHTARROW" "D" : return "LEFTARROW" "V" : return "PAGEUP" "U" : return "PAGEDOWN" "4" : { getch() ; return "INS" } default : return image(k || k2 || k3) } "O" : case k3 of { "P" : return "F1" "Q" : return "F2" "R" : return "F3" "S" : return "F4" "T" : return "F5" "U" : return "F6" "V" : return "F7" "W" : return "F8" "X" : return "F9" "Y" : return "F10" "E" : return "STAB" "]" : return "HOME" "^" : return "END" "o" : return "KP-" default : return image(k || k2 || k3) } default : return image(k || k2 || k3) } return "?" || image(k || k2 || k3) end # # dump the current image, by writing out the current sectors # to a tmp file and then running hd in aped mode. # procedure dump() temp := "aped.tmp" dumpfile := trim(file) || ".dmp" final := *block cmd := "which hd >" || temp system(cmd) write(con,at(23,1),black) (in := open(temp)) | { error("No hd command") ; return } result := read(in) close(in) if find("not found",result) then { error("No hd command") ; return } write(con,"Generating dump file...") (out := open(temp,"wu")) | stop(con,black,at(23,1),"Can't write ",file) if *sctrs > 1 then every i := 1 to *sctrs-1 do writes(out,sctrs[i]) tail := sctrs[-1] writes(out,tail[1+:final]) close(out) cmd := "hd " || temp || " -aped >" || dumpfile system(cmd) write(con,dumpfile," written. Press ENTER to continue.") getch() end # # display an error message # procedure error(msg) write(con,"\7",msg) writes(con,"Press ENTER to continue.") getch() end # # brief online help screen # procedure help() write(con,at(10,10),red," Very Brief Help ") write(con,at(11,10),red," : - Command Mode ") write(con,at(12,10),red," G - Goto Sctr : GOTO ") write(con,at(13,10),red," N - Next Sctr : NEXT ") write(con,at(14,10),red," P - Prior Sctr : PRIOR ") write(con,at(15,10),red," H - Home Sctr 1 : HOME ") write(con,at(16,10),red," $ - Last Sctr : EOF ") write(con,at(17,10),red," Q - Quit/nosave : QUIT ") write(con,at(18,10),red," X - Exit/Save : EXIT ") write(con,at(19,10),red," Z - Dump Hex : DUMP ") write(con,at(20,10),red," Press ENTER to continue. ") getch() end #################### END PROGRAM ######################### Chris Tenaglia (system manager) | The future foretold, Medical College of Wisconsin | The past explained, 8701 W. Watertown Plank Rd. | The present largely appologized for. Milwaukee, WI 53226 (414)456-8765 | Organon to the Doctor From icon-group-sender Tue Jul 8 12:21:21 1997 Received: from kingfisher.CS.Arizona.EDU by cheltenham.cs.arizona.edu; Tue, 8 Jul 1997 15:44:16 MST Received: by kingfisher.CS.Arizona.EDU; (5.65v3.2/1.1.8.2/08Nov94-0446PM) id AA25063; Tue, 8 Jul 1997 15:44:16 -0700 Message-Id: <199707081621.AA26556@optima.cs.arizona.edu> Date: Tue, 8 Jul 1997 12:21:21 -0400 From: Mark Keil To: gep2@computek.net Cc: icon-group@cs.arizona.edu Subject: RE: Scripting paper In-Reply-To: gep2@computek.net's message of July 2, 1997 17:37 (Re: Scripting paper) References: <199707022237.RAA04514@axp.cmpu.net> Reply-To: Mark Keil Errors-To: icon-group-errors@cs.arizona.edu Status: RO gep2@computek.net writes: > >Icon types: > I thought perhaps Icon devotees would like to take a look at > http://www.sunlabs.com/people/john.ousterhout/scripting.html > which talks about Perl, Tcl, Java and C as scripting languages. > Does Icon support #!/usr/local/bin/icon as the first line of an Icon script yet? Once Icon supports that it will be easy to use as a scripting language. I remenber using some kind of wrapper program that allows one to scriptify translators that don't support the #! system. I forget what that wrapper programs name is though, been a while. I have used Icon for scripting applications. > Where, if at all, do we think Icon fits into this picture? > In it's own circle in Ousterhout's chart. Ousterhout also left out scsh & guile, which fits in another set of circles > > Gordon Peterson > http://www.computek.net/public/gep2/ > Support the Anti-SPAM Amendment! Join at http://www.cauce.org/ > -Mark From icon-group-sender Tue Jul 8 15:38:06 1997 Received: from kingfisher.CS.Arizona.EDU by cheltenham.cs.arizona.edu; Tue, 8 Jul 1997 16:38:36 MST Received: by kingfisher.CS.Arizona.EDU; (5.65v3.2/1.1.8.2/08Nov94-0446PM) id AA25674; Tue, 8 Jul 1997 16:38:35 -0700 To: icon-group@cs.arizona.edu Date: 8 Jul 1997 15:38:06 -0700 From: icon-project@cs.arizona.edu Message-Id: <5pufge$op0@kingfisher.CS.Arizona.EDU> Organization: University of Arizona CS Department, Tucson AZ Sender: icon-group-request@cs.arizona.edu Reply-To: icon-project@cs.arizona.edu Subject: Icon Programming Language FAQ Errors-To: icon-group-errors@cs.arizona.edu Status: RO Archive-name: comp-lang-icon-faq Posting-Frequency: monthly Frequently Asked Questions About The Icon Programming Language Last updated: December 11, 1996 This FAQ answers various questions about the Icon programming language, ranging from what it is to how you can get it. The master copy of this FAQ is the Web page http://www.cs.arizona.edu/icon/faq.html. Other on-line documentation is available via the main Icon page at http://www.cs.arizona.edu/icon/. This FAQ is written by Ralph Griswold and Gregg Townsend, with help from Cliff Hathaway, Clint Jeffery, and Bob Alexander. * 1. What is Icon? * 2. What is Icon good for? * 3. Where did Icon come from? * 4. What does "Icon" stand for? * 5. On what computers does Icon run? * 6. Who did all these implementations? * 7. Are there other implementations in the works? * 8. What about different versions of Icon? * 9. Which implementations of Icon have graphics/window capabilities? * 10. Where can I get Icon? * 11. Where can I get documentation about Icon? * 12. How do I get started with Icon? * 13. What is the Icon Project? * 14. Where can I find examples of Icon programs? * 15. What is Idol? * 16. How often is material in Icon's FTP area updated? * 17. How do I stay up to date with what's going on with Icon? * 18. Is there a users' group for Icon? * 19. How do I get technical support? * 20. What do I need to run Icon? * 21. Can I build my own implementation of Icon for a new platform? ---------------------------------------------------------------------------- 1. 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 its semantics are at a much higher level than those languages. 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. 2. 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 at its best when used build software tools, for processing text, and when ease of programming is needed for experimental and research applications. Paradoxically, Icon is used most often for short, one-shot tasks and for very complex 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. This explains its usefulness for prototyping as well as the apparent paradox of applicability to simple and complex applications. 3. 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 60s. 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. Incidentally, Icon bears little physical resemblance to SNOBOL4, although it has similar objectives and many similar capabilities. 4. What does "Icon" stand for? The name Icon (which is not spelled ICON) is not an acronym nor does it stand for anything in particular, although the word "iconoclastic" was mentioned at the time the name was chosen. The name predates the now common use of "icon" to refer to small images used in graphical user interfaces. This latter usage sometimes causes persons to think mistakenly that Icon is designed to create or manipulate icons. There's not much that can be done about this. 5. On what computers does Icon run? The implementation of Icon is highly portable. Version 9 runs on UNIX, MS-DOS, Windows, NT, Macintosh/MPW, VAX/VMS, the Amiga, and the Acorn Archimedes. There are older versions for the Atari ST, IBM CMS and MVS, the Macintosh, and OS/2. Icon programs also are highly portable. Most Icon programs can run on any platform that supports Icon. 6. Who did all these implementations? The original implementation of Icon for UNIX was done at The University of Arizona. Most of the other implementations originally were done by volunteers scattered around the world. It's worth noting that all implementations of Icon are based on the same source code, which is written in C. This contributes to the portability of Icon itself, as well as to the portability of programs written in Icon. 7. Are there other implementations in the works? Work is constantly underway on implementations of Icon for new platforms. Microsoft Windows and Windows NT implementations are in beta testing. 8. What about different versions of Icon? Icon has evolved through a series of versions with improved and extended capabilities. The latest major version number is 9. This version includes recent changes and additions, notably in the graphics area, and runs on UNIX, MS-DOS, Macintosh/MPW, VAX/VMS, the Amiga, and Acorn Archimedes. Other implementations presently are at Version 8. Almost all programs that run under Version 8 and that do not use graphics will run under Version 9. 9. Which implementations of Icon have graphics/window capabilities? Icon's graphics facilities presently are supported on UNIX and VAX/VMS. Windows NT and Microsoft Windows implementations that support Icon's graphics facilities are in beta testing. 10. Where can I get Icon? Icon is available via anonymous FTP and on the Web. For FTP, use ftp.cs.arizona.edu and cd /icon. For the Web, use http://www.cs.arizona.edu/icon/ and check out the links there. For FTP, the directory /icon/binaries contains executable versions of Icon for several systems, including several popular UNIX platforms. The directory /icon/packages contains source code, test programs, related material, and, most cases, executable binaries as well. All directories have README files with additional information. 11. Where can I get documentation about Icon? The definitive work on Icon is the book The Icon Programming Language, Griswold and Griswold, third edition, Peer-to-Peer Communications, Inc, 1996, 386 pages, ISBN 1-57398-001-3. This book is a complete description and reference manual for Version 9 of Icon. A technical report describes changes since that version. There also is a book on the implementation of Icon: The Implementation of the Icon Programming Language, Griswold and Griswold, Princeton University Press, 1986, 336 pages, ISBN 0-691-08431-9. This book describes the implementation as of Version 6 of Icon. Although the implementation has changed considerably since then, the basic structure is the same. Technical reports describing recent implementation changes are included with copies of the book purchased from the Icon Project. These books are available from the Icon Project. Additional documentation is available via FTP in /icon/doc. Notable documents are: * IPD266: An Overview of Icon (text, PostScript, PDF) * IPD281: Graphics/window facilities (PostScript, PDF) * IPD278: Version 9.3 of Icon (text, PostScript, PDF) There are manual pages for UNIX systems, and more documentation under the Icon web page, but there is no complete on-line documentation. The Icon Newsletter, which includes topical material about Icon and a list of material available from the Icon Project, is published three times a year and is available on the Web. There is a subscription fee for an on-going subscription by postal mail. The Icon Analyst, a technically-oriented newsletter that features articles about programming, is published six times a year. There is a subscription fee for the Analyst. A sample copy is available on the Web. All back issues of both newsletters are available for purchase. 12. How do I get started with Icon? If you're running under UNIX, check first in the /icon/binaries/unix FTP directory to see if there is a "starter kit" for your platform. Starter kits include executables, documentation, and other material. Otherwise, go to the /icon/packages directory and get the appropriate package. Packages include documentation and other material; see the README file in that directory for more details. There is a UNIX package for platforms that lack starter kits. If the non-UNIX package you pick up does not contain executable files, check /icon/binaries. You also may want to get the overview of Icon: /icon/doc/ipd266.txt or ipd266.ps.Z. You'll find pointers to other documents of interest in the package you pick up. 13. What is the Icon Project? The Icon Project is a name used by the group that develops, implements, distributes, and supports the Icon programming language. The Icon Project is not commercial organization. It derives support from The University of Arizona, revenue from the sale of program material and documentation, and user contributions. 14. Where can I find examples of Icon programs? There is a large program library for Icon. It is an excellent resource for both new and experienced programmers. The library contains numerous examples of how to do things with Icon. The library also provides many useful applications, as well as hundreds of procedures that supplement Icon's built-in repertoire. The library, like other Icon material, is available via FTP in /icon/library. 15. What is Idol? Idol is an object-oriented extension to Icon that provides concepts such as classes and multiple inheritance. Idol is written in Idol and is distributed as part of the Icon program library. Idol runs on almost all of the platforms that support Icon. Additional Idol information is available from Clint Jeffery, jeffery@ringer.cs.utsa.edu. 16. How often is material in Icon's FTP area 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. 17. How do I stay up to date with what's going on with Icon? The best way to find out about developments related to Icon is to read the Icon Newsletter. You can stay up to date on the source code, which is changed much more frequently than the version on FTP is updated, by subscribing to the source update service, which provides a new version about twice a year. There also is a subscription service for updates to the Icon program library, which provides new material about twice a year. There is on-line information about subscribing to these services. 18. Is there a users' group for Icon? There is no official Icon users' group. The Icon Project maintains an electronic mailing list, icon-group@cs.arizona.edu. Mail sent to this address is forwarded to subscribers. 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, is less intrusive, but sometimes suffers from inappropriate postings. The Icon Project usually sends messages of interest to the Icon community to icon-group. 19. 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: Ordering Icon Material mail: Icon Project Department of Computer Science The University of Arizona P.O. Box 210077 Tucson, Arizona 85721-0077 U.S.A. fax: (520) 621-4246 voice: (520) 621-6613 e-mail: icon-orders@cs.arizona.edu Getting On-Line Information and Material web: http://www.cs.arizona.edu/icon/ ftp: ftp.cs.arizona.edu (cd /icon) e-mail: ftpmail@cs.arizona.edu Send a message consisting of the word help. Assistance with Installing Icon e-mail: icon-project@cs.arizona.edu Bug Reports e-mail: icon-project@cs.arizona.edu fax: (520) 621-4246 Assistance with Programming Problems e-mail: icon-group@cs.arizona.edu news: comp.lang.icon Uploading Files ftp: ftp.cs.arizona.edu (cd /incoming) After uploading, send e-mail to icon-project@cs.arizona.edu. 20. What do I need to run Icon? Icon will run on most computers. Under MS-DOS, the Icon interpreter needs at least 500 KB of application RAM to work well. 21. Can I build my own implementation of Icon for a new platform? As mentioned above, Icon is written in C and the source code is available. The existing implementations are testament to its portability. (A small amount of assembly-language code is required for a context switch, but this is only needed for an optional feature -- co-expressions -- that can be disabled without affecting other features of Icon.) New ports involve platform-specific configuration parameters and, in some cases, platform-specific code. The feasibility of a new port and the amount of work it may take depends on the platform -- its architecture, its C compiler, and its environment. Ports to new UNIX platforms generally are easy, although novel architectures may present problems. Ports to new operating systems generally are more difficult, especially if Icon's graphics facilities are implemented. The Icon Project provides what help it can with new ports. In return, it asks that code related to the port to be returned to the Icon Project for inclusion in future versions of the source code for Icon. This makes the new port available to others as well as to the porter when Icon is updated. From icon-group-sender Wed Jul 9 11:12:07 1997 Received: from kingfisher.CS.Arizona.EDU by cheltenham.cs.arizona.edu; Wed, 9 Jul 1997 12:27:03 MST Received: by kingfisher.CS.Arizona.EDU; (5.65v3.2/1.1.8.2/08Nov94-0446PM) id AA25461; Wed, 9 Jul 1997 12:27:03 -0700 Date: Wed, 9 Jul 1997 11:12:07 -0500 (CDT) Message-Id: <199707091612.LAA21200@dfw-ix5.ix.netcom.com> X-Sender: bobalex@popd.ix.netcom.com X-Mailer: Windows Eudora Pro Version 2.1.2 Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" To: Icon Group From: Bob Alexander Subject: Re: A small puzzle Errors-To: icon-group-errors@cs.arizona.edu Status: RO This is a really BORING solution, 'cause it's terribly straightforward, and probably the same way someone would do it in C, but why not: procedure lcp(a,b) every i := seq() do if not (a[i] == b[i]) then return a[1:i] end Or, maybe more efficient but less transparent: procedure lcp(a,b) every i := seq() do if not match(a[i],b,i) then return a[1:i] end ? Seems to me that this approach is linear in terms of characters examined (where n is somehow related to the lengths of the strings involved), as opposed to several n-squared agorithms I've seen here and in the SNOBOL4 area. -- Bob From icon-group-sender Wed Jul 9 13:51:21 1997 Received: from kingfisher.CS.Arizona.EDU by cheltenham.cs.arizona.edu; Wed, 9 Jul 1997 12:27:21 MST Received: by kingfisher.CS.Arizona.EDU; (5.65v3.2/1.1.8.2/08Nov94-0446PM) id AA26272; Wed, 9 Jul 1997 12:27:20 -0700 Date: Wed, 9 Jul 1997 13:51:21 -0400 (EDT) From: "Phillip L. Thomas" To: icon-group Subject: Accessing windows/95 clipboard Message-Id: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Errors-To: icon-group-errors@cs.arizona.edu Status: RO I'm looking for a way to copy material from one Windows/95 window to an icon application. Essentially, the text has to be copied to the clipboard and then be pasted into the icon window. Is this possible? Phillip Thomas From icon-group-sender Wed Jul 9 14:39:48 1997 Received: from kingfisher.CS.Arizona.EDU by cheltenham.cs.arizona.edu; Wed, 9 Jul 1997 16:42:25 MST Received: by kingfisher.CS.Arizona.EDU; (5.65v3.2/1.1.8.2/08Nov94-0446PM) id AA25814; Wed, 9 Jul 1997 16:42:25 -0700 Date: Wed, 9 Jul 1997 14:39:48 -0500 Message-Id: <199707091939.OAA16794@segfault.cs.utsa.edu> From: Clinton Jeffery To: ptho@loc.gov Cc: icon-group@cs.arizona.edu In-Reply-To: (ptho@loc.gov) Subject: Re: Accessing windows/95 clipboard Reply-To: jeffery@cs.utsa.edu Errors-To: icon-group-errors@cs.arizona.edu Status: RO > [Philip Thomas asks how to copy & paste info between programs] > I'm looking for a way to copy material from one Windows/95 > window to an icon application. Essentially, the text has to > be copied to the clipboard and then be pasted into the icon > window. Is this possible? At present, this is not possible under either UNIX/X or MSWindows Icon. Copying clipboard text into an Icon program sounds do-able, but it raises several questions for which we have not yet attempted a solution: achieving Icon's monumental source code portability across window systems, preserving fonts and colors, copying images and not just text... Perhaps a minimal solution would be better than no solution. Clint Jeffery, jeffery@cs.utsa.edu Division of Computer Science, The University of Texas at San Antonio Research http://www.cs.utsa.edu/research/plss.html From icon-group-sender Thu Jul 10 11:37:00 1997 Received: from kingfisher.CS.Arizona.EDU by cheltenham.cs.arizona.edu; Thu, 10 Jul 1997 11:16:32 MST Received: by kingfisher.CS.Arizona.EDU; (5.65v3.2/1.1.8.2/08Nov94-0446PM) id AA26576; Thu, 10 Jul 1997 11:16:32 -0700 Message-Id: <33C49F2C.D97@artaxia.com> Date: Thu, 10 Jul 1997 11:37:00 +0300 From: Steven Gross X-Mailer: Mozilla 3.0 (Win95; I) Mime-Version: 1.0 To: Icon Group Subject: Re: A small puzzle longest common prefix string Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Errors-To: icon-group-errors@cs.arizona.edu Status: RO Three lcp routines. Each is at least five times faster than the preceeding one, at least for for very long strings. procedure lcp1(s1,s2) # simplest. char by char match. easy to generalize for more strings. local i i := 1 while s1[i] == s2[i] do i +:= 1 return s1[1+:i-1] end procedure lcp2(s1,s2) # uses internal string scanning. doubles chunk scanned each time. local i, j i := 1; j := 0; while match(s1[j+1 +:i], s2, j+1) do { j+:= i; i *:= 2 } # or: while s2 ? (move(j) & =s1[j+1 +: i]) do { j +:= i; i *:= 2 } while j +:= 1 & s1[j] == s2[j] # check chars from j+1 to i return s1[1+:j-1] end procedure lcp3(s1,s2) # uses internal screen scanning, recursion to reuse doubling return s1[1+:lcph(s1, s2, 0)] end procedure lcph(s1, s2 ,k) # on entry, s1[1+:k] == s2[1+:k]. # returns the number of additional chars that match. local i, j i := 1; j := 0; while match(s1[k+j+1 +:i], s2, k+j+1) do { j +:= i; i *:= 2 } if j=0 then return 0 else return j + lcph(s1, s2, k + j) end From icon-group-sender Thu Jul 10 14:19:02 1997 Received: from kingfisher.CS.Arizona.EDU by cheltenham.cs.arizona.edu; Thu, 10 Jul 1997 16:53:26 MST Received: by kingfisher.CS.Arizona.EDU; (5.65v3.2/1.1.8.2/08Nov94-0446PM) id AA27195; Thu, 10 Jul 1997 16:53:25 -0700 Message-Id: <199707102119.OAA00541@orpheus.gemini.edu> From: swampler@noao.edu (Steve Wampler) Date: Thu, 10 Jul 1997 14:19:02 MST X-Mailer: Mail User's Shell (7.2.3 5/22/91) To: icon-group@cs.arizona.edu Subject: Results of 'A small puzzle' Errors-To: icon-group-errors@cs.arizona.edu Status: RO The puzzle was to write a procedure lcp(s1,s2) that would return the longest common prefix of strings s1 and s2. I won't repost the solutions that people have already sent to this group. Instead, I'll give my own solutions and then show some timings. --------- my solutions -------- procedure lcp0(s1,s2) return s2 ? =s1[1+:*s1 to 0 by -1] end procedure lcp1(s1,s2) return s2 ? =s1[1+:*(if *s1 > *s2 then s2 else s1) to 0 by -1] end procedure lcp2(s1,s2) return s1[1+:(p := *s1 to 0 by -1)] == s2[1+:p] end procedure lcp3(s1,s2) return s1[1+:(p := (many(s1**s2,s1)|0) to 0 by -1)] == s2[1+:p] end ------------------------------- In this list, the even-numbered procedures are 'simple', the odd numbered try out a couple of heuristics. Now for some timings: As you might imagine, the speed of each algorithm is extremely dependent on the nature of the input. Factors that influence the speed depend include (a) the sizes of the two strings, (b) the length of the longest common prefix, (c) the order of the two strings given as arguments. I didn't run any tests with *really* long strings - the linear solutions would have done much better on long strings with short lcp's. There is no clearly superior solution. I think the conclusion is that if you know the nature of the strings you are dealing with, you can pick an algorithm that does a good job with it! I've wondered if one of the fast substring find algorithms that are available could be adopted to the lcp() problem, but didn't feel like trying to code one up, as I doubt they would help as much for prefix substrings as they do in the general case. Also, you could produce a solution that *looks* really good according to my test program by doing something like: # warning untested code follows! procedure lcp(s1,s2) local k static lcpTab initial lcpTab := table() k := s1 || ":" || s2 /lcpTab[k] := real_lcp(s1,s2) return lcpTab[k] end But that would be *cheating* and potentially very costly to use in practice...though there is a simpler cheat that at least isn't so potentially costly, even if it isn't likely to help in the Real World(tm). --------------- Timing comparisons --------------------------- The two strings are shown at the start of each time set, separated by a :. Results are ordered from fastest to slowest for each time set. Time is the total time for 50,000 calls to the routine, minus the loop overhead itself. Multiple solutions from the same person are numbered in the same order that they appeared in their post. (I.e. bob1() is the first solution by Bob, bob2() is the 2nd., etc.) : { two null strings } carl........... 3.633 bob2........... 4.183 bob1........... 4.183 steve1......... 4.249 lcp0........... 5.750 lcp2........... 5.766 lcp1........... 6.683 jerry.......... 6.733 steve2......... 6.950 steve3......... 7.033 lcp3........... 8.000 fool:foodchain lcp0........... 7.550 lcp1........... 8.384 lcp2........... 9.167 carl........... 10.084 lcp3........... 12.100 bob2........... 13.033 bob1........... 13.734 steve1......... 14.467 jerry.......... 16.334 steve2......... 18.917 steve3......... 26.467 foodchain:fool lcp1........... 8.517 jerry.......... 8.550 carl........... 10.084 lcp3........... 12.084 bob2........... 12.900 bob1........... 13.700 steve1......... 14.534 lcp0........... 15.133 steve2......... 20.284 lcp2........... 21.117 steve3......... 28.717 aaaaaaaaaaaaaaab:aaaaaaaaaaaaaaac lcp0........... 8.384 lcp1........... 9.301 jerry.......... 9.850 lcp2........... 10.084 lcp3........... 14.567 carl........... 29.268 steve2......... 30.251 steve3......... 40.051 bob2........... 44.850 bob1........... 46.218 steve1......... 49.634 aardvarkseatsmallants:smallantsareeatenbylargeardvarks carl........... 5.283 bob2........... 5.451 bob1........... 5.650 steve1......... 5.684 steve3......... 9.234 steve2......... 10.184 lcp0........... 38.350 lcp1........... 39.217 jerry.......... 57.800 lcp2........... 71.933 lcp3........... 78.284 smallantsareeatenbylargeardvarks:aardvarkseatsmallants carl........... 5.284 bob2........... 5.468 steve1......... 5.684 bob1........... 5.684 steve3......... 9.217 steve2......... 10.234 lcp1........... 39.284 jerry.......... 40.617 lcp0........... 54.868 lcp3........... 68.851 lcp2........... 98.450 thisistheexactsamestringastheotherone:thisistheexactsamestringastheotherone lcp0........... 7.034 lcp2........... 7.151 lcp1........... 7.967 jerry.......... 8.101 lcp3........... 14.651 steve2......... 50.118 carl........... 62.750 steve3......... 77.267 bob2........... 96.051 bob1........... 103.884 steve1......... 112.167 ----------------------------------------------------------- I think I had about as much fun working on the timing test program as I did on the puzzle itself! If anyone would like to see the test program, let me know and I'll post it. (Perhaps people would like to improve upon it...) -- Steve Wampler - swampler@gemini.edu [Gemini 8m Telescopes Project (under AURA)] O Sibile, si ergo, fortibus es inero. Nobile, demis trux. Demis phulla causan dux. From icon-group-sender Sat Jul 12 05:00:28 1997 Received: from kingfisher.CS.Arizona.EDU by cheltenham.cs.arizona.edu; Tue, 15 Jul 1997 12:05:14 MST Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA02996; Tue, 15 Jul 1997 12:05:14 -0700 Date: Sat, 12 Jul 1997 05:00:28 -0500 Message-Id: <199707121000.FAA20024@segfault.cs.utsa.edu> From: Clinton Jeffery To: icon-group@cs.arizona.edu Subject: cutting and pasting in Windows Icon Reply-To: jeffery@cs.utsa.edu Errors-To: icon-group-errors@cs.arizona.edu Status: RO Philip Thomas recently asked if it was possible to cut and paste text from other windows into a Windows Icon program. In general it isn't, but I forgot to mention that the new Windows native facilities include a function EditRegion() that places a Windows text edit control on an Icon window, and it is easy to cut, copy and paste to and from the clipboard using this edit region. So far, the best example program that makes use of this capability is the Wi programming environment, whose source is available with the latest Windows Icon distribution. Wi supports cutting, copying and pasting text to and from other Windows applications. Clint Jeffery, jeffery@cs.utsa.edu Division of Computer Science, The University of Texas at San Antonio Research http://www.cs.utsa.edu/research/plss.html From icon-group-sender Sun Jul 13 02:19:08 1997 Received: from kingfisher.CS.Arizona.EDU by cheltenham.cs.arizona.edu; Tue, 15 Jul 1997 12:05:53 MST Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA03036; Tue, 15 Jul 1997 12:05:53 -0700 Date: Sun, 13 Jul 1997 02:19:08 -0500 Message-Id: <199707130719.CAA20587@segfault.cs.utsa.edu> From: Clinton Jeffery To: icon-group@cs.arizona.edu Subject: Questions for Icon users in Germany and other countries Reply-To: jeffery@cs.utsa.edu Errors-To: icon-group-errors@cs.arizona.edu Status: RO I am going to Finland and Germany next month, so I am wondering if there are any Icon folks who can answer me a couple questions: 1. Are there any German-language documents on Icon programming available? Was the Icon book ever translated into German in east or west germany? I have a Polish Icon book, aber ich kann es nicht lesen. I would love to get a copy of any materials on Icon in German. 2. I am a bibliophile, and I love books too. :-) Would anyone be able to recommend bookstores for technical books, and for used general books in central or southern Germany? What are the best libraries in those regions? I apologize for sending this out to the entire list, but it seemed the best or perhaps only way of reaching Icon-ers on the continent. On an international note, the next release of Windows Icon will include some improvements in writing mixed-size character sets, thanks to prompting from a user in Japan. Does anyone else have needs for an internationally-smart Icon? Are any Icon materials available in other human languages, such as Spanish? Thanks for all comments, Clint Jeffery, jeffery@cs.utsa.edu Division of Computer Science, The University of Texas at San Antonio Research http://www.cs.utsa.edu/research/plss.html From icon-group-sender Mon Jul 14 11:24:30 1997 Received: from kingfisher.CS.Arizona.EDU by cheltenham.cs.arizona.edu; Tue, 15 Jul 1997 12:06:50 MST Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA03066; Tue, 15 Jul 1997 12:06:50 -0700 Date: Mon, 14 Jul 1997 11:24:30 -0700 (PDT) From: Tom Mitchell To: icon-group@cs.arizona.edu, Chris Tenaglia Subject: Re: 4th of July Sample 2 In-Reply-To: Message-Id: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Errors-To: icon-group-errors@cs.arizona.edu Status: RO On Fri, 4 Jul 1997, Chris Tenaglia wrote: > Date: Fri, 4 Jul 1997 08:02:35 -0500 (CDT) > From: Chris Tenaglia > To: icon-group@cs.arizona.edu > Subject: 4th of July Sample 2 > > And for our second offering I post a binary file editor. > I've used it on files up to 1MB. It views the file in > terms of 256 byte sectors. It also assumes some kind of > vt terminal emulation. This is getting close to system > programming and the code gets thick doing binhex conversions > and tracking screen locations. But I pity someone trying to > do this in perl, c, or shell script. I suppose there is > something you could buy to do this, but I didn't know of > any so I wrote this. It took less time than the cost justification > paperwork to buy a piece of software. Nifty code! A number of my friends are lisp fans. One is using lisp as a prototype scripting language for network diagnostics. I have also seen makefiles for a 68010 unix kernel with generated assembler code produced by emacs in a #!emacs type shell batch script. Check out emacs The 24 MB buffer limits of gnu-emacs are not a problem with unix tools like split and dd. function hexlify-buffer and function dehexlify-buffer ==== dehexlify-buffer Function: Convert a hexl format buffer to binary. dehexlify-command Variable: The command to use to unhexlify a buffer. hexl-maybe-dehexlify-buffer Function: Convert a hexl format buffer to binary. hexlify-buffer Function: Convert a binary buffer to hexl format. hexlify-command Variable: The command to use to hexlify a buffer. hexlify-buffer: an interactive compiled Lisp function. (hexlify-buffer) Convert a binary buffer to hexl format. ======================================= Here is my .sig in hexl format. 00000000: 2020 0a20 2054 6f6d 204d 6974 6368 656c . Tom Mitchel 00000010: 6c20 2d20 6d69 7463 6840 7367 692e 636f l - mitch@sgi.co 00000020: 6d2c 206d 6974 6368 4072 656c 6179 2e63 m, mitch@relay.c 00000030: 7364 2e73 6769 2e63 6f6d 2c20 6d69 7463 sd.sgi.com, mitc 00000040: 6840 6163 6d2e 6f72 670a 2020 2020 2020 h@acm.org. 00000050: 2020 5275 6c65 7320 6f66 2074 6875 6d62 Rules of thumb 00000060: 2061 7265 206c 696b 6520 6861 6d6d 6572 are like hammer 00000070: 732c 206e 6169 6c73 2061 6e64 2074 6875 s, nails and thu 00000080: 6d62 732e 0a20 2020 2020 2020 2049 6620 mbs.. If 00000090: 796f 7520 646f 206e 6f74 206c 6f6f 6b20 you do not look 000000a0: 6174 2077 6861 7420 796f 7572 2061 7265 at what your are 000000b0: 2064 6f69 6e67 2069 7420 6361 6e20 6875 doing it can hu 000000c0: 7274 2e0a 2020 2020 2020 2020 2121 2121 rt.. !!!! 000000d0: 2120 204f 7563 6820 2121 2121 2121 0a0a ! Ouch !!!!!!.. 000000e0: 0a . .... Tom Mitchell - mitch@sgi.com, mitch@relay.csd.sgi.com, mitch@acm.org Rules of thumb are like hammers, nails and thumbs. If you do not look at what your are doing it can hurt. !!!!! Ouch !!!!!! From icon-group-sender Mon Jul 14 20:14:16 1997 Received: from kingfisher.CS.Arizona.EDU by cheltenham.cs.arizona.edu; Tue, 15 Jul 1997 12:07:31 MST Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA03122; Tue, 15 Jul 1997 12:07:30 -0700 To: icon-group@cs.arizona.edu Date: 14 Jul 1997 20:14:16 GMT From: espie@triere.ens.fr (Marc Espie) Message-Id: <5qe1ao$9pg$1@nef.ens.fr> Organization: Ecole Normale Superieure, Paris Sender: icon-group-request@cs.arizona.edu Subject: Is comp.lang.icon still alive ? Errors-To: icon-group-errors@cs.arizona.edu Status: RO Sometimes I wonder. I just skimmed through >20 postings, none of which was related to the Icon language, some 3 of them were remotely related to computing. There was not even any of the classical mistakes of `Where can I get this cool graphic icon editor ?'. The FAQ hasn't been updated in ages. Were it not for the icon newsletter, you would believe the language is dead. So I will try and write something a little more Icon-related. I've been working on an Icon port to the Amiga, and so has Marc Culler. Fortunately, our parallel work have been mostly in complementary direction, so there should be a new twin port that compiles under both SAS/C (amiga-centric) and gcc (Unix-like close port). The main work that remains to be done is... drum roll... the graphics part. I've seen the Unix and Windows version taking shape. Having at least two or three distinct ports will be a very Good Thing, as we will get the chance to get more platform independent graphics. Right now, the control you have on colormaps is a bit too simple, for instance. You can play with images as long as you stay within the Palette ranges, for instance, or as long as you don't allocate more colors than your display can handle. Playing with digitized images is much more difficult. Maybe I haven't looked closely enough, but it seems there is now way to ask for `the closest color to those already in use' except for the hard-coded palettes. Right now, I have to whip up another external graphics program to first correct my colormap, and then to play with Icon. I would say that colormaps are an important object in their own right, that deserves a more thorough concept. As another limitation, I've compiled Icon 9.3 under Amiga OpenBSD... Works withouth a hitch, BUT my X display is rather peculiar: I only have 4 color planes, for a grand total of 16 possibly different colors. Most icon color programs tend to allocate more than 16 colors, and so fail abysmally on my machine... though I'd like to get more use of it than out of a b&w machine. Contrasting with that, other programs such as the pure amiga port of Ghostscript manage to produce awesome color graphics with the same limitations. Well, enough rambling. There are probably ways to achieve better results, and I'll certainly have to look that up by myself. Just wanted to give all the comp.lang.icon lurkers the feeling they were not abandonned yet :-) -- [nosave] microsoft network is EXPLICITLY forbidden to redistribute this message. `Seiza no matataki kazoe, uranau koi no yuku e.' Marc Espie (Marc.Espie@ens.fr) From icon-group-sender Tue Jul 15 15:25:23 1997 Received: from kingfisher.CS.Arizona.EDU by cheltenham.cs.arizona.edu; Fri, 18 Jul 1997 15:08:19 MST Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA05665; Fri, 18 Jul 1997 15:08:18 -0700 Date: Tue, 15 Jul 1997 15:25:23 -0500 Message-Id: <199707152025.PAA22485@segfault.cs.utsa.edu> From: Clinton Jeffery To: espie@triere.ens.fr Cc: icon-group@cs.arizona.edu In-Reply-To: <5qe1ao$9pg$1@nef.ens.fr> (espie@triere.ens.fr) Subject: Icon graphics on 16-color machines Reply-To: jeffery@cs.utsa.edu Errors-To: icon-group-errors@cs.arizona.edu Status: RO [Marc Espie wrote:] > my X display is rather peculiar: I only have 4 color > planes, for a grand total of 16 possibly different colors. Most icon color > programs tend to allocate more than 16 colors, and so fail abysmally... > other programs such as the pure amiga port of Ghostscript manage to produce > awesome color graphics with the same limitations. There used to be lots of platforms with 16 colors; now they are rare. Some window systems automatically dither colors on such platforms, but X Window servers generally do not. Icon's implementation does not presently do dithering other than when the window system automatically does it for us. Marc, if you want to put code that adds dithering into either of the Amiga (X Window or Intuition) Icon implementations, that would be great. :-) Clint Jeffery, jeffery@cs.utsa.edu Division of Computer Science, The University of Texas at San Antonio Research http://www.cs.utsa.edu/research/plss.html From icon-group-sender Wed Jul 16 00:22:25 1997 Received: from kingfisher.CS.Arizona.EDU by cheltenham.cs.arizona.edu; Fri, 18 Jul 1997 15:09:51 MST Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA05692; Fri, 18 Jul 1997 15:09:50 -0700 Date: Wed, 16 Jul 1997 00:22:25 -0500 Message-Id: <199707160522.AAA06977@axp.cmpu.net> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit From: gep2@computek.net Subject: Is comp.lang.icon still alive ? To: icon-group@cs.arizona.edu X-Mailer: SPRY Mail Version: 04.00.06.17 Errors-To: icon-group-errors@cs.arizona.edu Status: RO >Sometimes I wonder. I just skimmed through >20 postings, none of which was related to the Icon language, some 3 of them were remotely related to computing. There was not even any of the classical mistakes of `Where can I get this cool graphic icon editor ?'. :-( In part, remember that this is summer, where a lot of the educational base of Icon's support is away for the summer holiday. Once the universities are more active again, I expect the traffic to pick up. >The FAQ hasn't been updated in ages. Were it not for the icon newsletter, you would believe the language is dead. It is posted periodically, and it's not clear that there's a whole lot of updating that it needs... is there? I would like to see some serious effort given to getting the Icon story out to Webmasters for use in CGI scripting, and possibly even adapting the interpreter somewhat to make it more "CGI friendly". This is an area where there is a huge and growing interest in the user community, and I think perl is still vulnerable there (if you have to learn a new language, Icon seems at least as reasonable as perl does). On the other hand, that particular window of opportunity will not stay open forever. >So I will try and write something a little more Icon-related. I've been working on an Icon port to the Amiga, and so has Marc Culler. Fortunately, our parallel work have been mostly in complementary direction, so there should be a new twin port that compiles under both SAS/C (amiga-centric) and gcc (Unix-like close port). The main work that remains to be done is... drum roll... the graphics part. Somehow I'm not surprised by that. :-) >I've seen the Unix and Windows version taking shape. Having at least two or three distinct ports will be a very Good Thing, as we will get the chance to get more platform independent graphics. Right now, the control you have on colormaps is a bit too simple, for instance. You can play with images as long as you stay within the Palette ranges, for instance, or as long as you don't allocate more colors than your display can handle. Playing with digitized images is much more difficult. Maybe I haven't looked closely enough, but it seems there is now way to ask for `the closest color to those already in use' except for the hard-coded palettes. The problem with graphics, like fancy printing perhaps, is that there is the traditional tradeoff of "fast/good/cheap, pick any two" with hardware independence thrown additionally into the pot somehow. Graphics suitable for high-quality image processing is probably at odds with fast sprite-type graphics suitable for games development, for instance. >Right now, I have to whip up another external graphics program to first correct my colormap, and then to play with Icon. I don't come to Icon with the sense that it's a language that's ideal for *everything*. For most general things, I find I still prefer S*BOL. For database-type business-y things and report generation, I find FoxPro is generally pretty good. For asynch communications stuff, I like SALT scripts within the Telix comm package. For really fast low-level stuff, I personally still find assembler the most satisfying (although few clients are willing to pay what it costs to develop in it). C is a good though primitive language for some kinds of development (I wrote a mouse-driven graphical editor for programming a computerized monumental water fountain in it, for example). And other stuff, especially combinatorial problems or those best suited for things like character sets and such, Icon is simply unbeatable. >I would say that colormaps are an important object in their own right, that deserves a more thorough concept. Fine, but it's hard to get everyone to agree on anything that's both general enough to be hardware independent, and efficient enough to do the things you want to be able to do. Coming up with a good "model" which will conceptually still be reasonable five or fifteen years from now is a bit tricky, I'd think. (OTOH, if anyone can do it, I think Griswold and his crew are probably some of the more creative and imaginative people out there). >As another limitation, I've compiled Icon 9.3 under Amiga OpenBSD... Works withouth a hitch, BUT my X display is rather peculiar: I only have 4 color planes, for a grand total of 16 possibly different colors. Most icon color programs tend to allocate more than 16 colors, and so fail abysmally on my machine... though I'd like to get more use of it than out of a b&w machine. Contrasting with that, other programs such as the pure amiga port of Ghostscript manage to produce awesome color graphics with the same limitations. Having at most sixteen displayable colors is a pretty severe limitation anymore. >Just wanted to give all the comp.lang.icon lurkers the feeling they were not abandonned yet :-) I believe that the comp.lang.icon messages are echoed to this mailing list... but does anybody echo these mailing list messages back to the newsgroup (at least the ones that weren't ALREADY echoed from there to the mailing list?) Gordon Peterson http://www.computek.net/public/gep2/ Support the Anti-SPAM Amendment! Join at http://www.cauce.org/ From icon-group-sender Thu Jul 17 18:32:25 1997 Received: from kingfisher.CS.Arizona.EDU by cheltenham.cs.arizona.edu; Fri, 18 Jul 1997 15:10:48 MST Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA05746; Fri, 18 Jul 1997 15:10:47 -0700 To: icon-group@cs.arizona.edu Date: 17 Jul 1997 18:32:25 GMT From: corre@alpha1.csd.uwm.edu (Alan D Corre) Message-Id: <5qlofp$72e@uwm.edu> Organization: University of Wisconsin - Milwaukee, Computing Services Division Sender: icon-group-request@cs.arizona.edu References: <5qe1ao$9pg$1@nef.ens.fr> Subject: Re: Is comp.lang.icon still alive ? Errors-To: icon-group-errors@cs.arizona.edu Status: RO In article <5qe1ao$9pg$1@nef.ens.fr> espie@triere.ens.fr (Marc Espie) writes: >Sometimes I wonder. I just skimmed through >20 postings, none of which was >related to the Icon language, some 3 of them were remotely related to >computing. There was not even any of the classical mistakes of `Where can I >get this cool graphic icon editor ?'. This plea prompts me to mention the following. A while ago I modified a calendar program I wrote in Icon several years ago to function on the World Wide Web. It ported quite easily, and it was apparent to me that writing programs for the web is easier, since you don't have to worry about screen control very much. The browsers do it for you. I had thought of publishing the code here, but decided it was too unesthetic, as I simply commented out a good deal of the code in the MS-DOS version, and left it hanging. I am always wary of deleting stuff, sometimes one's finger slips, and you take out something essential. If anyone is interested, I could send it to you. The URL is http://www.uwm.edu/cgi-bin/corre/calendar For documentation and explanations see http://www.uwm.edu/~corre/calendar.html -- Alan D. Corre Emeritus Professor of Hebrew Studies University of Wisconsin-Milwaukee http://www.uwm.edu/~corre/ From icon-group-sender Fri Jul 18 09:42:14 1997 Received: from kingfisher.CS.Arizona.EDU by cheltenham.cs.arizona.edu; Fri, 18 Jul 1997 15:11:18 MST Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA05771; Fri, 18 Jul 1997 15:11:17 -0700 Message-Id: X-Mailer: Novell GroupWise 4.1 Date: Fri, 18 Jul 1997 09:42:14 -0500 From: Charlie Hethcoat To: icon-group@cs.arizona.edu Subject: The Icon FAQ Mime-Version: 1.0 Content-Type: text/plain Content-Disposition: inline Errors-To: icon-group-errors@cs.arizona.edu Status: RO Marc Espie wrote: >The FAQ hasn't been updated in ages. Were it not for the icon newsletter, you would believe the language is dead. I have also wondered about whether the FAQ is being maintained. Each time I get it, it seems not to have changed (although I haven't done a diff on it). I think there should be more in it about potential application areas. I will briefly describe mine, because it does not seem to be mentioned often. Icon has made an excellent math/engineering programming vehicle for me, and I have been very pleased with it in that role. I think this is because of a happy combination of the properties and the stability of the language definition itself, its solid implementation, and (in no small measure) its portability and low cost to acquire. I think that a new paragraph in the FAQ relating to this type of application would be valuable. It is not now covered, perhaps because it's not really a "frequently asked question" (but that could be just because newcomers don't know enough to ask it). I started to jot down some notes for the FAQ but I haven't finished with them yet. Meanwhile, if anyone else has some ideas on this topic, by all means don't wait on me--write them up. Charles L Hethcoat III Oceaneering Space Systems, Inc. 16665 Space Center Blvd., Houston, Texas 77058 USA chethcoa@oss.oceaneering.com From icon-group-sender Fri Jul 18 17:16:14 1997 Received: from kingfisher.CS.Arizona.EDU by cheltenham.cs.arizona.edu; Mon, 21 Jul 1997 08:10:57 MST Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA06969; Mon, 21 Jul 1997 08:10:56 -0700 Message-Id: <3.0.16.19970718171609.0a3fc0ac@postoffice.worldnet.att.net> X-Sender: jtgalkowski@postoffice.worldnet.att.net X-Mailer: Windows Eudora Pro Version 3.0 (16) Date: Fri, 18 Jul 1997 17:16:14 -0400 To: Charlie Hethcoat , icon-group@cs.arizona.edu From: Jan Theodore Galkowski/Helen Andrea Galkowski Subject: Re: The Icon FAQ Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Errors-To: icon-group-errors@cs.arizona.edu Status: RO At 02:42 PM 7/18/97 +0000, Charlie Hethcoat wrote: >Marc Espie wrote: >>The FAQ hasn't been updated in ages. Were it not for the icon newsletter, >you would believe the language is dead. > The Icon language is * * * N O T * * * dead, not by any means. It has active use here. I bet there are others who feel similarly. I feel it is a mistake to believe in the criterion that if there isn't a lot of frenetic communal chit-chat or hubbub about this, that, or the other, there must be no life. Perhaps Icon users are simply more contemplative than your average Web aficionado, and are busy thinking and doing. Our group is small. Most of us have applications and things to do beyond Icon. But Icon is incredibly important. It is my computational mainstay. [snip] >Charles L Hethcoat III >Oceaneering Space Systems, Inc. >16665 Space Center Blvd., Houston, Texas 77058 USA >chethcoa@oss.oceaneering.com > Thanks, > --Jan Theodore Galkowski. ------------------------------------------------ jtgalkowski@worldnet.att.net [home] 607-754-1115, [work] 607-273-5900, x35, See our Web page at: http://home.att.net/~jtgalkowski/ Interests: Icon, Euler-Rodrigues parameters, spherical regression, vector algebra, Judaism, sports statistics, mathematical geology, algebraic animation, and a long-time fan of the Walt Disney Company Remember the
   Shoah Member, the American Statistical Association (http://www.amstat.org/), the Icon Users' Group (http://www.cs.arizona.edu/icon/) ------------------------------------------------- "To Mathematics: May She be of no damn use to anybody!" ------------------------------------------------- From icon-group-sender Mon Jul 21 07:04:09 1997 Received: from kingfisher.CS.Arizona.EDU by cheltenham.cs.arizona.edu; Mon, 21 Jul 1997 08:12:21 MST Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA07054; Mon, 21 Jul 1997 08:12:21 -0700 To: icon-group@cs.arizona.edu Date: 21 Jul 1997 07:04:09 GMT From: john@nmt.edu (John Shipman) Message-Id: <5qv1l9$eit$1@newshost.nmt.edu> Organization: New Mexico Tech Computer Center Sender: icon-group-request@cs.arizona.edu References: <5qum60$rva@news.asu.edu> Subject: Re: perl vs python vs icon Errors-To: icon-group-errors@cs.arizona.edu Status: RO In article <5qum60$rva@news.asu.edu>, wrote: >Could someone compare these languages. How easy is to lern, use, >features, speed, availability on platforms, libraries, popularity. >Thanks. See this URL for brief comparisons of Python vs. Perl and Icon: http://www.nmt.edu/tcc/help/lang/python/why.html John Shipman (john@nmt.edu), Applications Specialist, NM Tech Computer Center, Speare 19, Socorro, NM 87801, (505) 835-5950, http://www.nmt.edu/~john ``Let's go outside and commiserate with nature.'' --Dave Farber John Shipman (john@nmt.edu), Applications Specialist, NM Tech Computer Center, Speare 19, Socorro, NM 87801, (505) 835-5950, http://www.nmt.edu/~john ``Let's go outside and commiserate with nature.'' --Dave Farber From icon-group-sender Mon Jul 21 22:56:15 1997 Received: from kingfisher.CS.Arizona.EDU by cheltenham.cs.arizona.edu; Tue, 22 Jul 1997 07:52:40 MST Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA07678; Tue, 22 Jul 1997 07:52:40 -0700 To: icon-group@cs.arizona.edu Date: 21 Jul 1997 22:56:15 GMT From: shamim@nospam.com Message-Id: <5r0pef$l6c@hermes.synopsys.com> Organization: Synopsys Inc., Mountain View, CA 94043-4033 Sender: icon-group-request@cs.arizona.edu References: <5qum60$rva@news.asu.edu>, <5qv1l9$eit$1@newshost.nmt.edu> Subject: Re: perl vs python vs icon Errors-To: icon-group-errors@cs.arizona.edu Status: RO In article <5qv1l9$eit$1@newshost.nmt.edu>, John Shipman wrote: >See this URL for brief comparisons of Python vs. Perl and Icon: > > http://www.nmt.edu/tcc/help/lang/python/why.html I'd like to point out that this point _con_ Icon is no longer valid: > Python interfaces already exist to a wide variety of systems programming > facilities (such as directories and TCP/IP sockets), databases, other > languages, and much more. I have added POSIX calls to Icon (reading directories, TCP/UDP/IP, signals, dbm routines, etc.). For more details: http://www.crl.com/~spm/unicon/ I've tested it on SunOS4.1.3, Solaris 2.4 and 2.5, HP-UX versions 9.05 and 10.20, and Linux 2.x. Source patches and binaries are available. My opinion is that Icon with the POSIX features is (for the most part) a better language for scripts, CGI programs etc. than Perl. Perl still handles regular expressions more conveniently than Icon does; and Perl comes with a debugger. Other than these two points, Icon is a better system than Perl. IMHO, of course. This point: > Python has a lot more momentum and a much larger and more vigorous user > community. Alas, a self-perpetuating property... what we need is an O'Reilly book on Icon, that seems to be what does the trick! -s Shamim Mohamed shamim @ synopsys.com Shamim Mohamed A2-1 Synopsys Inc., 700 E Middlefield Rd., Mountain View, CA 94043-4033 -- Shamim Mohamed A2-1 Synopsys Inc., 700 E Middlefield Rd., Mountain View, CA 94043-4033 From icon-group-sender Tue Jul 22 17:34:05 1997 Received: from kingfisher.CS.Arizona.EDU by cheltenham.cs.arizona.edu; Tue, 22 Jul 1997 07:52:55 MST Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA07730; Tue, 22 Jul 1997 07:52:54 -0700 From: Guy Laden Message-Id: <199707221434.RAA09259@fs1.math.tau.ac.il> Subject: vidgets.ps To: icon-group@cs.arizona.edu Date: Tue, 22 Jul 1997 17:34:05 +0300 (GMT+0300) X-Mailer: ELM [version 2.4 PL25] Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Errors-To: icon-group-errors@cs.arizona.edu Status: RO This file is mentioned in ipd279 but doesnt see to be in the disribution. Can anyone say whether its availble? Thanks, Guy From icon-group-sender Tue Jul 22 17:05:10 1997 Received: from kingfisher.CS.Arizona.EDU by cheltenham.cs.arizona.edu; Wed, 23 Jul 1997 07:49:17 MST Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA08408; Wed, 23 Jul 1997 07:49:17 -0700 Date: Tue, 22 Jul 1997 17:05:10 -0700 From: GMCMILLAN@pimacc.pima.edu Subject: Need help on verse.icn To: icon-group@cs.arizona.edu Message-Id: <01ILJM0SILK28WYKG4@pimacc.pima.edu> X-Vms-To: IN::"icon-group@cs.arizona.edu" Mime-Version: 1.0 Content-Type: TEXT/PLAIN; CHARSET=US-ASCII Content-Transfer-Encoding: 7BIT Errors-To: icon-group-errors@cs.arizona.edu Status: RO Hi, I hope the writer of the code for verse.icn will be willing to help me get it to owrk. I am not that advanced in Icon and I have trouble understanding what is wrong with this program when I run it with a vocabulary list (a chapter of a novel turned into one column of words.) At the end of the run, I get this trace back: Run-time error 103 File verse.icn; Line 313 string expected offending value: &null Trace back main(list_1 = ["verse.dat"] form 8 () from line 152 in verse.icn {&null || "."} from line 313 in verse.icn I wouldn't bother the list with this, but I had thought that this could be an interesting introduction to poetry to use with my writing classes this fall. Anyone have a clue? Thanks, -Gloria From icon-group-sender Thu Jul 24 15:00:20 1997 Received: from kingfisher.CS.Arizona.EDU by cheltenham.cs.arizona.edu; Thu, 24 Jul 1997 08:13:33 MST Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA09255; Thu, 24 Jul 1997 08:13:32 -0700 To: icon-group@cs.arizona.edu Date: Thu, 24 Jul 1997 15:00:20 +1000 From: Stuart.Robinson@anu.edu.au (Stuart Robinson) Message-Id: Organization: ANU Sender: icon-group-request@cs.arizona.edu References: Subject: Re: Inadequate space in qualifier list? Errors-To: icon-group-errors@cs.arizona.edu Status: RO Is anyone out there? Anyone? Anyone? -- Stuart Robinson The Australian National University From icon-group-sender Wed Jul 23 16:55:00 1997 Received: from kingfisher.CS.Arizona.EDU by cheltenham.cs.arizona.edu; Thu, 24 Jul 1997 08:13:01 MST Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA09197; Thu, 24 Jul 1997 08:13:00 -0700 Date: Wed, 23 Jul 1997 16:55:00 -0700 (PDT) From: Tom Mitchell To: icon-group@cs.arizona.edu Subject: Re: perl vs python vs icon In-Reply-To: <5r0pef$l6c@hermes.synopsys.com> Message-Id: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Errors-To: icon-group-errors@cs.arizona.edu Status: RO shamim @ synopsys.com said something interesting. He used the words "better system" ..... Of interest is that Icon as a language has wonderful functions and features. Generators are a marvel.... Still more is needed than a Language -- a system. This is what got in the way of Modula II. There was no 'blessed' I/O library in the package that was the language. Niklaus Wirth was asked to bless a number of library packages but elected to not and a very strong language lost momentum. This is also one of the things that made "C" a contendor. As a scripting language Icon also is lacking in a foundation of library support ... from I/O to sockets, TCP/UDP/IP, signals, reg expressions..... This is why perl has so many friends. The basic perl package does all the stuff language designers leave for library designers. Thus a designed library package for Icon is needed or it is simply an exploration of language design. On 21 Jul 1997 shamim@nospam.com wrote: > Date: 21 Jul 1997 22:56:15 GMT > From: shamim@nospam.com > To: icon-group@cs.arizona.edu > Subject: Re: perl vs python vs icon > > In article <5qv1l9$eit$1@newshost.nmt.edu>, John Shipman wrote: > > >See this URL for brief comparisons of Python vs. Perl and Icon: > > > > http://www.nmt.edu/tcc/help/lang/python/why.html > > I'd like to point out that this point _con_ Icon is no longer valid: > > > Python interfaces already exist to a wide variety of systems programming > > facilities (such as directories and TCP/IP sockets), databases, other > > languages, and much more. > > I have added POSIX calls to Icon (reading directories, TCP/UDP/IP, signals, > dbm routines, etc.). For more details: > > http://www.crl.com/~spm/unicon/ > > I've tested it on SunOS4.1.3, Solaris 2.4 and 2.5, HP-UX versions 9.05 and > 10.20, and Linux 2.x. Source patches and binaries are available. > > My opinion is that Icon with the POSIX features is (for the most part) a > better language for scripts, CGI programs etc. than Perl. Perl still handles > regular expressions more conveniently than Icon does; and Perl comes with a > debugger. Other than these two points, Icon is a better system than > Perl. IMHO, of course. > > This point: > > Python has a lot more momentum and a much larger and more vigorous user > > community. > > Alas, a self-perpetuating property... what we need is an O'Reilly book on > Icon, that seems to be what does the trick! > > -s > > Shamim Mohamed > shamim @ synopsys.com > Shamim Mohamed > A2-1 Synopsys Inc., 700 E Middlefield Rd., Mountain View, CA 94043-4033 > -- > Shamim Mohamed > A2-1 Synopsys Inc., 700 E Middlefield Rd., Mountain View, CA 94043-4033 > -- Tom Mitchell - mitch@sgi.com, mitch@relay.csd.sgi.com, mitch@acm.org Count down to sabbatical is less than 3 weeks. sabbatical begins Aug 9th. From icon-group-sender Thu Jul 24 21:28:56 1997 Received: from kingfisher.CS.Arizona.EDU by cheltenham.cs.arizona.edu; Thu, 24 Jul 1997 16:21:45 MST Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA09587; Thu, 24 Jul 1997 16:21:45 -0700 Date: Thu, 24 Jul 1997 21:28:56 GMT From: ia@stryx.demon.co.uk (Iain Alexander) Reply-To: ia@stryx.demon.co.uk Message-Id: <22890@stryx.demon.co.uk> To: icon-group@cs.arizona.edu Subject: Re: Need help on verse.icn X-Mailer: PCElm 1.10 Lines: 13 Errors-To: icon-group-errors@cs.arizona.edu Status: RO In message <01ILJM0SILK28WYKG4@pimacc.pima.edu> GMCMILLAN@pimacc.pima.edu writes: > ... verse.icn ... I > have trouble understanding what is wrong with this program when I > run it with a vocabulary list (a chapter of a novel turned into one > column of words.) "One column of words" doesn't sound like the format the program is expecting - have you checked verse.dat? It is structured into several sections (%noun etc.), many of which expect multiple versions of each word (e.g. singular|plural). -- Iain Alexander PGP 1024-bit key id B501A0AD ia@stryx.demon.co.uk I.Alexander@bsn0106.wins.icl.co.uk From icon-group-sender Thu Jul 24 23:35:54 1997 Received: from kingfisher.CS.Arizona.EDU by cheltenham.cs.arizona.edu; Fri, 25 Jul 1997 08:18:03 MST Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA10020; Fri, 25 Jul 1997 08:18:02 -0700 Posted-Date: Thu, 24 Jul 1997 23:35:54 -0500 (CDT) Date: Thu, 24 Jul 1997 23:35:54 -0500 (CDT) From: Chris Tenaglia To: Iain Alexander Cc: icon-group@cs.arizona.edu Subject: Re: Need help on verse.icn In-Reply-To: <22890@stryx.demon.co.uk> Message-Id: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Errors-To: icon-group-errors@cs.arizona.edu Status: RO Iain is correct. I wrote the original verse.icn. verse.dat has a formula. % signify the parts of vocabulary. ! are comments. Nouns have singular and plurals. Other parts have their significant others. There is the original file at http://www.execpc.com/~cdt/verse.html which displays verse.dat. Then you can substutite your favorite vocabulary in the sections according to the formats you find. Sorry it took me a while to respond. I've been a tad busy the past few weeks. verse.icn also has 20 or so sentence/verse patterns. I've been planning on adding some more. You can add more of your own. It's not too hard to figure out the way things work. HAVE FUN! Chris Tenaglia (system manager) | The future foretold, Medical College of Wisconsin | The past explained, 8701 W. Watertown Plank Rd. | The present largely appologized for. Milwaukee, WI 53226 (414)456-8765 | Organon to the Doctor On Thu, 24 Jul 1997, Iain Alexander wrote: > Date: Thu, 24 Jul 1997 21:28:56 GMT > From: Iain Alexander > To: icon-group@cs.arizona.edu > Subject: Re: Need help on verse.icn > > In message <01ILJM0SILK28WYKG4@pimacc.pima.edu> GMCMILLAN@pimacc.pima.edu writes: > > ... verse.icn ... I > > have trouble understanding what is wrong with this program when I > > run it with a vocabulary list (a chapter of a novel turned into one > > column of words.) > > "One column of words" doesn't sound like the format the program > is expecting - have you checked verse.dat? It is structured > into several sections (%noun etc.), many of which expect > multiple versions of each word (e.g. singular|plural). > -- > Iain Alexander PGP 1024-bit key id B501A0AD > ia@stryx.demon.co.uk I.Alexander@bsn0106.wins.icl.co.uk > From icon-group-sender Fri Jul 25 06:47:47 1997 Received: from kingfisher.CS.Arizona.EDU by cheltenham.cs.arizona.edu; Fri, 25 Jul 1997 08:18:25 MST Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA10049; Fri, 25 Jul 1997 08:18:24 -0700 Posted-Date: Fri, 25 Jul 1997 06:47:47 -0500 (CDT) Date: Fri, 25 Jul 1997 06:47:47 -0500 (CDT) From: Chris Tenaglia To: icon-group@cs.arizona.edu Subject: verse samples Message-Id: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Errors-To: icon-group-errors@cs.arizona.edu Status: RO Using the original file as posted on the previously mentioned URL here are some sample verses. ___________________________________________________ Alongside games Defects exist hatefully over this. It showed the precious inheritance; The games twitched through the wilder bit buckets ! Kind hardwares terminate - Showing procedure and information Its cursor continued gloriously? The games's symbols caustic could not be; Indescribable editors munch . Roudy escapes manipulate . Apathetic deletions should have been wild and then Where do successful sciences extend? Why do games assemble alongside a vital thought? It showed the tired field; The games's pointers lazy may be; Its verbose detecting of the game and stack. This update attempted boldly; The games or update bold ain't. _________________________________________________________ Without super computers Logical merges could have been forms. The super computers compiled through the higher partitions . The super computers's machines swift should be? Mundane joysticks listen ! One apathetic evaluating of the super computer and region- Modifications wriggle the more fantastic design; Pretty statuses close , Your sharp integral lighted the spread sheet; How do super computers fry about a monstrous product? The super computers prepared on the higher values , Proper syntax errors should be calculating , Because interfaces couldn't have been kicking about munching news groups; How do obvious refusals operate? The super computers juggled around the higher equations , Self modifying bits triple , Hashes fry glowingly above you. Super computers above the hash should not be high. _____________________________________________________ To ignore some label Queries jump coldly with one; That painless interface enhanced the project. General copies would not be vain until Our intellectual kloojing of the label and utility, That ignored the indescribable move, Why do easy databases plan? Ignoring book and liquid Cannot labels climb without a sharp queue? The labels's patents indefinite should be not? The labels enhanced without the vainer installations , Strategic equations will have been munching ? Inventors light the more tepid number cruncher; Why do labels juggle from a destructive machine? That energetic loading of the label and load? Labels across from the load should have been vain. ____________________________________________________ The fairest fantasy The fantasies slipped by the fairer twos-complements . Some monstrous picking of the fantasy and file! Grand intellects may be not fair since Where do fantasies compare outside of a correct section? Our documentation calculated blindly. The fantasies's forms tight might be not- Painless libraries might be enhancing , Preparing integer and integral Utilities indicate the more subnormal glitsch; Bit buckets spool the more blinking example; Concise partners would be not combining ? Why don't fresh calenders enter? Where do precise occurences decrease? This disabled reading of the fantasy and ether? Files hit depletedly about something. Fantasies about the file could be fair. ______________________________________________________ Above a concept prettily The concepts's works gullible should be, High routines continue , Cycle times munch berzerkly inside that? Else if queues might be not quiting below crunching interfaces, Therefore logics could not be quiting about concluding trees, Or patches may be quiting above wriggling utilities. The concepts double! One bogus inquiry flipped the circuit card. Lists light the wisest mainframe, Cannot concepts compile inside a masterful bit bucket? The concepts overflow; Our lazy partition delivered the procedure; Some grand comparing of the concept and tree- Glowing utilities will have been pretty then Any spiffy compiling of the concept and operand? Its luscious instruction kicked the object- Speckled subschemas code - The concepts or subschema speckled can't be. _____________________________________________________________ Chris Tenaglia (system manager) | The future foretold, Medical College of Wisconsin | The past explained, 8701 W. Watertown Plank Rd. | The present largely appologized for. Milwaukee, WI 53226 (414)456-8765 | Organon to the Doctor From icon-group-sender Thu Jul 24 14:05:44 1997 Received: from kingfisher.CS.Arizona.EDU by cheltenham.cs.arizona.edu; Fri, 25 Jul 1997 08:18:39 MST Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA10066; Fri, 25 Jul 1997 08:18:39 -0700 To: icon-group@cs.arizona.edu Date: Thu, 24 Jul 1997 14:05:44 -0500 From: "Brian A. Rogers" Message-Id: <5r88rr$nur$1@solomon.cs.rose-hulman.edu> Organization: Rose-Hulman Institute of Technology Sender: icon-group-request@cs.arizona.edu Subject: Icon Engineering examples? Errors-To: icon-group-errors@cs.arizona.edu Status: RO Hi... I'm looking for some examples of Icon programs that prvide some sort of engineering or science function. From what I've read so far, it's a neat language. I'd like to see someone using it, though. -- ---------------------------------------------------------- Brian A. Rogers Student Manager, Laptop Orientation Rose-Hulman Institute of Technology (812) 877-8034 ----------------------------------------------------------- "There are no problems, only solutions." Tron, 1982 ----------------------------------------------------------- From icon-group-sender Sat Jul 26 20:44:13 1997 Received: from kingfisher.CS.Arizona.EDU by cheltenham.cs.arizona.edu; Mon, 4 Aug 1997 08:18:28 MST Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA13353; Mon, 4 Aug 1997 08:18:28 -0700 From: Guy Laden Message-Id: <199707261744.UAA21083@orion.math.tau.ac.il> Subject: Re: perl vs python vs icon To: shamim@nospam.com Date: Sat, 26 Jul 1997 20:44:13 +0300 (GMT+0300) Cc: icon-group@cs.arizona.edu In-Reply-To: <5r0pef$l6c@hermes.synopsys.com> from "shamim@nospam.com" at Jul 21, 97 10:56:15 pm X-Mailer: ELM [version 2.4 PL25] Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Errors-To: icon-group-errors@cs.arizona.edu Status: RO > I have added POSIX calls to Icon (reading directories, TCP/UDP/IP, signals, > dbm routines, etc.). For more details: > > http://www.crl.com/~spm/unicon/ > > I've tested it on SunOS4.1.3, Solaris 2.4 and 2.5, HP-UX versions 9.05 and > 10.20, and Linux 2.x. Source patches and binaries are available. I'd be interested in using Unicon but would much rather use libraries which dont require patches to the Icon distribution. Would it be possible to provide most of the functionality of Unicon as a library and have those features that require changes to the standard Icon distribution provided separately? > My opinion is that Icon with the POSIX features is (for the most part) a > better language for scripts, CGI programs etc. than Perl. Perl still handles > regular expressions more conveniently than Icon does; and Perl comes with a > debugger. Other than these two points, Icon is a better system than > Perl. IMHO, of course. I don't know much about Perl but while were at it I'll mention the two features I miss most in Icon: a Modula/Oberon-like module system and dynamic linking. I'd much rather have these features instead of 'object-oriented' additions. Regards, Guy. From icon-group-sender Sun Jul 27 19:28:09 1997 Received: from kingfisher.CS.Arizona.EDU by cheltenham.cs.arizona.edu; Mon, 4 Aug 1997 08:19:15 MST Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA14040; Mon, 4 Aug 1997 08:19:14 -0700 To: icon-group@cs.arizona.edu Date: 27 Jul 1997 19:28:09 GMT From: "david" Message-Id: <01bc9ac4$35496040$600874cf@default> Organization: Mython Services Sender: icon-group-request@cs.arizona.edu Subject: specification Errors-To: icon-group-errors@cs.arizona.edu Status: RO Thanks to everyone Who helped to introduce me to the language. Now i'm wondering where i might find an Icon Languange Specification online. Well? From icon-group-sender Mon Jul 28 14:19:58 1997 Received: from kingfisher.CS.Arizona.EDU by cheltenham.cs.arizona.edu; Mon, 4 Aug 1997 08:19:38 MST Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA14061; Mon, 4 Aug 1997 08:19:38 -0700 Date: Mon, 28 Jul 1997 14:19:58 -0700 From: Ralph Griswold Message-Id: <9707282119.AA18050@ursus.cs.arizona.edu> To: icon-group Subject: Icon Newsletter 53 Errors-To: icon-group-errors@cs.arizona.edu Status: RO Icon Newsletter 53 is now available on our Web site: http://www.cs.arizaon.edu/icon/ In the Documentation section, follow the link to The Icon Newsletter and then to Icon Newsleter 53. From icon-group-sender Tue Jul 29 13:08:42 1997 Received: from kingfisher.CS.Arizona.EDU by cheltenham.cs.arizona.edu; Mon, 4 Aug 1997 08:19:58 MST Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA14086; Mon, 4 Aug 1997 08:19:58 -0700 To: icon-group@cs.arizona.edu Date: Tue, 29 Jul 1997 13:08:42 GMT From: NohoBoy@ACDSoft.com (NohoBoy) Message-Id: <33ddeb15.413833260@news.scruznet.com> Organization: ACD Software Sender: icon-group-request@cs.arizona.edu References: , , <5rip78$rts$1@solomon.cs.rose-hulman.edu> Reply-To: nohoboy@ACDSoft.com Subject: Re: Inadequate space in qualifier list? Errors-To: icon-group-errors@cs.arizona.edu Status: RO On Mon, 28 Jul 1997 13:46:15 -0500, "Brian S. Rogers" wrote: > Yes, but I'll admit there aren't many of us. People do watch the list and >respond via email. But a few are lurking. ------------------------------------ NohoBoy@ACDSoft.com PGP key on request ----------------------------------- From icon-group-sender Wed Jul 30 16:02:22 1997 Received: from kingfisher.CS.Arizona.EDU by cheltenham.cs.arizona.edu; Mon, 4 Aug 1997 08:20:16 MST Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA14111; Mon, 4 Aug 1997 08:20:16 -0700 To: icon-group@cs.arizona.edu Date: Wed, 30 Jul 1997 16:02:22 +1000 From: Stuart.Robinson@anu.edu.au (Stuart Robinson) Message-Id: Organization: ANU Sender: icon-group-request@cs.arizona.edu References: Subject: Re: Inadequate space in qualifier list? Errors-To: icon-group-errors@cs.arizona.edu Status: RO The problem has been solved. Thanks to everyone who responded (especially Ralph Griswold, whose definitive answer is appended below). The problem was the parameter of Qualifier Pointer Region (which can be changed on Macs under Options: Execution Memory). I doubled it (from 5,000 to 10,000). Now it works beautifully. -------------------- Date: Sat, 26 Jul 1997 14:37:40 -0700 From: Ralph Griswold To: Stuart.Robinson@anu.edu.au Subject: Re: Inadequate space in qualifier list? That message means you have too many *different* strings for the memory allocated to the qualifier. That value do you have set in the Options->Execution Memeory-> Qualifier pointer region? That's what needs to be larger. I'm not sure, but I think there's a limit of 65KB in ProIcon. -- Stuart Robinson The Australian National University From icon-group-sender Wed Jul 30 14:40:44 1997 Received: from kingfisher.CS.Arizona.EDU by cheltenham.cs.arizona.edu; Mon, 4 Aug 1997 08:20:39 MST Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA14137; Mon, 4 Aug 1997 08:20:38 -0700 Comments: Authenticated sender is From: "J.R. Sampson" To: icon-group@cs.arizona.edu Date: Wed, 30 Jul 1997 14:40:44 +0000 Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7BIT Subject: Library - filecnvt Priority: normal X-Mailer: Pegasus Mail for Win32 (v2.53/R1) Message-Id: <97Jul30.150553+0100_bst.31813-18917+12@mail.u-net.net> Errors-To: icon-group-errors@cs.arizona.edu Status: RO I am trying to use filecnvt to convert a number of text files from Mac to Dos format. However, the comments in the code listing are not clear. I would be grateful for an example of how to write the command line for this library program. _John Sampson_ From icon-group-sender Mon Jul 28 13:46:15 1997 Received: from kingfisher.CS.Arizona.EDU by cheltenham.cs.arizona.edu; Mon, 4 Aug 1997 08:20:50 MST Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA14155; Mon, 4 Aug 1997 08:20:49 -0700 To: icon-group@cs.arizona.edu Date: Mon, 28 Jul 1997 13:46:15 -0500 From: "Brian S. Rogers" Message-Id: <5rip78$rts$1@solomon.cs.rose-hulman.edu> Organization: Rose-Hulman Institute of Technology Sender: icon-group-request@cs.arizona.edu References: , Subject: Re: Inadequate space in qualifier list? Errors-To: icon-group-errors@cs.arizona.edu Status: RO Yes, but I'll admit there aren't many of us. People do watch the list and respond via email. -- --------------------------------------------------------------- Brian A. Rogers Student Manager, Laptop Orientation Rose-Hulman Institute of Technology (812) 877-8034 ------------------------------------------------------------------ "There are no problems, only solutions." --Tron, 1982 ------------------------------------------------------------------- Stuart Robinson wrote in article ... >Is anyone out there? Anyone? Anyone? > >-- >Stuart Robinson >The Australian National University From icon-group-sender Mon Aug 4 12:24:14 1997 Received: from kingfisher.CS.Arizona.EDU by cheltenham.cs.arizona.edu; Mon, 4 Aug 1997 13:32:04 MST Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA14567; Mon, 4 Aug 1997 13:32:03 -0700 Sender: motto@ccmail.census.gov Message-Id: <33E6022E.48CC@Census.Gov> Date: Mon, 04 Aug 1997 12:24:14 -0400 From: Mark Otto Organization: Statistical Research Division, US Census Bureau X-Mailer: Mozilla 3.01 (X11; I; SunOS 5.5.1 sun4u) Mime-Version: 1.0 To: Guy Laden Cc: shamim@nospam.com, icon-group@cs.arizona.edu Subject: Re: perl vs python vs icon References: <199707261744.UAA21083@orion.math.tau.ac.il> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Errors-To: icon-group-errors@cs.arizona.edu Status: RO Guy Laden wrote : I don't know much about Perl but while were at it I'll mention the two features I miss most in Icon: a Modula/Oberon-like module system and dynamic linking. I'd much rather have these features instead of 'object-oriented' additions. I too would like to see modules in Icon. I know Ken Walker developed a commercial version with modules some years ago, but it wasn't persued because lack of interest. Is there more now? -- Mark Otto e-mail: Mark.Otto@Census.GOV Census Bureau, Rm 3000-4 (SRD) office: 301-457-4985 home: 301-431-1838 Washington, DC 20233-9100 fax: 301-457-2299 From icon-group-sender Tue Aug 5 09:41:32 1997 Received: from kingfisher.CS.Arizona.EDU by cheltenham.cs.arizona.edu; Tue, 5 Aug 1997 12:21:53 MST Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA15282; Tue, 5 Aug 1997 12:21:52 -0700 Message-Id: X-Mailer: Novell GroupWise 4.1 Date: Tue, 05 Aug 1997 09:41:32 -0500 From: Charlie Hethcoat To: rogersba@rose-hulman.edu Cc: icon-group@cs.arizona.edu Subject: Icon Engineering examples? -Reply Mime-Version: 1.0 Content-Type: text/plain Content-Disposition: inline Errors-To: icon-group-errors@cs.arizona.edu Status: RO I meant to answer this a couple of weeks ago. Sorry about the delay. I am a Senior Engineer in the Analysis group at Oceaneering Space Systems. We do a lot of stress and thermal analysis, and are heavily into finite element modelling of astronaut crew equipment. While my job isn't primarily to program stuff, it is an activity I enjoy, and I occasionally need to do some ad-hoc things with Icon. As one example, here is a program that computes 2-dimensional area properties of polygons of any size, with any number of embedded round holes. The program is fairly common (I first saw it programmed for a HP-67 calculator!), but nobody seems to think it should be a standard part of anybody's library. Hence, when I need it, I always have to reimplement it. In my Icon version, there is a nice ascii syntax for the input, it handles any number of vertices and holes, prints a neat little report, and generates a gnuplot input file and control file for plotting the shape. Of course, you'll need gnuplot to plot it, or some plotting program that can handle gnuplot input. There are some weaknesses in the input code that I need to improve (it isn't totally bulletproof), but the problem input syntax is so simple that there is almost no risk of screwing it up. Some people here complain that it isn't a CAD program, and they would prefer to use, e. g. Autocad or Pro-Engineer. Fine, let 'em, but I can be in and out of my little old Icon program, with the answers, in less time than it takes them to log into Pro-E. 'Course, my program is only 2-D. If 3-D is needed, you have to go elsewhere. But then the descriptive geometry overhead becomes much more severe. As you can see, Icon is a very nice language for general purpose mucking about with numerics. The only problem I have noticed is a tendency of the left(), right(), and center() functions to truncate (rather than round properly) floating point numbers when printing them. Internal accuracy, though, seems to be correct. Warning! This program requires command-line skills!!! 8^) Maybe someone can modify it to use vib--my skills to do that are yet insufficient. I'd like to see how my code can be adapted to that environment. _____________________________________________ # aprop.icn - Compute and plot area properties of 2D polygons w/holes link "w:/software/icon/mylib/scantool" # Update paths for your system link "w:/software/icon/mylib/numbtool" link "w:/software/icon/mylib/plotfns" link "basename" # Std. Icon library link "real2int" # for floor() and ceil() link "w:/software/icon/mylib/minmax" # for minlist() and maxlist() record holetype(x, y, d) # each hole gets location (x, y) and diameter d global infile, outfile # Text input and output global plotname, plotfile # Plot data output global gnuname, gnufile # Plot control output for Gnuplot global bname # For access by plotting routines global x, y, holelist # lists global i, n global xmin, xmax, xrange, ymin, ymax, yrange # For plotting ranges global area, xcg, ycg global Ixx, Iyy, Ixy global Ixcg, Iycg, Ixycg global angle global Ixprime, Iyprime, Ixyprime global J procedure main(args) static rcsid initial { rcsid := "$Id: aprop.icn 1.4 1996/12/18 21:16:39 Hethcoat Exp Hethcoat $" } # # $Log: aprop.icn $ # Revision 1.4 1996/12/18 21:16:39 Hethcoat # Noticed a typo in the name of the rcsid variable. # # Revision 1.3 1996/10/10 22:35:27 Hethcoat # Plotting enhancements: Now generates all gnuplot data, # scale factors for plotting now fully data-driven and are always in # multiples of 0.5 world units per inch. # # Revision 1.2 1996/10/05 21:35:29 Hethcoat # Merely added the RCS keyword strings. # # infile := &input outfile := &output if *args = 0 then { # A kluge for you to enjoy... system("list.com aprop.hlp") exit(0) } # Looks for an input file in the form modelname.ext # Generates output files in the same format. bname := basename(args[1], ".") infile := open(args[1], "r") | stop("Cannot open ", args[1], ".") outname := bname || ".apo" plotname := bname || ".dat" gnuname := bname || ".gnu" outfile := open(outname, "w") | stop("Cannot open ", basename, ".") # Setup holelist := [] # add holes as found x := [] y := [] i := 0 write(outfile, center("Input Data Listing", 72, "-")) write(outfile, ) # Input phase while line := decomm(infile, outfile) do { line ? { if tab(match("hole")) then { ws(); xhole := num() ws(); yhole := num() ws(); dhole := num() put(holelist, holetype(xhole, yhole, dhole)) next } i +:= 1 put(x, num()) ws() put(y, num()) } } n := *x # The number of points read, including any repeats. # Need ranges of the input data for plotting purposes: xmin := minlist(x) xmax := maxlist(x) xrange := xmax - xmin ymin := minlist(y) ymax := maxlist(y) yrange := ymax - ymin # Computations do_numbers() # Report do_report() # Plot control file outplot1(xmin, xmax, ymin, ymax) # Data plot output outplot2() exit(0) end # do_numbers - compute and print the detailed stuff procedure do_numbers() area := xcg := ycg := Ixx := Iyy := Ixy := 0.0 n := *x every i := (1 to n-1) do { delta_x := x[i+1] - x[i] sum_x := x[i+1] + x[i] delta_y := y[i+1] - y[i] sum_y := y[i+1] + y[i] area +:= delta_y*sum_x xcg +:= delta_y*(sum_x^2 + delta_x^2/3.) ycg +:= delta_x*(sum_y^2 + delta_y^2/3.) Ixx +:= delta_x*sum_y*(sum_y^2 + delta_y^2) Iyy +:= delta_y*sum_x*(sum_x^2 + delta_x^2) # Ixy is so big it has to be done in pieces: term1 := x[i+1]*y[i] - x[i]*y[i+1] term2 := x[i+1]^2 + x[i]^2 Ixy1 := delta_y^2*sum_x*(term2)/8. Ixy2 := delta_y*(term1)*(term2 + x[i+1]*x[i] )/3. Ixy3 := (term1)^2*sum_x/4. if not wee(delta_x) then Ixy +:= (Ixy1 + Ixy2 + Ixy3)/delta_x # else there is no contribution when delta_x # is zero. } area /:= -2.0 xcg /:= (-8.*area) ycg /:= (8.*area) Ixx /:= 24. Iyy /:= (-24.) # Ixy is OK as it comes out. # The above is correct before adding round holes. # Now have to correct for holes found, if any: every hole := !holelist do { holearea := -&pi*hole.d^2/4.0 # Note: negative area for holes!! holeIxx := -&pi*hole.d^4/64. # also negative!! holeIyy := holeIxx # by symmetry holeIxy := 0.0 # also by symmetry newarea := area + holearea # don't tamper with area just yet! xcg := (xcg*area + holearea*hole.x)/newarea # updated x c.g. ycg := (ycg*area + holearea*hole.y)/newarea Ixx +:= (holeIxx + holearea*hole.y^2) Iyy +:= (holeIyy + holearea*hole.x^2) Ixy +:= (holeIxy + holearea*hole.x*hole.y) area := newarea } # Finish up with the final numbers: Ixcg := Ixx - area*ycg^2 Iycg := Iyy - area*xcg^2 Ixycg := Ixy - area*xcg*ycg angle := 0.5*atan(-2.*Ixycg, Ixcg - Iycg) c := cos(angle) s := sin(angle) s2 := sin(2.*angle) c2 := cos(2.*angle) Ixprime := Ixcg*c^2 + Iycg*s^2 - Ixycg*s2 Iyprime := Iycg*c^2 + Ixcg*s^2 + Ixycg*s2 J := Ixprime + Iyprime Ixyprime := 0.5*(Ixcg - Iycg)*s2 + Ixycg*c2 return end # do_report - print the report procedure do_report() write(outfile, ) write(outfile, center("Area Properties Report", 72, "-")) write(outfile, ) write(outfile, "Polygon: ", n - 1, " points") write(outfile, "Holes: ", *holelist) write(outfile, "area = ", area) write(outfile, "xcg = ", xcg) write(outfile, "ycg = ", ycg) write(outfile, "Original axes:") write(outfile, "Ixx = ", Ixx) write(outfile, "Iyy = ", Iyy) write(outfile, "Ixy = ", Ixy) write(outfile, "Centroidal axes (parallel to Original):") write(outfile, "Ixxcg = ", Ixcg) write(outfile, "Iyycg = ", Iycg) write(outfile, "Ixycg = ",Ixycg) write(outfile, "Principal axes (rotated from Centroidal):") write(outfile, "angle = ", rtod(angle), " degrees") write(outfile, "Ix'x' = ", Ixprime) write(outfile, "Iy'y' = ", Iyprime) write(outfile, "Ix'y' = ", Ixyprime) write(outfile, "Polar Moment of Inertia:") write(outfile, "J = ", J) return end # outplot1 - Output file (*.gnu) with plotting controls procedure outplot1(xmin, xmax, ymin, ymax) # Right now, this plots only to an hpljii at 150x150. We'll # improve it later. static wide, high, clear local xrange, yrange local xbox, ybox local xmini, xmaxi, ymini, ymaxi local xsizei, ysizei local xscale, yscale local scale local max_x, max_y initial { # Need the actual plot area. # These are correct for the HP Laserjet 4 Plus # in portrait mode (so far!) wide := 5.35 high := 6.06 clear := 0.5 # minimum clearance around the data } # Imagine a box just enclosing the data: xbox := xmax - xmin ybox := ymax - ymin # Now find the next larger box with at least the stipulated clearance # and with integer dimensions: xmini := ceil(xmin - clear) xmaxi := ceil(xmax + clear) ymini := ceil(ymin - clear) ymaxi := ceil(ymax + clear) # Get the size of that integer box: xsizei := xmaxi - xmini ysizei := ymaxi - ymini # Compute separate x and y scale factors for plotting: xscale := xsizei/wide yscale := ysizei/high # The plot will be made to equal x and y scales, so it has to be # the larger of the two scales. Furthermore, it would be convenient # for the scale to be a nice number, i. e. positive multiples of 0.5. scale := 0.5*ceil(2.0*maxlist([xscale, yscale])) # Now, get the plotting parameters in shape for use with the gnuplot # xrange and yrange commands: max_x := xmini + scale*wide max_y := ymini + scale*high gnufile := open(gnuname, "w") | stop("Cannot open ", gnuname, ".") write(gnufile,"set data style lines") write(gnufile,"set xrange [", xmini, ":", max_x, "]") write(gnufile,"set yrange [", ymini, ":", max_y, "]") write(gnufile,"set terminal hpljii 150") write(gnufile,"set output '", bname || ".prn'") write(gnufile,"plot '", plotname, " '") write(gnufile,"exit") # write(gnufile,"") PATTERN--KEEP! close(gnufile) return end # outplot2 - Output file (*.dat) of results procedure outplot2() local length plotfile := open(plotname, "w") | stop("Cannot open " || plotname || ".") length := 1.25*minlist([xrange, yrange]) # Plot the input (x, y) data: comment("Plot file generated by aprop on " || &dateline) comment("Cross section: " || bname) comment("") # empty comment comment("Polygon data:") drawdata(x, y) comment("Centroidal axes:") drawcross(xcg, ycg, length, 0.0) comment("Principal axes:") drawcross(xcg, ycg, length, angle) comment("End of data.") close(plotfile) return end # drawdata - draw (x, y) list data procedure drawdata(x, y) local i, hole move(x[1], y[1]) every i := 2 to *x do draw(x[i], y[i]) every hole := !holelist do { comment("Hole:") drawcircle(hole.x, hole.y, 0.5*hole.d) comment("Crosshairs for preceding hole:") drawcross(hole.x, hole.y, hole.d, 0.0) } return end ________________________________________ # numbtool.icn - basic numerical math aids (nothing too fancy) # Usage: line w:\software\icon\mylib\numbtool # Author: Charles L. Hethcoat III # Date: September 14, 1996 # macheps - discern machine epsilon by test procedure macheps() static eps initial eps := 1.0 while 1.0 + eps > 1.0 do eps *:= 0.5 # Comes out only when eps is indiscernible, i.e. makes # no difference when added to 1.0. This is more or less the # definition of the machine epsilon. return eps end # wee - succeed if number is too "wee" (love that word) to divide by procedure wee(x) # Typical usage: if not wee(x) then y := 1.0/x # (wee() has to succeed, so that not wee fails, if x is wee.) static thresh initial thresh := 5.0*macheps() if abs(x) < thresh then return # else fail end ______________________________________ # scantool.icn - simple token-scanning tools for use in various projects # Usage: link w:\software\icon\mylib\scantool # Author: Charles L. Hethcoat III # Date: September 14, 1996 # id - scan an identifier procedure id() static first, rest initial { first := &letters ++ '_' # First chars in an identifier rest := first ++ &digits # Remaining ones } return scantok(first, rest) end # num - scan and return the next number in &subject procedure num() static first, rest initial { first := &digits ++ '+-.' # First chars in a number rest := first ++ 'e' # Remaining ones } return real(scantok(first, rest)) end # scantok - scan tokens starting with first, finishing with rest procedure scantok(first, rest) ws() return tab(any(first)) || tab(many(rest)) | tab(any(first)) end # ws - skip white space (blanks and tabs) procedure ws() tab(many(' \t')) end # decomm - echo lines from infile and return decommented ones only procedure decomm(infile, outfile) local line while line := write(outfile, read(infile)) do line ? { ws() if ='#' | pos(0) then next return trim(tab(upto('#') | 0)) } end _____________________________________________________ # minmax.icn: ############################################################################ # # These procedures return the maximum and minimum of a list containing # any number of numeric arguments. Modified by CLH from the library # routine minmax, which uses variable-length argument lists. # ############################################################################ procedure minlist(L) local minimum, n minimum := L[1] | fail every n := 2 to *L do minimum >:= L[n] return minimum end procedure maxlist(L) local maximum, n maximum := L[1] | fail every n := 2 to *L do maximum <:= L[n] return maximum end _____________________________________ # plotfns.icn: # Plot routines that I can use in future programs. # All of the following "plot routines" just generate Gnuplot output!! # drawcross - plot a cross with bar length L centered at (x, y) tilted theta procedure drawcross(x, y, L, theta) centerline(x, y, L, theta) # line centerline(x, y, L, theta + 0.5*&pi) # same line rotated +90 degrees return end # centerline - plot a line of length L centered at (x, y), tilted theta procedure centerline(x, y, L, theta) local L2, dx, dy L2 := 0.5*L dx := L2*cos(theta) dy := L2*sin(theta) move(x - dx, y - dy) draw(x, y) draw(x + dx, y + dy) return end # drawcircle - plot a circle of radius r centered at (x, y) procedure drawcircle(xc, yc, r) static n, deltheta local i, theta, x, y, x1, y1 initial { n := 16 # Number of points to draw deltheta := 2.0*&pi/n } every i := 1 to n do { theta := real(i - 1)*deltheta x := xc + r*cos(theta) y := yc + r*sin(theta) if i = 1 then { x1 := x; y1 := y # Save 1st point for doing the last line. move(x, y) # and don't drag the pen. } else draw(x, y) } draw(x1, y1) # Close the circle. return end # move - move to a new starting coordinate (x, y) for the next line procedure move(x, y) write(plotfile) # Gnuplot starts a new line with a blank input line. write(plotfile, x, " ", y) return end # draw - draw a line to final coordinate (x, y) procedure draw(x, y) write(plotfile, x, " ", y) return end # comment - add a gnuplot comment line to the data procedure comment(line) write(plotfile, "# ", line) return end _____________________________________ # aprop.inp - a right triangle with a rt. triangular hole & 2 round holes # Sample input data # Note the comment convention: From any '#' to the end of a line is ignored. # You may use comments in all your input files for documentation purposes. # Start the outer triangle. Move clockwise for areas: # (X,Y) coordinate pairs: 3. 1. 3. 7. 14. 7. 3. 1. # Closure on outer triangle--necessary! # Polygonal holes are defined by moving to and fro along a "cut" line. 4. 4. # Move along cut to inner triangle # Polygonal holes are done the same way, except moving counterclockwise. 9. 6. # Starts the inner triangle 4. 6. 4. 4. # Closure on inner triangle 3. 1. # Move outward on cut to final closure # Finally, let's have two round holes: # X Y Diameter hole 5.5 3.5 1.0 hole 10.0 6.0 0.5 _______________________________ That's it. Good luck. Charles Hethcoat >>> "Brian A. Rogers" 1997 Jul 24, 02:05pm >>> Hi... I'm looking for some examples of Icon programs that prvide some sort of engineering or science function. From what I've read so far, it's a neat language. I'd like to see someone using it, though. -- ---------------------------------------------------------- Brian A. Rogers Student Manager, Laptop Orientation Rose-Hulman Institute of Technology (812) 877-8034 ----------------------------------------------------------- "There are no problems, only solutions." Tron, 1982 ----------------------------------------------------------- From icon-group-sender Wed Aug 6 11:05:04 1997 Received: from kingfisher.CS.Arizona.EDU by cheltenham.cs.arizona.edu; Wed, 6 Aug 1997 12:47:24 MST Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA15914; Wed, 6 Aug 1997 12:47:24 -0700 To: icon-group@cs.arizona.edu Date: Wed, 6 Aug 1997 11:05:04 -0400 From: "david" Message-Id: <5sa3bp$pli@mtinsc03.worldnet.att.net> Organization: Mython Services Sender: icon-group-request@cs.arizona.edu References: <01bca210$bce768f0$586609cb@andrewb> Subject: Re: Icon editor Errors-To: icon-group-errors@cs.arizona.edu Status: RO Hi, Andrew; i really wish i could help You out, but this is a newsgroup not for discussion of issues pertinent to graphical icons but to the Icon programming language, so You probably won't get a helpful response to Your posting here. I'm sure there's something out there though, web wise or on Usenet or whatever. Good luck looking. Andrew Bluff wrote in article <01bca210$bce768f0$586609cb@andrewb>... >What does everybody body use to keep track of icons and bitmaps. > >I am looking for a relatively powerful tool to create edit and store icons. >The ones I have found seem to be basic pixel by pixel editors and I want to >perform some cool tricks on the icons which the tools just don't provide. >-- >Thanks, > >Andrew Bluff >andrewb@anca.com.au From icon-group-sender Fri Aug 29 09:51:11 1997 Return-Path: Received: from kingfisher.CS.Arizona.EDU by cheltenham.cs.arizona.edu; Fri, 29 Aug 1997 09:51:06 -0500 (EST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA18754; Fri, 29 Aug 1997 07:51:06 -0700 To: icon-group Date: Fri, 29 Aug 1997 13:40:23 +0900 From: Eric Hildum Message-Id: <340652B7.7E2F@Japan.NCR.com> Sender: icon-group-request References: <01bcb3cc$3bd0a100$010000c0@rastarr> Reply-To: Eric.Hildum@japan.ncr.com Subject: This newsgroup Errors-To: icon-group-errors Status: RO Just a reminder: This newsgroup is about the language Icon, not about icons in general. Any word on a new release for the Mac? -- "The idea that Bill Gates has appeared like a knight in shining armour to lead all customers out of a mire of technological chaos neatly ignores the fact that it was he who, by peddling second-rate technology, led them into it in the first place."-Douglas Adams Eric Hildum Eric.Hildum@Japan.NCR.COM From icon-group-sender Tue Sep 2 12:02:10 1997 Return-Path: Received: from kingfisher.CS.Arizona.EDU by cheltenham.cs.arizona.edu; Tue, 2 Sep 1997 12:02:09 -0500 (EST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA22064; Tue, 2 Sep 1997 10:02:09 -0700 To: icon-group Date: Tue, 02 Sep 1997 23:48:00 +1000 From: Stuart.Robinson@anu.edu.au (Stuart Robinson) Message-Id: Organization: ANU Sender: icon-group-request Subject: More specific GREP-related question Errors-To: icon-group-errors Status: RO Does anyone know how regular expressions like [a-z] work when a non-alphanumeric character is used? For example, which characters would the following regular expression match? [1-!] What about this one? [a-1] And the reverse? [1-a] I'm sure all of this could be predicted if one had knowledge of the ordering of ASCII, but I'm afraid I lack such knowledge. Any tips? Thanks in advance. Regards, Stuart Robinson -- Stuart Robinson The Australian National University From icon-group-sender Tue Sep 2 12:01:51 1997 Return-Path: Received: from kingfisher.CS.Arizona.EDU by cheltenham.cs.arizona.edu; Tue, 2 Sep 1997 12:01:50 -0500 (EST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA22412; Tue, 2 Sep 1997 10:01:50 -0700 To: icon-group Date: Tue, 02 Sep 1997 14:51:42 +1000 From: Stuart.Robinson@anu.edu.au (Stuart Robinson) Message-Id: Organization: ANU Sender: icon-group-request Subject: GREP Errors-To: icon-group-errors Status: RO Does anyone know where I can lay my hands on a good intro to GREP (which I'm using on BBEdit)? (Where else might I enquire?) I am doing a good deal of corpus work and I want to be able to search for complicated string patterns. Icon is good for some of these searches but sometimes it's not worth the programming time. Thanks in advance. -- Stuart Robinson The Australian National University From icon-group-sender Tue Sep 2 12:02:19 1997 Return-Path: Received: from kingfisher.CS.Arizona.EDU by cheltenham.cs.arizona.edu; Tue, 2 Sep 1997 12:02:18 -0500 (EST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA21451; Tue, 2 Sep 1997 10:02:18 -0700 To: icon-group Date: 2 Sep 1997 14:20:21 GMT From: mike@stok.co.uk (Mike Stok) Message-Id: <5uh7b5$gd7@news-central.tiac.net> Organization: Pencom Systems Administration Sender: icon-group-request References: Subject: Re: More specific GREP-related question Errors-To: icon-group-errors Status: RO In article , Stuart Robinson wrote: >Does anyone know how regular expressions like [a-z] work when a >non-alphanumeric character is used? For example, which characters would >the following regular expression match? > >[1-!] If you actually use that in a regex on a system with ASCII encoding (or one of the character sets wherer the low 128 characters are ASCII) you should get an "invalid [] range in regexp" warning as perl likes to work with ascending ranges. In ASCII you're asking for a range from character 49 up to character 33 >What about this one? > >[a-1] > >And the reverse? > >[1-a] 1-a will match a character in the range characters 49 to 97 inclusive, so in the debugger I can use perl's ord and chr functions to see what characters are in that range: DB<1> print ord '1' 49 DB<2> print ord 'a' 97 DB<3> print map {chr $_} (49 .. 97) 123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`a >I'm sure all of this could be predicted if one had knowledge of the >ordering of ASCII, but I'm afraid I lack such knowledge. Any tips? If you're on a unix system then there is usually a manual page for ascii, so man ascii should get you a useful page. Failing that a www search or a reference book might have a table of ascii codes in it (printer manuals usually have tables of characters somewhere in them...) Hope this helps, Mike -- mike@stok.co.uk | The "`Stok' disclaimers" apply. http://www.stok.co.uk/~mike/ | PGP fingerprint FE 56 4D 7D 42 1A 4A 9C http://www.tiac.net/users/stok/ | 65 F3 3F 1D 27 22 B7 41 stok@psa.pencom.com | Pencom Systems Administration (work) From icon-group-sender Tue Sep 2 12:02:41 1997 Return-Path: Received: from kingfisher.CS.Arizona.EDU by cheltenham.cs.arizona.edu; Tue, 2 Sep 1997 12:02:40 -0500 (EST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA17908; Tue, 2 Sep 1997 10:02:39 -0700 To: icon-group Date: Tue, 2 Sep 1997 15:26:07 GMT From: feustel@netcom.com (Dave Feustel) Message-Id: Organization: DAFCO Sender: icon-group-request References: Subject: Re: More specific GREP-related question Errors-To: icon-group-errors Status: RO See the O'Reilly book: _Mastering Regular Expressions_ for a complete exposition of regular expressions for all the standard unix programs. Stuart Robinson (Stuart.Robinson@anu.edu.au) wrote: : Does anyone know how regular expressions like [a-z] work when a : non-alphanumeric character is used? For example, which characters would : the following regular expression match? : [1-!] : What about this one? : [a-1] : And the reverse? : [1-a] : I'm sure all of this could be predicted if one had knowledge of the : ordering of ASCII, but I'm afraid I lack such knowledge. Any tips? : Thanks in advance. : Regards, : Stuart Robinson : -- : Stuart Robinson : The Australian National University -- Dave Feustel http://feustel.mixi.net 219-483-1857 mailto:feustel@netcom.com From icon-group-sender Tue Sep 2 18:25:39 1997 Return-Path: Received: from kingfisher.CS.Arizona.EDU by cheltenham.cs.arizona.edu; Tue, 2 Sep 1997 18:25:38 -0500 (EST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA23084; Tue, 2 Sep 1997 16:25:37 -0700 Message-Id: <3.0.16.19970902155455.2fbf5d2e@postoffice.worldnet.att.net> X-Sender: jtgalkowski@postoffice.worldnet.att.net X-Mailer: Windows Eudora Pro Version 3.0 (16) Date: Tue, 02 Sep 1997 15:55:03 -0400 To: Stuart.Robinson@anu.edu.au (Stuart Robinson) From: Jan Theodore Galkowski/Helen Andrea Galkowski Subject: Re: GREP Cc: icon-group Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Errors-To: icon-group-errors Status: RO At 04:51 AM 9/2/97 +0000, you wrote: >Does anyone know where I can lay my hands on a good intro to GREP (which >I'm using on BBEdit)? Hurray for BBEdit. Nisus Writer is also good. (Pardon the editorial.) >.........................(Where else might I enquire?) I am doing a good >deal of corpus work and I want to be able to search for complicated string >patterns. Icon is good for some of these searches but sometimes it's not >worth the programming time. > >Thanks in advance. Just look for any documentation on EMACS. It has a succinct description of how GREP patterns work since it offers it in its search and search and replace capabilities. > >-- >Stuart Robinson >The Australian National University -jt P.S. I believe there's a pattern-oriented procedure package in the Icon library, so you don't have to distill GREP down to MOVEs, UPTOs, and ARBNOs. > > From icon-group-sender Wed Sep 3 10:11:07 1997 Return-Path: Received: from kingfisher.CS.Arizona.EDU by cheltenham.cs.arizona.edu; Wed, 3 Sep 1997 10:11:06 -0500 (EST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA22034; Wed, 3 Sep 1997 08:11:06 -0700 To: icon-group Date: Wed, 03 Sep 1997 09:20:15 +0900 From: Eric Hildum Message-Id: <340CAD3F.3446@Japan.NCR.com> Sender: icon-group-request References: Reply-To: Eric.Hildum@japan.ncr.com Subject: Re: GREP Errors-To: icon-group-errors Status: RO Stuart Robinson wrote: > > Does anyone know where I can lay my hands on a good intro to GREP (which > I'm using on BBEdit)? (Where else might I enquire?) I am doing a good > deal of corpus work and I want to be able to search for complicated string > patterns. Icon is good for some of these searches but sometimes it's not > worth the programming time. > > Thanks in advance. > > -- > Stuart Robinson > The Australian National University That must be a very complicated search pattern if programing in Icon is not worth the time! Would you post some examples? Perhaps the group could give you some suggestions. -- "The idea that Bill Gates has appeared like a knight in shining armour to lead all customers out of a mire of technological chaos neatly ignores the fact that it was he who, by peddling second-rate technology, led them into it in the first place."-Douglas Adams Eric Hildum Eric.Hildum@Japan.NCR.COM From icon-group-sender Wed Sep 3 17:08:29 1997 Return-Path: Received: from kingfisher.CS.Arizona.EDU by cheltenham.cs.arizona.edu; Wed, 3 Sep 1997 17:08:29 -0500 (EST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA24262; Wed, 3 Sep 1997 15:08:28 -0700 To: icon-group Date: 3 Sep 1997 08:09:32 -0700 From: icon-project Message-Id: <5ujujc$mit@kingfisher.CS.Arizona.EDU> Organization: University of Arizona CS Department, Tucson AZ Sender: icon-group-request Reply-To: icon-project Subject: Icon Programming Language FAQ Errors-To: icon-group-errors Status: RO Archive-name: comp-lang-icon-faq Posting-Frequency: monthly Frequently Asked Questions About The Icon Programming Language Last updated: December 11, 1996 This FAQ answers various questions about the Icon programming language, ranging from what it is to how you can get it. The master copy of this FAQ is the Web page http://www.cs.arizona.edu/icon/faq.html. Other on-line documentation is available via the main Icon page at http://www.cs.arizona.edu/icon/. This FAQ is written by Ralph Griswold and Gregg Townsend, with help from Cliff Hathaway, Clint Jeffery, and Bob Alexander. * 1. What is Icon? * 2. What is Icon good for? * 3. Where did Icon come from? * 4. What does "Icon" stand for? * 5. On what computers does Icon run? * 6. Who did all these implementations? * 7. Are there other implementations in the works? * 8. What about different versions of Icon? * 9. Which implementations of Icon have graphics/window capabilities? * 10. Where can I get Icon? * 11. Where can I get documentation about Icon? * 12. How do I get started with Icon? * 13. What is the Icon Project? * 14. Where can I find examples of Icon programs? * 15. What is Idol? * 16. How often is material in Icon's FTP area updated? * 17. How do I stay up to date with what's going on with Icon? * 18. Is there a users' group for Icon? * 19. How do I get technical support? * 20. What do I need to run Icon? * 21. Can I build my own implementation of Icon for a new platform? ---------------------------------------------------------------------------- 1. 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 its semantics are at a much higher level than those languages. 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. 2. 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 at its best when used build software tools, for processing text, and when ease of programming is needed for experimental and research applications. Paradoxically, Icon is used most often for short, one-shot tasks and for very complex 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. This explains its usefulness for prototyping as well as the apparent paradox of applicability to simple and complex applications. 3. 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 60s. 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. Incidentally, Icon bears little physical resemblance to SNOBOL4, although it has similar objectives and many similar capabilities. 4. What does "Icon" stand for? The name Icon (which is not spelled ICON) is not an acronym nor does it stand for anything in particular, although the word "iconoclastic" was mentioned at the time the name was chosen. The name predates the now common use of "icon" to refer to small images used in graphical user interfaces. This latter usage sometimes causes persons to think mistakenly that Icon is designed to create or manipulate icons. There's not much that can be done about this. 5. On what computers does Icon run? The implementation of Icon is highly portable. Version 9 runs on UNIX, MS-DOS, Windows, NT, Macintosh/MPW, VAX/VMS, the Amiga, and the Acorn Archimedes. There are older versions for the Atari ST, IBM CMS and MVS, the Macintosh, and OS/2. Icon programs also are highly portable. Most Icon programs can run on any platform that supports Icon. 6. Who did all these implementations? The original implementation of Icon for UNIX was done at The University of Arizona. Most of the other implementations originally were done by volunteers scattered around the world. It's worth noting that all implementations of Icon are based on the same source code, which is written in C. This contributes to the portability of Icon itself, as well as to the portability of programs written in Icon. 7. Are there other implementations in the works? Work is constantly underway on implementations of Icon for new platforms. Microsoft Windows and Windows NT implementations are in beta testing. 8. What about different versions of Icon? Icon has evolved through a series of versions with improved and extended capabilities. The latest major version number is 9. This version includes recent changes and additions, notably in the graphics area, and runs on UNIX, MS-DOS, Macintosh/MPW, VAX/VMS, the Amiga, and Acorn Archimedes. Other implementations presently are at Version 8. Almost all programs that run under Version 8 and that do not use graphics will run under Version 9. 9. Which implementations of Icon have graphics/window capabilities? Icon's graphics facilities presently are supported on UNIX and VAX/VMS. Windows NT and Microsoft Windows implementations that support Icon's graphics facilities are in beta testing. 10. Where can I get Icon? Icon is available via anonymous FTP and on the Web. For FTP, use ftp.cs.arizona.edu and cd /icon. For the Web, use http://www.cs.arizona.edu/icon/ and check out the links there. For FTP, the directory /icon/binaries contains executable versions of Icon for several systems, including several popular UNIX platforms. The directory /icon/packages contains source code, test programs, related material, and, most cases, executable binaries as well. All directories have README files with additional information. 11. Where can I get documentation about Icon? The definitive work on Icon is the book The Icon Programming Language, Griswold and Griswold, third edition, Peer-to-Peer Communications, Inc, 1996, 386 pages, ISBN 1-57398-001-3. This book is a complete description and reference manual for Version 9 of Icon. A technical report describes changes since that version. There also is a book on the implementation of Icon: The Implementation of the Icon Programming Language, Griswold and Griswold, Princeton University Press, 1986, 336 pages, ISBN 0-691-08431-9. This book describes the implementation as of Version 6 of Icon. Although the implementation has changed considerably since then, the basic structure is the same. Technical reports describing recent implementation changes are included with copies of the book purchased from the Icon Project. These books are available from the Icon Project. Additional documentation is available via FTP in /icon/doc. Notable documents are: * IPD266: An Overview of Icon (text, PostScript, PDF) * IPD281: Graphics/window facilities (PostScript, PDF) * IPD278: Version 9.3 of Icon (text, PostScript, PDF) There are manual pages for UNIX systems, and more documentation under the Icon web page, but there is no complete on-line documentation. The Icon Newsletter, which includes topical material about Icon and a list of material available from the Icon Project, is published three times a year and is available on the Web. There is a subscription fee for an on-going subscription by postal mail. The Icon Analyst, a technically-oriented newsletter that features articles about programming, is published six times a year. There is a subscription fee for the Analyst. A sample copy is available on the Web. All back issues of both newsletters are available for purchase. 12. How do I get started with Icon? If you're running under UNIX, check first in the /icon/binaries/unix FTP directory to see if there is a "starter kit" for your platform. Starter kits include executables, documentation, and other material. Otherwise, go to the /icon/packages directory and get the appropriate package. Packages include documentation and other material; see the README file in that directory for more details. There is a UNIX package for platforms that lack starter kits. If the non-UNIX package you pick up does not contain executable files, check /icon/binaries. You also may want to get the overview of Icon: /icon/doc/ipd266.txt or ipd266.ps.Z. You'll find pointers to other documents of interest in the package you pick up. 13. What is the Icon Project? The Icon Project is a name used by the group that develops, implements, distributes, and supports the Icon programming language. The Icon Project is not commercial organization. It derives support from The University of Arizona, revenue from the sale of program material and documentation, and user contributions. 14. Where can I find examples of Icon programs? There is a large program library for Icon. It is an excellent resource for both new and experienced programmers. The library contains numerous examples of how to do things with Icon. The library also provides many useful applications, as well as hundreds of procedures that supplement Icon's built-in repertoire. The library, like other Icon material, is available via FTP in /icon/library. 15. What is Idol? Idol is an object-oriented extension to Icon that provides concepts such as classes and multiple inheritance. Idol is written in Idol and is distributed as part of the Icon program library. Idol runs on almost all of the platforms that support Icon. Additional Idol information is available from Clint Jeffery, jeffery@ringer.cs.utsa.edu. 16. How often is material in Icon's FTP area 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. 17. How do I stay up to date with what's going on with Icon? The best way to find out about developments related to Icon is to read the Icon Newsletter. You can stay up to date on the source code, which is changed much more frequently than the version on FTP is updated, by subscribing to the source update service, which provides a new version about twice a year. There also is a subscription service for updates to the Icon program library, which provides new material about twice a year. There is on-line information about subscribing to these services. 18. Is there a users' group for Icon? There is no official Icon users' group. The Icon Project maintains an electronic mailing list, icon-group@cs.arizona.edu. Mail sent to this address is forwarded to subscribers. 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, is less intrusive, but sometimes suffers from inappropriate postings. The Icon Project usually sends messages of interest to the Icon community to icon-group. 19. 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: Ordering Icon Material mail: Icon Project Department of Computer Science The University of Arizona P.O. Box 210077 Tucson, Arizona 85721-0077 U.S.A. fax: (520) 621-4246 voice: (520) 621-6613 e-mail: icon-orders@cs.arizona.edu Getting On-Line Information and Material web: http://www.cs.arizona.edu/icon/ ftp: ftp.cs.arizona.edu (cd /icon) e-mail: ftpmail@cs.arizona.edu Send a message consisting of the word help. Assistance with Installing Icon e-mail: icon-project@cs.arizona.edu Bug Reports e-mail: icon-project@cs.arizona.edu fax: (520) 621-4246 Assistance with Programming Problems e-mail: icon-group@cs.arizona.edu news: comp.lang.icon Uploading Files ftp: ftp.cs.arizona.edu (cd /incoming) After uploading, send e-mail to icon-project@cs.arizona.edu. 20. What do I need to run Icon? Icon will run on most computers. Under MS-DOS, the Icon interpreter needs at least 500 KB of application RAM to work well. 21. Can I build my own implementation of Icon for a new platform? As mentioned above, Icon is written in C and the source code is available. The existing implementations are testament to its portability. (A small amount of assembly-language code is required for a context switch, but this is only needed for an optional feature -- co-expressions -- that can be disabled without affecting other features of Icon.) New ports involve platform-specific configuration parameters and, in some cases, platform-specific code. The feasibility of a new port and the amount of work it may take depends on the platform -- its architecture, its C compiler, and its environment. Ports to new UNIX platforms generally are easy, although novel architectures may present problems. Ports to new operating systems generally are more difficult, especially if Icon's graphics facilities are implemented. The Icon Project provides what help it can with new ports. In return, it asks that code related to the port to be returned to the Icon Project for inclusion in future versions of the source code for Icon. This makes the new port available to others as well as to the porter when Icon is updated. From icon-group-sender Thu Sep 4 15:02:46 1997 Return-Path: Received: from kingfisher.CS.Arizona.EDU by cheltenham.cs.arizona.edu; Thu, 4 Sep 1997 15:02:45 -0500 (EST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA25059; Thu, 4 Sep 1997 13:02:45 -0700 To: icon-group Date: 04 Sep 1997 10:57:37 -0400 From: davidf@mks.com (David J. Fiander) Message-Id: Organization: Mortice Kern Systems Inc. Sender: icon-group-request References: Subject: n-ary comparison operators (was Re: Better Dylan syntax?) Errors-To: icon-group-errors Status: RO Gareth McCaughan writes: > > > Erik Naggum wrote: > > > hm. in a < b `<' is a binary operator, while it is ternary in a < b < c, > > and n-ary in a < b < ... < z. although I know of no language that has > > anything but binary infix operators, I get the impression from the above > > that you do. > > Yes. BCPL does it. "a < b <= c ~= d" means "a I don't know of any other languages with the same feature, but I'd > be surprised if BCPL were the only one. > Icon supports n-ary infix operators: a < b < c ~= d produces the same result as BCPL. This works because comparisions are left associative, and successful comparisons return the right operand. That is, the above expression is equivalent to (((a < b) < c) ~= d) and if a < b, then b is compared to c, and so on. If a >= b, then the expression fails, and none of the rest of it is evaluated. From icon-group-sender Mon Sep 8 11:31:52 1997 Return-Path: Received: from kingfisher.CS.Arizona.EDU by cheltenham.cs.arizona.edu; Mon, 8 Sep 1997 11:31:51 -0500 (EST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA26726; Mon, 8 Sep 1997 09:31:51 -0700 To: icon-group Date: Sat, 06 Sep 1997 16:44:32 +1000 From: Stuart.Robinson@anu.edu.au (Stuart Robinson) Message-Id: Organization: ANU Sender: icon-group-request Subject: GREP and regex Summary Errors-To: icon-group-errors Status: RO Many thanks to everyone who responded to my posting(s) on regular expressions and grep: johnl@iecc.com mike@stok.co.uk prp@sei.cmu.edu jfriedl@yahoo.com Eric.Hildum@Japan.NCR.COM clowenstein@ucsd.edu feustel@netcom.com gep2@computek.net jtgalkowski@postoffice.worldnet.att.net murray@zeus.mpce.mq.edu.au I was pointed to a variety of sources, the least helpful of which was the UNIX manual and the most helpful of which was the new O'Reilly book on regular expressions: Jeffrey Friedl. 1997. _Mastering Regular Expressions_ (O'Reilly) Some web sites were also pointed out (but since I haven't checked all of them, I can't vouch for their continued existence): http://enterprise.ic.gc.ca/~jfriedl/regex/ http://lib.stat.cmu.edu/scgn/v52/section1_7_0_1.html http://wonder.mit.edu/misc/regex.html http://sunsite.auc.dk/frexxed/docs/FrexxEd_Sections/regular_expressions.HTML http://www.ciser.cornell.edu/info/regex_NG.html Regards, SPR -- Stuart Robinson The Australian National University From icon-group-sender Wed Sep 10 14:23:39 1997 Return-Path: Received: from kingfisher.CS.Arizona.EDU by cheltenham.cs.arizona.edu; Wed, 10 Sep 1997 14:23:38 -0500 (EST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA31626; Wed, 10 Sep 1997 12:23:37 -0700 To: icon-group Date: Wed, 10 Sep 1997 13:59:41 GMT From: ltest@rte9-sun_5.5.1 (news_check.py) Message-Id: <5v69d2$4su@lztnsc06.att.com> Organization: AT&T WorldNet Load Test Sender: icon-group-request References: Subject: Re: More specific GREP-related question Errors-To: icon-group-errors Status: RO In article <5uh7b5$gd7@news-central.tiac.net> mike@stok.co.uk (Mike Stok) wrote: > In article , > Stuart Robinson wrote: > >Does anyone know how regular expressions like [a-z] work when a In article , Stuart Robinson wrote: >Does anyone know how regular expressions like [a-z] work when a >non-alphanumeric character is used? For example, which characters would >the following regular expression match? > >[1-!] If you actually use that in a regex on a system with ASCII encoding (or one of the character sets wherer the low 128 characters are ASCII) you should get an "invalid [] range in regexp" warning as perl likes to work with ascending ranges. In ASCII you're asking for a range from character 49 up to character 33 >What about this one? > >[a-1] > >And the reverse? > >[1-a] 1-a will match a character in the range characters 49 to 97 inclusive, so in the debugger I can use perl's ord and chr functions to see what characters are in that range: DB<1> print ord '1' 49 DB<2> print ord 'a' 97 DB<3> print map {chr $_} (49 .. 97) 123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`a >I'm sure all of this could be predicted if one had knowledge of the >ordering of ASCII, but I'm afraid I lack such knowledge. Any tips? If you're on a unix system then there is usually a manual page for ascii, so man ascii should get you a useful page. Failing that a www search or a reference book might have a table of ascii codes in it (printer manuals usually have tables of characters somewhere in them...) Hope this helps, Mike -- mike@stok.co.uk | The "`Stok' disclaimers" apply. http://www.stok.co.uk/~mike/ | PGP fingerprint FE 56 4D 7D 42 1A 4A 9C http://www.tiac.net/users/stok/ | 65 F3 3F 1D 27 22 B7 41 stok@psa.pencom.com | Pencom Systems Administration (work) From icon-group-sender Tue Sep 16 07:59:46 1997 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by cheltenham.cs.arizona.edu (8.8.7/8.8.7) with SMTP id HAA07300 for ; Tue, 16 Sep 1997 07:59:46 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA02851; Tue, 16 Sep 1997 07:59:45 -0700 To: icon-group@cs.arizona.edu Date: Tue, 16 Sep 1997 13:41:08 +1000 From: Stuart.Robinson@anu.edu.au (Stuart Robinson) Message-Id: Organization: ANU Sender: icon-group-request@cs.arizona.edu Subject: case selection expression Errors-To: icon-group-errors@cs.arizona.edu Status: RO How can I use the case selection expression to 1) check each line of a text for the presence or absence of a few key words and 2) do something according to which key word is present? The logic is basically: do 1 if find "x" do 2 if find "y" do 3 if find "z" do 4 otherwise (as a default) I think that the case selection expression (i.e., case X of {}) would work, but I don't really understand it and I don't have my manual handy. I know that this can be done with if-then (else), but what I want to know is how "case of {}" works. Thanks in advance for the help. Cheers, Stuart Robinson -- Stuart Robinson The Australian National University *TO REPLY, REMOVE "no_spam!" FROM E-MAIL ADDRESS GIVEN ABOVE From icon-group-sender Tue Sep 16 08:00:29 1997 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by cheltenham.cs.arizona.edu (8.8.7/8.8.7) with SMTP id IAA07330 for ; Tue, 16 Sep 1997 08:00:28 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA00552; Tue, 16 Sep 1997 08:00:22 -0700 To: icon-group@cs.arizona.edu Date: Tue, 16 Sep 1997 22:15:29 +1000 From: Stuart.Robinson@anu.edu.au (Stuart Robinson) Message-Id: Organization: ANU Sender: icon-group-request@cs.arizona.edu References: , <5vlnlo$juv$1@vishnu.jussieu.fr> Subject: Re: case selection expression Errors-To: icon-group-errors@cs.arizona.edu Status: RO Thanks. I think you're right, Mark. For this sort of thing, a series of if-then statements is probably more straightforward than the case selection expression. But it's good to know alternative ways of skinning the proverbial cat. By the way, what is the story with "<-"? Is it just a variant of ":="? > case (find( i <- "x"|"y"|"z"), i) of > "x": do 1 > "y": do 2 > "z": do 3 > default: do 4 -- Stuart Robinson The Australian National University *TO REPLY, REMOVE "no_spam!" FROM E-MAIL ADDRESS GIVEN ABOVE From icon-group-sender Tue Sep 16 07:59:59 1997 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by cheltenham.cs.arizona.edu (8.8.7/8.8.7) with SMTP id HAA07303 for ; Tue, 16 Sep 1997 07:59:59 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA02966; Tue, 16 Sep 1997 07:59:58 -0700 To: icon-group@cs.arizona.edu Date: Tue, 16 Sep 1997 13:48:04 +1000 From: Stuart.Robinson@anu.edu.au (Stuart Robinson) Message-Id: Organization: ANU Sender: icon-group-request@cs.arizona.edu References: , <340CAD3F.3446@Japan.NCR.com> Subject: Re: GREP Errors-To: icon-group-errors@cs.arizona.edu Status: RO I'm sorry I never replied to your posting, Eric. To give you an idea of the kind of searching, I'm doing, let me use an example from English, since everyone who can read this must speak it. (Most of my text searches are actually on Tzotzil, a Mayan languages spoken in Mexico.) Let's say I'm looking for relative clauses. I could just look for "who", "that", or "which", but I'd get a lot of things that aren't relative clauses. For example, Who went to the store? That man is a jerk. I saw that your arm was broken. Which store sells lolly pops? So I need way of looking for patterns and I need to be able to do it on multiple files. That's where BBEdit's multi-file and GREP search capabilities come in handy. I can use regexes like the following to find relative clauses: the[A-Za-z' ](that|who|((, )?which)) (I think that would work, although I haven't tested it.) I don't know of a quick and dirty way of doing the same with Icon (especially since I don't know off-hand how to get ProIcon--for the Mac--to use multiple files as input). Cheers, Stuart In article <340CAD3F.3446@Japan.NCR.com>, Eric.Hildum@Japan.NCR.com wrote: > That must be a very complicated search pattern if programing in Icon is > not worth the time! Would you post some examples? Perhaps the group > could give you some suggestions. -- Stuart Robinson The Australian National University *TO REPLY, REMOVE "no_spam!" FROM E-MAIL ADDRESS GIVEN ABOVE From icon-group-sender Tue Sep 16 08:00:33 1997 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by cheltenham.cs.arizona.edu (8.8.7/8.8.7) with SMTP id IAA07333 for ; Tue, 16 Sep 1997 08:00:32 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA02458; Tue, 16 Sep 1997 08:00:32 -0700 To: icon-group@cs.arizona.edu Date: Tue, 16 Sep 1997 22:56:57 +1000 From: Stuart.Robinson@anu.edu.au (Stuart Robinson) Message-Id: Organization: ANU Sender: icon-group-request@cs.arizona.edu Subject: Problem with Program Errors-To: icon-group-errors@cs.arizona.edu Status: RO I just wrote up a little program to check each line of text for the number of times the string "#PL" appears. I want the program to put the line in list_1 if the string shows up once, in list_2 if the string shows up twice, in list_3 if the string show up three times, and in list_other if it fails to show up at all or shows up more than three times. The problem is, it doesn't work. What gives? Thanks in advance. ========== #16 Sept 1997 #program written to print all clauses in which plurality is multiply marked procedure main() list_1 := [] list_2 := [] list_3 := [] otherlist_other := [] chars := &letters++-#7 count := 0 while line := read() do { line ? { while tab(upto(chars)) do { word := tab(many(chars)) word ? { if find("#PL") then count +:= 1 { } } if count = 1 then put(list_1, line) else if count = 2 then put(list_2, line) else if count = 3 then put(list_3, line) else put(list_other, line) count := 0 } write ("\n" || "LINES WITH PLURAL MARKED ONE TIME") every write(list_1[1 to *list_1]) write ("\n" || "LINES WITH PLURAL MARKED TWO TIMES") every write(list_2[1 to *list_2]) write ("\n" || "LINES WITH PLURAL MARKED THREE TIMES") every write(list_3[1 to *list_3]) write ("\n" || "ALL OTHER LINES") every write(list_other[1 to *list_other]) end -- Stuart Robinson The Australian National University *TO REPLY, REMOVE "no_spam!" FROM E-MAIL ADDRESS GIVEN ABOVE From icon-group-sender Tue Sep 16 08:00:13 1997 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by cheltenham.cs.arizona.edu (8.8.7/8.8.7) with SMTP id IAA07325 for ; Tue, 16 Sep 1997 08:00:12 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA01560; Tue, 16 Sep 1997 08:00:11 -0700 To: icon-group@cs.arizona.edu Date: 16 Sep 1997 10:39:52 GMT From: espie@vishnu.jussieu.fr (Marc ESPIE) Message-Id: <5vlnlo$juv$1@vishnu.jussieu.fr> Organization: Universites Paris VI/Paris VII - France Sender: icon-group-request@cs.arizona.edu References: Subject: Re: case selection expression Errors-To: icon-group-errors@cs.arizona.edu Status: RO Stuart Robinson (Stuart.Robinson@anu.edu.au) wrote: : How can I use the case selection expression to 1) check each line of a : text for the presence or absence of a few key words and 2) do something : according to which key word is present? The logic is basically: : do 1 if find "x" : do 2 if find "y" : do 3 if find "z" : do 4 otherwise (as a default) : I think that the case selection expression (i.e., case X of {}) would : work, but I don't really understand it and I don't have my manual handy. : I know that this can be done with if-then (else), but what I want to know : is how "case of {}" works. In your specific example, you need to combine generators with case. e.g.: case (find( i <- "x"|"y"|"z"), i) of "x": do 1 "y": do 2 "z": do 3 default: do 4 but I am not really sure that it is clearer than a cascaded if find("x") then do 1 else if find("y") then do 2 which is as readable once you've got the knack of it, and certainly more efficient in the present case under the current implementation of Icon. From icon-group-sender Tue Sep 16 12:47:34 1997 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by cheltenham.cs.arizona.edu (8.8.7/8.8.7) with SMTP id MAA10212 for ; Tue, 16 Sep 1997 12:47:19 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA03197; Tue, 16 Sep 1997 12:47:17 -0700 Date: Tue, 16 Sep 1997 08:29:12 -0700 From: kwalker@premenos.com (Ken Walker) Message-Id: <199709161529.IAA10288@varda.premenos.com> To: icon-group@optima.cs.arizona.edu, Stuart.Robinson@anu.edu.au Subject: Re: Problem with Program Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Md5: r1nw5tnoLAkf4GmYRQRAPA== Errors-To: icon-group-errors@cs.arizona.edu Status: RO > Date: Tue, 16 Sep 1997 22:56:57 +1000 > From: Stuart.Robinson@anu.edu.au (Stuart Robinson) > > I just wrote up a little program to check each line of text for the number > of times the string "#PL" appears. I want the program to put the line in > list_1 if the string shows up once, in list_2 if the string shows up > twice, in list_3 if the string show up three times, and in list_other if > it fails to show up at all or shows up more than three times. The problem > is, it doesn't work. What gives? Thanks in advance. You did not say exactly what the symptoms are and the program you posted has serveral typos in it. If you can tell me where things are going wrong and/or post a more accurate version of the program, I can probably figure out what's going on. Ken Walker, kwalker@premenos.com Premenos Coporation, Concord, Ca. 94520 From icon-group-sender Wed Sep 17 08:00:12 1997 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by cheltenham.cs.arizona.edu (8.8.7/8.8.7) with SMTP id IAA02259 for ; Wed, 17 Sep 1997 08:00:12 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA03444; Wed, 17 Sep 1997 08:00:11 -0700 To: icon-group@cs.arizona.edu Date: Wed, 17 Sep 1997 20:31:55 +1000 From: Stuart.Robinson@anu.edu.au (Stuart Robinson) Message-Id: Organization: ANU Sender: icon-group-request@cs.arizona.edu Subject: outputting name of file used as input Errors-To: icon-group-errors@cs.arizona.edu Status: RO Hello. I was wondering whether there is way of getting a program written in Icon and compiled on ProIcon (Macs) to write the name of the file it uses as input when file selection is done external to the program. In other words, I want to be able to write a line like the following write("Results of Count on " || FILENAME GOES HERE || ": " || count ) inserting the name of the file used as input where I have written "FILENAME GOES HERE". Thanks in advance. -- Stuart Robinson The Australian National University *TO REPLY, REMOVE "no_spam!" FROM E-MAIL ADDRESS GIVEN ABOVE From icon-group-sender Thu Sep 18 08:15:12 1997 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by cheltenham.cs.arizona.edu (8.8.7/8.8.7) with SMTP id IAA25565 for ; Thu, 18 Sep 1997 08:15:12 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA04833; Thu, 18 Sep 1997 08:15:11 -0700 Message-Id: <199709181443.PAA09401@holyrood.ed.ac.uk> Date: 18 Sep 97 15:43:24 BST From: Roger Hare Subject: Icon Talk To: icon-group@cs.arizona.edu Reply-To: rjhare@ed.ac.uk Organisation: Edinburgh University Computing Services Errors-To: icon-group-errors@cs.arizona.edu Status: RO At last, after about 10 years, I have managed to persuade my colleagues (or some of them) to let me tell them about Icon in a short departmental seminar. I have about 30 minutes, with slides. What features of Icon do folks think I should present in order to convince them to start using Icon? Obviously, I have my own ideas, but any others are welcome. Thanks. Roger Hare From icon-group-sender Thu Sep 18 08:14:52 1997 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by cheltenham.cs.arizona.edu (8.8.7/8.8.7) with SMTP id IAA25545 for ; Thu, 18 Sep 1997 08:14:51 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA05089; Thu, 18 Sep 1997 08:14:50 -0700 Date: Tue, 16 Sep 1997 23:11:15 GMT From: ia@stryx.demon.co.uk (Iain Alexander) Reply-To: ia@stryx.demon.co.uk Message-Id: <25954@stryx.demon.co.uk> To: icon-group@cs.arizona.edu Subject: Re: Problem with Program X-Mailer: PCElm 1.10 Lines: 45 Errors-To: icon-group-errors@cs.arizona.edu Status: RO In message Stuart.Robinson@anu.edu.au (Stuart Robinson) writes: > > I just wrote up a little program to check each line of text for the number > of times the string "#PL" appears. I want the program to put the line in > list_1 if the string shows up once, in list_2 if the string shows up > twice, in list_3 if the string show up three times, and in list_other if > it fails to show up at all or shows up more than three times. The problem > is, it doesn't work. What gives? Thanks in advance. > > ========== > > #16 Sept 1997 > #program written to print all clauses in which plurality is multiply marked > > procedure main() > > list_1 := [] > list_2 := [] > list_3 := [] > otherlist_other := [] > > chars := &letters++-#7 > count := 0 > > while line := read() do > { try count:= 0 > line ? > { > while tab(upto(chars)) do > { > word := tab(many(chars)) > word ? > { > if find("#PL") then count +:= 1 > { > } > } [etc. snipped] -- Iain Alexander PGP 1024-bit key id B501A0AD ia@stryx.demon.co.uk I.Alexander@bsn0106.wins.icl.co.uk From icon-group-sender Thu Sep 18 12:51:01 1997 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by cheltenham.cs.arizona.edu (8.8.7/8.8.7) with SMTP id MAA28470 for ; Thu, 18 Sep 1997 12:51:00 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA05883; Thu, 18 Sep 1997 12:50:59 -0700 From: gep2@computek.net Date: Thu, 18 Sep 1997 12:10:57 -0500 Message-Id: <199709181710.MAA19533@axp.cmpu.net> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Subject: Icon Talk To: icon-group@cs.arizona.edu X-Mailer: SPRY Mail Version: 04.00.06.17 Errors-To: icon-group-errors@cs.arizona.edu Status: RO >At last, after about 10 years, I have managed to persuade my colleagues (or some of them) to let me tell them about Icon in a short departmental seminar. I have about 30 minutes, with slides. What features of Icon do folks think I should present in order to convince them to start using Icon? >Obviously, I have my own ideas, but any others are welcome. Damned difficult question, without knowing anything about what kind of stuff you do, what other software and file/database systems you use, etc.! That said, I think that the major advantages compared to a lot of other programming languages involve: a) speed and productivity for programmers b) reduction of boundary condition errors in programs ("do for all elements in the array" rather than "i = 1 to N") c) availability of more advanced data structures (lists, tables, etc.) d) reduction of pointer errors in programs (a real gotcha in C) e) more robust and supple treatment of input commands and strings, due to string scanning capabilities f) easier to do more comprehensive edit checking on inputs (help reduce bad data from finding its way into the system) g) reduction of memory management errors (another traditional weak point of C-type languages) h) shorter source programs that are easier to follow in terms of program logic (fewer lines of purely mechanical detail that aren't important to the overall algorithm being coded) i) very fast compilation times coupled with reduced opportunities for faults reduce the compile/debug cycle time I'm sure there are others, but those are the ones that spring immediately to mind. Gordon Peterson http://www.computek.net/public/gep2/ Support the Anti-SPAM Amendment! Join at http://www.cauce.org/ From icon-group-sender Thu Sep 18 12:50:42 1997 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by cheltenham.cs.arizona.edu (8.8.7/8.8.7) with SMTP id MAA28465 for ; Thu, 18 Sep 1997 12:50:42 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA05867; Thu, 18 Sep 1997 12:50:41 -0700 Posted-Date: Thu, 18 Sep 1997 10:36:08 -0500 (CDT) Message-Id: <1.5.4.32.19970918153333.0070a258@post.its.mcw.edu> X-Sender: cdt@post.its.mcw.edu X-Mailer: Windows Eudora Light Version 1.5.4 (32) Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Date: Thu, 18 Sep 1997 10:33:33 -0500 To: rjhare@ed.ac.uk, icon-group@cs.arizona.edu From: Chris Tenaglia Subject: Re: Icon Talk Errors-To: icon-group-errors@cs.arizona.edu Status: RO Greetings, I also have a slide set. Actually two. One I did in 1991 on plain transparencies. The other in powerpoint is about 80% complete. But mine were much too long. I think mine focus on teaching programming principles using icon as the medium. The features I push are : cleanness and consistency of the language. No end of statement delimiters to confuse things. A great software chip library (IPL + more). Speed and ease of development. The lack of deep hooks in the OS is a feature to me. Less chance of mucking up the entire host. Availability, low cost, and reliability. Chris Tenaglia, system manager Medical College of Wisconsin At 03:43 PM 9/18/97 BST, Roger Hare wrote: >At last, after about 10 years, I have managed to persuade my >colleagues (or some of them) to let me tell them about Icon in a >short departmental seminar. I have about 30 minutes, with slides. >What features of Icon do folks think I should present in order to >convince them to start using Icon? > >Obviously, I have my own ideas, but any others are welcome. > >Thanks. > >Roger Hare > > From icon-group-sender Mon Sep 22 08:22:06 1997 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by cheltenham.cs.arizona.edu (8.8.7/8.8.7) with SMTP id IAA19372 for ; Mon, 22 Sep 1997 08:22:05 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA02917; Mon, 22 Sep 1997 08:22:05 -0700 To: icon-group@cs.arizona.edu Date: Mon, 22 Sep 1997 14:55:37 +1000 From: Stuart.Robinson@anu.edu.au (Stuart Robinson) Message-Id: Organization: ANU Sender: icon-group-request@cs.arizona.edu Subject: if not find a and/or b, do x Errors-To: icon-group-errors@cs.arizona.edu Status: RO Hello, all. I want to write up a little program that does, among other things, some error checking for me. Basically, if the program finds a certain element in a line, I want it to look for two other elements and to write the line if one or both of those two other elements are missing. Ex. if find( "{T" ) then if not find( "{A" | "{O" ) then write( line ) should write (1), (2), and (3), but not (4) 1. {T 2. {T {A 3. {T {O 4. {T {O {A Thanks in advance. Cheers, Stuart -- Stuart Robinson The Australian National University *TO REPLY, REMOVE "no_spam!" FROM E-MAIL ADDRESS GIVEN ABOVE From icon-group-sender Mon Sep 22 12:50:06 1997 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by cheltenham.cs.arizona.edu (8.8.7/8.8.7) with SMTP id MAA21908 for ; Mon, 22 Sep 1997 12:50:06 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA07364; Mon, 22 Sep 1997 12:50:05 -0700 From: gep2@computek.net Date: Mon, 22 Sep 1997 11:44:25 -0500 Message-Id: <199709221644.LAA08065@axp.cmpu.net> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Subject: if not find a and/or b, do x To: icon-group@cs.arizona.edu X-Mailer: SPRY Mail Version: 04.00.06.17 Errors-To: icon-group-errors@cs.arizona.edu Status: RO >I want to write up a little program that does, among other things, some error checking for me. Basically, if the program finds a certain element in a line, I want it to look for two other elements and to write the line if one or both of those two other elements are missing. >Ex. if find( "{T" ) then if not find( "{A" | "{O" ) then write( line ) should write (1), (2), and (3), but not (4) 1. {T 2. {T {A 3. {T {O 4. {T {O {A Here is a SNOBOL4+/SPITBOL version: &fullscan = 1 next line = input ?(atag = otag = ttag = ) :f(end) line fence breakx("{") len(1) ("T" $ ttag | "O" $ otag | "A" $ atag) + *differ(atag) *differ(otag) *differ(ttag) output = differ(ttag) ~(differ(otag) differ(atag)) line :(next) end Gordon Peterson http://www.computek.net/public/gep2/ Support the Anti-SPAM Amendment! Join at http://www.cauce.org/ From icon-group-sender Mon Sep 22 16:20:53 1997 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by cheltenham.cs.arizona.edu (8.8.7/8.8.7) with SMTP id QAA23601 for ; Mon, 22 Sep 1997 16:20:42 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA08227; Mon, 22 Sep 1997 16:20:42 -0700 Message-Id: <9709222031.AA06900@hpclpax.cup.hp.com> Subject: Re: if not find a and/or b, do x Date: Mon, 22 Sep 97 13:34:02 -0700 X-Sender: cary@hpclpax.cup.hp.com X-Mailer: Claris Emailer 2.0, March 15, 1997 From: Cary Coutant To: "Stuart Robinson" , Mime-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Errors-To: icon-group-errors@cs.arizona.edu Status: RO >if find( "{T" ) > then if not find( "{A" | "{O" ) > then write( line ) The if-clause not find("{A" | "{O") succeeds if find("{A" | "{O") fails. The find will succeed if it finds *either* string in the line, so you're really testing here for the presence of either string rather than both. What you want is this: not find("{A") | not find("{O") This will succeed (i.e., it has found an invalid line) if either string is not found. -cary From icon-group-sender Tue Sep 23 08:01:38 1997 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by cheltenham.cs.arizona.edu (8.8.7/8.8.7) with SMTP id IAA11882 for ; Tue, 23 Sep 1997 08:01:37 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA09017; Tue, 23 Sep 1997 08:01:36 -0700 To: icon-group@cs.arizona.edu Date: Tue, 23 Sep 1997 18:12:03 +1000 From: Stuart.Robinson@anu.edu.au (Stuart Robinson) Message-Id: Organization: ANU Sender: icon-group-request@cs.arizona.edu Subject: another program with problems Errors-To: icon-group-errors@cs.arizona.edu Status: RO Hello. I'm sorry to keep posting my programs to comp.lang.icon for editorial comments, but I have no local Icon support. Anyhow, I have a program that is producing output that I wouldn't expect, given the input. Here's the program: ################################################################################ ## Program modified 22 Sept 1997, SPR--total_no added ## Program finished 13 May 97, SPR ## program designed to tally the number of {S's, {A's, and {O's in a text ################################################################################ procedure main() chars := &letters ++ &digits ++ '{.*[]?' #valid characters total_no := 0 noS := 0 noA := 0 noO := 0 none := 0 while line := read() do #line = line of text { total_no +:= 1 #increment total_no by 1 line ? #scan line { while tab(upto(chars)) do #look for valid character { word := tab(many(chars)) #word = valid character through next invalid character word ? #scan word { while tab(upto("{") +1) do #move just past bracket (will fail if there is none) { wordfrag := move(1) #wordfrag = one character past bracket case wordfrag of #if wordfrag is { "S" : noS +:= 1 #S, then increment noS by 1 "A" : noA +:= 1 #A, then increment noA by 1 "O" : noO +:= 1 #O, then increment noO by 1 default : none +:= 1 #none of the above letters, #then increment none by 1 } } } } } } write( "Total No. of Clauses: " || total_no ) #writes total number of clauses (total_no) write( "Total No. of Nonverbal Clauses: " || none ) #writes total number of clauses without S, A, or O write( "Total No. of S's: " || noS ) #writes total number of S's (noS) write( "Total No. of A's: " || noA ) #writes total number of A's (noA) write( "Total No. of O's: " || noO ) #writes total number of O's (noO) end ################################################################################ Here's the input: {S {A {O {S {A {O {S {A {O nonverbal nonverbal nonverbal { { { Given the program and the input, I would expect the following output: Total No. of Clauses: 15 Total No. of Nonverbal Clauses: 3 Total No. of S's: 3 Total No. of A's: 3 Total No. of O's: 3 But instead I get this: Total No. of Clauses: 15 Total No. of Nonverbal Clauses: 0 Total No. of S's: 3 Total No. of A's: 3 Total No. of O's: 6 It seems the lines with a single curly brackets are being treated as lines with "{O". What gives? Cheers, Stuart -- Stuart Robinson The Australian National University *TO REPLY, REMOVE "no_spam!" FROM E-MAIL ADDRESS GIVEN ABOVE From icon-group-sender Tue Sep 23 12:44:52 1997 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by cheltenham.cs.arizona.edu (8.8.7/8.8.7) with SMTP id MAA14544 for ; Tue, 23 Sep 1997 12:44:46 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA07981; Tue, 23 Sep 1997 12:44:46 -0700 Date: Tue, 23 Sep 1997 08:09:56 -0700 From: kwalker@premenos.com (Ken Walker) Message-Id: <199709231509.IAA17682@varda.premenos.com> To: icon-group@optima.cs.arizona.edu, Stuart.Robinson@anu.edu.au Subject: Re: another program with problems Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Md5: M5beUf93xnQmrK00KiBPEw== Errors-To: icon-group-errors@cs.arizona.edu Status: RO > Date: Tue, 23 Sep 1997 18:12:03 +1000 > From: Stuart.Robinson@anu.edu.au (Stuart Robinson) > ... > wordfrag := move(1) #wordfrag = one character past bracket I think your problem is that move(1) fails if there is nothing left in the string being scanned. Consequently wordfrag retains its previous value. In this case 'O'. You might try wordfrag := move(1) | "" Ken Walker, kwalker@premenos.com Premenos Coporation, Concord, Ca. 94520 From icon-group-sender Tue Sep 23 17:27:58 1997 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by cheltenham.cs.arizona.edu (8.8.7/8.8.7) with SMTP id RAA16855 for ; Tue, 23 Sep 1997 17:27:58 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA07551; Tue, 23 Sep 1997 17:27:57 -0700 Message-Id: <34281F1D.5E91@wwnet.com> Date: Tue, 23 Sep 1997 15:57:17 -0400 From: Scott Helmke Reply-To: scott@wwnet.com X-Mailer: Mozilla 3.01C-WWNet (Win95; U) Mime-Version: 1.0 To: icon-group@cs.arizona.edu Subject: Size limit on Icon programs? Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Errors-To: icon-group-errors@cs.arizona.edu Status: RO I've got an Icon application that is used to generate C code for a database system... you specify tables, columns, abbreviations, reports, etc. and the Icon stuff comes up with the C code that is the real source code. We've been doing this for years, and even ported it all over from MS-DOS to SCO unix a few years ago, Icon and all. The problem I am having is that beyond a certain size (hard to quantify), the icont link fails (this has been noticed on the unix side, and is related to a specific set of data) with a segmentation fault. I have been able to get around this by removing unused things from the Icon programs, but now I've run out of things to remove. I was using Icon 9.0, and just upgraded to the latest (9.3). No luck, and I spent a day trying to pinpoint the crash to no avail. I also tried it on my trusty old DOS version of Icon, but that failed also (lots of "Illegal opcode" type messages with random ASCII control characters mixed in). Any ideas? A fixed size limit? I can probably tar and compress the whole thing up, although running it (iconx) may not work on another platform due to the large amount of configuration things (directories to write into, etc) that need to be set. Things I *have* figured out: There are 12 .icn source files, all of them are compiled by icont with no errors or warnings. The crash happens in the "third phase" of the linking part of icont. I found a couple odd things related to SCO-specific weirdness in the Icon distribution, but fixing those didn't make any difference. Thanks, -Scott Helmke From icon-group-sender Wed Sep 24 12:34:12 1997 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by cheltenham.cs.arizona.edu (8.8.7/8.8.7) with SMTP id MAA06812 for ; Wed, 24 Sep 1997 12:34:12 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA08481; Wed, 24 Sep 1997 12:34:11 -0700 To: icon-group@cs.arizona.edu Date: 24 Sep 1997 18:15:55 GMT From: kot@math.utk.edu (Mark Kot) Message-Id: <60blcr$2t0$1@gaia.ns.utk.edu> Organization: University of Tennessee Sender: icon-group-request@cs.arizona.edu Subject: Icon + Festival Errors-To: icon-group-errors@cs.arizona.edu Status: RO I recently downloaded the Festival Speech Synthesis System (http://www.cstr.ed.ac.uk/projects/festival.html) for unix. I found that Icon was the ideal language for controlling this speech synthesizer. It took just a matter of minutes to write Icon programs that would produce useful text and pipe the output to festival. Examples include a program to read off my appointments for any given day, another to read off the name and subject of new mail, and third to read off the day's forecast. I was struck by the power of this combination and encourage others to try it. From icon-group-sender Wed Sep 24 16:23:13 1997 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by cheltenham.cs.arizona.edu (8.8.7/8.8.7) with SMTP id QAA08740 for ; Wed, 24 Sep 1997 16:23:12 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA10180; Wed, 24 Sep 1997 16:23:12 -0700 To: icon-group@cs.arizona.edu Date: Wed, 24 Sep 1997 22:30:42 GMT From: (Pete M. Wilson) Message-Id: <34299413.10548025@stripey.gamewood.net> Organization: Danville Regional Medical Center Sender: icon-group-request@cs.arizona.edu References: Subject: Re: another program with problems Errors-To: icon-group-errors@cs.arizona.edu Status: RO Stuart.Robinson@anu.edu.au (Stuart Robinson) wrote: >Hello. I'm sorry to keep posting my programs to comp.lang.icon for >editorial comments, but I have no local Icon support. Anyhow, I have a >program that is producing output that I wouldn't expect, given the input. >Here's the program: > ... omitted ... > while tab(upto("{") +1) do #move just past bracket (will >fail if there is none) > { > wordfrag := move(1) #wordfrag = one character past bracket > ... omitted ... >It seems the lines with a single curly brackets are being treated as lines >with "{O". What gives? > At a quick glance, I would say that on the lines with just open braces, the assignment to wordfrag fails, since the move(1) fails, since that is the end of the line. So wordfrag remains the last value it was assigned, which is "0". If you change the last {0 to something else, I bet the open brace lines will act like that instead. Try either doing if (wordfrag := move(1)) to protect the following code. Pete M. Wilson Gamewood Data Systems Internet Service wilsonpm@gamewood.net From icon-group-sender Thu Sep 25 08:07:18 1997 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by cheltenham.cs.arizona.edu (8.8.7/8.8.7) with SMTP id IAA27070 for ; Thu, 25 Sep 1997 08:07:12 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA11031; Thu, 25 Sep 1997 08:07:11 -0700 Date: Thu, 25 Sep 1997 02:53:07 -0500 Message-Id: <199709250753.CAA01958@segfault.cs.utsa.edu> From: Clinton Jeffery To: icon-group@cs.arizona.edu Subject: CGI scripting in Icon Reply-To: jeffery@cs.utsa.edu Errors-To: icon-group-errors@cs.arizona.edu Status: RO Those of you interested in Web programming might like to check out http://www.cs.utsa.edu/research/icon/cgi.html, which is a technical report describing CGI programming in Icon and a simple library (cgi.icn) that we've started using to simplify CGI programming in Icon. The library is nothing fancy at this point, so far it is a useful preliminary effort and I hope to improve it. I'd love feedback from others who are using Icon for CGI stuff. I'm interested in improving the correctness and content of the report, as well as suggestions of what else should be in the library, or pointers to other Icon programmers' CGI resources I might cite/adopt/merge with. Clint Jeffery, jeffery@cs.utsa.edu Division of Computer Science, The University of Texas at San Antonio Research http://www.cs.utsa.edu/research/plss.html From icon-group-sender Thu Sep 25 08:08:25 1997 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by cheltenham.cs.arizona.edu (8.8.7/8.8.7) with SMTP id IAA27086 for ; Thu, 25 Sep 1997 08:08:24 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA10175; Thu, 25 Sep 1997 08:08:24 -0700 Message-Id: <342A5E4D.3A32@wwnet.com> Date: Thu, 25 Sep 1997 08:51:25 -0400 From: Scott Helmke Reply-To: scott@wwnet.com X-Mailer: Mozilla 3.01C-WWNet (Win95; U) Mime-Version: 1.0 To: icon-group@cs.arizona.edu Subject: Re: Size limit on Icon programs? Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Errors-To: icon-group-errors@cs.arizona.edu Status: RO On further investigation... The .icn files add up to some 14k lines. I've gotten it down to being able to uncomment just 4 lines in a specific .icn file and the linker crashes. However, I was able to add many lines to another file with no problem. Clearly some resource is running out, but what? I can bundle these up with a makefile, where to send it? Thanks, Scott Helmke From icon-group-sender Fri Sep 26 12:41:39 1997 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by cheltenham.cs.arizona.edu (8.8.7/8.8.7) with SMTP id MAA22645 for ; Fri, 26 Sep 1997 12:41:38 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA09700; Fri, 26 Sep 1997 12:41:37 -0700 Message-Id: <342C0A4B.2E41@wwnet.com> Date: Fri, 26 Sep 1997 15:17:31 -0400 From: Scott Helmke Reply-To: scott@wwnet.com X-Mailer: Mozilla 3.01C-WWNet (Win95; U) Mime-Version: 1.0 To: icon-group@cs.arizona.edu Subject: Re: Size limit on Icon programs? Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Errors-To: icon-group-errors@cs.arizona.edu Status: RO In our previous episode, I had determined that even the latest version of Icon on my SCO Unix box still crashed during icont linking of my Icon code. Removing just a few lines makes the crash go away. Previous respondants are: Clinton Jeffery, "shouldn't be a limit, can you reproduce it?" Ralph Griswold, "The SCO compiler was pretty buggy, could that be it?" (remarks are paraphrased) More new info: I've downloaded the MS-DOS 386 binaries, and I can reproduce the crash, and then have it link successfully if I make the same source (my source, not the Icon source) changes as I do in the SCO platform. Here's what DOS icont.exe said when it crashed: Translating: cg.icn: main No errors Linking: ILLEGAL ADDRESS HAS CAUSED A PAGE FAULT absolute address = 1005BB38 DGROUP relative address = 0005BB38 error code = 0006 eax = 00009E34 esi = 0005BB34 flags = 3206 ds = 0033 ebx = 00009E30 edi = 00051D00 eip = 0000A89D es = 0033 ecx = 001569B2 ebp = 00000004 cs = 002B fs = 0000 edx = 0004B394 esp = DFFFE964 ss = 003B gs = 0000C:\DEV\DETA So, anybody interested? I can bundle up my source and put it somewhere, with works/fails versions of the appropriate file. Thanks, Scott Helmke From icon-group-sender Tue Oct 14 07:45:23 1997 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by cheltenham.cs.arizona.edu (8.8.7/8.8.7) with SMTP id HAA16875 for ; Tue, 14 Oct 1997 07:45:17 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA13932; Tue, 14 Oct 1997 07:45:17 -0700 From: gep2@computek.net Date: Thu, 9 Oct 1997 18:38:05 -0500 Message-Id: <199710092338.SAA11892@axp.cmpu.net> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Subject: CGI scripting in Icon To: icon-group@cs.arizona.edu X-Mailer: SPRY Mail Version: 04.00.06.17 Errors-To: icon-group-errors@cs.arizona.edu Status: RO > Those of you interested in Web programming might like to check out http://www.cs.utsa.edu/research/icon/cgi.html, which is a technical report describing CGI programming in Icon and a simple library (cgi.icn) that we've started using to simplify CGI programming in Icon. The library is nothing fancy at this point, so far it is a useful preliminary effort and I hope to improve it. I'd love feedback from others who are using Icon for CGI stuff. I'm interested in improving the correctness and content of the report, as well as suggestions of what else should be in the library, or pointers to other Icon programmers' CGI resources I might cite/adopt/merge with. I just dropped by and took a look at your report, and it certainly LOOKS reasonable enough on a casual read. At some point I'm going to have to start doing some of these things, so I've bookmarked your site. I do hope you plan to keep the report online. Gordon Peterson http://www.computek.net/public/gep2/ Support the Anti-SPAM Amendment! Join at http://www.cauce.org/ From icon-group-sender Mon Oct 20 08:09:52 1997 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by cheltenham.cs.arizona.edu (8.8.7/8.8.7) with SMTP id IAA26475 for ; Mon, 20 Oct 1997 08:09:50 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA19175; Mon, 20 Oct 1997 08:09:49 -0700 To: icon-group@cs.arizona.edu Date: Sun, 19 Oct 1997 15:44:33 +1000 From: Stuart.Robinson@anu.edu.au (Stuart Robinson) Message-Id: Organization: ANU Sender: icon-group-request@cs.arizona.edu Subject: counting letters Errors-To: icon-group-errors@cs.arizona.edu Status: RO What would be the best way to design an Icon program that takes a text file as input, counts up the instances of every letter in the alphabet (ignoring other characters and distinguishing between uppercase and lowercase letters), and spits out the results of the count as output? For example, the following input abcdefghjijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890!@#$%^&*() would produce the following output a 1 b 2 [etc.] A 1 b 2 [etc.] [nothing for the non-alphabetic characters] Cheers, Stuart Robinson -- Stuart Robinson The Australian National University *TO REPLY, REMOVE "no-spam." FROM E-MAIL ADDRESS GIVEN ABOVE From icon-group-sender Mon Oct 20 08:10:02 1997 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by cheltenham.cs.arizona.edu (8.8.7/8.8.7) with SMTP id IAA26483 for ; Mon, 20 Oct 1997 08:10:01 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA17674; Mon, 20 Oct 1997 08:10:00 -0700 To: icon-group@cs.arizona.edu Date: Sun, 19 Oct 1997 16:25:35 +1000 From: Stuart.Robinson@anu.edu.au (Stuart Robinson) Message-Id: Organization: ANU Sender: icon-group-request@cs.arizona.edu References: Subject: Re: counting letters Errors-To: icon-group-errors@cs.arizona.edu Status: RO Nevermind. I found a program in the program library that does the trick. Sorry for pestering everyone needlessly. Cheers, Stuart -- Stuart Robinson The Australian National University *TO REPLY, REMOVE "no-spam." FROM E-MAIL ADDRESS GIVEN ABOVE From icon-group-sender Mon Oct 20 12:33:06 1997 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by cheltenham.cs.arizona.edu (8.8.7/8.8.7) with SMTP id MAA28725 for ; Mon, 20 Oct 1997 12:33:06 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA19468; Mon, 20 Oct 1997 12:33:05 -0700 From: gep2@computek.net Date: Mon, 20 Oct 1997 12:11:29 -0500 Message-Id: <199710201711.MAA10989@axp.cmpu.net> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Subject: counting letters To: icon-group@cs.arizona.edu X-Mailer: SPRY Mail Version: 04.00.06.17 Errors-To: icon-group-errors@cs.arizona.edu Status: RO >What would be the best way to design an Icon program that takes a text file as input, counts up the instances of every letter in the alphabet (ignoring other characters and distinguishing between uppercase and lowercase letters), and spits out the results of the count as output? Define "best"... smallest, simplest, fastest, most elegant? >For example, the following input abcdefghjijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890!@#$%^&*() would produce the following output >a 1 b 2 [etc.] A 1 b 2 [etc.] [nothing for the non-alphabetic characters] In SNOBOL4+/SPITBOL, one program would be: -PLUSOPS 1 T = TABLE() CHRSET = &LCASE &UCASE GETREC LINE = INPUT :F(EOF) COUNT LINE BREAK(CHRSET) ANY(CHRSET) . LET = ?(T[LET] = T[LET] + 1) + :S(COUNT)F(GETREC) EOF A = SORT(TABLE,1) :F(DONE) LIST OUTPUT = A[(N = N + 1),1] " " A[N,2] :S(LIST) END Gordon Peterson http://www.computek.net/public/gep2/ Support the Anti-SPAM Amendment! Join at http://www.cauce.org/ From icon-group-sender Tue Oct 21 08:05:47 1997 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by cheltenham.cs.arizona.edu (8.8.7/8.8.7) with SMTP id IAA18421 for ; Tue, 21 Oct 1997 08:05:46 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA19492; Tue, 21 Oct 1997 08:05:46 -0700 Posted-Date: Mon, 20 Oct 1997 22:09:15 -0500 (CDT) Date: Mon, 20 Oct 1997 22:09:15 -0500 (CDT) From: Chris Tenaglia To: gep2@computek.net Cc: icon-group@cs.arizona.edu Subject: Re: counting letters In-Reply-To: <199710201711.MAA10989@axp.cmpu.net> Message-Id: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Errors-To: icon-group-errors@cs.arizona.edu Status: RO Brute force procedural icon... ____________________________________________________ procedure main() count := table(0) while line := read() do every byte := !line do if any(&letters,byte) then count[byte] +:= 1 every byte := !&letters do (count[byte] = 0) | write(byte," ",count[byte]) end ____________________________________________________ I'm sure there's briefer more collapsed method. This also ignores letters that don't occur, those with 0 occurrences. Chris Tenaglia (system manager) | The future foretold, Medical College of Wisconsin | The past explained, 8701 W. Watertown Plank Rd. | The present largely appologized for. Milwaukee, WI 53226 (414)456-8765 | Organon to the Doctor On Mon, 20 Oct 1997 gep2@computek.net wrote: > Date: Mon, 20 Oct 1997 12:11:29 -0500 > From: gep2@computek.net > To: icon-group@cs.arizona.edu > Subject: counting letters > > >What would be the best way to design an Icon program that takes a text > file as input, counts up the instances of every letter in the alphabet > (ignoring other characters and distinguishing between uppercase and > lowercase letters), and spits out the results of the count as output? > > Define "best"... smallest, simplest, fastest, most elegant? > > >For example, the following input > abcdefghjijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890!@#$%^&*() > would produce the following output > > >a 1 > b 2 > [etc.] > A 1 > b 2 > [etc.] > [nothing for the non-alphabetic characters] > > In SNOBOL4+/SPITBOL, one program would be: > > -PLUSOPS 1 > T = TABLE() > CHRSET = &LCASE &UCASE > GETREC LINE = INPUT :F(EOF) > COUNT LINE BREAK(CHRSET) ANY(CHRSET) . LET = ?(T[LET] = T[LET] + 1) > + :S(COUNT)F(GETREC) > EOF A = SORT(TABLE,1) :F(DONE) > LIST OUTPUT = A[(N = N + 1),1] " " A[N,2] :S(LIST) > END > > Gordon Peterson > http://www.computek.net/public/gep2/ > Support the Anti-SPAM Amendment! Join at http://www.cauce.org/ > > From icon-group-sender Tue Oct 21 08:05:58 1997 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by cheltenham.cs.arizona.edu (8.8.7/8.8.7) with SMTP id IAA18426 for ; Tue, 21 Oct 1997 08:05:56 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA20549; Tue, 21 Oct 1997 08:05:56 -0700 To: icon-group@cs.arizona.edu Date: 21 Oct 1997 01:52:27 GMT From: davepirtle@aol.com (DavePirtle) Message-Id: <19971021015201.VAA06430@ladder01.news.aol.com> Organization: AOL http://www.aol.com Sender: icon-group-request@cs.arizona.edu References: Subject: Re: counting letters Errors-To: icon-group-errors@cs.arizona.edu Status: RO In article , Stuart.Robinson@anu.edu.au (Stuart Robinson) writes: >Nevermind. I found a program in the program library that does the trick. >Sorry for pestering everyone needlessly. > >Cheers, >Stuart > > Well at least someone else reads this news group. Prometheus - Mankind's greatest benefactor Heracles - Mankind's greatest hero From icon-group-sender Tue Oct 21 12:23:58 1997 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by cheltenham.cs.arizona.edu (8.8.7/8.8.7) with SMTP id MAA21246 for ; Tue, 21 Oct 1997 12:23:57 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA21150; Tue, 21 Oct 1997 12:23:57 -0700 Date: Tue, 21 Oct 1997 08:27:29 -0700 From: swampler@noao.edu (Steve Wampler) Subject: Re: counting letters To: icon-group@cs.arizona.edu Message-Id: In-Reply-To: Errors-To: icon-group-errors@cs.arizona.edu Status: RO Chris Tenaglia wrote: > Brute force procedural icon... ... snip... > I'm sure there's briefer more collapsed > method. I have one of those, but haven't posted it because it's something only SNOBOL4 and APL fans would really appreciate...definitely not good 'Icon' style. If anyone's interested, I'll email it to you, but be prepared to spend some time figuring out how it works... -- Steve Wampler - swampler@gemini.edu [Gemini 8m Telescopes Project (under AURA)] O Sibile, si ergo, fortibus es inero. Nobile, demis trux. Demis phulla causan dux. From icon-group-sender Thu Oct 23 14:12:16 1997 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by cheltenham.cs.arizona.edu (8.8.7/8.8.7) with SMTP id OAA07274 for ; Thu, 23 Oct 1997 14:12:16 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA22536; Thu, 23 Oct 1997 14:12:15 -0700 To: icon-group@cs.arizona.edu Date: Fri, 24 Oct 1997 01:46:21 +1000 From: Stuart.Robinson@anu.edu.au (Stuart Robinson) Message-Id: Organization: ANU Sender: icon-group-request@cs.arizona.edu Subject: tabulating values Errors-To: icon-group-errors@cs.arizona.edu Status: RO Hello. I am trying to write up a program that takes a list of values and counts their frequency of occurence (like a word count, but with numbers). (I'll eventually make a histogram out of the results.) For example, given the following output 1 2 1 3 10 100 I'd like the following output value n 1 2 2 1 3 1 10 1 100 1 Is there something in the program library? I fished around but came up with nothing. Thanks in advance. Cheers, Stuart Robinson -- Stuart Robinson The Australian National University *TO REPLY, REMOVE "nospam." FROM E-MAIL ADDRESS GIVEN ABOVE From icon-group-sender Thu Oct 23 17:59:19 1997 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by cheltenham.cs.arizona.edu (8.8.7/8.8.7) with SMTP id RAA09006 for ; Thu, 23 Oct 1997 17:59:18 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA23922; Thu, 23 Oct 1997 17:59:18 -0700 From: gep2@computek.net Date: Thu, 23 Oct 1997 18:08:20 -0500 Message-Id: <199710232308.SAA04895@axp.cmpu.net> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Subject: tabulating values To: icon-group@cs.arizona.edu X-Mailer: SPRY Mail Version: 04.00.06.17 Errors-To: icon-group-errors@cs.arizona.edu Status: RO >Hello. I am trying to write up a program that takes a list of values and counts their frequency of occurence (like a word count, but with numbers). (I'll eventually make a histogram out of the results.) For example, given the following output 1 2 1 3 10 100 I'd like the following output value n 1 2 2 1 3 1 10 1 100 1 In fact, it's EXACTLY a "word" count... since a "word" can be made up of numeric characters just as well as alphabetic ones! Surely there are word count programs already in the library. The only thing that might be different would come when it's time to do the sort for the output, so you get them in the order you indicated and not in string-sort order (1,10,100,2,3...) but you can probably get that by just ensuring that you convert the values to numeric before storing them in your table (in SNOBOL4, and probably in ICON, you convert a numeric string variable value to a number by simply adding a unary "+" on the front of the variable name...) If there's not something in the library to do this, it's because the job is _so_ trivial that there's little reason to do a library routine for it... Gordon Peterson http://www.computek.net/public/gep2/ Support the Anti-SPAM Amendment! Join at http://www.cauce.org/ From icon-group-sender Fri Oct 24 08:39:27 1997 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by cheltenham.cs.arizona.edu (8.8.7/8.8.7) with SMTP id IAA26548 for ; Fri, 24 Oct 1997 08:39:26 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA24457; Fri, 24 Oct 1997 08:39:25 -0700 To: icon-group@cs.arizona.edu Date: 24 Oct 1997 03:16:42 GMT From: espie@litp.ibp.fr (Marc ESPIE) Message-Id: <62p3uq$sup$1@vishnu.jussieu.fr> Organization: LIAFA, Paris Sender: icon-group-request@cs.arizona.edu References: , Reply-To: espie@litp.ibp.fr Subject: Re: tabulating values Errors-To: icon-group-errors@cs.arizona.edu Status: RO In article , Stuart Robinson wrote: >Well, I've now received six responses to my query, none of which provide a >solution to the problem. I really do appreciate the responses, but four >of the responses consisted of people essentially saying "Heck, that's >trivial" without proving it by actually providing a working solution and >the two responses that did actually contain code failed to provide a >solution. Here they are: This problem is trivial... I'm sorry for you, I wish that people would at least check what they're writing before answering. >PROGRAM #1 >---------- >procedure main() > >t := table(0) >while t[!read()] +:= 1 this is the erroneous line. while t[read()] +:= 1 would be mostly correct. The !read() does what it should on a string, namely take every character one at a time. However, this won't truely work for numerical values, as it distinguishes 010 from 10... Try: while t[integer(read())] +:= 1 which will convert explicitly the line read to integer. Second catch: this one will fail as soon as you encounter a line that does not hold an integer number. I would write while n := read() do t[integer(n)] +:= 1 that way, I can add an error condition whenever integer() fails, and separate it from the stop condition of the main loop. >write("value n") >every i := !sort(t) do write(left(i[1], 9), left(i[2], 4)) >end >PROGRAM #2 >---------- >procedure main() > >count := table(0) >every n := read() do >count[n] +:= 1 > >write("value\tn") >every n := key(count) do >write(n, "\t", count[n]) This one should check what key() actually returns... which is a list. It does suffer from the same `string is not an integer as program #1'. Come on guys, when somebody asks a rather simple question, giving him an half-baked program that doesn't work won't probably give him a clue about what's wrong. Stuart: I'm curious about the way you're using Icon. If you're truely stuck with the program library as far as programming goes, you're only using a small part of Icon. How about trying to learn and program ? -- Marc Espie (espie@litp.ibp.fr) From icon-group-sender Fri Oct 24 08:39:33 1997 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by cheltenham.cs.arizona.edu (8.8.7/8.8.7) with SMTP id IAA26551 for ; Fri, 24 Oct 1997 08:39:33 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA24456; Fri, 24 Oct 1997 08:39:32 -0700 To: icon-group@cs.arizona.edu Date: Fri, 24 Oct 1997 12:58:06 +1000 From: Stuart.Robinson@anu.edu.au (Stuart Robinson) Message-Id: Organization: ANU Sender: icon-group-request@cs.arizona.edu References: Subject: Re: tabulating values Errors-To: icon-group-errors@cs.arizona.edu Status: RO Well, I've now received six responses to my query, none of which provide a solution to the problem. I really do appreciate the responses, but four of the responses consisted of people essentially saying "Heck, that's trivial" without proving it by actually providing a working solution and the two responses that did actually contain code failed to provide a solution. Here they are: PROGRAM #1 ---------- procedure main() t := table(0) while t[!read()] +:= 1 write("value n") every i := !sort(t) do write(left(i[1], 9), left(i[2], 4)) end PROGRAM #2 ---------- procedure main() count := table(0) every n := read() do count[n] +:= 1 write("value\tn") every n := key(count) do write(n, "\t", count[n]) end Assume the following input (note that the last three values are two and three digit figures): 1 2 3 10 10 100 The output I'd like would be something like the following: 1 1 2 1 3 1 10 2 100 1 Here is what each of the above-listed programs actually outputs: OUTPUT OF PROGRAM #1 -------------------- value n 1 4 2 1 3 1 OUTPUT OF PROGRAM #2 -------------------- value n 1 1 -- Stuart Robinson The Australian National University *TO REPLY, REMOVE "nospam." FROM E-MAIL ADDRESS GIVEN ABOVE From icon-group-sender Fri Oct 24 13:14:40 1997 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by cheltenham.cs.arizona.edu (8.8.7/8.8.7) with SMTP id NAA28882 for ; Fri, 24 Oct 1997 13:14:39 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA24995; Fri, 24 Oct 1997 13:14:39 -0700 From: gep2@computek.net Date: Fri, 24 Oct 1997 12:54:16 -0500 Message-Id: <199710241754.MAA08555@axp.cmpu.net> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Subject: Re: tabulating values To: icon-group@cs.arizona.edu X-Mailer: SPRY Mail Version: 04.00.06.17 Errors-To: icon-group-errors@cs.arizona.edu Status: RO > Well, I've now received six responses to my query, none of which provide a solution to the problem. Why are you asking those of us on the Net to do things for you which would appear to be your homework assignments? > I really do appreciate the responses, but four of the responses consisted of people essentially saying "Heck, that's trivial" without proving it by actually providing a working solution It's NOT as if something so evident requires a "proof". > and the two responses that did actually contain code failed to provide a solution. OK, let me give you a SNOBOL4/SPITBOL version of your "solution": -plusops 1 ;* (for SNOBOL4+ only) t = table() rdrec line = input :f(donerd) tabnum line span("0123456789") . n = :f(rdrec) t[+n] = t[+n] + 1 :(tabnum) donerd a = sort(t,1) :f(end) output = "number count" outlp output = rpad(a[(i = i + 1),1],9) a[i,2] :s(outlp) end The FACT, Stuart, is that my original post holds true. If you compare this program against the word count program (which you will CERTAINLY find in the Icon Program Library) you'll see that the technique used is essentially identical, except that (1) one is spanning numeric characters instead of alphabetic ones, and (2) the "+" used in front of the table index to make it integer type rather than string type. This program (or one nearly identical) is probably an example program used in nearly every SNOBOL4/ICON book ever published!!! And with a fairly trivial upgrade to it it would also handle signed numbers and decimal fractions, too. But the bigger issue still remains: why do you think we should be doing homework assignments for you, and why do you feel that we have to "prove" anything at all to you? For you to even ASK here for such a trivial program is to make it evident that you are unwilling (or unable) to pick up an Icon book and READ it, or to give half a moment's effort to trying to learn how to use this language. And either case is sad, because the language really is far too useful and interesting for you to devote such a pathetically poor effort to learning to use and understand it. (And besides, if you can't figure out the beginning-level stuff like this, you're NEVER going to successfully finish your later class assignments, anyhow, which will be complicated enough that you're not going to find people here on the newsgroup who will post working-and-tested solutions for you!). Gordon Peterson http://www.computek.net/public/gep2/ Support the Anti-SPAM Amendment! Join at http://www.cauce.org/ From icon-group-sender Fri Oct 24 13:14:12 1997 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by cheltenham.cs.arizona.edu (8.8.7/8.8.7) with SMTP id NAA28879 for ; Fri, 24 Oct 1997 13:14:11 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA24963; Fri, 24 Oct 1997 13:14:11 -0700 Date: Fri, 24 Oct 1997 09:01:17 -0700 From: swampler@noao.edu (Steve Wampler) Subject: Re: tabulating values To: icon-group@cs.arizona.edu Message-Id: In-Reply-To: <62p3uq$sup$1@vishnu.jussieu.fr> Errors-To: icon-group-errors@cs.arizona.edu Status: RO Marc ESPIE wrote: > > Come on guys, when somebody asks a rather simple question, giving him > an half-baked program that doesn't work won't probably give him a clue > about what's wrong. > > Stuart: I'm curious about the way you're using Icon. If you're truely > stuck with the program library as far as programming goes, you're only > using a small part of Icon. How about trying to learn and program ? Ok, here's one that works as I understand the problem: procedure main() counts := table(0) every counts[genNum()] +:= 1 counts := sort(counts,2) every i := *counts to 1 by -1 do { write(counts[i][1],"\t",counts[i][2]) } end procedure genNum() every line := !&input do line ? { while tab(upto(&digits)) do suspend tab(many(&digits)) \ 1 } end Also, you can adapt the countwords() procedure given on page 82 of the 3rd edition of the Icon book to do most of the work by changing &letters to &digits. Of course, you really should rename the procedure also! -- Steve Wampler - swampler@gemini.edu [Gemini 8m Telescopes Project (under AURA)] O Sibile, si ergo, fortibus es inero. Nobile, demis trux. Demis phulla causan dux. From icon-group-sender Mon Oct 27 09:45:21 1997 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by cheltenham.cs.arizona.edu (8.8.7/8.8.7) with SMTP id JAA00381 for ; Mon, 27 Oct 1997 09:45:17 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA25702; Mon, 27 Oct 1997 09:45:17 -0700 To: icon-group@cs.arizona.edu Date: Sat, 25 Oct 1997 16:03:48 +1000 From: Stuart.Robinson@anu.edu.au (Stuart Robinson) Message-Id: Organization: ANU Sender: icon-group-request@cs.arizona.edu References: , , <62p3uq$sup$1@vishnu.jussieu.fr> Subject: Re: tabulating values Errors-To: icon-group-errors@cs.arizona.edu Status: RO I got a number of useful responses. Thanks. Robert Clayton is especially deserving of thanks, since he not only gave me a program, but explained briefly how it works. (Teach a man to fish...) I've also attached a rather rude reply sent by Gordon Peterson . This typifies the sort of response I don't want! (By the way, these queries are NOT an attempt to get others to do my homework for me. I assume, though, that most people on the newsgroup never were under this erroneous--and, I might add, uncharitable--assumption.) === From: gep2@computek.net Date: Fri, 24 Oct 1997 12:54:16 -0500 Mime-Version: 1.0 Subject: Re: tabulating values To: icon-group@cs.arizona.edu X-Mailer: SPRY Mail Version: 04.00.06.17 Errors-To: icon-group-errors@cs.arizona.edu X-UIDL: 3293cc176c97dbe60efef2aee9954237 > Well, I've now received six responses to my query, none of which provide a solution to the problem. Why are you asking those of us on the Net to do things for you which would appear to be your homework assignments? > I really do appreciate the responses, but four of the responses consisted of people essentially saying "Heck, that's trivial" without proving it by actually providing a working solution It's NOT as if something so evident requires a "proof". > and the two responses that did actually contain code failed to provide a solution. OK, let me give you a SNOBOL4/SPITBOL version of your "solution": -plusops 1 ;* (for SNOBOL4+ only) t = table() rdrec line = input :f(donerd) tabnum line span("0123456789") . n = :f(rdrec) t[+n] = t[+n] + 1 :(tabnum) donerd a = sort(t,1) :f(end) output = "number count" outlp output = rpad(a[(i = i + 1),1],9) a[i,2] :s(outlp) end The FACT, Stuart, is that my original post holds true. If you compare this program against the word count program (which you will CERTAINLY find in the Icon Program Library) you'll see that the technique used is essentially identical, except that (1) one is spanning numeric characters instead of alphabetic ones, and (2) the "+" used in front of the table index to make it integer type rather than string type. This program (or one nearly identical) is probably an example program used in nearly every SNOBOL4/ICON book ever published!!! And with a fairly trivial upgrade to it it would also handle signed numbers and decimal fractions, too. But the bigger issue still remains: why do you think we should be doing homework assignments for you, and why do you feel that we have to "prove" anything at all to you? For you to even ASK here for such a trivial program is to make it evident that you are unwilling (or unable) to pick up an Icon book and READ it, or to give half a moment's effort to trying to learn how to use this language. And either case is sad, because the language really is far too useful and interesting for you to devote such a pathetically poor effort to learning to use and understand it. (And besides, if you can't figure out the beginning-level stuff like this, you're NEVER going to successfully finish your later class assignments, anyhow, which will be complicated enough that you're not going to find people here on the newsgroup who will post working-and-tested solutions for you!). Gordon Peterson http://www.computek.net/public/gep2/ Support the Anti-SPAM Amendment! Join at http://www.cauce.org/ -- Stuart Robinson The Australian National University *TO REPLY, REMOVE "nospam." FROM E-MAIL ADDRESS GIVEN ABOVE From icon-group-sender Mon Oct 27 09:46:16 1997 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by cheltenham.cs.arizona.edu (8.8.7/8.8.7) with SMTP id JAA00387 for ; Mon, 27 Oct 1997 09:46:15 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA26273; Mon, 27 Oct 1997 09:46:15 -0700 To: icon-group@cs.arizona.edu Date: 25 Oct 1997 14:14:17 GMT From: espie@litp.ibp.fr (Marc ESPIE) Message-Id: <62surp$rhj$1@vishnu.jussieu.fr> Organization: LIAFA, Paris Sender: icon-group-request@cs.arizona.edu References: Reply-To: espie@litp.ibp.fr Subject: Re: one more question Errors-To: icon-group-errors@cs.arizona.edu Status: RO get icon to sort numbers instead of strings, replace numcount[ tab( many( &digits ) ) ] with numcount[ integer(tab( many( &digits ) )) ] which incidentally was the main point in my previous post. -- Marc Espie (espie@litp.ibp.fr) From icon-group-sender Mon Oct 27 09:46:01 1997 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by cheltenham.cs.arizona.edu (8.8.7/8.8.7) with SMTP id JAA00384 for ; Mon, 27 Oct 1997 09:46:00 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA26110; Mon, 27 Oct 1997 09:46:00 -0700 To: icon-group@cs.arizona.edu Date: Sat, 25 Oct 1997 17:49:51 +1000 From: Stuart.Robinson@anu.edu.au (Stuart Robinson) Message-Id: Organization: ANU Sender: icon-group-request@cs.arizona.edu Subject: one more question Errors-To: icon-group-errors@cs.arizona.edu Status: RO Again, thanks to everyone for their help with what is admittedly a pretty trivial matter. It seems the key to my problem was tables, a structure that I didn't understand until someone pointed out their necessity and I read the appropriate section in _The Icon Programming Language_. (I mention this fact only to prevent people from thinking that I just want solutions handed to me on a silver platter) Anyhow, I just have one more question: Look at the program attached below (which is my modification of the proposed solution sent to me by Steven Wampler). The problem with it is this: I want to sort on the value being counted and not the counts themselves. However, the sorting is fairly "dumb" and puts e.g. "4" after e.g. "392" (looking at only the first digit). Is there a quick fix? Cheers, Stuart ############################################################################ # # File: tabl_values.icn # Subject: program written to do number count # Author: Steven Wampler (w/ modifications by Stuart Robinson) # Date: 25 October 1997 # ############################################################################ # # The main revision consists of the if clause in the procedure # countnums(), which now looks for lines with O's that had no # referential index and therefore have no lookback value. # ############################################################################ procedure main() counts := sort( countnums(), 1 ) # HEREIN LIES THE PROBLEM!!! every i := *counts to 1 by -1 do { write( counts[i][1] || "\t" || counts[i][2] ) } end procedure countnums() numcount := table(0) while line := read() do line ? { if find( "no ref index" ) then numcount[ "NA" ] +:= 1 else while tab( upto( &digits ) ) do numcount[ tab( many( &digits ) ) ] +:= 1 } return numcount end -- Stuart Robinson The Australian National University *TO REPLY, REMOVE "nospam." FROM E-MAIL ADDRESS GIVEN ABOVE From icon-group-sender Mon Oct 27 09:46:28 1997 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by cheltenham.cs.arizona.edu (8.8.7/8.8.7) with SMTP id JAA00390 for ; Mon, 27 Oct 1997 09:46:26 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA25482; Mon, 27 Oct 1997 09:46:25 -0700 To: icon-group@cs.arizona.edu Date: 25 Oct 1997 15:00:09 GMT From: nr@viper.cs.Virginia.EDU (Norman Ramsey) Message-Id: <62t1hp$1s1$1@murdoch.acc.Virginia.EDU> Organization: University of Virginia Sender: icon-group-request@cs.arizona.edu References: Subject: Re: one more question Errors-To: icon-group-errors@cs.arizona.edu Status: RO In article , Stuart Robinson wrote: > The problem with it is >this: I want to sort on the value being counted and not the counts >themselves. However, the sorting is fairly "dumb" and puts e.g. "4" after >e.g. "392" (looking at only the first digit). Is there a quick fix? integer(tab(many(&digits))) From icon-group-sender Mon Oct 27 09:48:29 1997 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by cheltenham.cs.arizona.edu (8.8.7/8.8.7) with SMTP id JAA00413 for ; Mon, 27 Oct 1997 09:48:29 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA26326; Mon, 27 Oct 1997 09:48:27 -0700 From: gep2@computek.net Date: Sat, 25 Oct 1997 16:31:57 -0500 Message-Id: <199710252131.QAA16388@ns1.cmpu.net> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Subject: Re: tabulating values To: icon-group@cs.arizona.edu X-Mailer: SPRY Mail Version: 04.00.06.17 Errors-To: icon-group-errors@cs.arizona.edu Status: RO >Date: Sat, 25 Oct 1997 15:58:18 +1000 To: gep2@computek.net From: Stuart.Robinson@anu.edu.au (Stuart Robinson) Subject: Re: tabulating values >Please do not send me any more e-mail. Okay, accordingly I am responding via the list. >Your responses are generally not very helpful and in this case downright rude. I'm sorry if my attempts to help haven't been helpful to you. Note that I *did* write and provide you with an complete example program (and, before that, a series of comments regarding the changes to widely available word count programs) that would satisfy your needs. And I genuinely am not as a rule a rude person, so I'm sorry if you took my comments that way. > And for your information, these are not my homework assignments. They are my attempts to learn a bit of Icon. I am new to programming and to Icon and sometimes can't find what I'm looking for in the book. I'm sorry if your problems looked to be "beginning programming 101" homework assignments. I understand that you clearly are not an accomplished programmer. But please understand that the reasons for my frustration with your approach to learning is that to successfully learn *any* programming language requires the ability and willingness to sit down with the book and STUDY how the language works, and what elements of the given example programs do what. Just asking people to supply you with a program that performs some trivial function is not going to help, particularly since if you're not willing to study and understand the MANY example programs in the Icon book, then you're probably not going to be willing to study and understand the programs you're asking us here on the newsgroup to write for you, either. If you want to learn Icon, you need to STUDY THE BOOK and UNDERSTAND THE EXAMPLES THERE. If you understand how the stuff in the book works, and why, then you'll see that a lot of the questions you're posting here look pretty silly. If you are *completely* lost in even the first-level introductory material in the book (which is the kind of stuff we're dealing with here) then there's little point in trying to go for more advanced material before you understand the basics. > Since I have no local support, I use usenet. Isn't that's what it's for? (Rhetorical Q, I don't want an answer.) I would hope that even most beginning programmers are willing to devote at least a smidgen of independent study and trying to understand the material in question (and Icon has a LOT of introductory material available... including the book "Icon Programming for Humanists" which is oriented towards linguists and other liberal-arts types rather than just CompSci jocks) before they come to others for "local support". Back in my Intelec BBS programming group days, we had a couple of common taglines, expressing related tongue-in-cheek thoughts: "Why RTFM, when you can just post a message To: ALL ?" "Why RTFM, when you can just call the shareware author at home?" Again, if you are ever going to learn to program successfully (in Icon or indeed almost any other programming language) it is going to require a modicum of effort... especially at the beginning, when you're trying to grasp some of the admittedly obtuse concepts you simply have to grasp before getting very far (and hey, I know that I struggled too, back in college, to understand pointers and linked lists and dynamic data structures and recursion and things like that). If you are going to ever learn Icon, it's NOT going to be by us here on the Icon discussion list leading you by the hand every single step of the way... you're going to have to put in at least some independent effort, and the book is there to support you for about 98% of that. I'm sure that I and many of the other people here on the mailing list will be happy to try to assist you if, after trying to grasp some concept or debug some unfathomable problem, you really and truly need help to get you over that hump. But up to now, the kinds of questions you're asking betray that you really haven't put forth even a modicum of effort at studying and trying to understand the material that IS available in the book for that purpose. And THAT is why we're frustrated with your posts. If there is something in the book that REALLY is unclear, after giving it significant effort, *then* ask us to explain the *specific* part of it that you don't understand. Or, post the program YOU wrote that you couldn't get to work, so we can show you where you might have gone astray. IT IS NORMAL TO FEEL LOST AND CONFUSED when you're first getting into computer programming... there are a LOT of alien concepts you simply have to manage to wrap your mind around. But you CAN succeed at doing that. You will probably NOT succeed at achieving it, however, by just asking other people to write full and completely working programs for you. And especially not if you put as little effort into studying the programs WE write for you as you apparently have into studying the examples in the book. :-( Gordon Peterson http://www.computek.net/public/gep2/ Support the Anti-SPAM Amendment! Join at http://www.cauce.org/ From icon-group-sender Mon Oct 27 09:48:48 1997 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by cheltenham.cs.arizona.edu (8.8.7/8.8.7) with SMTP id JAA00416 for ; Mon, 27 Oct 1997 09:48:48 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA26280; Mon, 27 Oct 1997 09:48:47 -0700 To: icon-group@cs.arizona.edu Date: Sun, 26 Oct 1997 12:37:48 +1000 From: Stuart.Robinson@anu.edu.au (Stuart Robinson) Message-Id: Organization: ANU Sender: icon-group-request@cs.arizona.edu References: Subject: Re: one more question Errors-To: icon-group-errors@cs.arizona.edu Status: RO Thanks. That's pretty easy, isn't it? Marc, sorry for overlooking your previous posting. By the way, does anyone know of an Icon programmer at the ANU who I could talk to face to face about Icon. It would make the learning process a lot more straightforward. (It would also mean I'd post less silly questions.) Cheers, Stuart -- Stuart Robinson The Australian National University *TO REPLY, REMOVE "nospam." FROM E-MAIL ADDRESS GIVEN ABOVE From icon-group-sender Mon Oct 27 14:34:36 1997 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by cheltenham.cs.arizona.edu (8.8.7/8.8.7) with SMTP id OAA02878 for ; Mon, 27 Oct 1997 14:34:35 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA26382; Mon, 27 Oct 1997 14:34:35 -0700 From: gep2@computek.net Date: Mon, 27 Oct 1997 11:37:18 -0600 Message-Id: <199710271737.LAA11104@ns1.cmpu.net> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Subject: Re: one more question To: icon-group@cs.arizona.edu X-Mailer: SPRY Mail Version: 04.00.06.17 Errors-To: icon-group-errors@cs.arizona.edu Status: RO > By the way, does anyone know of an Icon programmer at the ANU who I could talk to face to face about Icon. It would make the learning process a lot more straightforward. (It would also mean I'd post less silly questions.) You might want to check with the Computer Science department there at the University, surely they'd have someone there who knows of a sharp student looking for a short part-time job and who wouldn't mind tutoring a beginner. Gordon Peterson http://www.computek.net/public/gep2/ Support the Anti-SPAM Amendment! Join at http://www.cauce.org/ From icon-group-sender Tue Oct 28 10:52:56 1997 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by cheltenham.cs.arizona.edu (8.8.7/8.8.7) with SMTP id KAA23576 for ; Tue, 28 Oct 1997 10:52:56 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA27456; Tue, 28 Oct 1997 10:52:55 -0700 Message-Id: <199710281655.QAA12246@holyrood.ed.ac.uk> Date: 28 Oct 97 16:55:53 GMT From: Roger Hare Subject: latex2html To: icon-group@cs.arizona.edu Reply-To: rjhare@ed.ac.uk Organisation: Edinburgh Parallel Computing Centre Errors-To: icon-group-errors@cs.arizona.edu Status: RO Hm! Anyone written a latex2html-like translator in Icon - so much is different in our local latex setup that I'd like something I can hack to take accvount ount of our local differences. Thanks. Roger Hare From icon-group-sender Thu Oct 30 08:35:24 1997 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id IAA25703 for ; Thu, 30 Oct 1997 08:35:23 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA28518; Thu, 30 Oct 1997 08:35:22 -0700 To: icon-group@optima.CS.Arizona.EDU Date: Thu, 30 Oct 1997 16:44:36 +1000 From: Stuart.Robinson@anu.edu.au (Stuart Robinson) Message-Id: Organization: ANU Sender: icon-group-request@optima.CS.Arizona.EDU Subject: error in startup code: icode file name too long Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO What does the error message "icode file name too long" mean? I encountered it while running a program on ProIcon. Thanks in advance. -- Stuart Robinson The Australian National University *TO REPLY, REMOVE "nospam." FROM E-MAIL ADDRESS GIVEN ABOVE From icon-group-sender Thu Oct 30 08:36:03 1997 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id IAA25711 for ; Thu, 30 Oct 1997 08:36:03 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA28663; Thu, 30 Oct 1997 08:36:02 -0700 To: icon-group@optima.CS.Arizona.EDU Date: Thu, 30 Oct 1997 16:27:31 +1000 From: Stuart.Robinson@anu.edu.au (Stuart Robinson) Message-Id: Organization: ANU Sender: icon-group-request@optima.CS.Arizona.EDU Subject: problem with data type in program Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Hello, everyone. I wanted to apologise for causing a stir with my last couple of postings. It has been brought to my attention that they gave the impression of not only an unwillingnes to actually learn Icon but also ingratitude towards those who have helped me in the past. This is not the impression that I wish to give the readers of this newsgroup, because I am keen to learn to program well in Icon and I sincerely appreciate all of the help that I have received thus far. With that said, I would like to solicit help with a program that is causing me problems. It is, I think, less trivial than my query about tabulating values (which was admittedly trivial and should not have been posted in the first place). The problem is this. I am getting error messages saying that the main procedure expects a table does not get one from the procedure it invokes--namely, scantext(). But it looks to me as if the value returned by scantext() should be a table. What am I doing wrong? Thanks in advance for any help. Regards, Stuart Robinson ############################################################################ # # File: tabulate_AO_person.icn # Subject: Program to tabulate person of A and O # Author: Stuart P. Robinson # Date: 14 October, 1997 # ############################################################################ # # This program was written to calculate what proportion of A's and O's # are 1st, 2nd, or 3rd person. Unlike previous version, it does NOT give # percentages--just raw numbers. The 7 logical possibilities it counts are: # # 1. 1-2 first_on_second # 2. 1-3 first_on_third # 3. 2-1 second_on_first # 4. 2-3 second_on_third # 5. 3-1 third_on_first # 6. 3-2 third_on_second # 7. 3-3 third_on_third # ############################################################################ procedure main() output := sort( scan_text(), 1 ) write( "Person Config." || "/t" || "No." ) every x := key( output ) do write( x || "\t" || output[x] ) end procedure scan_text( ) value_table := table( 0 ) while line := read() do { line ? { value_table[ search_line() ] +:= 1 } } return value_table end procedure search_line( ) chars := &letters++&digits++'{`' subject := 0 object := 0 if find( "{Q" ) then while tab( upto( chars ) ) do { word := tab( many( chars ) ) word ? { if tab( find( "{" ) ) then word := tab( 0 ) case word of { "{A1" : subject := 1 "{A2" : subject := 2 "{A" : subject := 3 "{O1" : object := 1 "{O2" : object := 2 "{O" : object := 3 } } } if subject == 1 then if object == 2 then type := "first on second" else if object == 3 then type := "first on third" if subject == 2 then if object == 1 then type := "second on first" else if object == 3 then type := "second on third" if subject == 3 then if object == 1 then type := "third on first" else if object == 2 then type := "third on second" else if object == 3 then type := "third on third" return type end -- Stuart Robinson The Australian National University *TO REPLY, REMOVE "nospam." FROM E-MAIL ADDRESS GIVEN ABOVE From icon-group-sender Thu Oct 30 13:20:31 1997 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id NAA21157 for ; Thu, 30 Oct 1997 13:20:30 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA29315; Thu, 30 Oct 1997 13:20:30 -0700 Posted-Date: Thu, 30 Oct 1997 11:03:26 -0600 (CST) Message-Id: <1.5.4.32.19971030170253.007560a4@post.its.mcw.edu> X-Sender: cdt@post.its.mcw.edu X-Mailer: Windows Eudora Light Version 1.5.4 (32) Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Date: Thu, 30 Oct 1997 11:02:53 -0600 To: icon-group@optima.CS.Arizona.EDU From: Chris Tenaglia Subject: gophweb Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Greetings. I have this fun project to convert an old gopher menu into HTML web pages. The actual data is nested in a deep directory structure. I've been able to write an icon program to scan the gopher directories and generate a huge flat file (27MB of text). Now the next step is converting to HTML. Before I invent this gophweb wheel, I wonder if anyone has invented it already? That would save me some typing. If not, wish me luck! Chris. From icon-group-sender Thu Oct 30 13:21:36 1997 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id NAA21178 for ; Thu, 30 Oct 1997 13:21:35 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA29172; Thu, 30 Oct 1997 13:21:35 -0700 From: gep2@computek.net Date: Thu, 30 Oct 1997 12:53:03 -0600 Message-Id: <199710301853.MAA25014@axp.cmpu.net> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Subject: problem with data type in program To: icon-group@optima.CS.Arizona.EDU X-Mailer: SPRY Mail Version: 04.00.06.17 Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO >The problem is this. I am getting error messages saying that the main procedure expects a table does not get one from the procedure it invokes--namely, scantext(). But it looks to me as if the value returned by scantext() should be a table. What am I doing wrong? >Thanks in advance for any help. The most basic debugging technique for a situation like this is to make sure that the program is ACTUALLY running the way you EXPECTED it to... that data values are as you expected, that transfers of control are taking place the way you wanted them to, etc. etc. And it helps if, when writing a program, you can design in features to facilitate the initial debugging... and such that they can be turned off or removed (ideally, progressively) after parts or all of the program are working. And part of designing in debugging output is knowing where you should and shouldn't put it, so that you get useful output without drowning in it. :-) Let me take your program and show you, for example, what kind of debugging output I'm talking about (and note that there is no one way to do stuff like this... you might want more or less... or even done differently... but at least putting stuff like the following in, and STUDYING WHAT OUTPUT the program then produces, will help you to understand what your program REALLY does (and, especially for beginning programmers but sometimes even for us experienced ones, programs do NOT always follow what my CS professor used to call "The Principle of Least Astonishment".... :-) I will not mark quotes during the program text, but will indicate my additions by using a ">>>>>>" at the beginning of the example debugging lines I've added. ############################################################################ # # File: tabulate_AO_person.icn # Subject: Program to tabulate person of A and O # Author: Stuart P. Robinson # Date: 14 October, 1997 # ############################################################################ # # This program was written to calculate what proportion of A's and O's # are 1st, 2nd, or 3rd person. Unlike previous version, it does NOT give # percentages--just raw numbers. The 7 logical possibilities it counts are: # # 1. 1-2 first_on_second # 2. 1-3 first_on_third # 3. 2-1 second_on_first # 4. 2-3 second_on_third # 5. 3-1 third_on_first # 6. 3-2 third_on_second # 7. 3-3 third_on_third # ############################################################################ procedure main() >>>>>> write("procedure main starting") output := sort( scan_text(), 1 ) >>>>>> write("size of output after sorting is ",*output) write( "Person Config." || "/t" || "No." ) every x := key( output ) do write( x || "\t" || output[x] ) >>>>>> write("procedure main is finished") end procedure scan_text( ) value_table := table( 0 ) >>>>>> write("scan_text starting") while line := read() do { >>>>>> write("processing line: '",line,"'") line ? { value_table[ search_line() ] +:= 1 } } >>>>>> write("scan_text is returning a value of type ",type(value_table)) return value_table end procedure search_line( ) >>>>>> write("search_line starting") chars := &letters++&digits++'{`' subject := 0 object := 0 if find( "{Q" ) then while tab( upto( chars ) ) do { word := tab( many( chars ) ) >>>>>> write(" word found: '",word,"'") word ? { if tab( find( "{" ) ) then word := tab( 0 ) >>>>>> write(" case statement test being started with word: '",word,"'") case word of { "{A1" : subject := 1 "{A2" : subject := 2 "{A" : subject := 3 "{O1" : object := 1 "{O2" : object := 2 "{O" : object := 3 } } } >>>>>> write(" after case statement test, subject=",subject," object=",object) if subject == 1 then if object == 2 then type := "first on second" else if object == 3 then type := "first on third" if subject == 2 then if object == 1 then type := "second on first" else if object == 3 then type := "second on third" if subject == 3 then if object == 1 then type := "third on first" else if object == 2 then type := "third on second" else if object == 3 then type := "third on third" >>>>>> write("search_line is returning '",type,"'") return type end Running the program with that debugging output, and STUDYING THE RESULT, will help you to understand how the program you've written is ACTUALLY working, and help you to see where it's not ACTUALLY working the way you intended for it to. Gordon Peterson http://www.computek.net/public/gep2/ Support the Anti-SPAM Amendment! Join at http://www.cauce.org/ From icon-group-sender Mon Nov 3 09:24:53 1997 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id JAA25254 for ; Mon, 3 Nov 1997 09:24:52 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA31671; Mon, 3 Nov 1997 09:24:52 -0700 Message-Id: <199711010358.OAA16052@anugpo.anu.edu.au> X-Sender: s9551814@pophost.anu.edu.au Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Date: Sat, 1 Nov 1997 15:03:58 +1000 To: icon-group@optima.CS.Arizona.EDU From: Stuart.Robinson@anu.edu.au (Stuart Robinson) Subject: second edition of _The Icon Programming Manual_ Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Hello, one and all. Does anyone have a copy of the second edition of _The Icon Programming Manual_ that they would like to sell? It is apparently sold out and I would like to obtain a copy since I am told that that edition has exercises in addition to examples. Thanks in advance. Regards, Stuart Robinson -- Stuart Robinson Linguistics Department Australian National University Canberra ACT 0200 FAX: 61-6-279-8214 From icon-group-sender Mon Nov 3 09:25:09 1997 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id JAA25292 for ; Mon, 3 Nov 1997 09:25:08 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA31650; Mon, 3 Nov 1997 09:25:08 -0700 To: icon-group@optima.CS.Arizona.EDU Date: Sat, 01 Nov 1997 14:58:19 +1000 From: Stuart.Robinson@anu.edu.au (Stuart Robinson) Message-Id: Organization: ANU Sender: icon-group-request@optima.CS.Arizona.EDU References: Subject: Re: problem with data type in program Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Thanks to everyone who responded to my plea for help with my problematic program. The main problem was that I sorted() a table, thereby converting it into a list, and then tried to use key() on the resultant list (which I mistakenly thought would be a table). Cheers, Stuart -- Stuart Robinson The Australian National University *TO REPLY, REMOVE "nospam." FROM E-MAIL ADDRESS GIVEN ABOVE From icon-group-sender Wed Nov 5 12:42:34 1997 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id MAA06620 for ; Wed, 5 Nov 1997 12:42:34 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA00577; Wed, 5 Nov 1997 12:42:33 -0700 To: icon-group@optima.CS.Arizona.EDU Date: Wed, 05 Nov 1997 07:51:59 -0800 From: Mark Emmer Message-Id: <3460961F.523C@SNOBOL4.com> Organization: Catspaw, Inc. Sender: icon-group-request@optima.CS.Arizona.EDU References: Reply-To: marke@SNOBOL4.com Subject: Re: error in startup code: icode file name too long Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Stuart Robinson wrote: > > What does the error message "icode file name too long" mean? I > encountered it while running a program on ProIcon. > > Thanks in advance. Is the file buried down many levels in your folder tree? Internally, ProIcon expands file names into a full path name, and the Mac's Pascal-style strings use a one-byte count at the beginning of string. Hence, full path names are limited to 255 characters. ----- note address change from marke@rmi.net to marke@SNOBOL4.com ----- Mark B. Emmer Voice: 719-539-3884 Specialties: Catspaw, Inc. FAX: 719-539-4830 SNOBOL4 & SPITBOL P.O. Box 1123 marke@SNOBOL4.com SCSI Firmware Design Salida, CO 81201 USA http://www.SNOBOL4.com Embedded Systems ----------------------------------------------------------------------- From icon-group-sender Thu Nov 6 13:20:27 1997 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id NAA07544 for ; Thu, 6 Nov 1997 13:20:17 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA02628; Thu, 6 Nov 1997 13:20:17 -0700 To: icon-group@optima.CS.Arizona.EDU Date: 6 Nov 1997 12:34:07 GMT From: andersh@maths.lth.se (Anders Holtsberg) Message-Id: <63sdfv$q4d$1@news.lth.se> Organization: Lund Institute of Technology, Sweden Sender: icon-group-request@optima.CS.Arizona.EDU Subject: Graphics suggestion Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO I'm thinking of two small projects that I want to be executable under UNIX, Win32 and Mac. They involve simple graphics. Now, Icon is one very good way to go for me if it weren't for graphic support lacking. The other two ways seem to be Java or C++ in combination with vxWindows library (or similar) which should run on all platforms. Java seems OK but the other one is time consuming as we all know. Still I'd prefer Icon. Now a straight question to you developers: Can't you use e g vxWindows cross platform library directly when developping Icon? Then it would run on a bunch of platforms with rather minimal changes in source code, i e no extra job for you! It would be great to have graphics on all platforms! Never mind if all bells and whistles aren't there on all platforms, just get it up running! best wishes Anders Holtsberg -- === Anders Holtsberg ================================================= Department of Mathematical Statistics Phone +46 46 222 8550 Lund University Fax +46 46 222 4623 Box 118 andersh@maths.lth.se From icon-group-sender Thu Nov 6 13:20:46 1997 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id NAA07556 for ; Thu, 6 Nov 1997 13:20:44 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA02672; Thu, 6 Nov 1997 13:20:44 -0700 To: icon-group@optima.CS.Arizona.EDU Date: 6 Nov 1997 16:45:37 GMT From: jeffery@cs.utsa.edu (Clinton Jeffery) Message-Id: <63ss7h$n0q@ringer.cs.utsa.edu> Organization: The University of Texas at San Antonio Sender: icon-group-request@optima.CS.Arizona.EDU References: <63sdfv$q4d$1@news.lth.se> Reply-To: jeffery@cs.utsa.edu Subject: Re: Graphics suggestion Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Anders Holtsberg (andersh@maths.lth.se) wrote: : I'm thinking of two small projects that I want... under UNIX, Win32 and Mac. : Now, Icon is one very good way to : go for me if it weren't for graphic support lacking. Presently we support graphics on UNIX and Win32. We would love to support the Mac, and hope to some day, but this sort of thing is done by volunteers from the user community. We have a substantial start, to about an alpha-test level, but so for no one with sufficient Mac expertise has stepped in and completed the job. : Now a straight question to you developers: Can't you use e g vxWindows : cross platform library directly when developping Icon? Then it would run : on a bunch of platforms with rather minimal changes in source code, i e : no extra job for you! It would be great to have graphics on all platforms! Gee, it sure would! Why don't you write it? This would be a HUGE "extra job" for us! We don't know vxwindows! Never heard of it! Is it public domain? Is it a heavily-used and industrially-supported library with its own web site, newsgroup, and so forth? Is it a de facto standard for developing applications on each platform? Really, we would have loved a suitable cross-platform library when we started implementing Icon's graphics, but it didn't exist back then. If it exists now, it isn't obvious to me. I've seen mostly expensive commercial cross-platform libraries; the few freeware products that might do the job haven't become widely adopted enough to give confidence. Java is starting to come close, and it would be cool if the Java implementation of Icon supported graphics, but I don't expect that to happen any time soon. So, Anders, why don't you implement a vxwindows-based version of Icon? I'll be glad to provide advice and assistance with testing it, and I have a technical report on the graphics facilities implementation for you to read. :-) -- Clint Jeffery, jeffery@cs.utsa.edu Division of Computer Science, The University of Texas at San Antonio Research http://www.cs.utsa.edu/research/plss.html From icon-group-sender Fri Nov 7 08:02:40 1997 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id IAA01362 for ; Fri, 7 Nov 1997 08:02:40 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA02689; Fri, 7 Nov 1997 08:02:39 -0700 To: icon-group@optima.CS.Arizona.EDU Date: Thu, 6 Nov 1997 10:50:38 -0800 From: Brian Rogoff Message-Id: Sender: icon-group-request@optima.CS.Arizona.EDU References: <63sdfv$q4d$1@news.lth.se>, <63ss7h$n0q@ringer.cs.utsa.edu> Subject: Re: Graphics suggestion Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO On 6 Nov 1997, Clinton Jeffery wrote: > Anders Holtsberg (andersh@maths.lth.se) wrote: > : Now a straight question to you developers: Can't you use e g vxWindows > : cross platform library directly when developping Icon? Then it would run > : on a bunch of platforms with rather minimal changes in source code, i e > : no extra job for you! It would be great to have graphics on all platforms! > > ... snip ... > > Really, we would have loved a suitable cross-platform library when we > started implementing Icon's graphics, but it didn't exist back then. If it > exists now, it isn't obvious to me. Tk? > I've seen mostly expensive commercial > cross-platform libraries; the few freeware products that might do the job > haven't become widely adopted enough to give confidence. Tk seems to fit the bill for me here, but opinions vary of course. There are Perl-Tk, Python-Tk, ML-Tk, etc. Numerous commercial and free products are built with Tk, and it seems fairly stable now. > Java is starting > to come close, and it would be cool if the Java implementation of Icon > supported graphics, but I don't expect that to happen any time soon. It would also be nice if Icon snarfed the Java package system, or something better. Maybe in Idol? :-). You should probably wait a while before trying to use Java graphics APIs, as they don't seem to have settled yet. -- Brian From icon-group-sender Fri Nov 7 08:02:55 1997 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id IAA01365 for ; Fri, 7 Nov 1997 08:02:54 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA03250; Fri, 7 Nov 1997 08:02:54 -0700 To: icon-group@optima.CS.Arizona.EDU Date: 7 Nov 1997 11:14:33 GMT From: andersh@maths.lth.se (Anders Holtsberg) Message-Id: <63ut6p$icj$1@news.lth.se> Organization: Lund Institute of Technology, Sweden Sender: icon-group-request@optima.CS.Arizona.EDU References: <63sdfv$q4d$1@news.lth.se>, <63ss7h$n0q@ringer.cs.utsa.edu>, Subject: Re: Graphics suggestion Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Clint Jeffery, wrote >So, Anders, why don't you implement a vxwindows-based version >of Icon? Brian Rogoff wrote >Tk seems to fit the bill for me here, but opinions vary of course. >There are Perl-Tk, Python-Tk, ML-Tk, etc. Numerous commercial and >products are built with Tk, and it seems fairly stable now. Yes I got two other replies by email that pointed me to Tk and I have in fact ordered the book today since it seems like this is the way to go whether doing it from c or Python or Icon. I had no idea of the huge support of Tk. What would be preferable, a straight Icon-Tk connection or a connection that tries to follow the present Icon graphic conventions? I guess that the former is easy and the latter is better. Not that I _plan_ to do anything but I'm playing with the thought of having a fun christmas project... -- === Anders Holtsberg ================================================= Department of Mathematical Statistics Phone +46 46 222 8550 Lund University Fax +46 46 222 4623 Box 118 andersh@maths.lth.se From icon-group-sender Fri Nov 7 13:07:59 1997 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id NAA29731 for ; Fri, 7 Nov 1997 13:07:45 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA03636; Fri, 7 Nov 1997 13:07:45 -0700 Date: Fri, 7 Nov 1997 11:49:14 -0600 Message-Id: <199711071749.LAA25967@segfault.cs.utsa.edu> From: Clinton Jeffery To: andersh@maths.lth.se Cc: icon-group@optima.CS.Arizona.EDU In-Reply-To: <63ut6p$icj$1@news.lth.se> (andersh@maths.lth.se) Subject: Re: Graphics suggestion Reply-To: jeffery@cs.utsa.edu Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Brian Rogoff wrote, regarding portable graphics: > There are Perl-Tk, Python-Tk, ML-Tk, etc. Numerous commercial and free > products are built with Tk, and it seems fairly stable now. Yup, Tk seems like a strong option, and there are probably several Tk users in our community who could help build and/or test it. Anders writes: > What would be preferable, a straight Icon-Tk connection or a > connection that follows the present Icon graphic conventions? Good question! There are strong advantages to both. A straight Icon-Tk connection would provide facilities for more flexible user interface construction. A connection that implements our interface would provide somewhat better support for graphics programming. Whether or not it provided a portable straight-Tk interface, a Tk-Icon wouldn't solve our portability goals unless it supported our graphics interface on the Mac and maybe additional platforms. Clint Jeffery, jeffery@cs.utsa.edu From icon-group-sender Wed Nov 12 09:59:31 1997 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id JAA27035 for ; Wed, 12 Nov 1997 09:59:23 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA07280; Wed, 12 Nov 1997 09:59:23 -0700 To: icon-group@optima.CS.Arizona.EDU Date: Mon, 10 Nov 1997 10:58:46 -0500 From: Chris Lusena Message-Id: Organization: University of Kentucky Computing Services Sender: icon-group-request@optima.CS.Arizona.EDU Subject: Regular Expressions Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO For part of a class project I need/like to be able to find all occanses of a Regular Expression in a ASCII file. Icon seams that is might be good for this, since one can fine all occurance of a word easly. So how would one go about this? I'd like to be able to serach for the Reg. Exp. over line breaks if possable. Thanks in advance foryou time and help. --Chris Lusena U of Kentucky, Dept. of Com. Sci. Just a plain boring .SIG, eh? Lexington, Kentucky, U.S.A. email: Lusena@cs.engr.uky.edu #include and for the webbies out there: http://www.cs.engr.uky.edu/~lusena/ From icon-group-sender Wed Nov 12 16:25:11 1997 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id QAA07730 for ; Wed, 12 Nov 1997 16:25:11 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA07668; Wed, 12 Nov 1997 16:25:11 -0700 From: gep2@computek.net Date: Wed, 12 Nov 1997 14:14:34 -0600 Message-Id: <199711122014.OAA02574@axp.cmpu.net> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Subject: Regular Expressions To: icon-group@optima.CS.Arizona.EDU X-Mailer: SPRY Mail Version: 04.00.06.17 Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO >For part of a class project I need/like to be able to find all occanses of a Regular Expression in a ASCII file. Icon seams that is might be good for this, since one can fine all occurance of a word easly. The problem is that RegExes are a truly braindead way to express a pattern, and although RegExes were inspired by SNOBOL4 (which also inspired Icon, of course) the RegEx thing is really in a number of ways a different beast than a full-fledged pattern match or string scan like you'd do with SNOBOL4/SPITBOL or Icon, respectively. If you're looking for something, S*BOL or Icon either one go *way* beyond what you might reasonably hope to do with RegExes. >So how would one go about this? Do you HAVE to use RegExes? Or are S*BOL patterns or Icon string scanning techniques acceptable alternatives? >I'd like to be able to serach for the Reg. Exp. over line breaks if possable. That's fairly trivial, one simple way to do it is to append pairs of consecutive lines together prior to the match (assuming that a given match will not extend across more than two lines...) Gordon Peterson http://www.computek.net/public/gep2/ Support the Anti-SPAM Amendment! Join at http://www.cauce.org/ From icon-group-sender Wed Nov 12 16:24:56 1997 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id QAA07678 for ; Wed, 12 Nov 1997 16:24:56 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA08248; Wed, 12 Nov 1997 16:24:55 -0700 Sender: rpereda@ringer.cs.utsa.edu Message-Id: <346A07C2.4CAC@cs.utsa.edu> Date: Wed, 12 Nov 1997 13:47:14 -0600 From: Ray Pereda X-Mailer: Mozilla 3.0 (X11; I; SunOS 5.5 sun4m) Mime-Version: 1.0 To: Chris Lusena Cc: icon-group@optima.CS.Arizona.EDU Subject: Re: Regular Expressions References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Chris, There is an excellent regular expression kit in the Icon Programming Library written by Robert Alexander. Look for the file regexp.icn. Here is an example that extracts all the numbers from a text file: link regexp procedure main() text := "" while text ||:= read() num_pattern := "\\d+(\\.\\d+)?" text ? { while tab(ReFind(num_pattern)) do { number := tab(ReMatch(num_pattern)) write(number) } } end -ray Chris Lusena wrote: > > For part of a class project I need/like to be able to find all > occanses of a Regular Expression in a ASCII file. Icon seams that is might > be good for this, since one can fine all occurance of a word easly. > > So how would one go about this? I'd like to be able to serach for the Reg. > Exp. over line breaks if possable. > > Thanks in advance foryou time and help. > > --Chris Lusena U of Kentucky, Dept. of Com. Sci. > Just a plain boring .SIG, eh? Lexington, Kentucky, U.S.A. > email: Lusena@cs.engr.uky.edu #include > and for the webbies out there: http://www.cs.engr.uky.edu/~lusena/ From icon-group-sender Thu Nov 13 09:37:10 1997 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id JAA16785 for ; Thu, 13 Nov 1997 09:37:09 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA08827; Thu, 13 Nov 1997 09:37:09 -0700 Date: Wed, 12 Nov 1997 16:38:55 -0700 From: swampler@noao.edu (Steve Wampler) Subject: Re: Regular Expressions To: icon-group@optima.CS.Arizona.EDU Message-Id: In-Reply-To: <346A07C2.4CAC@cs.utsa.edu> Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO If I understand the original post, the person is *not* looking to use regular expressions, but rather only to locate them in text. But, even that could be hard! For example, how many RE's are there in this text? -- Steve Wampler - swampler@gemini.edu [Gemini 8m Telescopes Project (under AURA)] O Sibile, si ergo, fortibus es inero. Nobile, demis trux. Demis phulla causan dux. From icon-group-sender Thu Nov 13 13:35:56 1997 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id NAA03868 for ; Thu, 13 Nov 1997 13:35:56 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA07417; Thu, 13 Nov 1997 13:35:55 -0700 Posted-Date: Thu, 13 Nov 1997 10:45:42 -0600 (CST) Message-Id: <1.5.4.32.19971113164513.0097d724@post.its.mcw.edu> X-Sender: cdt@post.its.mcw.edu X-Mailer: Windows Eudora Light Version 1.5.4 (32) Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Date: Thu, 13 Nov 1997 10:45:13 -0600 To: swampler@noao.edu (Steve Wampler), icon-group@optima.CS.Arizona.EDU From: Chris Tenaglia Subject: Re: Regular Expressions Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Isn't just about any printable text string a potential candidate for a regular expression? Just a matter of what precisely you are hoping match? Chris At 04:38 PM 11/12/97 -0700, Steve Wampler wrote: > >If I understand the original post, the person is *not* looking to >use regular expressions, but rather only to locate them in text. > >But, even that could be hard! For example, how many RE's are >there in this text? > >-- >Steve Wampler - swampler@gemini.edu [Gemini 8m Telescopes Project (under AURA)] >O Sibile, si ergo, fortibus es inero. >Nobile, demis trux. Demis phulla causan dux. > > From icon-group-sender Fri Nov 14 10:46:45 1997 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id KAA10976 for ; Fri, 14 Nov 1997 10:46:45 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA09772; Fri, 14 Nov 1997 10:46:44 -0700 To: icon-group@optima.CS.Arizona.EDU Date: 13 Nov 1997 13:08:13 GMT From: eddie@holyrood.ed.ac.uk (Eddie Corns) Message-Id: <64eu3t$c7l@scotsman.ed.ac.uk> Organization: Edinburgh University Sender: icon-group-request@optima.CS.Arizona.EDU References: Subject: Re: Regular Expressions (+ description of useful prog) Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Chris Lusena writes: >For part of a class project I need/like to be able to find all >occanses of a Regular Expression in a ASCII file. Icon seams that is might >be good for this, since one can fine all occurance of a word easly. >So how would one go about this? I'd like to be able to serach for the Reg. >Exp. over line breaks if possable. It's not clear whether you're looking to write a program or maybe you're just saddled with a deficient machine that doesn't have the grep program. Or perhaps you're not aware that regular expression matching is an order of magnitude or two more complex than a straightforward search! There is certainly a regular expression library in the icon library (regexp.icn). However, to make it work across lines you'd need to read the entire file into a string then call ReFind(). Using the default pattern matching rule of leftmost longest match however this can be excrutiatingly slow. Regexp.icn does have a way of doing shortest first which speeds things up considerably and would probably be essential. As an alternative you (and others reading this group) may want to look at a program called cgrep which I came across some time ago. Look at ftp://plg.uwaterloo.ca/pub/mt/cgrep for details. There is a report.ps which describes the problems fairly well and a c program which ought to compile on most platforms. This program does shortest first matching as well as allowing you to define boundary conditions (using regular expressions) which makes searching structured files a breeze. Eddie From icon-group-sender Mon Nov 17 09:20:03 1997 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id JAA12230 for ; Mon, 17 Nov 1997 09:19:58 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA01616; Mon, 17 Nov 1997 09:19:58 -0700 To: icon-group@optima.CS.Arizona.EDU Date: 14 Nov 1997 23:59:00 -0500 From: rdd@access4.digex.net (R. D. Davis) Message-Id: <64ja6k$s7t@access4.digex.net> Organization: Society for the Obsolescence of Obsolescence Sender: icon-group-request@optima.CS.Arizona.EDU Subject: Fix for pack.c in cfuncs under SunOS Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO While attempting to run make in the cfuncs directory, using gcc under SunOS 4.1.1, I ran into a minor problem with compiling pack.c. The solution to getting this to compile cleanly was to add an include file: #include BTW, Icon seems like a very nice programming language; thanks very much to those who've created it, written code for it and made it freely available. -- R.D. Davis http://www.access.digex.net/~rdd rdd@access.digex.net Computer preservationist. Many types of ...!uunet!mystica!rdd unwanted older computer systems disassembled, Office telephone: 1-410-744-4900 removed for free (locally) and preserved. From icon-group-sender Mon Nov 24 08:30:50 1997 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id IAA20025 for ; Mon, 24 Nov 1997 08:30:49 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA07618; Mon, 24 Nov 1997 08:30:49 -0700 From: Mike D Cross Message-Id: <199711221443.OAA03592@heu534.ha.uk.sbphrd.com> X-Authentication-Warning: heu534.ha.uk.sbphrd.com: localhost [127.0.0.1] didn't use HELO protocol To: icon-group@optima.CS.Arizona.EDU Cc: crossmd@mh.uk.sbphrd.com Subject: Question - How to extract data from a formatted line. Date: Sat, 22 Nov 97 14:43:22 +0000 X-Mts: smtp Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Hi, I've been given some Perl programs which extract data from lines of text, each line being of a set format. In perl you do: @dumpline = /^RLOGNAME=\"(.*)\" UID=\"(.*)\" GID=\"(.*)\" PROFILE=\"(.*)\" REALNAME=\"(.*)\" HOMEDIR=\"(.*)\" USERLASTCHANGE=\"(.*)\" FLAGS=\"(.*)\" PSW=\"(.*)\" PSWLASTCHANGE=\"(.*)\" NO_PWDF=\"(.*)\" SERIAL=\"(.*)\" PSWKEY=\"(.*)\" LASTTTY=\"(.*)\" LASTLOGIN=\"(.*)\" LASTLOGOUT=\"(.*)\" RETRY=\"(.*)\" RESERVED1=\"(.*)\" RESERVED2=\"(.*)\" LOGINVALIDTIME=\"(.*)\" PSWVALIDTIME=\"(.*)\" CHPSWTIME=\"(.*)\" PSWMINLEN=\"(.*)\" PSWFORCE=\"(.*)\" PSWHISTLEN=\"(.*)\" CHPSWFREQ=\"(.*)\" TIMEOUT=\"(.*)\" TTIMEOUT=\"(.*)\" TDAYS=\"(.*)\" TSTART=\"(.*)\" TEND=\"(.*)\" RETRYMAX=\"(.*)\" CONCUR_LOGINS=\"(.*)\" SHELL=\"(.*)\" PARAMETERMASK=\"(.*)\".*$/; which generates an array (dumpline) which contains all the text which matched the pattern \"(.*)\" The input file contains about 20 different format lines, I'm not a fan of Perl and would like to re-write the programs in Icon, but I need some hints on the best method. Thanks in advance Mike ============================================================= Mike Cross Principal Analyst UNIX Systems SmithKline Beecham New Frontiers Science Park (South) Third Avenue, Harlow, CM19 5AW email: crossmd@mh.uk.sbphrd.com From icon-group-sender Mon Nov 24 08:30:31 1997 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id IAA20012 for ; Mon, 24 Nov 1997 08:30:30 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA06626; Mon, 24 Nov 1997 08:30:30 -0700 To: icon-group@optima.CS.Arizona.EDU Date: 22 Nov 1997 01:03:35 -0500 From: rdd@access2.digex.net (R. D. Davis) Message-Id: <655sjn$ebr@access2.digex.net> Organization: Society for the Obsolescence of Obsolescence Sender: icon-group-request@optima.CS.Arizona.EDU Subject: File locking in Icon Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO While looking over the procedure files for Icon, and the documentation available via the Univ. of Arizona's Icon WWW page, I haven't seen anything pertaining to file locking thus far. (yes, I know, I should have ordered the Icon programming book, which I plan to do). Am I going to need to implement file locking using C code for my programs, to be called by Icon programs, or am I overlooking something? -- R.D. Davis http://www.access.digex.net/~rdd rdd@access.digex.net Computer preservationist. Many types of ...!uunet!mystica!rdd unwanted older computer systems disassembled, Office telephone: 1-410-744-4900 removed for free (locally) and preserved. From icon-group-sender Tue Nov 25 16:54:08 1997 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id QAA07183 for ; Tue, 25 Nov 1997 16:54:06 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA09370; Tue, 25 Nov 1997 16:54:05 -0700 To: icon-group@optima.CS.Arizona.EDU Date: 25 Nov 1997 14:37:11 -0800 From: kendall shaw Message-Id: <52oh38lhwo.fsf@plight.lbin.com> Organization: Netcom Sender: icon-group-request@optima.CS.Arizona.EDU Subject: wicont and stdin Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Hello, I downloaded windows icon and proceeded to try out a program which processes stdin. I haven't figure out how to do this though, because when I use read() it pops up a window to read from the keyboard, rather than reading from stdin. So, I can't pipe files into it. Is there a way around this? Kendall Shaw From icon-group-sender Mon Dec 1 09:24:39 1997 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id JAA06519 for ; Mon, 1 Dec 1997 09:24:38 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA00709; Mon, 1 Dec 1997 09:24:37 -0700 Message-Id: <347B8113.C76C7986@ix.netcom.com> Date: Tue, 25 Nov 1997 20:53:23 -0500 From: Phillip Lee Thomas Reply-To: thomaspl@acm.org X-Mailer: Mozilla 4.03 [en] (Win95; U) Mime-Version: 1.0 To: Mike D Cross Cc: icon-group@optima.CS.Arizona.EDU Subject: Re: Question - How to extract data from a formatted line. References: <199711221443.OAA03592@heu534.ha.uk.sbphrd.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Mike, I'm not literate in Perl -- your own example might be a fair reason of why I've avoided such literacy. Here's a truncated program that 1) sets up a list, 2) identifies a field terminator character sequence, 3) pulls out the strings upto the terminators, 4) places them in a list, and 5) prints them out. In any real situation, you would read in the data ("while line := read() do ..."), and determine whether you need to store the parsed elements for further processing, launder them further, etc. In the present example, if your string is not terminated by the field terminator, then you need one further put(mylist, tab(0)) after the while loop. -- Phillip Thomas procedure main() mylist := [] terminator := "xxx" line := "this isxxxa linexxxof formatted dataxxx" line ? { while put(mylist, tab(find(terminator))) do # grab the data move(*terminator) # skip length of terminator } while write(pop(mylist)) end Mike D Cross wrote: > Hi, > > I've been given some Perl programs which extract data from lines > of text, each line being of a set format. In perl you do: > > @dumpline = /^RLOGNAME=\"(.*)\" UID=\"(.*)\" GID=\"(.*)\" PROFILE=\"(.*)\" From icon-group-sender Mon Dec 1 09:26:00 1997 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id JAA06584 for ; Mon, 1 Dec 1997 09:26:00 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA00746; Mon, 1 Dec 1997 09:25:59 -0700 Date: Wed, 26 Nov 1997 06:40:39 -0600 From: jeffery@ringer.cs.utsa.edu (Clinton L. Jeffery) Message-Id: <199711261240.GAA20273@pandora.cs.utsa.edu> To: icon-group@optima.CS.Arizona.EDU Subject: Windows Icon 9.3.1 release announcement Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO The Microsoft Windows distribution of Version 9.3.1 of the Icon Programming Language is available from ftp://ringer.cs.utsa.edu/pub/icon/nt/binaries/ This release corresponds to the forthcoming graphics book, described at www.cs.arizona.edu/icon/. Windows Icon programmers will all want this release because of: * standard Windows installation (and uninstallation) via a setup.exe file * creation of a program group and program items for launching Windows Icon * bundling of console-mode (non-graphics) binaries for NT and Win95 * improved functionality of the integrated development environment, Wi * comprehensive on-line documentation in keyword-searchable Windows Help format, including the Icon Program Library and VIB interface builder * vastly improved support for Windows 3.1/Win32s users * performance improvements in tasks such as reading image files * bug fixes Windows Icon will continue to evolve, but this is a major milestone and I would greatly appreciate positive or negative feedback, suggestions, and bug reports if you use this software. Clint Jeffery jeffery@cs.utsa.edu The University of Texas at San Antonio From icon-group-sender Mon Dec 1 09:25:31 1997 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id JAA06576 for ; Mon, 1 Dec 1997 09:25:30 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA00728; Mon, 1 Dec 1997 09:25:30 -0700 Date: Tue, 25 Nov 1997 19:56:01 -0600 Message-Id: <199711260156.TAA13665@segfault.cs.utsa.edu> From: Clinton Jeffery To: kshaw@plight.lbin.com Cc: icon-group@optima.CS.Arizona.EDU In-Reply-To: <52oh38lhwo.fsf@plight.lbin.com> (message from kendall shaw on 25 Nov 1997 14:37:11 -0800) Subject: Re: wicont and stdin Reply-To: jeffery@cs.utsa.edu Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO > I downloaded windows icon and proceeded to try out a program which > processes stdin. I haven't figure out how to do this though, because > when I use read() it pops up a window to read from the keyboard, rather > than reading from stdin. So, I can't pipe files into it. Is there a > way around this? You want to pipe, you gotta use a real operating system, like UNIX. Under NT and Win95, you can use the NT "console" binaries available at ftp://ringer.cs.utsa.edu/pub/icon/nt/console which don't pop up a window, don't have graphics, and don't run under Windows 3.1. If you need graphics, realize that Win32 doesn't let graphics applications read stdio: they have no standard input. If Windows Icon sees a "<" or ">" as a command-line argument, it performs file redirection for you, but code to support this had to be added in by hand, and the behavior of redirection was inconsistent across Windows platforms. By the way, the next release of Windows Icon will include the console mode binaries and the graphics binaries in a single distribution, and include a standard Windows installation program, which should simplify the task of obtaining the software and running programs. Clint Jeffery, jeffery@cs.utsa.edu Division of Computer Science, The University of Texas at San Antonio Research http://www.cs.utsa.edu/research/plss.html From icon-group-sender Thu Dec 4 16:32:41 1997 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id QAA07620 for ; Thu, 4 Dec 1997 16:32:39 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA04225; Thu, 4 Dec 1997 16:32:39 -0700 Message-Id: From: CHARLES HOLDER To: "'icon-group@cs.arizona.edu'" Subject: Icon for MVS Date: Thu, 4 Dec 1997 14:14:17 -0800 X-Priority: 3 Mime-Version: 1.0 X-Mailer: Internet Mail Service (5.0.1457.3) Content-Type: text/plain; charset="iso-8859-1" Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO I need to install Icon on a remote MVS system. I have version 8.0 on tape; but I don't have access to a tape drive. Can I get an MVS version on ZIP disk, floppy disk, or by FTP? Charles Holder From icon-group-sender Fri Dec 5 08:24:47 1997 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id IAA21158 for ; Fri, 5 Dec 1997 08:24:46 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA05747; Fri, 5 Dec 1997 08:24:46 -0700 Date: Thu, 4 Dec 1997 19:06:50 -0700 From: Ralph Griswold Message-Id: <9712050206.AA13016@jupiter.CS.Arizona.EDU> To: icon-group Subject: Icon Newsletter 54 Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Icon Newsletter 54 now is available on our Web site: http://www.cs.arizona.edu/icon/inl/inl54/inl54.htm From icon-group-sender Mon Dec 8 09:16:25 1997 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id JAA00083 for ; Mon, 8 Dec 1997 09:16:24 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA07508; Mon, 8 Dec 1997 09:16:23 -0700 Message-Id: <2.2.32.19971207022656.006b6638@ionet.net> X-Sender: turk@ionet.net X-Mailer: Windows Eudora Pro Version 2.2 (32) Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Date: Sat, 06 Dec 1997 20:26:56 -0600 To: icon-group@baskerville.CS.Arizona.EDU From: "Dr. Louis A. Turk" Subject: Two Problems Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Dear Icon Friends, Having worked with Icon for only about two weeks, I have already been able to make a nice concordance program. Icon is, indeed, powerful and well suited for working with text. However, I am having two problems: 1. "every i := find(word,line) do" will only find the first 5 instances of word in line, then it fails. Why is this? 2. How can I set the number of spaces '\t' represents? On my computer it represents 8 spaces (if I counted right); I want it to represent 11 spaces on anybody's computer. Thanks, Louis Turk From icon-group-sender Mon Dec 8 12:31:57 1997 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id MAA08434 for ; Mon, 8 Dec 1997 12:31:54 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA07912; Mon, 8 Dec 1997 12:31:53 -0700 Date: Mon, 8 Dec 1997 08:47:18 -0800 From: kwalker@premenos.com (Ken Walker) Message-Id: <199712081647.IAA00778@varda.premenos.com> To: icon-group@baskerville.CS.Arizona.EDU, turk@ionet.net Subject: Re: Two Problems Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Md5: iaTEb+hvh8uW3dlouCzkXg== Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO > Date: Sat, 06 Dec 1997 20:26:56 -0600 > From: "Dr. Louis A. Turk" > > ... I am having two problems: > > 1. "every i := find(word,line) do" will only find the first 5 instances of > word in line, then it fails. Why is this? Can you give an example of when it fails? I ran the following program under version 9.0 of Icon on a Sparc without any problem. procedure main() local word, line write(&version) line := "one two one three one four one five one six one seven one" word:= "one" every i := find(word, line) do write(i) end > 2. How can I set the number of spaces '\t' represents? On my computer it > represents 8 spaces (if I counted right); I want it to represent 11 spaces > on anybody's computer. '\t' is a single character. How it gets displayed depends on the software you use. Icon has no control over that. If you need a specific number of spaces, you must use space characters instead of tabs. Take a look at the detab() function. It lets you specify tab stops then replaces tab characters in a string with the appropriate number of spaces. Ken Walker, kwalker@premenos.com Premenos Coporation, Concord, Ca. 94520 From icon-group-sender Tue Dec 9 12:36:12 1997 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id MAA22277 for ; Tue, 9 Dec 1997 12:36:11 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA08911; Tue, 9 Dec 1997 12:36:11 -0700 Message-Id: <2.2.32.19971209173440.005d3ca0@ionet.net> X-Sender: turk@ionet.net (Unverified) X-Mailer: Windows Eudora Pro Version 2.2 (32) Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Date: Tue, 09 Dec 1997 11:34:40 -0600 To: icon-group@baskerville.CS.Arizona.EDU From: "Dr. Louis A. Turk" Subject: do while Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Friends, How do you write a do while control statement in Icon? I need something kind of like this: do { ... } while line := read(file) I have tried to use repeat, but cannot seem to figure out how to cause a break at the end of file. This one is, I am sure, very simple, but it eludes me. Many thanks in advance, Louis From icon-group-sender Wed Dec 10 08:15:31 1997 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id IAA02934 for ; Wed, 10 Dec 1997 08:15:31 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA09574; Wed, 10 Dec 1997 08:15:30 -0700 Date: Tue, 9 Dec 1997 12:50:11 -0800 From: kwalker@premenos.com (Ken Walker) Message-Id: <199712092050.MAA02602@varda.premenos.com> To: icon-group@baskerville.CS.Arizona.EDU, turk@ionet.net Subject: Re: do while Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Md5: UicDfU8TKuatexnNBIVvtw== Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO > Date: Tue, 09 Dec 1997 11:34:40 -0600 > From: "Dr. Louis A. Turk" > > ... > How do you write a do while control statement in Icon? I need something > kind of like this: > > do { > ... > } while line := read(file) > > I have tried to use repeat, but cannot seem to figure out how to cause a > break at the end of file. This one is, I am sure, very simple, but it > eludes me. read() fails when it reaches end-of-file. You can provide a break expression as an alternative and the loop will terminate when read() fails: procedure main() local line, file file := open("temp") | stop("cannot open file") repeat { line := read(file) | break write(line) } write("**done**") end If you need to break out of multiple nested loops you can use another break as an argument to the first one. Ken Walker, kwalker@premenos.com Premenos Coporation, Concord, Ca. 94520 From icon-group-sender Thu Dec 11 12:31:01 1997 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id MAA18468 for ; Thu, 11 Dec 1997 12:31:01 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA10862; Thu, 11 Dec 1997 12:31:00 -0700 To: icon-group@optima.CS.Arizona.EDU Date: 11 Dec 1997 16:58:10 GMT From: baf@texas.net (Ben Fairbank) Message-Id: <66p632$lit$1@news3.texas.net> Organization: Texas Networking, Inc. Sender: icon-group-request@optima.CS.Arizona.EDU Subject: The Icon Trick Bag? Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO I have seen a reference to "the Icon Trick Bag," but it was not explained. Can any reader tell me what and where it is? Thanks, Ben Fairbank From icon-group-sender Fri Dec 12 07:44:29 1997 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id HAA07416 for ; Fri, 12 Dec 1997 07:44:29 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA11776; Fri, 12 Dec 1997 07:44:28 -0700 Date: Thu, 11 Dec 97 22:18:02 -0500 Message-Id: <9712120318.AA0094@valinet.com> From: Paul Abrahams To: icon-group@optima.CS.Arizona.EDU Cc: abrahams@acm.org (Paul Abrahams) Subject: Extensions to `open' Reply-To: abrahams@acm.org Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO I would like to propose a small but very useful extension to Icon: that it should be possible to open a directory by specifying a "d" option to the `open' function. It seems that any extension to Icon ought to satisfy three criteria: (1) It provides functionality that isn't easily achieved by other means. (2) It is stylistically consistent with the rest of the language and won't break existing code,. (3) For a minor extension, it should take someone familiar with the implementation no more than half a day to code. (Testing and debugging, of course, has to be added on.) Icon already recognizes the existence of directories by providing the "chdir" function. At first glance it would seem that being able to scan a directory is easy enough with the `system' function: you just call the system command for the purpose. But that approach has two difficulties. It's very awkward to retrieve the output, since `system' returns only an exit code. More significantly, the user code depends unnecessarily on the operating environment: in Unix you use `ls', in DOS/Windows you use `dir', and in MacOS you use something else again which I don't know. Yet directory structure is a concept common to all modern operating systems. It ought to be possible to read a directory without having to resort to system-dependent code. Adding an option letter to the second argument of `open' is clearly consistent with Icon as it stands. The associated file would then act as a generator whose result sequence consists of the names of the files in the directory. `read' would produce the next file name in the directory; `reads' should probably produce an error when called on a directory (as it does, I believe, when called on an output file). As to the work involved: although I don't know the actual code, I assume that it involves going to the place where the option letters are extracted for `open' and inserting one additional case, together with the appropriate system call. It also involves recording the fact that the file is a directory. In the code for `read', it involves substituting the "get next filename" API for the "read line" API; both Unix and DOS provide such an API. ------- Then there's another extension, perhaps even more useful but not quite as straightforward to implement: if `open' is called with a null argument, it invokes the current system's API for *dynamically* selecting a file to be opened. This is the usual dialog that enables a user to browse the directory structure, looking for the file to be opened. I have a hunch that if graphical user interfaces were common in the days when Ralph was first designing Icon, he would have included this facility. It recognizes that programs are now used in far more interactive environments than they were in the old days. Paul Abrahams From icon-group-sender Mon Dec 15 08:29:51 1997 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id IAA06528 for ; Mon, 15 Dec 1997 08:29:50 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA01590; Mon, 15 Dec 1997 08:29:51 -0700 Message-Id: <2.2.32.19971213003516.007340c4@ionet.net> X-Sender: turk@ionet.net X-Mailer: Windows Eudora Pro Version 2.2 (32) Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Date: Fri, 12 Dec 1997 18:35:16 -0600 To: icon-group@baskerville.CS.Arizona.EDU From: "Dr. Louis A. Turk" Subject: Thanks everybody! Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Many thanks to Ralph Griswold, Ken Walker, Otfried Geffert, Chris Tenaglia, Steve Wampler, Nevin Liber, Stuart Payton Robinson, Joe T. Hall and Clinton Jeffery for helping me understand the Icon programming language. So far I am having very good success with Icon; it is by far the best language for working with text that I have ever used. This fine support group makes the language even better. With your fine help I have almost completed, in about a week of actual programming, a rather complicated program that would would have taken several months in C. And it was fun! Again, thanks, Louis Turk From icon-group-sender Mon Dec 15 08:30:35 1997 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id IAA06791 for ; Mon, 15 Dec 1997 08:30:30 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA01610; Mon, 15 Dec 1997 08:30:31 -0700 From: gep2@computek.net Date: Fri, 12 Dec 1997 23:57:18 -0600 Message-Id: <199712130557.XAA04542@axp.cmpu.net> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Subject: Extensions to `open' To: icon-group@optima.CS.Arizona.EDU X-Mailer: SPRY Mail Version: 04.00.06.17 Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO >I would like to propose a small but very useful extension to Icon: that it should be possible to open a directory by specifying a "d" option to the `open' function. Personally, I wrote (some years ago) a loadable function DIRFNC (in assembler) for SNOBOL4+ which offers similar getfirst/getnext features. Despite having my OWN function, I probably actually use the "shell out to DIR" technique more when writing real programs. Why? 1) it's always available, even if I haven't brought my function along to the client site where I am 2) it's nearly as easy to use >It seems that any extension to Icon ought to satisfy three criteria: (1) It provides functionality that isn't easily achieved by other means. And that's part of the problem... this functionality is in fact pretty easy to achieve... if not in mainline code, then certainly in a small library subroutine. > (2) It is stylistically consistent with the rest of the language and won't break existing code,. That shouldn't be a problem. > (3) For a minor extension, it should take someone familiar with the implementation no more than half a day to code. (Testing and debugging, of course, has to be added on.) Writing such a library routine probably comes close to that. >Icon already recognizes the existence of directories by providing the "chdir" function. At first glance it would seem that being able to scan a directory is easy enough with the `system' function: you just call the system command for the purpose. Right. >But that approach has two difficulties. >It's very awkward to retrieve the output, since `system' returns only an exit code. But you were GOING to call open and read it "as a file" anyhow, right? So you wouldn't retrieve the output via SYSTEM anyhow. If SYSTEM redirects the output to a file, you can then get basically what you want (yeah, okay, you have multiuser issues to prevent walking on some other user's file... if that situation applies to you... but in that case you probably have to handle the same issue in mainline code and your other file accesses anyhow). > More significantly, the user code depends unnecessarily on the operating environment: This is a rather minor issue really because most users simply in reality don't have multiple environments that they have to run their programs in. For example, I'd be *perfectly* happy to just have an MS-DOS/Windows version, since I wouldn't expect to ever need to run the program in a Mac or Unix environment. Probably the huge majority of all computer users are in the same situation. > in Unix you use `ls', in DOS/Windows you use `dir', and in MacOS you use something else again which I don't know. Yes, but it's trivial under Unix to set up "dir" as an alias to "ls" and it's nearly as easy under DOS/Windows to set up a batch file named "ls" which invokes "dir". Handling options is somewhat trickier, of course, but then again that opens up a whole other can of worms which I'll get to in a moment. > Yet directory structure is a concept common to all modern operating systems. Yes, but they don't all handle it in quite the same way. For example, under Windows 95 and NT you're allowed to have filenames which contain spaces. You also find that in European (and other) countries, time and date fields are generally formatted differently than they are here in the USA. Volume names and drive specs (not to mention site/node/? and network addresses) are handled differently. Where Unix uses "/" to separate subdirectories, MS-DOS/Windows/NT use "\". Microsoft operating systems generally use "/" for options, while Unix usually uses "-" to designate options. The file attributes provided by different systems are inconsistent: Novell servers have an "execute permission" for files which allows a program to be executed but not read. Some systems' directories contain "last accessed" date (in addition to creation or last modification). Some schemes have user-specific rights attached to individual files. > It ought to be possible to read a directory without having to resort to system-dependent code. Agreed that that would be nice, but in reality when you're accessing directory entries, that often (admittedly, not ALWAYS) implies you doing something that involves a more detailed understanding of how the system directories are organized. Just one other example: since Intel operating systems don't support direct aliases to filenames, you know that the directory (if undamaged, anyhow) is properly tree-structured and cannot contain any loops or cross-pointere. I don't believe that this is guaranteed under Unix systems, (is it?) > Adding an option letter to the second argument of `open' is clearly consistent with Icon as it stands. The associated file would then act as a generator whose result sequence consists of the names of the files in the directory. `read' would produce the next file name in the directory; `reads' should probably produce an error when called on a directory (as it does, I believe, when called on an output file). >As to the work involved: although I don't know the actual code, I assume that it involves going to the place where the option letters are extracted for `open' and inserting one additional case, together with the appropriate system call. >It also involves recording the fact that the file is a directory. In the code for `read', it involves substituting the "get next filename" API for the "read line" API; both Unix and DOS provide such an API. Right, but presumably the information available from each will not be formatted in the same fashion once retrieved and returned... so much for cross-platform common code! So you have to in fact change not only open and read, but essentially the entire I/O package (close, seek, etc too). How do you handle directory opens for OUTPUT? How are errors reported? Are file-type fault returned conditions really appropriate for directories, or do you need other kinds? The other issue is that if you're going to provide such a "read directory as a file" feature, you really would WANT it to be consistent not just for one language, but on a system-wide basis. And that sounds like in a perfect world it would be more desirable to implement it (under MS-DOS-type systems anyhow?) as a small TSR which would intercept opens/reads/closes/etc at the MS-DOS level (rather that at the language runtime library level) and then you could directly use other system commands on directories too... FIND/MORE/SORT/LIST/TYPE/PRINT/etc, and the same features that work then under Icon would work (and the same way) under BASIC, COBOL, FORTRAN, Assembler, or other languages too. >Then there's another extension, perhaps even more useful but not quite as straightforward to implement: if `open' is called with a null argument, it invokes the current system's API for *dynamically* selecting a file to be opened. This is the usual dialog that enables a user to browse the directory structure, looking for the file to be opened. Agreed that this is a nice extension, although again that implies that you can use the screen (and put it back the way it was when you're done). And implementing that is substantially different under (say) MS-DOS than it is under (say) Windows95. > I have a hunch that if graphical user interfaces were common in the days when Ralph was first designing Icon, he would have included this facility. It recognizes that programs are now used in far more interactive environments than they were in the old days. Agreed. But I still think that writing such routines in the classic way is at least (most of the time) pretty easy (the interactive one less so, but then again you probably only need to do it once). Gordon Peterson http://www.computek.net/public/gep2/ Support the Anti-SPAM Amendment! Join at http://www.cauce.org/ From icon-group-sender Mon Dec 15 13:46:23 1997 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id NAA03509 for ; Mon, 15 Dec 1997 13:46:22 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA02110; Mon, 15 Dec 1997 13:46:23 -0700 To: icon-group@optima.CS.Arizona.EDU Date: Mon, 15 Dec 1997 09:47:45 -0800 From: Brian Rogoff Message-Id: Sender: icon-group-request@optima.CS.Arizona.EDU References: <66p632$lit$1@news3.texas.net> Subject: Re: The Icon Trick Bag? Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO It is one of the web pages at the NM Tech Icon site. It has a newsgroup posting from comp.lang.icon (a rarity) about backtracking and some practical stuff about writing CGI handlers and socket programming. http://www.nmt.edu/tcc/help/lang/icon/tricks.html -- Brian On 11 Dec 1997, Ben Fairbank wrote: > I have seen a reference to "the Icon Trick Bag," but it was not explained. Can > any reader tell me what and where it is? > > Thanks, > > Ben Fairbank > > > From icon-group-sender Fri Dec 19 08:26:28 1997 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id IAA15440 for ; Fri, 19 Dec 1997 08:26:27 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA05375; Fri, 19 Dec 1997 08:26:27 -0700 Message-Id: <199712191102.LAA17172@holyrood.ed.ac.uk> Date: 19 Dec 97 11:02:00 GMT From: Roger Hare Subject: Transparent pixels To: icon-group@optima.CS.Arizona.EDU Reply-To: rjhare@ed.ac.uk Organisation: Edinburgh Parallel Computing Centre Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Don't have the book with me - help! How do I specify `transparent' pixels when setting up images using Icons graphics facilities? Thanks. Roger Hare. From icon-group-sender Fri Dec 26 17:28:07 1997 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id RAA11619 for ; Fri, 26 Dec 1997 17:28:07 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA08469; Fri, 26 Dec 1997 17:28:07 -0700 To: icon-group@optima.CS.Arizona.EDU Date: Sun, 21 Dec 1997 15:27:56 -0500 From: Jules Gilbert Message-Id: <349D7BCC.5BB6@aasp.net> Organization: SymbTech Sender: icon-group-request@optima.CS.Arizona.EDU Reply-To: jules@aasp.net Subject: A new kind of pattern operator Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Hi, folks: I have been developing a new kind of pattern operator for Icon. This operator is the inverse of the conventional Icon '?' operator, because instead of supplying a representation [normally string based] of the input, one supplies the input and this 'operator' delivers descriptions of the identified pattern(s). The technology is based on a hybrid of CLIPS (an expert system tool) and a fairly straight-forward neural process. I have built a Linux version and several small DOS versions and am interested in supplying them to experimeters under appropriate license. If this interests you, please supply a description of your intended project. For now, I am only going to create five user licenses. --jules From icon-group-sender Fri Dec 26 17:27:45 1997 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id RAA11616 for ; Fri, 26 Dec 1997 17:27:44 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA08450; Fri, 26 Dec 1997 17:27:44 -0700 Message-Id: <349BE9DC.B9E1D728@ix.netcom.com> Date: Sat, 20 Dec 1997 10:53:00 -0500 From: David Feustel Reply-To: feustel@ix.netcom.com X-Mailer: Mozilla 4.01 [en] (WinNT; U) Mime-Version: 1.0 To: icon-group@optima.CS.Arizona.EDU Subject: Icon for WinCE X-Priority: 3 (Normal) References: <9712120318.AA0094@valinet.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Are there any plans to port the Windows version of Icon to WinCE? From icon-group-sender Tue Dec 30 13:58:00 1997 Return-Path: Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239]) by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id NAA12202 for ; Tue, 30 Dec 1997 13:57:55 -0700 (MST) Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM) id AA10469; Tue, 30 Dec 1997 13:57:56 -0700 Date: Tue, 30 Dec 1997 12:25:11 -0600 Message-Id: <199712301825.MAA16743@segfault.cs.utsa.edu> From: Clinton Jeffery To: feustel@ix.netcom.com Cc: icon-group@optima.CS.Arizona.EDU In-Reply-To: <349BE9DC.B9E1D728@ix.netcom.com> (message from David Feustel on Sat, 20 Dec 1997 10:53:00 -0500) Subject: Re: Icon for WinCE Reply-To: jeffery@cs.utsa.edu Errors-To: icon-group-errors@optima.CS.Arizona.EDU Status: RO Ed Feustel writes: > Are there any plans to port the Windows version of Icon to WinCE? The Windows sources are available, and anyone who wants to do this is welcome to do so. In theory, porting Windows Icon (except co-expressions) to WinCE would be "fairly easy", since it is written on top of the Win32s C language API rather than one of the toolkits that WinCE doesn't fully support, such as the current MFC. I'd be happy to provide advice and technical support to anyone who wants to do this. Personally I have no plans to work on a WinCE port, because I don't own a WinCE device and haven't seen one that I would want. So far I prefer the 2 lb. Win95 boxes that run regular Windows Icon, such as the Mitsubishi Amity. By the way, there was an article (quite awhile ago now) about Icon on the old Atari handheld PC, so "there is nothing new under the sun". Clint Jeffery, jeffery@cs.utsa.edu Division of Computer Science, The University of Texas at San Antonio Research http://www.cs.utsa.edu/research/plss.html