home *** CD-ROM | disk | FTP | other *** search
/ ftp.cs.arizona.edu / ftp.cs.arizona.edu.tar / ftp.cs.arizona.edu / icon / newsgrp / group92a.txt < prev    next >
Internet Message Format  |  1992-05-06  |  400KB

  1. From icon-group-request  Wed Jan  1 09:42:23 1992
  2. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Wed, 1 Jan 92 09:42:23 MST
  3. Received: from ucbvax.Berkeley.EDU by optima.cs.arizona.edu (4.1/15)
  4.     id AA06371; Wed, 1 Jan 92 09:42:21 MST
  5. Received: by ucbvax.Berkeley.EDU (5.63/1.43)
  6.     id AA27710; Wed, 1 Jan 92 08:35:03 -0800
  7. Received: from USENET by ucbvax.Berkeley.EDU with netnews
  8.     for icon-group@cs.arizona.edu (icon-group@cs.arizona.edu)
  9.     (contact usenet@ucbvax.Berkeley.EDU if you have questions)
  10. Date: 12 Dec 91 22:51:53 GMT
  11. From: elroy.jpl.nasa.gov!swrinde!cs.utexas.edu!convex!russur@ames.arc.nasa.gov  (Russ Urquhart)
  12. Organization: CONVEX Computer Corporation, Richardson, Tx., USA
  13. Subject: Snobol4 to Icon: A converter?
  14. Message-Id: <russur.692578313@convex.convex.com>
  15. Sender: icon-group-request@cs.arizona.edu
  16. To: icon-group@cs.arizona.edu
  17.  
  18. I'm kind of new to this group, so if this question has already been
  19. asked/answered, please bear with me.
  20.  
  21. I an looking for a snobol4 to icon conversion. I have some snobol4 programs
  22. that I would like to convert and use under icon.
  23.  
  24. Any help would be appreciated!
  25.  
  26. Thanks
  27.  
  28.  
  29. Russ Urquhart
  30. Convex Computer Corporation 
  31.  
  32. From icon-group-request  Wed Jan  1 23:18:45 1992
  33. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Wed, 1 Jan 92 23:18:45 MST
  34. Received: from ucbvax.Berkeley.EDU by optima.cs.arizona.edu (4.1/15)
  35.     id AA25319; Wed, 1 Jan 92 23:18:43 MST
  36. Received: by ucbvax.Berkeley.EDU (5.63/1.43)
  37.     id AA05563; Wed, 1 Jan 92 17:05:23 -0800
  38. Received: from USENET by ucbvax.Berkeley.EDU with netnews
  39.     for icon-group@cs.arizona.edu (icon-group@cs.arizona.edu)
  40.     (contact usenet@ucbvax.Berkeley.EDU if you have questions)
  41. Date: 13 Dec 91 17:56:39 GMT
  42. From: elroy.jpl.nasa.gov!swrinde!cs.utexas.edu!wupost!dsuvax.dsu.edu!ghelmer@ames.arc.nasa.gov  (Guy Helmer)
  43. Organization: Dakota State University
  44. Subject: CFP: SIXTH INTERNATIONAL CONFERENCE on SYMBOLIC and LOGICAL COMPUTING
  45. Message-Id: <1991Dec13.175639.23063@dsuvax.dsu.edu>
  46. Sender: icon-group-request@cs.arizona.edu
  47. To: icon-group@cs.arizona.edu
  48.  
  49.  
  50.  
  51.    SIXTH INTERNATIONAL CONFERENCE on SYMBOLIC and LOGICAL COMPUTING
  52.  
  53.                       DAKOTA STATE UNIVERSITY
  54.                        MADISON, SOUTH DAKOTA
  55.                        OCTOBER 15 - 16, 1992
  56.  
  57.     ICEBOL6, the Sixth International Conference on Symbolic and Logical
  58. Computing, is designed for teachers, scholars, and programmers who want
  59. to meet to exchange ideas about computer programming for non-numeric
  60. applications -- especially those in the humanities.  In addition to a
  61. focus on SNOBOL4, SPITBOL, and Icon, ICEBOL6 invites presentations on
  62. textual and logical processing in a variety of programming languages such
  63. as Prolog and C.  Topics of discussion will include artificial
  64. intelligence and expert systems, and a wide range of analyses of texts in
  65. English and other natural languages.  Parallel tracks of concurrent
  66. sessions are planned.
  67.  
  68.     ICEBOL's coffee breaks, social hours, lunches, and banquet will
  69. provide a series of opportunities for participants to meet and informally
  70. exchange information.
  71.  
  72.  
  73. CALL FOR PAPERS
  74.  
  75.     Abstracts (250-750 words) of proposed papers to be read at ICEBOL6
  76. are invited in any area of non-numeric programming.  Planned sessions
  77. include the following:
  78.  
  79.     analysis of texts (including bibliography, concordance, and index
  80.        generation)
  81.     artificial intelligence and expert systems
  82.     computational linguistics
  83.     computer languages and compilers designed for non-numeric processing
  84.     electronic texts and encoding
  85.     grammar and style checkers
  86.     linguistic and lexical analysis (including parsing and machine
  87.        translation)
  88.     music analysis
  89.     preparation of texts for publishing
  90.  
  91.  
  92.     Papers must be in English and may not exceed twenty minutes reading
  93. time.  Abstracts should be received by March 1, 1992.  Notification of
  94. acceptance (based on recommendations of readers) will follow promptly.
  95. Papers will be published in ICEBOL6 Proceedings.
  96.  
  97.     Presentations at previous ICEBOL conferences were made by Paul
  98. Abrahams (ACM President), Gene Amdahl (Andor Systems), Robert Dewar (New
  99. York University), Mark Emmer (Catspaw, Inc.),  James Gimpel (Lehigh),
  100. Ralph Griswold (Arizona), Susan Hockey (Oxford), Nancy Ide (Vassar) and
  101. many others.  Copies of the ICEBOL5 Proceedings are available.
  102.  
  103.  
  104. FOR FURTHER INFORMATION
  105.  
  106.     All correspondence including abstracts of proposed papers as well as
  107. requests for registration materials may be sent to:
  108.  
  109.                    Eric Johnson
  110.                    ICEBOL Director
  111.                    114 Beadle Hall
  112.                    Dakota State University
  113.                    Madison, SD  57042 U.S.A.
  114.  
  115.     Inquiries, abstracts, and correspondence are encouraged via
  116. electronic mail, and they may be sent to Eric Johnson at:
  117.  
  118.                    ERIC@SDNET.BITNET
  119.  
  120.                           or
  121.  
  122.                 johnsone@dsuvax.dsu.edu
  123.  
  124. -- 
  125.           Guy Helmer, Dakota State University Computing Services
  126. ghelmer@dsuvax.dsu.edu, helmer@sdnet.bitnet, dsuvax!ghelmer@wunoc.wustl.edu
  127.          Whip me, beat me, but don't make me maintain BASIC code!
  128.  
  129. From icon-group-request  Thu Jan  2 14:18:45 1992
  130. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Thu, 2 Jan 92 14:18:45 MST
  131. Received: from ucbvax.Berkeley.EDU by optima.cs.arizona.edu (4.1/15)
  132.     id AA00596; Thu, 2 Jan 92 14:18:42 MST
  133. Received: by ucbvax.Berkeley.EDU (5.63/1.43)
  134.     id AA22969; Thu, 2 Jan 92 08:07:02 -0800
  135. Received: from USENET by ucbvax.Berkeley.EDU with netnews
  136.     for icon-group@cs.arizona.edu (icon-group@cs.arizona.edu)
  137.     (contact usenet@ucbvax.Berkeley.EDU if you have questions)
  138. Date: 2 Jan 92 19:22:27 GMT
  139. From: att!cbnewsj!dsk@ucbvax.berkeley.edu  (donald.s.klett)
  140. Organization: AT&T Bell Laboratories
  141. Subject: Icon Version 8 System for Mac
  142. Message-Id: <1992Jan2.192227.3854@cbnewsj.cb.att.com>
  143. Sender: icon-group-request@cs.arizona.edu
  144. To: icon-group@cs.arizona.edu
  145.  
  146. I have ported the Icon translator and interpreter to the Macintosh using
  147. THINK C 5.0.1 under System 7.  This is not the MPW version.  I used the
  148. "console" feature in THINK C.  Since I am not sure how much interest there
  149. is in the Mac community, I will initially offer to e-mail the binaries to
  150. anyone interested.  Just send e-mail making the request.  Source code is not
  151. available from me, but may be available from the Icon project.  I submitted
  152. the ported code to the project.
  153. At this stage, coexpressions are not activated, and calling C routines is
  154. not supported.
  155.  
  156. Don Klett
  157. dsk@arch3.att.com
  158. (908)949-2283
  159.  
  160. From icon-group-request  Fri Jan  3 21:10:07 1992
  161. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Fri, 3 Jan 92 21:10:07 MST
  162. Received: from ucbvax.Berkeley.EDU by optima.cs.arizona.edu (4.1/15)
  163.     id AA06817; Fri, 3 Jan 92 21:10:01 MST
  164. Received: by ucbvax.Berkeley.EDU (5.63/1.43)
  165.     id AA08162; Fri, 3 Jan 92 20:05:15 -0800
  166. Received: from USENET by ucbvax.Berkeley.EDU with netnews
  167.     for icon-group@cs.arizona.edu (icon-group@cs.arizona.edu)
  168.     (contact usenet@ucbvax.Berkeley.EDU if you have questions)
  169. Date: 3 Jan 92 07:12:19 GMT
  170. From: csus.edu!wupost!spool.mu.edu!munnari.oz.au!uniwa!gudjm@ucdavis.ucdavis.edu  (D John McKenna)
  171. Organization: University of Western Australia
  172. Subject: Re: tic-tac-toe
  173. Message-Id: <1992Jan3.071219.3395@uniwa.uwa.oz.au>
  174. References: <9112241206.AA05909@relay2.UU.NET>
  175. Sender: icon-group-request@cs.arizona.edu
  176. To: icon-group@cs.arizona.edu
  177.  
  178. nowlin@isidev.UUCP writes:
  179. >The reason I brought this up was the tic-tac-toe game that's popped up here
  180. >a couple of times lately.  The nim program has a learning mode (which is
  181. >what made it applicable to the AI seminar) that applies real well to
  182. >tic-tac-toe since tic-tac-toe has a finite range of possible "states" that
  183. >can be recorded in game memory.  The nim game remembers the success or
  184. >failure of a given choice for a given "state" of the game and eventually
  185. >only makes choices for a given "state" that result in success.  It learns
  186. >by playing so it tends to make stupid moves for the first five or ten
  187. >games.  Then if it was playing someone smart it gets just as good.  The
  188. >same learning mode could be easily applied to tic-tac-toe.
  189.  
  190. >I would tackle it but thought I'd give the original poster a shot at this
  191. >technique first.  Tic-tac-toe has a more difficult algorithm than nim
  192. >(although not that hard) so the learning version may be easier to program
  193. >than the algorithmic version.  A neat trick would be to have the game
  194. >record it's game memory in a file so it doesn't have to learn all over
  195. >again every time the game is started.  The nim game doesn't (yet).
  196.  
  197. Your mention of a learning tic-tac-toe reminds me of something I saw in
  198. some book produced by Reader's Digest many years ago. This was circa
  199. 1980, maybe earlier.
  200.  
  201. There was a method of creating a learning tic-tac-toe system, where
  202. every possible situation (except reflections, of course) were drawn on a
  203. macthbox - that is, one matchbox per situation. Each possible next move
  204. by the opponent was drawn in a different colour - ie green if the
  205. opponent moves into the top left corner, red if the opponent moves into
  206. the centre, etc. Each move is represented by a coloured bead in the
  207. matchbox.  Once this is all set up, you begin playing.
  208.  
  209. So you do your move - maybe in the centre of the grid. Then, taking the
  210. matchbox that represents this situation, you take a bead out of it at
  211. random, to determine the system's move. You then do your move, and get
  212. the matchbox representing that situation, etc. This continues till the
  213. game is over.  If the system loses, you destroy the last bead you drew -
  214. ie leave it out of the matchbox in future. 
  215.  
  216. Now I think about it, the game wasn't tic-tac-toe - it was played on a 3
  217. by 3 grid with chess pawns - the top row had 3 pawns belonging to the
  218. human, and the bottom row had 3 pawns belonging to the system.  But the
  219. same principles applied.  It was interesting to me - I was probably
  220. younger than ten when I did this - my first contact with AI I suppose,
  221. although I didn't know it at the time.
  222.  
  223. Oh well, that was much harder to explain than it should be.
  224.  
  225. Steven McLeod (posing as John Mckenna)  - the man without a signature
  226.  
  227. From icon-group-request  Sat Jan  4 03:52:32 1992
  228. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Sat, 4 Jan 92 03:52:32 MST
  229. Received: from ucbvax.Berkeley.EDU by optima.cs.arizona.edu (4.1/15)
  230.     id AA24629; Sat, 4 Jan 92 03:52:29 MST
  231. Received: by ucbvax.Berkeley.EDU (5.63/1.43)
  232.     id AA00564; Sat, 4 Jan 92 02:40:49 -0800
  233. Received: from USENET by ucbvax.Berkeley.EDU with netnews
  234.     for icon-group@cs.arizona.edu (icon-group@cs.arizona.edu)
  235.     (contact usenet@ucbvax.Berkeley.EDU if you have questions)
  236. Date: 12 Dec 91 18:53:06 GMT
  237. From: arizona.edu!arizona.edu!news@arizona.edu  (Kurt Parten)
  238. Organization: Dept of Electrical and Computer Engineering, University of Arizona, Tucson, Arizona
  239. Subject: read() problems
  240. Message-Id: <1991Dec12.115308.2254@arizona.edu>
  241. Sender: icon-group-request@cs.arizona.edu
  242. To: icon-group@cs.arizona.edu
  243.  
  244. Is there a way for read to be OS independent, so that DOS text files
  245. look like UNIX text files.  I'm running icon under UNIX, but the
  246. data files are in DOS format.  I would like to get rid of
  247. the ^M character that shows up in every line.  
  248.  
  249. I tried trim(read(dosfile), "\r"), but that transformed
  250.  
  251. h  e  l  l  o \r \n
  252.  
  253. to:
  254.  
  255. h  e  l  l  o \r \r \n
  256.  
  257. instead of
  258.  
  259. h  e  l  l  o  \n
  260. --
  261. Kurt Parten
  262. parten@helios.ece.arizona.edu
  263.  
  264. From icon-group-request  Sat Jan  4 14:28:57 1992
  265. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Sat, 4 Jan 92 14:28:57 MST
  266. Received: from ucbvax.Berkeley.EDU by optima.cs.arizona.edu (4.1/15)
  267.     id AA07848; Sat, 4 Jan 92 14:28:55 MST
  268. Received: by ucbvax.Berkeley.EDU (5.63/1.43)
  269.     id AA06274; Sat, 4 Jan 92 13:17:13 -0800
  270. Received: from USENET by ucbvax.Berkeley.EDU with netnews
  271.     for icon-group@cs.arizona.edu (icon-group@cs.arizona.edu)
  272.     (contact usenet@ucbvax.Berkeley.EDU if you have questions)
  273. Date: 19 Dec 91 01:44:22 GMT
  274. From: mips.mitek.com!utacfd.uta.edu!utagraph.uta.edu!utarlg.uta.edu!b912dieg@apple.com  (DOUG WITMER)
  275. Organization: The University of Texas at Arlington
  276. Subject: Memory Mangement
  277. Message-Id: <1991Dec19.015629.3966@utagraph.uta.edu>
  278. Sender: icon-group-request@cs.arizona.edu
  279. To: icon-group@cs.arizona.edu
  280.  
  281. This question is directed at those having an in depth knowledge
  282. of ICON internals and in particular ICON memory management.  I
  283. know from my readings that the ICON system finds it necessary
  284. to perform frequent garbage collections to maintain an adequate
  285. supply of unfragmented memory.  I also know that ICON is 
  286. implemented in the C language.  My question stems from a claim
  287. which I read today concerning the Mathematica language which is
  288. also implemented in C.  Here is what they say about garbage 
  289. collection:
  290.  
  291.      Mathematica does memory management with reference counts, 
  292.      so that pieces of memory are freed as soon as they stop
  293.      being used.  This means that Mathematica can make use of
  294.      essentially all the memory that is available on a 
  295.      particular computer, without the need for operations such
  296.      as garbage collection.  (Mathematica by Wolfram 1988:xvi)
  297.  
  298. Does anyone have an explanation of reference counts?  Can the
  299. use of reference counts really eliminate garbage collection?
  300. Thanks for helping satisfy my curiosity.
  301. Doug Witmer
  302. b912dieg@utarlg.uta.edu
  303.  
  304. From icon-group-request  Mon Jan  6 16:06:26 1992
  305. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Mon, 6 Jan 92 16:06:26 MST
  306. Received: from ucbvax.Berkeley.EDU by optima.cs.arizona.edu (4.1/15)
  307.     id AA19180; Mon, 6 Jan 92 16:06:21 MST
  308. Received: by ucbvax.Berkeley.EDU (5.63/1.43)
  309.     id AA18045; Mon, 6 Jan 92 14:50:57 -0800
  310. Received: from USENET by ucbvax.Berkeley.EDU with netnews
  311.     for icon-group@cs.arizona.edu (icon-group@cs.arizona.edu)
  312.     (contact usenet@ucbvax.Berkeley.EDU if you have questions)
  313. Date: 21 Dec 91 03:22:27 GMT
  314. From: ksr!tim@uunet.uu.net  (Tim Peters)
  315. Organization: Kendall Square Research Corp.
  316. Subject: Re: Memory Mangement
  317. Message-Id: <8080@ksr.com>
  318. References: <1991Dec19.015629.3966@utagraph.uta.edu>
  319. Sender: icon-group-request@cs.arizona.edu
  320. To: icon-group@cs.arizona.edu
  321.  
  322. In article <1991Dec19.015629.3966@utagraph.uta.edu> b912dieg@utarlg.uta.edu writes:
  323. >...
  324. >I know from my readings that the ICON system finds it necessary to
  325. >perform frequent garbage collections to maintain an adequate supply of
  326. >unfragmented memory.
  327.  
  328. Guess I'll have to do until a real expert comes along <grin>.  The
  329. frequency of Icon garbage collection depends on an awful lot of things.
  330. In general, I'd say that if Icon *is* doing collections frequently,
  331. there's an easily-changed (if not easily-found ...) way to stop that by
  332. rewriting a bit of the Icon application.  For most Icon programs most
  333. times, garbage collection should not be a problem; indeed, for many real
  334. Icon programs garbage collection is never needed at all.
  335.  
  336. > ...
  337. >     Mathematica does memory management with reference counts, 
  338. >     so that pieces of memory are freed as soon as they stop
  339. >     being used.  This means that Mathematica can make use of
  340. >     essentially all the memory that is available on a 
  341. >     particular computer, without the need for operations such
  342. >     as garbage collection.  (Mathematica by Wolfram 1988:xvi)
  343. >
  344. >Does anyone have an explanation of reference counts?
  345. >Can the use of reference counts really eliminate garbage collection?
  346.  
  347. Dynamic memory management has become a rather large field by now, but
  348. the intro in Knuth's "Art of Computer Programming" (Volume 1) remains
  349. helpful.
  350.  
  351. Assuming you can read Icon, here's a fragement to help explain the
  352. differences:
  353.  
  354.    B := [2]
  355.    A := [1, b, 3]  # === [1, B === pointer to [2], 3]
  356.    B := &null
  357.    A := &null
  358.  
  359. I'll call those lines #1, #2, #3 and #4.
  360.  
  361. Icon-style garbage collection works by (in effect) putting a mark on all
  362. the memory you can possibly reference, then reusing all the memory that
  363. is *not* marked (it's trickier than that, of course, but I think that's
  364. a fair summary of the basic idea).
  365.  
  366. So if garbage collection (GC) occurs right after line #2, the memory
  367. earlier allocated for the lists A and B will get marked, because you
  368. could still reference that memory in the future just by mentioning A or
  369. B.
  370.  
  371. If GC occurs after #3, we must still keep all the memory around, but for
  372. a subtler reason:  even though you can't reference the [2] list directly
  373. via B any more, the garbage collector knows you might still reference A,
  374. and the value of A still contains a pointer to the list that used to be
  375. named by B.  So all the allocated memory is still potentially reachable,
  376. so the garbage collector can't reuse it.  GC must in general not only
  377. mark all the memory reachable in "one step", but all the memory
  378. reachable from that in turn, and so on & so on.
  379.  
  380. If GC occurs after #4, of course neither of the earlier-allocated lists
  381. are reachable, so the memory they occupy won't get "marked", so that
  382. memory will get reused.
  383.  
  384. The general behavior is that "the system" doesn't worry about memory
  385. until it runs out of it, at which point it stops everything else to
  386. find & recycle the old memory that's no longer being used.
  387.  
  388. This can take an appreciable amount of time when it happens, and of
  389. course the collector is itself a program that needs memory for its own
  390. use.  That's the likely source of the (misleading; see below) claim that
  391. Mathematica can use "essentially all" the memory for real stuff.
  392.  
  393. Reference counting (RC) is a different technique.  Under RC, each piece
  394. of allocated memory keeps track of how many times it's pointed *at* by
  395. other pieces of memory; when this count drops to 0, the memory can be
  396. reused (that the count is 0 *means* that it's not being pointed at).
  397.  
  398. So in executing line #1, a piece of data is attached to the [2] list
  399. that records that the [2] list is pointed at once (by the program
  400. variable A).
  401.  
  402. In executing line #2, the "reference count" for the [2] list must be
  403. bumped up by 1 because the [2] list is again referenced by a pointer
  404. embedded in the A list.  In addition, a RC of 1 must be attached to the
  405. list assigned to A.
  406.  
  407. In line #3, the system sees that B is being changed to point at a
  408. different chunk of memory, so the RC of what it used to point at (the
  409. [2] list) must be decreased by 1.  This will decrease it from 2 to 1.
  410. Since it's 1, it's still being pointed at by something, so the system
  411. can't reuse it.
  412.  
  413. Similarly, in line #4 the reference count of the A list is decreased
  414. from 1 to 0.  Aha!  Since it's 0, nobody else is referencing it, so the
  415. system can reuse it.  Since it will be reused, the reference counts of
  416. everything *it* points at must also be decreased by 1, so the system has
  417. to examine the A list carefully to find all the things it points at.  It
  418. will find that it's pointing to the [2] list, so will decrease the [2]
  419. list's RC by 1.  That in turn decrease's the [2] list's RC to 0, so that's
  420. no longer used either.  The system then searches thru the [2] list in
  421. order to find anything *it* may be referencing, but doesn't find another
  422. pointer so the process stops there.
  423.  
  424. There are several things to note about this:  (1) It takes memory to
  425. store the reference counts.  So a claim that an RC approach lets you use
  426. "almost all" the available memory for "real stuff" is misleading.  (2)
  427. Like Icon-flavor GC, RC also needs to recursively traverse your data
  428. structures looking for contained pointers.  (3) It takes time to
  429. increase and decrease the counts.  (4) While Icon-flavor GC lumps all
  430. the work together at one time, RC-based systems tend to spread the work
  431. out over time so that memory-management "hiccups" (pauses) aren't
  432. noticeable.  (5) An RC-based system does all the work of maintaining the
  433. counts whether or not you eventually run out of memory; so an Icon-
  434. flavor GC gets off cheaper in the common case where the initial memory
  435. region suffices.
  436.  
  437.  
  438. Dynamic memory management is a very involved topic, and the stuff above
  439. conveniently ignored almost all the interesting problems & possible
  440. workarounds in both systems.  They both face real problems in practice!
  441. As another complication, almost all large programs (like Icon, and
  442. probably Mathematica too) use several different strategies (e.g., Icon
  443. uses a different scheme for strings than it uses for co-expressions, and
  444. so on).
  445.  
  446. I just hoped to convey enough of the essentials to make you skeptical of
  447. marketing hype <grin>.
  448.  
  449. from-what-i-know-of-them-icon's-strategies-are-very-intelligent-choices-
  450.    for-icon's-needs-and-i'd-be-real-surprised-if-mathematica's-choices-
  451.    weren't-intelligent-for-its-needs-ly y'rs  - tim
  452.  
  453. Tim Peters   Kendall Square Research Corp
  454. tim@ksr.com,         ksr!tim@uunet.uu.net
  455.  
  456. From icon-group-request  Mon Jan  6 16:34:14 1992
  457. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Mon, 6 Jan 92 16:34:14 MST
  458. Received: from ucbvax.Berkeley.EDU by optima.cs.arizona.edu (4.1/15)
  459.     id AA20619; Mon, 6 Jan 92 16:34:11 MST
  460. Received: by ucbvax.Berkeley.EDU (5.63/1.43)
  461.     id AA19778; Mon, 6 Jan 92 15:22:35 -0800
  462. Received: from USENET by ucbvax.Berkeley.EDU with netnews
  463.     for icon-group@cs.arizona.edu (icon-group@cs.arizona.edu)
  464.     (contact usenet@ucbvax.Berkeley.EDU if you have questions)
  465. Date: 21 Dec 91 04:52:15 GMT
  466. From: news@psuvax1.cs.psu.edu  (Felix Lee)
  467. Organization: Penn State Computer Science
  468. Subject: Re: Memory Mangement
  469. Message-Id: <lfdH+&=f4@cs.psu.edu>
  470. References: <1991Dec19.015629.3966@utagraph.uta.edu>
  471. Sender: icon-group-request@cs.arizona.edu
  472. To: icon-group@cs.arizona.edu
  473.  
  474. >     Mathematica does memory management with reference counts, 
  475. >     so that pieces of memory are freed as soon as they stop
  476. >     being used.  This means that Mathematica can make use of
  477. >     essentially all the memory that is available on a 
  478. >     particular computer, without the need for operations such
  479. >     as garbage collection.  (Mathematica by Wolfram 1988:xvi)
  480.  
  481. This is called "propaganda": condensing many subtle issues into a
  482. sweeping, positive-image statement.
  483.  
  484. The memory management problem is this: if X used to refer to A but now
  485. refers to B, you can reuse the memory occupied by A, but only if
  486. noone else is using A.
  487.  
  488. Reference counting (RC) is giving each object a count of how many
  489. things are using it.  When you assign X = A, you increase A's count by
  490. one.  When you later assign X = B, you decrease A's count, and
  491. increase B's count.  When the count for something reaches zero, you
  492. know that noone is using it, so you can reclaim it.
  493.  
  494. The main flaw is this does not handle circular references.  Say that A
  495. refers to B and B refers to A, but neither A nor B is being used any
  496. more.  In principle you can reclaim both A and B, but RC cannot
  497. discover this fact easily.  This isn't a problem if you can't create
  498. recursive structures.  Perhaps Mathematica forbids them.  But these
  499. types of structures are quite natural and common in languages like
  500. Icon and Lisp.
  501.  
  502. Garbage collection (GC) strategies are more general than RC.  Rather
  503. than continually doing RC bookkeeping, you periodically discover which
  504. objects are in use and reclaim everything else.  There are several
  505. different strategies for this, with different contraints and
  506. characteristics.  I'm not going to describe them here.
  507.  
  508. The main flaw with GC is it has a bad image.  At apparently random
  509. times, the system may pause for several seconds to do GC.  But modern
  510. GC systems tend to behave well, and there's still plenty of active
  511. research into improving GC in different ways.
  512.  
  513. There is good evidence that, overall, GC is more efficient than RC.
  514. All the bookkeeping involved in RC doesn't come free.  However, the
  515. costs get amortized over all operations, giving you a more predictable
  516. response time.  This is attractive for interactive and real-time use,
  517. as long as you can ignore the circular-reference problem.  Incremental
  518. and concurrent GC strategies may be viable alternatives.
  519.  
  520. Memory fragmentation is a related issue.  If you allocate variably
  521. sized pieces of memory, then the available memory in the system tends
  522. to become scattered into many small pieces over the course of many
  523. allocations and deallocations.
  524.  
  525. Now say you need to allocate 16 bytes.  There may be more than 1600
  526. bytes of memory available, but you won't be able to use any of it if
  527. all the pieces are smaller than 16 bytes.  RC is not enough to ensure
  528. you can actually use "all the memory that is available on a particular
  529. computer".
  530.  
  531. Pathological fragmentation is unavoidable in general unless you do
  532. garbage compaction.  This involves moving all the objects in memory to
  533. collect the available memory into a single area.  This suffers from
  534. all the performance objections that apply to GC.  Note, however, that
  535. with some types of GC you get compaction for free.
  536.  
  537. Now, try to condense all this into a simple blurb.  "Mathematica uses
  538. reference counting instead of garbage collection because it seemed
  539. like a good idea at the time."  Not very marketroidish...
  540. --
  541. Felix Lee    flee@cs.psu.edu
  542.  
  543. From icon-group-request  Tue Jan  7 17:37:14 1992
  544. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Tue, 7 Jan 92 17:37:14 MST
  545. Received: from ucbvax.Berkeley.EDU by optima.cs.arizona.edu (4.1/15)
  546.     id AA21434; Tue, 7 Jan 92 17:37:11 MST
  547. Received: by ucbvax.Berkeley.EDU (5.63/1.43)
  548.     id AA17595; Tue, 7 Jan 92 16:20:34 -0800
  549. Received: from USENET by ucbvax.Berkeley.EDU with netnews
  550.     for icon-group@cs.arizona.edu (icon-group@cs.arizona.edu)
  551.     (contact usenet@ucbvax.Berkeley.EDU if you have questions)
  552. Date: 6 Jan 92 22:50:53 GMT
  553. From: autodesk!drake@apple.com  (Dan Drake)
  554. Organization: Autodesk Inc., Sausalito CA, USA
  555. Subject: Re: tic-tac-toe
  556. Message-Id: <9512@autodesk.COM>
  557. References: <1992Jan3.071219.3395@uniwa.uwa.oz.au+
  558. Sender: icon-group-request@cs.arizona.edu
  559. To: icon-group@cs.arizona.edu
  560.  
  561. gudjm@uniwa.uwa.oz.au (D John McKenna) writes:
  562. + Your mention of a learning tic-tac-toe reminds me of something I saw in
  563. + some book produced by Reader's Digest many years ago. This was circa
  564. + 1980, maybe earlier.
  565. + There was a method of creating a learning tic-tac-toe system, where
  566. + every possible situation (except reflections, of course) were drawn on a
  567. + macthbox - that is, one matchbox per situation. Each possible next move
  568. + by the opponent was drawn in a different colour - ie green if the
  569. + opponent moves into the top left corner, red if the opponent moves into
  570. + the centre, etc. Each move is represented by a coloured bead in the
  571. + matchbox.  Once this is all set up, you begin playing.
  572.  
  573. Reader's Digest?  Interesting.  It was first written up in the early
  574. 60's in the Amateur Scientist department (I think) of Scientific
  575. American.  It was called Matchbox Educable Naughts And Crosses Engine, or
  576. Menace.  No worse than Oak Ridge Automatic Computing and Logical Engine,
  577. which was an ORACLE long before Larry whatsisname got into business.
  578.  
  579. + ...
  580. + Now I think about it, the game wasn't tic-tac-toe - it was played on a 3
  581. + by 3 grid with chess pawns - the top row had 3 pawns belonging to the
  582. + human, and the bottom row had 3 pawns belonging to the system.  But the
  583. + same principles applied.  It was interesting to me - I was probably
  584. + younger than ten when I did this - my first contact with AI I suppose,
  585. + although I didn't know it at the time.
  586.  
  587. The Hexpawn game was described in the same SciAm article, as another
  588. candidate for this treatment.  I implemented it as my first non-trivial
  589. assembler program, on an IBM 1620 in 1965.  Decimal assembly language.
  590. NO arithmetic capability in the hardware; just table lookup.  160
  591. microseconds for a NO-OP.  Those were the days.
  592.  
  593. --
  594. Dan Drake             "When you're as good as I am, it's hard to be humble"
  595. drake@Autodesk.com    "It wasn't hard for Einstein; so what's _your_ problem?"
  596.  
  597. From icon-group-request  Tue Jan  7 19:22:40 1992
  598. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Tue, 7 Jan 92 19:22:40 MST
  599. Received: from ucbvax.Berkeley.EDU by optima.cs.arizona.edu (4.1/15)
  600.     id AA24614; Tue, 7 Jan 92 19:22:38 MST
  601. Received: by ucbvax.Berkeley.EDU (5.63/1.43)
  602.     id AA23397; Tue, 7 Jan 92 18:16:49 -0800
  603. Received: from USENET by ucbvax.Berkeley.EDU with netnews
  604.     for icon-group@cs.arizona.edu (icon-group@cs.arizona.edu)
  605.     (contact usenet@ucbvax.Berkeley.EDU if you have questions)
  606. Date: 7 Jan 92 16:58:51 GMT
  607. From: walter!MERLIN.ims.bellcore.com!attila@uunet.uu.net  (Leslie A. Walko)
  608. Organization: Bellcore - IMS, Morristown, NJ
  609. Subject: windows interface ?
  610. Message-Id: <1992Jan7.165851.20951@walter.bellcore.com>
  611. Sender: icon-group-request@cs.arizona.edu
  612. To: icon-group@cs.arizona.edu
  613.  
  614. Hello, 
  615.  
  616. Is there an operating system independent graphic system for Icon?  
  617. What I have in mind is a UIMS such as CLIM (Common Lisp Interface
  618. Management System) that can provide high level graphics and presentation
  619. services.  
  620.  
  621. Thank you,
  622. Leslie A. Walko
  623. attila@bellcore.com
  624.  
  625. From cfcl!rdm@apple.com  Wed Jan  8 00:51:23 1992
  626. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Wed, 8 Jan 92 00:51:23 MST
  627. Received: from apple.com by optima.cs.arizona.edu (4.1/15)
  628.     id AA04369; Wed, 8 Jan 92 00:51:18 MST
  629. Received: by apple.com (5.61/10-Dec-1991-eef)
  630.     id AA04511; Tue, 7 Jan 92 23:38:53 -0800
  631.     for 
  632. Received: by cfcl.uucp (4.1/SMI-4.1)
  633.     id AA17517; Tue, 7 Jan 92 22:38:00 PST
  634. Date: Tue, 7 Jan 92 22:38:00 PST
  635. From: cfcl!rdm@apple.com (Rich Morin)
  636. Message-Id: <9201080638.AA17517@cfcl.uucp>
  637. To: icon-group@cs.arizona.edu
  638. Subject: Re:  windows interface ?  (Or: Icon do Windows?)
  639.  
  640. I tried hacking Icon together with NeWS a few years back.  It wasn't too
  641. hard to do; I just allowed Icon to open I/O channels with the NeWS server.
  642. The programs then emitted commands as text PostScript strings.  I never
  643. pursued it, however, so I can't say whether it would have worked out well.
  644.  
  645. If I were to try it today, I think I would tie in with a high-level X11
  646. toolkit.  Tk (ftp: sprite.berkeley.edu) might be an interesting choice.
  647. It is written in C, making it easy to hack onto Icon. The relevant paper is:
  648.  
  649.   An X11 Toolkit based on the Tcl Language
  650.   John K. Ousterhout
  651.   USENIX Conference Proceedings, Winter, 1991
  652.  
  653. Here's the Abstract:
  654.  
  655.   This paper describes a new toolkit for X11 called Tk.  The overall functions
  656.   provided by Tk are similar to those of the standard toolkit Xt.  However,
  657.   Tk is implemented using Tcl, a lightweight interpretive command language.
  658.   This means that Tk's functions are available not just from C code compiled
  659.   into the application but also via Tcl commands issued dynamically while the
  660.   application runs.  Tcl commands are used for binding keystrokes and other
  661.   events to application-specified actions, for creating and configuring
  662.   widgets, and for dealing with geometry managers and the selection.  The use
  663.   of an interpretive language means that any aspect of the user interface may
  664.   be changed dynamically while an application executes.  It also means that
  665.   many interesting applications can be created without writing any new C code,
  666.   simply by writing Tcl scripts for existing applications.  Furthermore,  Tk
  667.   provides a special "send" command that allows any Tk-based application to
  668.   invoke Tcl commands in any other Tk-based application.  Send allows
  669.   applications to communicate in more powerful ways than a selection
  670.   mechanism and makes it possible to replace monolithic applications with
  671.   collections of reusable tools.
  672.  
  673. From icon-group-request  Sun Jan 12 07:27:21 1992
  674. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Sun, 12 Jan 92 07:27:21 MST
  675. Received: from ucbvax.Berkeley.EDU by optima.cs.arizona.edu (4.1/15)
  676.     id AA05986; Sun, 12 Jan 92 07:27:19 MST
  677. Received: by ucbvax.Berkeley.EDU (5.63/1.43)
  678.     id AA16412; Sun, 12 Jan 92 06:12:51 -0800
  679. Received: from USENET by ucbvax.Berkeley.EDU with netnews
  680.     for icon-group@cs.arizona.edu (icon-group@cs.arizona.edu)
  681.     (contact usenet@ucbvax.Berkeley.EDU if you have questions)
  682. Date: 30 Dec 91 22:03:32 GMT
  683. From: uchinews!ellis!goer@speedy.wisc.edu  (Richard L. Goerwitz)
  684. Organization: University of Chicago Computing Organizations
  685. Subject: bibleref-2.2
  686. Message-Id: <1991Dec30.220332.4899@midway.uchicago.edu>
  687. Sender: icon-group-request@cs.arizona.edu
  688. To: icon-group@cs.arizona.edu
  689.  
  690. For anyone who wants it, a maintenance update of bibleref has been
  691. placed in ~ftp/icon/contrib/bibleref-2.2.tar.Z on cs.arizona.edu.
  692. Bibleref is a King James Bible text retrieval program geared for
  693. UNIX systems.  It comes with a pre-indexed, compressed King James
  694. text, but other texts can be indexed as well (e.g. the CCAT RSV
  695. text with the Catholic Apocrypha, the Princeton Qur'an, and the
  696. Book of Mormon).
  697.  
  698. I've not tried running the program under anything but UNIX.  It
  699. can't run under DOS because of the 64k executable size-limit, but
  700. maybe it would run under VMS - ?  Dunno.
  701.  
  702. Anyone wanting additional information, please drop me a line.
  703.  
  704. -- 
  705.  
  706.    -Richard L. Goerwitz              goer%sophist@uchicago.bitnet
  707.    goer@sophist.uchicago.edu         rutgers!oddjob!gide!sophist!goer
  708.  
  709. From LARSSON@sj03.ts.tele.nokia.fi  Mon Jan 13 08:18:53 1992
  710. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Mon, 13 Jan 92 08:18:53 MST
  711. Received: from SJ03.TS.TELE.NOKIA.FI by optima.cs.arizona.edu (4.1/15)
  712.     id AA07720; Mon, 13 Jan 92 08:18:43 MST
  713. Date:    Mon, 13 Jan 1992 17:18:45 GMT+0300
  714. From: LARSSON@sj03.ts.tele.nokia.fi (Arne Larsson tel 358-0-5117476 fax 358-0-51044287)
  715. Message-Id: <920113171845.23a0849b@sjclus.tele.nokia.fi>
  716. Subject: Icon on HP Apollo under Domain/OS?
  717. To: icon-group@cs.arizona.edu
  718. X-Vmsmail-To: INET::"icon-group@cs.arizona.edu"
  719.  
  720.         Have the Icon programming language been ported
  721.         to the HP Apollo hardware running under Domain/OS
  722.         SR 10.2 and/or higher.
  723.  
  724.         If so, would there be a binary downloadable using
  725.         FTP from cs.arizona.edu?
  726.  
  727.         Best regards,
  728.         Arne Larsson
  729.  
  730.  
  731. From isidev!nowlin@uunet.uu.net  Mon Jan 13 15:57:27 1992
  732. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Mon, 13 Jan 92 15:57:27 MST
  733. Received: from relay1.UU.NET by optima.cs.arizona.edu (4.1/15)
  734.     id AA29311; Mon, 13 Jan 92 15:57:24 MST
  735. Received: from uunet.uu.net (via LOCALHOST.UU.NET) by relay1.UU.NET with SMTP 
  736.     (5.61/UUNET-internet-primary) id AA05558; Mon, 13 Jan 92 17:57:20 -0500
  737. Date: Mon, 13 Jan 92 17:57:20 -0500
  738. From: isidev!nowlin@uunet.uu.net
  739. Message-Id: <9201132257.AA05558@relay1.UU.NET>
  740. Received: from isidev.UUCP by uunet.uu.net with UUCP/RMAIL
  741.     (queueing-rmail) id 175706.8102; Mon, 13 Jan 1992 17:57:06 EST
  742. To: uunet!cs.arizona.edu!icon-group@uunet.uu.net
  743. Subject: large integer bug?
  744.  
  745. This may be related to an earlier problem with large integers that was
  746. posted a while back but I just recently noticed a problem with large
  747. integers that work just fine for other operations but bomb with run-time
  748. error 101 when used with "to".  This program illustrates:
  749.  
  750.         procedure main(args)
  751.                 local i
  752.                 while i := integer(get(args)) do {
  753.                         write(i)
  754.                         every write("\t",(i-4) to i)
  755.                 }
  756.         end
  757.  
  758. If this program is invoked with 1234567890 and 999999999999999:
  759.  
  760.         $ testint 1234567890 999999999999999
  761.         1234567890
  762.                 1234567886
  763.                 1234567887
  764.                 1234567888
  765.                 1234567889
  766.                 1234567890
  767.         999999999999999
  768.         Run-time error 101
  769.         File testint.icn; Line 5
  770.         integer expected
  771.         offending value: 999999999999995
  772.         Trace back:
  773.            main(list_1 = [])
  774.            {999999999999995 to 999999999999999 by 1} from line 5 in testint.icn
  775.  
  776. it can convert both strings to integers and can subtract 4 from each but it
  777. croaks when it tries to use 999999999999995 in the every loop.  Any
  778. thoughts?
  779.  
  780. --- ---
  781.  | S | Iconic Software, Inc.  -  Jerry Nowlin  -  uunet!isidev!nowlin
  782. --- ---
  783.  
  784.  
  785. From ralph  Mon Jan 13 16:22:06 1992
  786. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Mon, 13 Jan 92 16:22:06 MST
  787. Received: from relay1.UU.NET by optima.cs.arizona.edu (4.1/15)
  788.     id AA01345; Mon, 13 Jan 92 16:22:04 MST
  789. Received: from optima.cs.arizona.edu by relay1.UU.NET with SMTP 
  790.     (5.61/UUNET-internet-primary) id AA13471; Mon, 13 Jan 92 18:21:49 -0500
  791. Received: from cheltenham.cs.arizona.edu by optima.cs.arizona.edu (4.1/15)
  792.     id AA01308; Mon, 13 Jan 92 16:21:48 MST
  793. Date: Mon, 13 Jan 92 16:21:46 MST
  794. From: "Ralph Griswold" <ralph@cs.arizona.edu>
  795. Message-Id: <9201132321.AA13804@cheltenham.cs.arizona.edu>
  796. Received: by cheltenham.cs.arizona.edu; Mon, 13 Jan 92 16:21:46 MST
  797. To: isidev!nowlin@uunet.uu.net, cs.arizona.edu!icon-group@uunet.uu.net
  798. Subject: Re:  large integer bug?
  799.  
  800. Large integers are not supported in
  801.  
  802.     i to j
  803.  
  804. and
  805.     seq()
  806.  
  807. This is documented, although it might be easy to overlook.  The
  808. reason is that supporting large integers in these situations would
  809. have a significant performance impact on the customary use.
  810.     
  811.     Ralph Griswold / Department of Computer Science 
  812.     The University of Arizona / Tucson, AZ 85721
  813.     
  814.     ralph@cs.arizona.edu / uunet!arizona!ralph
  815.     
  816.     voice: 602-621-6609 / fax: 602-621-9618
  817.  
  818. From kwalker  Mon Jan 13 16:56:54 1992
  819. Received: from ocotillo.cs.arizona.edu by cheltenham.cs.arizona.edu; Mon, 13 Jan 92 16:56:54 MST
  820. Date: Mon, 13 Jan 92 16:56:53 MST
  821. From: "Kenneth Walker" <kwalker>
  822. Message-Id: <9201132356.AA01101@ocotillo.cs.arizona.edu>
  823. Received: by ocotillo.cs.arizona.edu; Mon, 13 Jan 92 16:56:53 MST
  824. To: icon-group
  825. Subject: Re:  large integer bug?
  826.  
  827. Part of the confusion in trying to use large integers in "to" is that
  828. in V8.0 the error message is
  829.  
  830.     integer expected
  831.  
  832. that is fixed in future releases by changing it to
  833.  
  834.     integer expected or out of range
  835.  
  836.   Ken Walker / Computer Science Dept / Univ of Arizona / Tucson, AZ 85721
  837.   +1 602 621-4252  kwalker@cs.arizona.edu {uunet|allegra|noao}!arizona!kwalker
  838.  
  839. From icon-group-request  Tue Jan 14 15:36:29 1992
  840. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Tue, 14 Jan 92 15:36:29 MST
  841. Received: from ucbvax.Berkeley.EDU by optima.cs.arizona.edu (4.1/15)
  842.     id AA26091; Tue, 14 Jan 92 15:36:22 MST
  843. Received: by ucbvax.Berkeley.EDU (5.63/1.43)
  844.     id AA10408; Tue, 14 Jan 92 14:32:00 -0800
  845. Received: from USENET by ucbvax.Berkeley.EDU with netnews
  846.     for icon-group@cs.arizona.edu (icon-group@cs.arizona.edu)
  847.     (contact usenet@ucbvax.Berkeley.EDU if you have questions)
  848. Date: 2 Jan 92 19:22:27 GMT
  849. From: att!cbnewsj!dsk@ucbvax.berkeley.edu  (donald.s.klett)
  850. Organization: AT&T Bell Laboratories
  851. Subject: Icon Version 8 System for Mac
  852. Message-Id: <1992Jan2.192227.3854@cbnewsj.cb.att.com>
  853. Sender: icon-group-request@cs.arizona.edu
  854. To: icon-group@cs.arizona.edu
  855.  
  856. I have ported the Icon translator and interpreter to the Macintosh using
  857. THINK C 5.0.1 under System 7.  This is not the MPW version.  I used the
  858. "console" feature in THINK C.  Since I am not sure how much interest there
  859. is in the Mac community, I will initially offer to e-mail the binaries to
  860. anyone interested.  Just send e-mail making the request.  Source code is not
  861. available from me, but may be available from the Icon project.  I submitted
  862. the ported code to the project.
  863. At this stage, coexpressions are not activated, and calling C routines is
  864. not supported.
  865.  
  866. Don Klett
  867. dsk@arch3.att.com
  868. (908)949-2283
  869.  
  870. From icon-group-request  Tue Jan 14 17:51:39 1992
  871. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Tue, 14 Jan 92 17:51:39 MST
  872. Received: from ucbvax.Berkeley.EDU by optima.cs.arizona.edu (4.1/15)
  873.     id AA01375; Tue, 14 Jan 92 17:51:33 MST
  874. Received: by ucbvax.Berkeley.EDU (5.63/1.43)
  875.     id AA17429; Tue, 14 Jan 92 16:41:19 -0800
  876. Received: from USENET by ucbvax.Berkeley.EDU with netnews
  877.     for icon-group@cs.arizona.edu (icon-group@cs.arizona.edu)
  878.     (contact usenet@ucbvax.Berkeley.EDU if you have questions)
  879. Date: 2 Jan 92 19:47:27 GMT
  880. From: cis.ohio-state.edu!zaphod.mps.ohio-state.edu!qt.cs.utexas.edu!yale.edu!jvnc.net!netnews.upenn.edu!msuinfo!uchinews!ellis!goer@ucbvax.berkeley.edu  (Richard L. Goerwitz)
  881. Organization: University of Chicago Computing Organizations
  882. Subject: bibleref, more info
  883. Message-Id: <1992Jan2.194727.10677@midway.uchicago.edu>
  884. Sender: icon-group-request@cs.arizona.edu
  885. To: icon-group@cs.arizona.edu
  886.  
  887. I have been asked to offer more information about Bibleref.  It's not
  888. a very complicated program, but I've certainly found it useful.  A tri-
  889. lingual version (English-Hebrew-Aramaic) is actually the driving data
  890. collection tool for my dissertation.  (Don't ask me for the trilingual
  891. version, though; I can't possible maintain it at other sites.)  I've
  892. appended part of the README file for Bibleref below.  I hope this satis-
  893. fies the requests for additional information I've received.  If not,
  894. please drop me a line.
  895.  
  896.  
  897. --------
  898.  
  899.  
  900. Program:  Bibleref  (version 2.2)
  901. Language: Icon
  902. Purpose:  Perform word and passage-based retrievals on the King
  903.       James or CCAT Revised Standard versions of the Bible
  904.       (check with me if you have a Greek New Testament online)
  905.  
  906. Files: bibleref.src convertb.icn convertr.icn listutil.icn
  907.        name2num.icn passutil.icn readfile.icn ref2bmap.icn
  908.        srchutil.icn
  909.  
  910. Requires: Icon version 8, a working, up-to-date Icon Program Library
  911.       (see below on IPATH), and a King James or RSV Bible text
  912.       (the latest from helens.stanford.edu; write me if yours is
  913.       different)
  914.  
  915.  
  916. --------
  917.  
  918.  
  919. Overview:
  920.  
  921.     This package, Bibleref, offers simple tools for word and
  922. passage-based access to the King James or Revised Standard Version of
  923. the Bible on UNIX platforms.  Bibleref is quick, and fairly easy to
  924. install (assuming you possess a suitable King James Bible text, a
  925. sufficiently powerful machine, and know a little about Icon).  It will
  926. also run with stock terminals - even nasty old ones that leave magic
  927. cookies on your screen.  Bibleref will, however, put a significant
  928. dent in your mass storage resources.  Your 4-5 megabyte King James or
  929. RSV text will get block Huffman encoded, which will bring it down to
  930. about three.  The freed space, however, will be gobbled up immediately
  931. by some 2 megabytes of auxiliary files, and by the 150k executable
  932. (more if you compile, rather than interpret).  In-core requirements
  933. for the executable start at about 300k, and go up from there (if your
  934. searches are complex enough, you could easily eat up two or three
  935. megabytes).  In brief: Bibleref has a large appetite for memory.  Once
  936. set up, though, it can operate with fairly minimal impact on the CPU.
  937.     With Bibleref, you can perform most of the more basic,
  938. low-level functions commercial Bible browsing packages offer (and
  939. perhaps a few not found in some of the commercial packages).  You can,
  940. for example,
  941.  
  942.     -  retrieve any passage in the Bible instantaneously
  943.     -  move forward or backward relative to the retrieved passage
  944.     -  search the entire Bible for words and/or word-patterns
  945.     -  search for word co-occurrences (or the absence thereof)
  946.     -  save passages and/or passage-lists for use with an editor
  947.  
  948. Although this program is hardly the product of any major research
  949. effort :-), it should prove sophisticated enough for quick lookup of
  950. passages whose precise location you have forgotten, for research on
  951. sermons and Bible study classes, and for general topical perusal of
  952. the biblical text.
  953.  
  954.  
  955. --------
  956.  
  957.  
  958. Installation:
  959.  
  960.     The following set-up and installation instructions generally
  961. assume that you received Bibleref as a shell archive, with no prebuilt
  962. data files.  If you snarfed it from an ftp site, with the data files
  963. already built, you can skip all the instructions about obtaining and
  964. indexing a King James Bible text.  If there's any doubt over whether
  965. your data files are prebuilt, check to see if the file "index.done"
  966. exists in your Bibleref source directory.  If it does, then your data
  967. files have already been built.  Otherwise, you'll need to do a "from
  968. scratch" installation.
  969.     In brief, the setup process consists of the following steps
  970. (those with prebuilt data files only need to do the starred ones):
  971.  
  972.     *  make sure Icon is installed & your IPATH variable is set
  973.     -  get a hold of a KJV or RSV text
  974.     -  unpack the text & link the files to the current directory
  975.     *  modify the makefile to suit your machine
  976.     *  make
  977.  
  978. Although I will discuss it below briefly, installation of the Icon
  979. programming language falls outside the scope of this manual.  I will
  980. therefore begin setup instructions with directions on how to get a
  981. biblical text, and how to set it up for indexing.
  982.  
  983. And so on... (blah, blah, blah)
  984.  
  985. -- 
  986.  
  987.    -Richard L. Goerwitz              goer%sophist@uchicago.bitnet
  988.    goer@sophist.uchicago.edu         rutgers!oddjob!gide!sophist!goer
  989.  
  990. From icon-group-request  Wed Jan 15 08:34:28 1992
  991. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Wed, 15 Jan 92 08:34:28 MST
  992. Received: from ucbvax.Berkeley.EDU by optima.cs.arizona.edu (4.1/15)
  993.     id AA08139; Tue, 14 Jan 92 22:20:36 MST
  994. Received: by ucbvax.Berkeley.EDU (5.63/1.43)
  995.     id AA02147; Tue, 14 Jan 92 21:07:59 -0800
  996. Received: from USENET by ucbvax.Berkeley.EDU with netnews
  997.     for icon-group@cs.arizona.edu (icon-group@cs.arizona.edu)
  998.     (contact usenet@ucbvax.Berkeley.EDU if you have questions)
  999. Date: 2 Jan 92 22:40:15 GMT
  1000. From: mcsun!sun4nl!wn1.sci.kun.nl!news@uunet.uu.net  (NUnet News Owner)
  1001. Organization: University of Nijmegen
  1002. Subject: test
  1003. Message-Id: <1992Jan2.224015.13121@sci.kun.nl>
  1004. Sender: icon-group-request@cs.arizona.edu
  1005. To: icon-group@cs.arizona.edu
  1006.  
  1007. this is the first line.
  1008. This is he second line.
  1009. This is the third line.
  1010. Sorry folks, this test is very important for me.
  1011.  
  1012. From cliff  Fri Jan 17 11:32:46 1992
  1013. Received: from javelina.cs.arizona.edu by cheltenham.cs.arizona.edu; Fri, 17 Jan 92 11:32:46 MST
  1014. Date: Fri, 17 Jan 92 11:32:42 MST
  1015. From: "Cliff Hathaway" <cliff>
  1016. Message-Id: <9201171832.AA03711@javelina.cs.arizona.edu>
  1017. Received: by javelina.cs.arizona.edu; Fri, 17 Jan 92 11:32:42 MST
  1018. To: icon-group
  1019. Subject: resending message
  1020.  
  1021.  
  1022. The disk that the icon-group mailinglist address file resides on went down
  1023. yesterday - here's a message that apparently didn't make it out.
  1024.  
  1025.  
  1026.     Cliff Hathaway
  1027.     Dept. of Computer Science (602)621-4291
  1028.     University of Arizona     cliff@cs.arizona.edu             (internet) 
  1029.     Tucson, Ariz. 85721          {cmcl2,noao,uunet}!arizona!cliff    (uucp)
  1030.  
  1031. =============  forwarded message starts here  ================================
  1032.  
  1033. Received: from ucbvax.Berkeley.EDU by optima.cs.arizona.edu (4.1/15)
  1034.         id AA01541; Thu, 16 Jan 92 19:59:08 MST
  1035. Received: by ucbvax.Berkeley.EDU (5.63/1.43)
  1036.         id AA28720; Thu, 16 Jan 92 18:56:28 -0800
  1037. Received: from USENET by ucbvax.Berkeley.EDU with netnews
  1038.         for icon-group@cs.arizona.edu (icon-group@cs.arizona.edu)
  1039.         (contact usenet@ucbvax.Berkeley.EDU if you have questions)
  1040. Date: 15 Jan 92 23:58:06 GMT
  1041. From: pa.dec.com!nntpd.lkg.dec.com!tle.enet.dec.com!ellenberger@decwrl.dec.com  (John Ellenberger)
  1042. Organization: Digital Equipment Corporation
  1043. Subject: New Version of Catspaw Snobol Available
  1044. Message-Id: <32582@nntpd.lkg.dec.com>
  1045. Sender: icon-group-request@cs.arizona.edu
  1046. To: icon-group@cs.arizona.edu
  1047.  
  1048. This month's BYTE article on Snobol mentions a free implmentation
  1049. of the language available on the network.  Unfortunately the version
  1050. available in most archives (uu, wuarchive, simtel) is out of date 
  1051. and will not work on some PCs (486s in particular).
  1052.  
  1053. Catspaw Inc. has provided an up to date version and I have downloaded
  1054. it to GATEKEEPER for general use.  Fell free to propigate it to the 
  1055. other archives if you wish.  It can be ftp'd from:
  1056.  
  1057.         gatekeeper:/pub/micro/msdos/Snobol/vanilla.zip
  1058.  
  1059. Any questions/concerns/orders should be directed to:
  1060.  
  1061.         Catspaw, Inc.
  1062.         P.O. Box 1123
  1063.         Salida, Colorado 81201
  1064.         719-539-3884
  1065.         FAX 539-4830
  1066.         AppleLink D6941
  1067.         CompuServe 76176,1304
  1068.         Internet emmer@cs.arizona.edu
  1069.  
  1070.  
  1071. From @castle.edinburgh.ac.uk,@emas-a.edinburgh.ac.uk:R.J.Hare@edinburgh.ac.uk  Fri Jan 17 12:41:31 1992
  1072. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Fri, 17 Jan 92 12:41:31 MST
  1073. Received: from sun2.nsfnet-relay.ac.uk by optima.cs.arizona.edu (4.1/15)
  1074.     id AA26478; Fri, 17 Jan 92 12:41:07 MST
  1075. Received: from castle.edinburgh.ac.uk by sun2.nsfnet-relay.ac.uk via JANET 
  1076.           with NIFTP id <14322-5@sun2.nsfnet-relay.ac.uk>;
  1077.           Fri, 17 Jan 1992 13:24:47 +0000
  1078. Received: from emas-a.ed.ac.uk by castle.ed.ac.uk id aa21167;
  1079.           17 Jan 92 12:15 WET
  1080. Date: 17 Jan 92 12:16:32 gmt
  1081. From: R.J.Hare@edinburgh.ac.uk
  1082. Subject: Test
  1083. To: icon-group@cs.arizona.edu
  1084. Message-Id: <17 Jan 92 12:16:32 gmt 320862@EMAS-A>
  1085. Sender: "R.J.Hare" <@emas-a.edinburgh.ac.uk:R.J.Hare@edinburgh.ac.uk>
  1086.  
  1087. This also is a test - problems with mail at this end - please ignore.
  1088. RH
  1089.  
  1090. From icon-group-request  Fri Jan 17 21:48:19 1992
  1091. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Fri, 17 Jan 92 21:48:19 MST
  1092. Received: from ucbvax.Berkeley.EDU by optima.cs.arizona.edu (4.1/15)
  1093.     id AA19476; Fri, 17 Jan 92 21:48:11 MST
  1094. Received: by ucbvax.Berkeley.EDU (5.63/1.43)
  1095.     id AA18359; Fri, 17 Jan 92 20:45:51 -0800
  1096. Received: from USENET by ucbvax.Berkeley.EDU with netnews
  1097.     for icon-group@cs.arizona.edu (icon-group@cs.arizona.edu)
  1098.     (contact usenet@ucbvax.Berkeley.EDU if you have questions)
  1099. Date: 7 Jan 92 11:56:39 GMT
  1100. From: csus.edu!wupost!zaphod.mps.ohio-state.edu!caen!garbo.ucc.umass.edu!risky.ecs.umass.edu!umaecs!amh!kehandley@ucdavis.ucdavis.edu
  1101. Organization: Amherst College, Amherst, MA.
  1102. Subject: MS-DOS Icon limitations?
  1103. Message-Id: <17517.29699577@amherst.edu>
  1104. Sender: icon-group-request@cs.arizona.edu
  1105. To: icon-group@cs.arizona.edu
  1106.  
  1107. Hello all.  Richard Goerwitz recently posted the following to HUMANIST:
  1108.  
  1109. >[MS-DOS's] memory limitations and inability to multitask make it a
  1110. >bit difficult for many of us to stomach (although its small size and
  1111. >relative simplicity make it fine for applications).  Icon is a very
  1112. >high level, OS-independent language, and its implementation was geared
  1113. >for machines with medium or large address spaces and high-level memory
  1114. >management facilities (i.e. UNIX, VMS, etc.).  There is a DOS version
  1115. >available from cs.arizona.edu (which you can obtain via anonymous ftp),
  1116. >and it's very popular.  I found it klunky, though, and the inherent
  1117. >limitations of DOS memory management facilities forced me quickly to
  1118. >move "up."
  1119.  
  1120. My Icon programs aren't nearly as long as Goerwitz's programs that I've
  1121. seen, so I was curious about just what kind of limitation DOS might really
  1122. have for me.  I do my Icon work in VMS.  I decided to see whether the
  1123. program I am currently writing would work on MS-DOS.  Here are the
  1124. VMS and MS-DOS compiles, respectively:
  1125.  
  1126. $ icont create                C:\> icont create
  1127. Translating:                Translating:
  1128. create.icn:                         create.icn:               
  1129.   main (99/15000)                         main (3037/15000)         
  1130.   pow (5/15000)                           pow (179/15000)           
  1131.   get1or2 (8/15000)                       get1or2 (286/15000)       
  1132.   makeprintout (11/15000)                 makeprintout (388/15000) 
  1133.   printit (111/15000)                     printit (3565/15000)     
  1134.   randomseed (8/15000)                    randomseed (267/15000)    
  1135. No errors                               No errors                 
  1136. Linking:                                Linking:                  
  1137. $                                       C:\>                         
  1138.  
  1139. I remember (perhaps incorrectly) that the (99/15000), etc. has to do with
  1140. memory, but I don't remember where I read it.  Anyway, I wonder if
  1141. anyone out there can tell me where to find out.  It appears as though
  1142. some of my procedures are making a dent in MS-DOS Icon, whereas to VMS
  1143. Icon, they are pretty dinky.
  1144.  
  1145. So what's the point of my post?  First, the question above, and second,
  1146. some folks may not know the difference between the compiles across
  1147. platforms, so maybe it is a little interesting.  I am not trying to
  1148. knock MS-DOS.
  1149.  
  1150. Keith Handley
  1151. kehandley@amherst
  1152.  
  1153. From icon-group-request  Sat Jan 18 12:05:29 1992
  1154. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Sat, 18 Jan 92 12:05:29 MST
  1155. Received: from ucbvax.Berkeley.EDU by optima.cs.arizona.edu (4.1/15)
  1156.     id AA11462; Sat, 18 Jan 92 12:05:25 MST
  1157. Received: by ucbvax.Berkeley.EDU (5.63/1.43)
  1158.     id AA17097; Sat, 18 Jan 92 11:00:12 -0800
  1159. Received: from USENET by ucbvax.Berkeley.EDU with netnews
  1160.     for icon-group@cs.arizona.edu (icon-group@cs.arizona.edu)
  1161.     (contact usenet@ucbvax.Berkeley.EDU if you have questions)
  1162. Date: 16 Jan 92 03:42:29 GMT
  1163. From: dorm.rutgers.edu!pilot.njin.net!hedges@princeton.edu  (Douglas Hedges)
  1164. Organization: Rutgers Univ., New Brunswick, N.J.
  1165. Subject: Re: New Version of Catspaw Snobol Available
  1166. Message-Id: <Jan.15.22.42.29.1992.16226@pilot.njin.net>
  1167. References: <32582@nntpd.lkg.dec.com>
  1168. Sender: icon-group-request@cs.arizona.edu
  1169. To: icon-group@cs.arizona.edu
  1170.  
  1171. ellenberger@tle.enet.dec.com (John Ellenberger) writes:
  1172.  
  1173. >This month's BYTE article on Snobol mentions a free implmentation
  1174. >of the language available on the network.  Unfortunately the version
  1175. >available in most archives (uu, wuarchive, simtel) is out of date 
  1176. >and will not work on some PCs (486s in particular).
  1177.  
  1178. >Catspaw Inc. has provided an up to date version and I have downloaded
  1179. >it to GATEKEEPER for general use.  Fell free to propigate it to the 
  1180. >other archives if you wish.  It can be ftp'd from:
  1181.  
  1182. >    gatekeeper:/pub/micro/msdos/Snobol/vanilla.zip
  1183.  
  1184. >Any questions/concerns/orders should be directed to:
  1185.  
  1186. >    Catspaw, Inc.
  1187. >    P.O. Box 1123
  1188. >    Salida, Colorado 81201
  1189. >    719-539-3884
  1190. >    FAX 539-4830
  1191. >    AppleLink D6941
  1192. >    CompuServe 76176,1304
  1193. >    Internet emmer@cs.arizona.edu
  1194.  
  1195. Let me add that Catspaw also has an excellent version
  1196. of Spitbol available for the Mac, MaxSPITBOL.
  1197. Mark Emmer has continued to refine it and has  been
  1198. generous in his update policy.  Note that MaxSPITBOL
  1199. is, unlike the 'vanilla' version of Snobol he makes 
  1200. available for DOS machines, a commercial product
  1201. and  well worth the money at that.
  1202.  
  1203. NOTE:  I've no connection with Catspaw other than
  1204. as a satisfied customer.  It's nice to be able to
  1205. call and speak with Mark himself in re questions
  1206. or  problems.
  1207.  
  1208. From icon-group-request  Sun Jan 19 10:52:06 1992
  1209. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Sun, 19 Jan 92 10:52:06 MST
  1210. Received: from ucbvax.Berkeley.EDU by optima.cs.arizona.edu (4.1/15)
  1211.     id AA13840; Sun, 19 Jan 92 10:52:04 MST
  1212. Received: by ucbvax.Berkeley.EDU (5.63/1.43)
  1213.     id AA26974; Sun, 19 Jan 92 09:45:58 -0800
  1214. Received: from USENET by ucbvax.Berkeley.EDU with netnews
  1215.     for icon-group@cs.arizona.edu (icon-group@cs.arizona.edu)
  1216.     (contact usenet@ucbvax.Berkeley.EDU if you have questions)
  1217. Date: 16 Jan 92 11:21:41 GMT
  1218. From: dog.ee.lbl.gov!network.ucsd.edu!swrinde!cs.utexas.edu!qt.cs.utexas.edu!zaphod.mps.ohio-state.edu!sol.ctr.columbia.edu!ira.uka.de!gmdzi!icking@ucbvax.berkeley.edu  (Werner Icking)
  1219. Organization: GMD, St. Augustin, F.R. Germany
  1220. Subject: Re: New Version of Catspaw Snobol Available
  1221. Message-Id: <6744@gmdzi.gmd.de>
  1222. References: <32582@nntpd.lkg.dec.com>
  1223. Sender: icon-group-request@cs.arizona.edu
  1224. To: icon-group@cs.arizona.edu
  1225.  
  1226. ellenberger@tle.enet.dec.com (John Ellenberger) writes:
  1227.  
  1228. >[...]
  1229. >Catspaw Inc. has provided an up to date version and I have downloaded
  1230. >it to GATEKEEPER for general use. [...]
  1231.  
  1232. You mean:  gatekeeper.dec.com? I could ftp it from there :-) Thanks
  1233.  
  1234. >    gatekeeper:/pub/micro/msdos/Snobol/vanilla.zip
  1235. -- 
  1236. Werner Icking         icking@gmdzi.gmd.de         (+49 2241) 14-2443
  1237. GMD - Gesellschaft fuer Mathematik und Datenverarbeitung mbH
  1238. Schloss Birlinghoven, P.O.Box 1316, D-5205 Sankt Augustin 1, Germany
  1239.                                "Der Dativ ist dem Genitiv sein Tod."
  1240.  
  1241. From KKTK_KK@cc.helsinki.fi  Mon Jan 20 11:58:19 1992
  1242. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Mon, 20 Jan 92 11:58:19 MST
  1243. Received: from cc.Helsinki.FI (hylka.Helsinki.FI) by optima.cs.arizona.edu (4.1/15)
  1244.     id AA25506; Mon, 20 Jan 92 11:58:15 MST
  1245. Date: Mon, 20 Jan 1992 20:58 EET
  1246. From: "Kimmo Kettunen; HYLK" <KKTK_KK@cc.helsinki.fi>
  1247. Subject: Subscription
  1248. To: icon-group@cs.arizona.edu
  1249. Message-Id: <F3787F0EE0A04A6C@hylk.Helsinki.FI>
  1250.  
  1251. Hi,
  1252.  
  1253. could you put me on the subscription list of Icon newsgroup. My e-mail
  1254. address is KKTK_KK@CC.HELSINKI.FI.
  1255.  
  1256. Yours,
  1257.  
  1258. Kimmo Kettunen
  1259. Helsinki
  1260.  
  1261.  
  1262.  
  1263. From @castle.edinburgh.ac.uk,@emas-a.edinburgh.ac.uk:R.J.Hare@edinburgh.ac.uk  Mon Jan 20 22:48:15 1992
  1264. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Mon, 20 Jan 92 22:48:15 MST
  1265. Received: from  by optima.cs.arizona.edu (4.1/15)
  1266.     id AB17386; Mon, 20 Jan 92 22:48:08 MST
  1267. Received: from castle.edinburgh.ac.uk by sun2.nsfnet-relay.ac.uk via JANET 
  1268.           with NIFTP id <8208-4@sun2.nsfnet-relay.ac.uk>;
  1269.           Mon, 20 Jan 1992 12:18:49 +0000
  1270. Received: from emas-a.ed.ac.uk by castle.ed.ac.uk id aa22781;
  1271.           20 Jan 92 12:02 WET
  1272. Date: 20 Jan 92 12:03:54 gmt
  1273. From: R.J.Hare@edinburgh.ac.uk
  1274. Subject: Mac Icon
  1275. To: icon-group@cs.arizona.edu
  1276. Message-Id: <20 Jan 92 12:03:54 gmt 320141@EMAS-A>
  1277. Sender: "R.J.Hare" <@emas-a.edinburgh.ac.uk:R.J.Hare@edinburgh.ac.uk>
  1278.  
  1279. I am having great trouble contacting Donald Klett (poster of the THINK C Mac
  1280. Icon) by email - could he please post his email address somwhere in clear
  1281. please (I can't see what is going wrong - I mail to the States every day and
  1282. don't normally have problems).
  1283.  
  1284. Thanks.
  1285.  
  1286. Roger Hare.
  1287.  
  1288. From kwalker  Tue Jan 21 08:51:22 1992
  1289. Received: from ocotillo.cs.arizona.edu by cheltenham.cs.arizona.edu; Tue, 21 Jan 92 08:51:22 MST
  1290. Date: Tue, 21 Jan 92 08:51:20 MST
  1291. From: "Kenneth Walker" <kwalker>
  1292. Message-Id: <9201211551.AA04139@ocotillo.cs.arizona.edu>
  1293. Received: by ocotillo.cs.arizona.edu; Tue, 21 Jan 92 08:51:20 MST
  1294. To: icon-group
  1295. Subject: Re:  MS-DOS Icon limitations?
  1296.  
  1297. > Keith Handley (kehandley@amherst) writes:
  1298. > ...
  1299. > Here are the VMS and MS-DOS compiles, respectively:
  1300. >
  1301. > $ icont create                C:\> icont create
  1302. > Translating:                Translating:
  1303. > create.icn:                         create.icn:               
  1304. >   main (99/15000)                         main (3037/15000)         
  1305. > ...
  1306. > I remember (perhaps incorrectly) that the (99/15000), etc. has to do with
  1307. > memory, but I don't remember where I read it.
  1308.  
  1309. The first number indicates the amount of memory used during translation
  1310. to represent the procedure. The second number is the amount of memory
  1311. reserved for this; it can be changed with the -St option of icont. icont
  1312. is implemented in C and the first number may vary somewhat between
  1313. systems depending how the C compiler represents structures. However, I
  1314. would say that, in your case, at least one set of numbers is bogus. The
  1315. code to print the numbers in our working version of Icon looks okay to me,
  1316. but I haven't checked it out on different platforms to see if it really is.
  1317. I vaguely recall that a problem in that code was fixed a while ago.
  1318.  
  1319. In any event, these numbers don't tell you anything about the run-time
  1320. memory usage of your program.
  1321.  
  1322.   Ken Walker / Computer Science Dept / Univ of Arizona / Tucson, AZ 85721
  1323.   +1 602 621-4252  kwalker@cs.arizona.edu {uunet|allegra|noao}!arizona!kwalker
  1324.  
  1325. From @um.cc.umich.edu:Paul_Abrahams@MTS.cc.Wayne.edu  Thu Jan 23 19:01:44 1992
  1326. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Thu, 23 Jan 92 19:01:44 MST
  1327. Received: from mailrus.cc.umich.edu by optima.cs.arizona.edu (4.1/15)
  1328.     id AA15122; Thu, 23 Jan 92 19:01:37 MST
  1329. Received: from um.cc.umich.edu by mailrus.cc.umich.edu (5.61/1123-1.0)
  1330.     id AA08470; Thu, 23 Jan 92 20:57:24 -0500
  1331. Received: from MTS.cc.Wayne.edu by um.cc.umich.edu via MTS-Net; Thu, 23 Jan 92 19:12:54 EST
  1332. Date: Thu, 23 Jan 92 19:12:38 EST
  1333. From: Paul_Abrahams@mts.cc.wayne.edu
  1334. To: icon-group@cs.arizona.edu
  1335. Message-Id: <407392@MTS.cc.Wayne.edu>
  1336. Subject: Pipes in MS-DOS Icon
  1337.  
  1338. The latest issue of the Icon Analyst discusses several handy uses
  1339. of pipes.  It also points out that pipes are not available under
  1340. the MS-DOS version of Icon and states:
  1341.  
  1342. "Note that the MS-DOS idea of pipes---writing the output of a
  1343. program to a temporary file and then reading that file in another
  1344. program---is bogus."
  1345.  
  1346. In fact, the MS-DOS idea of pipes is only slightly less powerful
  1347. than the Unix version, and including pipes in MS-DOS Icon poses
  1348. no problem in principle.  (Not knowing the code, I can't speak to
  1349. the problems that it might pose in practice.)  Nearly all useful
  1350. cases would be covered by a straightforward implementation of
  1351. pipes in MS-DOS; in particular, such an implementation would
  1352. easily handle all the examples in the Analyst article.  The
  1353. straightforward  and obvious implementation goes like this:
  1354.  
  1355. (1) When opening a pipe for input, execute the command in a
  1356. subshell, save the output in a temporary file, and read that
  1357. temporary file as though you were reading the pipe.
  1358.  
  1359. (2) When opening a pipe for output, save all data written to the
  1360. pipe in a temporary file; when the pipe is closed either
  1361. explicitly or implicitly (at program termination), execute the
  1362. piped command with that file as its standard input.
  1363.  
  1364. To understand why the DOS use of temporary files isn't really so
  1365. far from the Unix treatment of pipes, it helps to look at what
  1366. the Unix treatment of pipes really is.  Unix treats pipes at two
  1367. levels: shell commands and system functions.  The shell commands,
  1368. which are what most users see, behave very much like the DOS
  1369. ones; typing
  1370.    prog1 | prog2
  1371. produces the same effect in either system.
  1372.  
  1373. The underlying mechanism is that the shell sets up a pipe between
  1374. prog1 and prog2 by calling the "pipe" function to obtain a pair
  1375. of file descriptors, one for output and one for input.  The shell
  1376. associates the output descriptor with the output of prog1 and the
  1377. input descriptor with the input of prog2.  The shell then calls
  1378. the system function "fork" twice to establish prog1 and prog2 as
  1379. its child processes.
  1380.  
  1381. The pipe itself uses an internal 4096-byte memory buffer (in
  1382. classic Unix, at least); if no context switching takes place and
  1383. the output of prog1 is less than 4096 bytes long, the sequence of
  1384. events is:
  1385.   (1) prog1 writes its output to the memory buffer.  (If prog2
  1386. tries to start before prog1, it is suspended on its first read
  1387. from standard input.)
  1388.   (2) prog1 fills the memory buffer and terminates.
  1389.   (3) prog2 executes, reading the memory buffer, and terminates.
  1390. In fact, the sequence is almost exactly equivalent to what
  1391. happens under DOS using a RAM disk to hold the temporary file.
  1392.  
  1393. Although other variations are possible under Unix in principle,
  1394. they don't matter much in practice.  For instance, context
  1395. switching might take place so that execution of prog1 and prog2
  1396. is interleaved.  However, if the result depends on the presence
  1397. of such interleaving, prog1 and prog2 are probably not very
  1398. robust.  If the size of the output exceeds the capacity of the
  1399. memory buffer associated with the pipe, interleaving will be
  1400. unavoidable, but still should not affect the result.
  1401.  
  1402. Unix does, of course, also offer the opportunity for a C
  1403. programmer to construct pipes within a program (as the various
  1404. shells do).  Such programmed pipes offer possibilities not
  1405. available at the command-line level or through MS-DOS (although
  1406. some of them can be achieved in MS-DOS through explicit
  1407. subshelling).  For instance, you can connect two processes
  1408. through two independent pipes.  (I don't know how often people
  1409. really do this.)  However, if the pipes don't all flow in the
  1410. same direction, then the possibility of deadlock is immediately
  1411. introduced.  And if they do flow in the same direction, the
  1412. straightforward MS-DOS implementation described above still
  1413. works; it is only necessary to execute the upstream program
  1414. before the downstream program. 
  1415.  
  1416. I don't believe the rare case that is expressible in Unix but not
  1417. in MS-DOS (processes that share pairs of pipes pointing in
  1418. opposite directions) arises very often.  Virtually all of the
  1419. examples I have seen of pipes used for program input and output
  1420. involve system programs such as "ls" (for Unix) or "dir" (for
  1421. MS-DOS).  And even if this case is excluded, the functionality of
  1422. piped commands would be very useful for MS-DOS Icon.
  1423.  
  1424. Another way of looking at it is that Unix provides more possible
  1425. orders of computation than MS-DOS; the temporary file model
  1426. greatly constrains the order of computation.  However, programs
  1427. that are sensitive to the order of computation are unlikely to be
  1428. well-behaved or useful.  Therefore the MS-DOS order must be
  1429. semantically equivalent to any of the Unix orders.  Any
  1430. counterexamples?
  1431.  
  1432. Paul Abrahams
  1433. Abrahams@mts.cc.wayne.edu 
  1434.  
  1435. From ralph  Thu Jan 23 19:20:31 1992
  1436. Date: Thu, 23 Jan 92 19:20:31 MST
  1437. From: "Ralph Griswold" <ralph>
  1438. Message-Id: <9201240220.AA00618@cheltenham.cs.arizona.edu>
  1439. Received: by cheltenham.cs.arizona.edu; Thu, 23 Jan 92 19:20:31 MST
  1440. To: Paul_Abrahams@mts.cc.wayne.edu, icon-group@cs.arizona.edu
  1441. Subject: Re:  Pipes in MS-DOS Icon
  1442.  
  1443. I stand by my statement.  If the output of one process is very large (or
  1444. not bounded), the use of a temporary file as in MS-DOS ranges from
  1445. downright painful to unworkable.
  1446.  
  1447. I'll let my side of the conversation drop there -- this is the kind
  1448. of thing that results in endless "flames" that do little to
  1449. illuminate and only clutter the network.
  1450.     
  1451.     Ralph Griswold / Department of Computer Science 
  1452.     The University of Arizona / Tucson, AZ 85721
  1453.     
  1454.     ralph@cs.arizona.edu / uunet!arizona!ralph
  1455.     
  1456.     voice: 602-621-6609 / fax: 602-621-9618
  1457.  
  1458. From nevin@apple.com  Fri Jan 24 02:05:11 1992
  1459. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Fri, 24 Jan 92 02:05:11 MST
  1460. Received: from apple.com by optima.cs.arizona.edu (4.1/15)
  1461.     id AA08658; Fri, 24 Jan 92 02:05:08 MST
  1462. Received: from [90.134.16.31] by apple.com with SMTP (5.61/10-Dec-1991-eef)
  1463.     id AA25306; Fri, 24 Jan 92 01:04:57 -0800
  1464.     for icon-group@cs.arizona.edu
  1465. Message-Id: <9201240904.AA25306@apple.com>
  1466. Date: Fri, 24 Jan 1992 01:06:13 -0800
  1467. To: icon-group@cs.arizona.edu
  1468. From: nevin@apple.com (Nevin :-] Liber)
  1469. Subject: Re:  Pipes in MS-DOS Icon
  1470. Cc: Paul_Abrahams@mts.cc.wayne.edu
  1471.  
  1472. [This is pretty much off the subject of Icon.  Followup by mail and/or to
  1473. another newsgroup if you feel that you must.]
  1474.  
  1475. Ralph Griswold (ralph@cs.arizona.edu) writes:
  1476. >... If the output of one process is very large (or
  1477. >not bounded), the use of a temporary file as in MS-DOS ranges from
  1478. >downright painful to unworkable.
  1479.  
  1480. Let me second this sentiment.  As someone who once had to make the
  1481. transition from Unix to MS-DOS, I was made painfully aware of how limiting
  1482. MS-DOS pseudo-pipes (or MPW pipes on the Macintosh, for that matter) really
  1483. are.
  1484.  
  1485. One of the most common idioms I use under Unix is something like:
  1486.  
  1487.         command1 | command2 | ... | commandN | more
  1488.  
  1489. where the output of each of the commands is typically much larger than 4K
  1490. (a typical size for a Unix pipe), and I using "more" to do some interactive
  1491. filtering of the data.  If I had to wait until command1 finished running,
  1492. then command2 starting, then command2 ending, then command3 starting, etc.
  1493. (MS-DOS pipes are equivalent to sequential execution of the commands)
  1494. before I could even begin to look at my output, it would at a minimum slow
  1495. me down and take a lot of temporary space.  As a human, I tend to
  1496. implicitly exploit the property that I am pushing through much more data
  1497. than the size of the pipe, and I suspect that most other Unix users do too.
  1498.  
  1499. Many uses of pipes involve looking for a specific piece of information and
  1500. ignoring the rest of the input.  Even if you have a lot of temp space (and
  1501. believe me; it is very frustrating when you run out), this is vastly
  1502. inefficient on an MS-DOS machine.  And if one of the processes happens to
  1503. produce an unbounded amount of output (such as a random sentence generator
  1504. or getting live data from a port and then piping the output to some kind of
  1505. a filter), all bets are off.
  1506.  
  1507. Back when I was using MS-DOS (it should be obvious from my .signature why I
  1508. don't anymore :-)), I was running most of my stuff using the MKS Toolkit
  1509. (an excellent commercial port of most of the Unix utilities).  Even with
  1510. this environment, the scripts I used under Unix were much different than
  1511. the ones I used under MS-DOS, precisely because of the way pipes didn't
  1512. work on my MS-DOS machine.  The sequential execution/temporary file model
  1513. of pipes, although still quite useful, does not even come close to the
  1514. power of a Unix pipe.
  1515.  
  1516.  
  1517. From @um.cc.umich.edu:Paul_Abrahams@MTS.cc.Wayne.edu  Fri Jan 24 20:08:41 1992
  1518. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Fri, 24 Jan 92 20:08:41 MST
  1519. Received: from mailrus.cc.umich.edu by optima.cs.arizona.edu (4.1/15)
  1520.     id AA19622; Fri, 24 Jan 92 20:08:34 MST
  1521. Received: from um.cc.umich.edu by mailrus.cc.umich.edu (5.61/1123-1.0)
  1522.     id AA17741; Fri, 24 Jan 92 22:04:37 -0500
  1523. Received: from MTS.cc.Wayne.edu by um.cc.umich.edu via MTS-Net; Fri, 24 Jan 92 21:17:59 EST
  1524. Date: Fri, 24 Jan 92 21:18:04 EST
  1525. From: Paul_Abrahams@mts.cc.wayne.edu
  1526. To: icon-group@cs.arizona.edu
  1527. Message-Id: <407920@MTS.cc.Wayne.edu>
  1528. Subject: Pipes in MS-DOS Icon (continued)
  1529.  
  1530.  
  1531. I readily concede the point that when intermediate results are
  1532. very large and the ultimate output is being processed
  1533. interactively, the MS-DOS imitation of pipes doesn't work very
  1534. well (or not at all, if the output is unbounded).  Nonetheless
  1535. I still argue that there are many useful applications of the
  1536. MS-DOS model, including practically all of the published examples
  1537. of Icon pipes.  The disk usage implied under MS-DOS is not much
  1538. of a penalty if the disk is a RAM disk---which is easily provided
  1539. for on machines having the hardware capability of typical Unix
  1540. machines.  Moreover, if the temporary files fit on the RAM disk
  1541. and the final output is not being processed interactively, the
  1542. MS-DOS timings (for comparable hardware) should be similar to the
  1543. Unix ones.  In fact, some MS-DOS programs run faster than their
  1544. Unix equivalents on the same hardware; for example, Eberhard
  1545. Mattes's version of TeX, EmTeX, runs about 40% faster than Unix
  1546. TeX on my computer.
  1547.  
  1548. I also point out that "sort" is one of the most commonly used
  1549. filters in a Unix pipeline, and if the amount of data being
  1550. passed through "sort" exceeds the memory capacity, even Unix
  1551. needs to use an intermediate file implicitly.  The same holds for
  1552. any other filter that cannot operate in a single pass.
  1553.  
  1554. Paul Abrahams
  1555. Abrahams@mts.cc.wayne.edu
  1556.  
  1557.  
  1558. From icon-group-request  Fri Jan 24 20:27:34 1992
  1559. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Fri, 24 Jan 92 20:27:34 MST
  1560. Received: from ucbvax.Berkeley.EDU by optima.cs.arizona.edu (4.1/15)
  1561.     id AA20187; Fri, 24 Jan 92 20:27:32 MST
  1562. Received: by ucbvax.Berkeley.EDU (5.63/1.43)
  1563.     id AA17612; Fri, 24 Jan 92 19:12:14 -0800
  1564. Received: from USENET by ucbvax.Berkeley.EDU with netnews
  1565.     for icon-group@cs.arizona.edu (icon-group@cs.arizona.edu)
  1566.     (contact usenet@ucbvax.Berkeley.EDU if you have questions)
  1567. Date: 18 Jan 92 21:19:06 GMT
  1568. From: uchinews!ellis!goer@handies.ucar.edu  (Richard L. Goerwitz)
  1569. Organization: University of Chicago Computing Organizations
  1570. Subject: icon & parsing
  1571. Message-Id: <1992Jan18.211906.23703@midway.uchicago.edu>
  1572. Sender: icon-group-request@cs.arizona.edu
  1573. To: icon-group@cs.arizona.edu
  1574.  
  1575. If one were outputting a LALR(k) parser of some sort in Icon,
  1576. I wonder how states might best be represented.  Normally, one
  1577. can created labeled nodes in the source code to which one sim-
  1578. ply jumps via a goto.  In Icon this isn't possible.  What
  1579. would be better?  To create a coexpression that reads a state
  1580. table, outputting states as needed, and then check these
  1581. states against a (possibly huge) case statement?
  1582.  
  1583. Sorry if these questions sound naive.  I'd appreciate any ad-
  1584. vice I can get.
  1585.  
  1586. -- 
  1587.  
  1588.    -Richard L. Goerwitz              goer%sophist@uchicago.bitnet
  1589.    goer@sophist.uchicago.edu         rutgers!oddjob!gide!sophist!goer
  1590.  
  1591. From wgg@cs.ucsd.edu  Fri Jan 24 23:14:45 1992
  1592. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Fri, 24 Jan 92 23:14:45 MST
  1593. Received: from ucsd.edu by optima.cs.arizona.edu (4.1/15)
  1594.     id AA25014; Fri, 24 Jan 92 23:14:41 MST
  1595. Received: from odin.ucsd.edu by ucsd.edu; id AA00993
  1596.     sendmail 5.64/UCSD-2.2-sun via SMTP
  1597.     Fri, 24 Jan 92 22:14:33 -0800 for icon-group@cs.arizona.edu
  1598. Received: by odin.ucsd.edu (4.1/UCSDPSEUDO.4)
  1599.     id AA10946 for uchinews!ellis!goer@handies.ucar.edu; Fri, 24 Jan 92 22:14:32 PST
  1600. Date: Fri, 24 Jan 92 22:14:32 PST
  1601. From: wgg@cs.ucsd.edu (William Griswold)
  1602. Message-Id: <9201250614.AA10946@odin.ucsd.edu>
  1603. To: icon-group@cs.arizona.edu, uchinews!ellis!goer@handies.ucar.edu
  1604. Subject: Re:  icon & parsing
  1605.  
  1606. Yes, simulating gotos with a case statement is quite reasonable.  I
  1607. don't know that a coexpression would be necessary to generate the states.
  1608.  
  1609. You can think of the state transitions as instructions to be
  1610. executed by an interpreter.  Then you can think of case statement as the
  1611. basic interpreter-loop for the instructions.
  1612.  
  1613. But I'll bet someone out there can out-do this solution.
  1614.  
  1615.                     bill
  1616.  
  1617. From icon-group-request  Sat Jan 25 00:58:33 1992
  1618. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Sat, 25 Jan 92 00:58:33 MST
  1619. Received: from ucbvax.Berkeley.EDU by optima.cs.arizona.edu (4.1/15)
  1620.     id AA27646; Sat, 25 Jan 92 00:58:30 MST
  1621. Received: by ucbvax.Berkeley.EDU (5.63/1.43)
  1622.     id AA29028; Fri, 24 Jan 92 23:54:47 -0800
  1623. Received: from USENET by ucbvax.Berkeley.EDU with netnews
  1624.     for icon-group@cs.arizona.edu (icon-group@cs.arizona.edu)
  1625.     (contact usenet@ucbvax.Berkeley.EDU if you have questions)
  1626. Date: 17 Jan 92 12:51:41 GMT
  1627. From: mcsun!uknet!bcc.ac.uk!ucgadkw@uunet.uu.net  (Dominik Wujastyk)
  1628. Organization: Bloomsbury Computing Consortium, London
  1629. Subject: Re: New Version of Catspaw Snobol Available
  1630. Message-Id: <1992Jan17.125141.93070@link-1.ts.bcc.ac.uk>
  1631. References: <32582@nntpd.lkg.dec.com>
  1632. Sender: icon-group-request@cs.arizona.edu
  1633. To: icon-group@cs.arizona.edu
  1634.  
  1635. What is the ftp address of "Gatekeeper"?
  1636.  
  1637. Thanks,
  1638.  
  1639. Dominik
  1640.  
  1641. From @um.cc.umich.edu:Paul_Abrahams@MTS.cc.Wayne.edu  Sat Jan 25 10:16:24 1992
  1642. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Sat, 25 Jan 92 10:16:24 MST
  1643. Received: from mailrus.cc.umich.edu by optima.cs.arizona.edu (4.1/15)
  1644.     id AA13933; Sat, 25 Jan 92 10:16:21 MST
  1645. Received: from um.cc.umich.edu by mailrus.cc.umich.edu (5.61/1123-1.0)
  1646.     id AA21466; Sat, 25 Jan 92 12:12:26 -0500
  1647. Received: from MTS.cc.Wayne.edu by um.cc.umich.edu via MTS-Net; Sat, 25 Jan 92 12:13:20 EST
  1648. Date: Sat, 25 Jan 92 12:13:24 EST
  1649. From: Paul_Abrahams@mts.cc.wayne.edu
  1650. To: icon-group@cs.arizona.edu
  1651. Message-Id: <408009@MTS.cc.Wayne.edu>
  1652. Subject: Pipes for MS-DOS Icon revisited
  1653.  
  1654. The question of whether or not MD-DOS pipes are bogus has, I think,
  1655. obscured my main point relative to Icon: that providing pipes in MS-DOS
  1656. Icon would be a very useful enhancement.  Even if the MS-DOS version
  1657. lacks the full power of the Unix version, the power it provides would
  1658. be very convenient.  Moreover, the visible semantics under the two
  1659. systems are the same (modulo the fact that the DOS utilities have
  1660. different names from their Unix counterparts).  The weaknesses of the
  1661. DOS version show up not in different results but in programs that run
  1662. more slowly (including the extreme point of nontermination).
  1663.  
  1664. Paul Abrahams
  1665. Abrahams@mts.cc.wayne.edu 
  1666.  
  1667. From nevin@apple.com  Sun Jan 26 01:37:21 1992
  1668. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Sun, 26 Jan 92 01:37:21 MST
  1669. Received: from apple.com by optima.cs.arizona.edu (4.1/15)
  1670.     id AA26138; Sun, 26 Jan 92 01:37:16 MST
  1671. Received: from [90.134.16.31] by apple.com with SMTP (5.61/10-Dec-1991-eef)
  1672.     id AA12732; Sun, 26 Jan 92 00:37:01 -0800
  1673.     for icon-group@cs.arizona.edu
  1674. Message-Id: <9201260837.AA12732@apple.com>
  1675. Date: Sun, 26 Jan 1992 00:38:22 -0800
  1676. To: icon-group@cs.arizona.edu
  1677. From: nevin@apple.com (Nevin :-] Liber)
  1678. Subject: Re: Pipes for MS-DOS Icon revisited
  1679. Cc: Paul_Abrahams@mts.cc.wayne.edu
  1680.  
  1681. >The question of whether or not MD-DOS pipes are bogus has, I think,
  1682. >obscured my main point relative to Icon: that providing pipes in MS-DOS
  1683. >Icon would be a very useful enhancement.
  1684.  
  1685. The interface between Icon and the underlying operating system a given
  1686. implementation is run on is minimal (and should be, IMHO.  This is one of
  1687. the reasons why the Icon implementation itself is highly portable).  It
  1688. does, however, provide extra support for OS features (system(), pipes in
  1689. Unix, etc.) when the cost for the service is negligible.  To provide pipes
  1690. under Unix, all that has to happen on the C implementation side is to call
  1691. popen() instead of fopen() to open the file.  No other bookkeeping is
  1692. required.  [As a side note:  when I write Unix utilities with multiple
  1693. input and/or output streams, I tend to add options to allow users to pipe
  1694. to and from the utility via the command line precisely because it is so
  1695. easy to implement.]
  1696.  
  1697. Now, should features be added to Icon to make up for operating system
  1698. deficiencies?  IMHO, this is not something that Icon is well-suited for. 
  1699. This problem falls outside of what a programming language for processing
  1700. symbolic data should be fixing; it goes against the "spirit" of Icon
  1701. (again, IMHO).  
  1702.  
  1703. >Moreover, the visible semantics under the two
  1704. >systems are the same (modulo the fact that the DOS utilities have
  1705. >different names from their Unix counterparts).
  1706.  
  1707. Not true.  Adding the ability to save the output of a command into a
  1708. temporary file and then reading that file back in (equivalent to reading
  1709. from MS-DOS pipes) or the ability to write to a temporary file and then
  1710. execute a command using that file as input (writing to MS-DOS pipes) does
  1711. not provide any new functionality to Icon, while true Unix-type pipes do.
  1712.  
  1713. Now, if you still really think that this enhancement justifies the cost,
  1714. then why don't you implement it yourself?  And you can do it all without
  1715. writing a single line of C code!  And it would be almost transparent (all
  1716. you really need are five Icon procedures and a global variable) to the rest
  1717. of your program, too (ie, you can make it so the code takes advantage of
  1718. real pipes when it is running under Unix)!
  1719.  
  1720.  
  1721. How to go about implementing MS-DOS pipes for Icon in Icon:
  1722.  
  1723. Under Icon, you can replace any of the built-in function calls with your
  1724. own procedures.  All you would need to replace are open, close, exit, and
  1725. stop (exit and stop are replaced because they may need to close and remove
  1726. the temporary files if there are still open pipes).  You would need an
  1727. initialization routine to do this; let's call it PIPEInitialize().  The
  1728. code for PIPEInitialize() would go something like this (note: this code is
  1729. 100% untested):
  1730.  
  1731.  
  1732. global  PIPETGlobals
  1733.  
  1734. procedure main(LArguments)
  1735.  
  1736. initial {       #in case main() is called recursively
  1737.         PIPEInitialize()
  1738.         ...     #your code
  1739. }
  1740. ...
  1741. end
  1742.  
  1743. procedure PIPEInitialize()
  1744.  
  1745. initial {       #put it in the initial clause in case someone tries to call
  1746.                 #it a second time
  1747.  
  1748.         if ("pipes" ~== &features) then {       #only bother if real pipes
  1749.                                                 #are not available
  1750.  
  1751.                 PIPETGlobals := table()         #need to still call
  1752.                 PIPETGlobals["open"] := open    # the built-ins
  1753.                 PIPETGlobals["close"] := close
  1754.                 PIPETGlobals["exit"] := exit
  1755.                 PIPETGlobals["stop"] := stop
  1756.  
  1757.                 open := PIPEOpen
  1758.                 close := PIPEClose
  1759.                 exit := PIPEExit
  1760.                 stop := PIPEStop
  1761.         }      
  1762. }
  1763.  
  1764. end
  1765.  
  1766.  
  1767. Since the semantics of reading from/writing to a sequentially executed pipe
  1768. are very well defined, it should be fairly straightforward to write the
  1769. procedures PIPEOpen(sFilename, sOptions), PIPEClose(fFile),
  1770. PIPEExit(iExitStatus), and PIPEStop(xStrings[]).  For instance: the code
  1771. for PIPEOpen should go something like this:
  1772.  
  1773. 1.      Trap run-time errors
  1774. 2.      Call "open" (fFile := PIPETGlobals["open"](sFilename, sOptions))
  1775. 3.      If no errors occurred, restore &error and return \fFile
  1776. 4.      If the error was not invalid option or "p" is not in sOptions, then
  1777.                 restore &error, do runerr() and fail
  1778. 5.      Make up a unique file name.
  1779. 6.      Call system(sFilename || " > " || sTemporaryFilename)
  1780. 7.      Open the temp file
  1781.                 fFile := PIPETGlobals["open"](sTemporaryFilename)
  1782. 8.      Keep track of the file so PIPEClose can remove it when done
  1783.                 PIPETGlobals[fFile] := sTemporaryFilename
  1784. 9.      restore &error and return fFile
  1785.  
  1786.  
  1787. And PIPEClose() (again, ignoring the case of writing to a pipe) would do
  1788. something like this:
  1789.  
  1790.         procedure PIPEClose(fFile)
  1791.  
  1792.                 PIPETGlobals["close"](fFile)
  1793.  
  1794.                 remove(\PIPETGlobals[fFile])
  1795.                 delete(PIPETGlobals, fFile)
  1796.  
  1797.                 return fFile
  1798.  
  1799.         end
  1800.  
  1801.  
  1802. Anyway, you get the idea.  Starting with this model and a few hours work,
  1803. you can have your sequentially executed pipes without having to bog down
  1804. the implementation with yet another "creeping featurism".  Plus, it can be
  1805. 100% portable, too!
  1806. ___
  1807. NEVIN ":-)" LIBER,  Speech Recognition Guy
  1808.  email: nevin@apple.com         paper:  Apple Computer, Inc.
  1809.  voice: (408) 974-MIX1                  20525 Mariani Avenue, MS: 76-7E
  1810.  AppleLink: NEVIN.LIBER                 Cupertino, California 95014
  1811.  
  1812.  
  1813. From @um.cc.umich.edu:Paul_Abrahams@MTS.cc.Wayne.edu  Sun Jan 26 13:00:20 1992
  1814. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Sun, 26 Jan 92 13:00:20 MST
  1815. Received: from mailrus.cc.umich.edu by optima.cs.arizona.edu (4.1/15)
  1816.     id AA15095; Sun, 26 Jan 92 13:00:14 MST
  1817. Received: from um.cc.umich.edu by mailrus.cc.umich.edu (5.61/1123-1.0)
  1818.     id AA27886; Sun, 26 Jan 92 14:56:15 -0500
  1819. Received: from MTS.cc.Wayne.edu by um.cc.umich.edu via MTS-Net; Sun, 26 Jan 92 14:54:51 EST
  1820. Date: Sun, 26 Jan 92 13:33:04 EST
  1821. From: Paul_Abrahams@mts.cc.wayne.edu
  1822. To: icon-group@cs.arizona.edu
  1823. Message-Id: <408264@MTS.cc.Wayne.edu>
  1824. Subject: Pipes in MS-DOS Icon (ctd.)
  1825.  
  1826. What strikes me about the debate over pipes in MS-DOS Icon is
  1827. that just about all of the objections to my suggestion have come
  1828. from Unix users who, judging from their comments, consider MS-DOS
  1829. to be beneath contempt and never use MS-DOS Icon.  (As for me, I
  1830. use Icon under both MS-DOS and Unix.)  It would be interesting to
  1831. get some comments from whoever is responsible for the current
  1832. MS-DOS implementation as well as from people who are using MS-DOS
  1833. Icon.  My impression is that there are many of them out there
  1834. (any data, Ralph?)
  1835.  
  1836. I just don't see why enhancements to MS-DOS Icon should be so
  1837. irksome to the Unix folk.  After all, what difference does it
  1838. make to you?  It's a big world, guys and gals!
  1839.  
  1840. However, I can't resist one dig: anybody out there who has paid
  1841. for Unix software or hardware with an unreimbursed personal check
  1842. (OK, Visa and Mastercard count too)?
  1843.  
  1844. Paul Abrahams
  1845. Abrahams@mts.cc.wayne.edu 
  1846.  
  1847. From cfcl!rdm@apple.com  Sun Jan 26 15:28:01 1992
  1848. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Sun, 26 Jan 92 15:28:01 MST
  1849. Received: from apple.com by optima.cs.arizona.edu (4.1/15)
  1850.     id AA18810; Sun, 26 Jan 92 15:27:57 MST
  1851. Received: by apple.com (5.61/10-Dec-1991-eef)
  1852.     id AA18262; Sun, 26 Jan 92 14:12:26 -0800
  1853.     for 
  1854. Received: by cfcl.uucp (4.1/SMI-4.1)
  1855.     id AA05456; Sun, 26 Jan 92 13:55:18 PST
  1856. Date: Sun, 26 Jan 92 13:55:18 PST
  1857. From: cfcl!rdm@apple.com (Rich Morin)
  1858. Message-Id: <9201262155.AA05456@cfcl.uucp>
  1859. To: icon-group@cs.arizona.edu, rdm@apple.com
  1860. Subject: UNIX software prices
  1861.  
  1862. > However, I can't resist one dig: anybody out there who has paid
  1863. > for Unix software or hardware with an unreimbursed personal check
  1864. > (OK, Visa and Mastercard count too)?
  1865.  
  1866. I have bought in excess of $50K worth of "UNIX Hardware" (primarily
  1867. Sun-related equipment) over the years.  By and large, I consider it
  1868. to be money well-spent.  I spend vanishingly small amounts of money
  1869. on software, however.  Reasons:
  1870.  
  1871.   1)    As a trade writer, I tend to get free copies of almost any
  1872.     software I want.  This isn't much, however, as I really don't
  1873.     use much commercial software.  Instead, I use:
  1874.  
  1875.   2)    Bundled UNIX tools.  The UNIX system comes with zillions of
  1876.     useful tools.  I can usually make some combination of them
  1877.     do the trick.  Interesting combinations get saved as shell
  1878.     scripts, and may be distributed as:
  1879.  
  1880.   3)    Freeware.  I am a very minimal producer of freeware, but I
  1881.     use a number of freeware packages on a regular basis.  The
  1882.     fact that source code distribution is the norm for UNIX
  1883.     freeware allows me to build upon others' work, fix bugs, etc.
  1884.     Aside from the usual ftp and UUCP techniques, I can acquire
  1885.     this code in the form of inxpensive CDROM collections.
  1886.  
  1887. Which gives me an entree into a commercial pitch (tune out if desired,
  1888. flames to /dev/null):
  1889.  
  1890. Prime Time Freeware, Volume 1, Number 1 (January, 1992)
  1891.  
  1892. The first issue of Prime Time Freeware (PTF) is now available.  It contains
  1893. over 1500 MB of UNIX-related source code, stored as compressed tar(1) files
  1894. on an ISO-9660 CDROM.  A 50+ page booklet introduces and explains the disc.
  1895. The issue contains recent versions of over 100 packages, including:
  1896.  
  1897.         Andrew (windowing code)
  1898.         Athena (except Kerberos)
  1899.         CLU
  1900.         comp.sources.{amiga,3b1,games,x,sun,unix}
  1901.         Epoch
  1902.         GNU (current and vintage versions)
  1903.         Icon
  1904.         InterViews
  1905.         ISODE
  1906.         Kermit (tapes A-E)
  1907.         Mach
  1908.         NCSA Data Analysis Code
  1909.         Scheme
  1910.         Serpent
  1911.         T
  1912.         Utah Rendering Toolkit
  1913.         X11R5
  1914.  
  1915. The disc and booklet are available from:
  1916.  
  1917.         Prime Time Freeware
  1918.         415-112 N. Mary Ave., Suite 50
  1919.         Sunnyvale, CA  94086  USA
  1920.  
  1921.         (408) 738-4832
  1922.         cfcl!ptf@apple.com
  1923.  
  1924. The list price is $60 US, payable by check or money order.  A 30% discount
  1925. applies to orders of 10-100 units.  Include $5 per order for shipping and
  1926. handling.  Add %7 to help with sales tax, if ordering within California.
  1927.  
  1928. From ercn72@festival.ed.ac.uk  Mon Jan 27 05:14:17 1992
  1929. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Mon, 27 Jan 92 05:14:17 MST
  1930. Received: from Arizona.edu (Osprey.Telcom.Arizona.EDU) by optima.cs.arizona.edu (4.1/15)
  1931.     id AA15072; Mon, 27 Jan 92 05:14:06 MST
  1932. Received: from UKACRL.BITNET (MAILER@UKACRL) by Arizona.edu with PMDF#10282;
  1933.  Mon, 27 Jan 1992 05:13 MST
  1934. Received: from RL.IB by UKACRL.BITNET (Mailer R2.07) with BSMTP id 0390; Mon,
  1935.  27 Jan 92 10:18:33 GMT
  1936. Received: from RL.IB by UK.AC.RL.IB (Mailer R2.07) with BSMTP id 1263; Mon, 27
  1937.  Jan 92 10:18:04 GMT
  1938. Date: Mon, 27 Jan 92 10:04:33 GMT
  1939. From: "R.J.Hare" <ercn72@festival.ed.ac.uk>
  1940. Subject: Compiler on Sun
  1941. To: icon-group <icon-group@cs.arizona.edu>
  1942. Message-Id: <9201271004.aa28931@uk.ac.ed.festival>
  1943. X-Envelope-To: icon-group@cs.arizona.edu
  1944. Via:        UK.AC.ED.FESTIVAL; 27 JAN 92 10:04:24 GMT
  1945.  
  1946. I am getting:
  1947.  
  1948. write failed, file system full
  1949.  
  1950. messages when I try and compile large(ish) Icon programs on a Sun. Our system
  1951. staff tell me that this is probably because Icon is grabbing all the available
  1952. space on the /tmp directory. Is there any switch or environment variable I
  1953. ould use or set to force Icon to use a different area for its temporary files
  1954. (for local reasons, they are unwilling to increase the size of the /tmp
  1955. disrectory).
  1956.  
  1957. Thanks.
  1958.  
  1959. Roger Hare.
  1960.  
  1961.  
  1962. From @castle.edinburgh.ac.uk,@emas-a.edinburgh.ac.uk:R.J.Hare@edinburgh.ac.uk  Mon Jan 27 09:14:09 1992
  1963. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Mon, 27 Jan 92 09:14:09 MST
  1964. Received: from  by optima.cs.arizona.edu (4.1/15)
  1965.     id AB22341; Mon, 27 Jan 92 09:14:02 MST
  1966. Received: from castle.edinburgh.ac.uk by sun2.nsfnet-relay.ac.uk via JANET 
  1967.           with NIFTP id <15975-0@sun2.nsfnet-relay.ac.uk>;
  1968.           Mon, 27 Jan 1992 15:32:05 +0000
  1969. Received: from emas-a.ed.ac.uk by castle.ed.ac.uk id aa18388;
  1970.           27 Jan 92 15:36 WET
  1971. Date: 27 Jan 92 15:37:40 gmt
  1972. From: R.J.Hare@edinburgh.ac.uk
  1973. Subject: Compiler on Sun.
  1974. To: icon-group@cs.arizona.edu
  1975. Message-Id: <27 Jan 92 15:37:40 gmt 320193@EMAS-A>
  1976. Sender: "R.J.Hare" <@emas-a.edinburgh.ac.uk:R.J.Hare@edinburgh.ac.uk>
  1977.  
  1978. Please ignore my last message - problem fixed, and in any case the message
  1979. should have gone to the Icon team. Soirry...
  1980.  
  1981. Roger Hare.
  1982.  
  1983. From @um.cc.umich.edu:Paul_Abrahams@MTS.cc.Wayne.edu  Mon Jan 27 11:43:37 1992
  1984. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Mon, 27 Jan 92 11:43:37 MST
  1985. Received: from mailrus.cc.umich.edu by optima.cs.arizona.edu (4.1/15)
  1986.     id AA02700; Mon, 27 Jan 92 11:43:33 MST
  1987. Received: from um.cc.umich.edu by mailrus.cc.umich.edu (5.61/1123-1.0)
  1988.     id AA01345; Mon, 27 Jan 92 13:39:39 -0500
  1989. Received: from MTS.cc.Wayne.edu by um.cc.umich.edu via MTS-Net; Mon, 27 Jan 92 12:39:17 EST
  1990. Date: Mon, 27 Jan 92 12:39:04 EST
  1991. From: Paul_Abrahams@mts.cc.wayne.edu
  1992. To: icon-group@cs.arizona.edu
  1993. Message-Id: <408605@MTS.cc.Wayne.edu>
  1994. Subject: Pipes for MS-DOS clarified
  1995.  
  1996. Some of the heat generated by my comments about pipes in MS-DOS
  1997. may come from a confusion between two different ways of using
  1998. pipes.  The case that most people have cited to show the
  1999. inadequacies of MSDOS piping is a command line of the form
  2000.  
  2001. prog1 | prog2 | ... | more
  2002.  
  2003. where at least one of the progs is an Icon program.  The
  2004. enhancements I was discussing were not directed at all towards
  2005. this case; I don't see anything that MS-DOS Icon can reasonably
  2006. do to improve DOS's behavior here.
  2007.  
  2008. The other case, the one that concerned me, was the use, internal
  2009. to a program, of an Icon expression such as
  2010.  
  2011. infile := open("dir", "rp")
  2012.  
  2013. (or its Unix equivalent using "ls").  I still see no difficulties
  2014. in principle with enhancing MS-DOS Icon to cover this case,
  2015. although I want to make very clear that I'm not expecting the
  2016. Icon project to take on the burden of providing this enhancement. 
  2017. If they want to do it, I'd be delighted; if they don't, I'll
  2018. remain grateful for all the other fine things they have done.  My
  2019. postings have been directed only at the question of whether the
  2020. enhancement poses difficulties in principle.
  2021.  
  2022. Although generalizations are risky, my impression, not
  2023. contradicted by the posted examples, is that most uses of pipes
  2024. that depend on process interleaving are at the command level
  2025. rather than at the internal level.  Indeed, the internal level is
  2026. much more useful for extracting the output of a fixed command,
  2027. while the external level is more useful for combining programs in
  2028. a flexible way.
  2029.  
  2030. Paul Abrahams
  2031. Abrahams@mts.cc.wayne.edu
  2032.  
  2033.  
  2034. From reid@vtopus.cs.vt.edu  Mon Jan 27 12:29:41 1992
  2035. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Mon, 27 Jan 92 12:29:41 MST
  2036. Received: from vtopus.cs.vt.edu by optima.cs.arizona.edu (4.1/15)
  2037.     id AA05171; Mon, 27 Jan 92 12:29:35 MST
  2038. Received: by vtopus.cs.vt.edu (5.57/Ultrix3.0-C)
  2039.     id AA14401; Mon, 27 Jan 92 14:29:20 -0500
  2040. Message-Id: <9201271929.AA14401@vtopus.cs.vt.edu>
  2041. Subject: Programming Problem
  2042. To: icon-group@cs.arizona.edu
  2043. Date: Mon, 27 Jan 92 14:29:20 EST
  2044. From: Thomas F. Reid <reid@vtopus.cs.vt.edu>
  2045. Cc: reid@vtopus.cs.vt.edu (Thomas F. Reid)
  2046. X-Mailer: ELM [version 2.3 PL11]
  2047.  
  2048. I am going to spend a day (2 1/2 hours) of my graduate level programming 
  2049. languages class on Icon and would like the students to do a small 
  2050. programming problem in Icon as homework.  What I would like about a 100 
  2051. line program that I can leave out about 10 lines that they have to figure 
  2052. out and enter.
  2053.  
  2054. Any suggestions for a meaty little program that will help the students
  2055. get the gist of Icon without having to do a tremendous amount of
  2056. programming?
  2057.  
  2058. Thanks in advance,
  2059.  
  2060. Tom Reid, Virginia Tech No VA Graduate Center,
  2061. Falls Church VA,  (703)698-4713
  2062. reid@vtopus.cs.vt.edu
  2063.  
  2064.  
  2065. From icon-group-request  Wed Jan 29 18:05:49 1992
  2066. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Wed, 29 Jan 92 18:05:49 MST
  2067. Received: from ucbvax.Berkeley.EDU by optima.cs.arizona.edu (4.1/15)
  2068.     id AA12117; Wed, 29 Jan 92 18:05:46 MST
  2069. Received: by ucbvax.Berkeley.EDU (5.63/1.43)
  2070.     id AA01057; Wed, 29 Jan 92 16:52:19 -0800
  2071. Received: from USENET by ucbvax.Berkeley.EDU with netnews
  2072.     for icon-group@cs.arizona.edu (icon-group@cs.arizona.edu)
  2073.     (contact usenet@ucbvax.Berkeley.EDU if you have questions)
  2074. Date: 24 Jan 92 12:34:43 GMT
  2075. From: hsi!mlfarm!rosie!ron@uunet.uu.net  (Ronald Florence)
  2076. Organization: Maple Lawn Farm, Stonington, CT
  2077. Subject: Re: Pipes in MS-DOS Icon
  2078. Message-Id: <1992Jan24.123443.17900@mlfarm.com>
  2079. References: <407392@MTS.cc.Wayne.edu>
  2080. Sender: icon-group-request@cs.arizona.edu
  2081. To: icon-group@cs.arizona.edu
  2082.  
  2083. Paul_Abrahams@MTS.CC.WAYNE.EDU writes:
  2084.  
  2085.    In fact, the MS-DOS idea of pipes is only slightly less powerful
  2086.    than the Unix version, and including pipes in MS-DOS Icon poses
  2087.    no problem in principle. 
  2088.  
  2089. Since I don't use MS-DOS I cannot comment on the efficiency of
  2090. temporary files as pseudo-pipes, and in any case I don't want to join
  2091. a flame war.  I wrote the following code to imitate pipes for MS-DOS
  2092. and other Icon implementations which cannot write-to or read-from
  2093. pipes.  It works, but as the comment in the header notes, I'm not sure
  2094. how to determine when a pseudo-pipe fails in MS-DOS.  Any suggestions?
  2095.  
  2096.  
  2097. -----------------------------pipes.icn--------------------------
  2098. # pipes.icn
  2099. # imitates pipes  
  2100. # ron@mlfarm.com, 24 Jan 92
  2101. # This is a modest effort at portability.  Unix implementations of
  2102. # Icon have the ability to read from and write to pipes.  Pipeout()
  2103. # and pipein() are an effort to duplicate this functionality for
  2104. # systems without pipes, like ms-dos.  Both functions could do with
  2105. # some error-trapping, especially in the ms-dos versions.  My
  2106. # experience with the system function is that it returns 0 (success)
  2107. # on ms-dos machines even when command.com cannot find the command, so
  2108. # I'm at a loss how to trap errors.
  2109.  
  2110.  
  2111.     # write "what" (a list) to command "cmd"
  2112.  
  2113. procedure pipeout(what, cmd)
  2114.   static real_pipes
  2115.  
  2116.   initial real_pipes := find("pipes", &features)
  2117.   p := (\real_pipes & open(cmd, "wp")) | open(tfn := tempname(), "w")
  2118.   every write(p, !what)
  2119.   if \real_pipes then return close(p) 
  2120.   else {
  2121.     cmd ||:= " < " || tfn
  2122.     status := system(cmd)
  2123.     remove(tfn)
  2124.     return status
  2125.   }
  2126. end
  2127.  
  2128.     # read from command "cmd"
  2129.  
  2130. procedure pipein(cmd)
  2131.   static real_pipes
  2132.  
  2133.   initial real_pipes := find("pipes", &features)
  2134.   if \real_pipes then p := open(cmd || " 2> /dev/null", "rp")
  2135.   else {
  2136.     tfn := tempname()
  2137.     system(cmd || " > " || tfn)
  2138.     p := open(tfn)
  2139.   }
  2140.   suspend !p
  2141.   /real_pipes & remove(tfn)
  2142. end
  2143.  
  2144.  
  2145.     # Richard Goerwitz's ever-useful generator.
  2146.  
  2147. procedure tempname()
  2148.   dir := ""
  2149.  
  2150.   every temp_name := dir || "pipe." || right(1 to 999,3,"0") do {
  2151.     close(open(temp_name)) & next
  2152.     suspend \temp_name
  2153.   }
  2154. end
  2155. --------------------------------eof-----------------------------
  2156. -- 
  2157.  
  2158.                 Ronald Florence
  2159.                 ron@mlfarm.com
  2160.  
  2161. From icon-group-request  Thu Jan 30 06:10:49 1992
  2162. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Thu, 30 Jan 92 06:10:49 MST
  2163. Received: from ucbvax.Berkeley.EDU by optima.cs.arizona.edu (4.1/15)
  2164.     id AA07373; Thu, 30 Jan 92 06:10:45 MST
  2165. Received: by ucbvax.Berkeley.EDU (5.63/1.43)
  2166.     id AA02380; Thu, 30 Jan 92 05:03:05 -0800
  2167. Received: from USENET by ucbvax.Berkeley.EDU with netnews
  2168.     for icon-group@cs.arizona.edu (icon-group@cs.arizona.edu)
  2169.     (contact usenet@ucbvax.Berkeley.EDU if you have questions)
  2170. Date: 26 Jan 92 15:39:34 GMT
  2171. From: hsi!mlfarm!rosie!ron@uunet.uu.net  (Ronald Florence)
  2172. Organization: Maple Lawn Farm, Stonington, CT
  2173. Subject: Re: Pipes for MS-DOS Icon revisited
  2174. Message-Id: <1992Jan26.153934.7567@mlfarm.com>
  2175. References: <408009@MTS.cc.Wayne.edu>
  2176. Sender: icon-group-request@cs.arizona.edu
  2177. To: icon-group@cs.arizona.edu
  2178.  
  2179. Paul_Abrahams@MTS.CC.WAYNE.EDU writes:
  2180.  
  2181.    The question of whether or not MD-DOS pipes are bogus has, I think,
  2182.    obscured my main point relative to Icon: that providing pipes in MS-DOS
  2183.    Icon would be a very useful enhancement.  Even if the MS-DOS version
  2184.    lacks the full power of the Unix version, the power it provides would
  2185.    be very convenient.  
  2186.  
  2187. Agreed.  The code below is intuitive, if not efficient.  The `pipe'
  2188. has to be closed with pclose under ms-dos.
  2189.  
  2190. #
  2191. # popen.icn
  2192. # ron@mlfarm.com, 26 Jan 1992
  2193. #
  2194. # popen(cmd, mode) 
  2195. #    mode == "w" writes to a pipe, mode == "r" reads from a pipe
  2196. # pclose(pipe)
  2197. #
  2198. # On systems without real pipes (ms-dos), popen and pclose imitate
  2199. # pipes; pclose must be called after popen.  The code should run
  2200. # faster on ms-dos if dir in tempname() points to a directory on a
  2201. # virtual disk.
  2202. #
  2203. # On systems with real pipes, popen & pclose open and close a pipe.
  2204.  
  2205. global real_pipes, pipe_cmd, pipe_fname
  2206.  
  2207. procedure popen(cmd, mode)
  2208.  
  2209.   initial {
  2210.     real_pipes := find("pipes", &features) 
  2211.     pipe_cmd := table()
  2212.     pipe_fname := table()
  2213.   }
  2214.   \real_pipes & return open(cmd, mode || "p")
  2215.   tfn := tempname()
  2216.   upto('r', mode) & system(cmd || " > " || tfn)
  2217.   p := open(tfn, mode)
  2218.   pipe_fname[p] := tfn
  2219.   upto('w', mode) &  pipe_cmd[p] := cmd
  2220.   return p
  2221. end
  2222.  
  2223.  
  2224. procedure pclose(pipe)
  2225.  
  2226.   \real_pipes & return close(pipe)
  2227.   if \pipe_cmd[pipe] then {
  2228.     pipe_cmd[pipe] ||:= " < " || pipe_fname[pipe]
  2229.     status := system(pipe_cmd[pipe])
  2230.   }
  2231.   else status := close(pipe)
  2232.   remove(pipe_fname[pipe])
  2233.   pipe_cmd[pipe] := pipe_fname[pipe] := &null
  2234.   return status
  2235. end
  2236.  
  2237.     # Richard Goerwitz's ever-useful generator.
  2238.  
  2239. procedure tempname()
  2240.   dir := ""
  2241.  
  2242.   every temp_name := dir || "pipe." || right(1 to 999,3,"0") do {
  2243.     close(open(temp_name)) & next
  2244.     suspend \temp_name
  2245.   }
  2246. end
  2247. -- 
  2248.  
  2249.                 Ronald Florence
  2250.                 ron@mlfarm.com
  2251.  
  2252. From icon-group-request  Mon Feb  3 16:55:51 1992
  2253. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Mon, 3 Feb 92 16:55:51 MST
  2254. Received: from ucbvax.Berkeley.EDU by optima.cs.arizona.edu (4.1/15)
  2255.     id AA23123; Mon, 3 Feb 92 16:55:45 MST
  2256. Received: by ucbvax.Berkeley.EDU (5.63/1.43)
  2257.     id AA14662; Mon, 3 Feb 92 15:51:00 -0800
  2258. Received: from USENET by ucbvax.Berkeley.EDU with netnews
  2259.     for icon-group@cs.arizona.edu (icon-group@cs.arizona.edu)
  2260.     (contact usenet@ucbvax.Berkeley.EDU if you have questions)
  2261. Date: 2 Feb 92 05:54:47 GMT
  2262. From: wupost!uwm.edu!csd4.csd.uwm.edu!corre@decwrl.dec.com  (Alan D Corre)
  2263. Organization: Computing Services Division, University of Wisconsin - Milwaukee
  2264. Subject: Icon and MSDOS
  2265. Message-Id: <1992Feb2.055447.8433@uwm.edu>
  2266. Sender: icon-group-request@cs.arizona.edu
  2267. To: icon-group@cs.arizona.edu
  2268.  
  2269. "Nobody appreciates what I do until I don't do it." -- notice above
  2270. the service desk at our gym.
  2271.  
  2272.   I should like to offer some reflections on using Icon under MSDOS.
  2273. It seems to me that MSDOS is like a Chevy with automatic shift. It is
  2274. meant for use by ordinary people who have no interest in looking under
  2275. the hood. (The last time I did that a hole in a pipe was spurting
  2276. gasoline and I ran for my life.) MSDOS is rock solid. In the years I
  2277. have been writing Icon programs and doing much else, my Zenith has
  2278. never once stopped working. Error messages aplenty, always justified,
  2279. but never, never a need to reboot. Its commands are named with humans,
  2280. not machines, in mind. Compare dir, erase, rename with ls, rm and mv.
  2281. MSDOS made it possible for the ordinary, non-professional programmer
  2282. to do a lot of useful, if simple-minded, work. So it doesn't have
  2283. pipes. I was never a smoker anyway.
  2284.   I only realised this when I shifted to using ProIcon on the Mac. For
  2285. years I had wanted to confront some problems in the teaching of Hebrew
  2286. in a particular way. I had tried programmed learning, but it was
  2287. clumsy and cumbersome. The Mac's visual capabilities seemed to make it
  2288. possible. The result was really excellent. The student sees one window
  2289. in which he types an English transcription, and another window offers
  2290. the unvocalized Hebrew equivalent, which he is able to enunciate
  2291. because he used a modified phonemic transcription. She can switch off
  2292. the transcription at will. A cumulative log is kept, and is instantly
  2293. available with dates, lessons studied, and scores. A vocabulary can be
  2294. viewed at any time. The student can print documents in mixed Hebrew
  2295. and English. But how difficult it was for me as developer to
  2296. achieve! The machine was forever blowing up for no apparent reason,
  2297. and demanding to be restarted from scratch. Some of this was due to
  2298. bugs in the Icon program, which were promptly attended to by the
  2299. author, but most were simply that Mac operating system. Peter Robinson
  2300. of Oxford, author of a Mac program called "Collate" puts it well in
  2301. the documentation (p.69):
  2302.  
  2303.     I have taken every care I could to make Collate as stable as
  2304.     possible. However, C programming is notoriously tricky, and
  2305.     nowhere more so than on the Mac. Essentially, C lets you
  2306.     manipulate any bit of memory you like anyway you like. But if
  2307.     you do this to this bit, or that to that bit, the machine will
  2308.     crash. Most difficult of all: a program will include a memory
  2309.     error which every Mac you run it on tolerates. But the next
  2310.     Mac won't! This applies particularly to locking and unlocking
  2311.     handles to memory. Lock or unlock the wrong handle, at the
  2312.     wrong time, and most of the time all is well. But sometimes...
  2313.  
  2314. Sometimes, says he. Maybe in Oxford it's sometimes, but in Milwaukee
  2315. it's like frequently. At the hundredth appearance of that cute little
  2316. bomb, I started remarking with Queen Victoria: We are not amused. For
  2317. a period of more than a month I was unable to get my SE to run Icon
  2318. altogether. I had two people who know much more about the Mac than I
  2319. do working on it for days. We took all the files off the hard disk and
  2320. reinitialized it. We removed the inits. Nothing seemed to work. Then I
  2321. tried booting up the Mac from a floppy, and Icon worked again. The next
  2322. time I tried from the hard disk, and we were back in business.
  2323.   Last week I needed to make a small change to the program. Since the
  2324. program was written under system six, and I am now using system seven
  2325. on the SE, I decided to take Icon off the SE and use the chief Mac in
  2326. the lab the students use to recompile under the old system six Icon.
  2327. The lab folks dont want to switch to seven, because they can't spare
  2328. the memory. Anyway, I made the change, and told the Mac to recompile.
  2329. It did so. Then characters started appearing on the screen that looked
  2330. like a cross between Chinese and Mongolian. Then a window appeared
  2331. that looked like a standard Mac message window, but it was completely
  2332. empty. And the machine was frozen. I said to the lab monitor glumly:
  2333. It's stuck. Her hand flew to the reset button at the bottom of the
  2334. machine. I said:  Stop! Tom told me never to do that. She said: Why
  2335. not? This happens all the time, and I'm always hitting that button. I
  2336. pleaded: Call Tom, and ask him if it's ok. (I'm too old to adopt the
  2337. morals of the new generation.) She called and announced: He's with the
  2338. director of Computer services. He can't come to the phone. She added
  2339. archly: Can I hit the button now? Go ahead, I said in resignation. The
  2340. machine made that silly noise and came to life. There was the newly
  2341. compiled program, and it worked just fine.  What had I done wrong? I
  2342. asked. After compiling the program properly, why should it go beserk?
  2343.   MSDOS I love you.
  2344. -- 
  2345. Alan D. Corre
  2346. Department of Hebrew Studies
  2347. University of Wisconsin-Milwaukee                     (414) 229-4245
  2348. PO Box 413, Milwaukee, WI 53201               corre@csd4.csd.uwm.edu
  2349.  
  2350. From icon-group-request  Tue Feb  4 01:27:27 1992
  2351. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Tue, 4 Feb 92 01:27:27 MST
  2352. Received: from ucbvax.Berkeley.EDU by optima.cs.arizona.edu (4.1/15)
  2353.     id AA11856; Tue, 4 Feb 92 01:27:25 MST
  2354. Received: by ucbvax.Berkeley.EDU (5.63/1.43)
  2355.     id AA04266; Tue, 4 Feb 92 00:19:44 -0800
  2356. Received: from USENET by ucbvax.Berkeley.EDU with netnews
  2357.     for icon-group@cs.arizona.edu (icon-group@cs.arizona.edu)
  2358.     (contact usenet@ucbvax.Berkeley.EDU if you have questions)
  2359. Date: 29 Jan 92 02:01:18 GMT
  2360. From: hsi!mlfarm!rosie!ron@uunet.uu.net  (Ronald Florence)
  2361. Organization: Maple Lawn Farm, Stonington, CT
  2362. Subject: Re: Pipes in MS-DOS Icon (ctd.)
  2363. Message-Id: <1992Jan29.020118.16915@mlfarm.com>
  2364. References: <408264@MTS.cc.Wayne.edu>
  2365. Sender: icon-group-request@cs.arizona.edu
  2366. To: icon-group@cs.arizona.edu
  2367.  
  2368. Paul_Abrahams@MTS.CC.WAYNE.EDU writes:
  2369.  
  2370.    What strikes me about the debate over pipes in MS-DOS Icon is
  2371.    that just about all of the objections to my suggestion have come
  2372.    from Unix users who, judging from their comments, consider MS-DOS
  2373.    to be beneath contempt and never use MS-DOS Icon.  
  2374.  
  2375. Someone once gave me the good advice to never criticize the spouse or
  2376. children of a friend.  Given the sensitivity that the issue provokes,
  2377. I'd add `operating system' to the do-not-criticize list.
  2378.  
  2379. That said, I think there is little to be gained by pretending that
  2380. differences of operating systems do not exist.  Unix has pipes on the
  2381. kernel level; ms-dos does not.  We can produce Icon code that will
  2382. imitate the _function_ of pipes in ms-dos, and doing so makes it
  2383. possible to write portable Icon code.  But there is a difference
  2384. between reading from and writing to a temporary file, and a true pipe;
  2385. code which depends heavily on pipes will run better on an operating
  2386. system with real pipes.  Recognizing those differences is not judging
  2387. ms-dos "beneath contempt."
  2388.  
  2389.    However, I can't resist one dig: anybody out there who has paid
  2390.    for Unix software or hardware with an unreimbursed personal check
  2391.    (OK, Visa and Mastercard count too)?
  2392.  
  2393. For what it is worth, we bought our Sun workstations and SunOS (the
  2394. only software we had to buy) with an unreimbursed personal check.
  2395. Now, let's please let this newsgroup return to talk about Icon, a
  2396. language that does many things, on many operating systems, very well.
  2397. -- 
  2398.  
  2399.                 Ronald Florence
  2400.                 ron@mlfarm.com
  2401.  
  2402. From nevin@apple.com  Wed Feb  5 02:08:11 1992
  2403. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Wed, 5 Feb 92 02:08:11 MST
  2404. Received: from colossus.apple.com by optima.cs.arizona.edu (4.1/15)
  2405.     id AA19032; Wed, 5 Feb 92 02:08:03 MST
  2406. Received: from [90.1.0.10] by colossus.apple.com with SMTP (5.65/11-Dec-1991-eef)
  2407.     id AA01496; Tue, 4 Feb 92 23:43:35 -0800
  2408.     for 
  2409. Received: from [90.134.16.31] (peachfuzz.apple.com) by goofy.apple.com with SMTP (5.61/27-Sep-1991-eef)
  2410.     id AA16328; Tue, 4 Feb 92 23:43:27 -0800
  2411.     for corre@csd4.csd.uwm.edu
  2412. Message-Id: <9202050743.AA16328@internal.apple.com>
  2413. Date: Tue, 4 Feb 1992 23:45:13 -0800
  2414. To: icon-group@cs.arizona.edu
  2415. From: nevin@apple.com (Nevin ":-]" Liber)
  2416. Subject: Re: Icon and MSDOS
  2417. Cc: corre@csd4.csd.uwm.edu
  2418.  
  2419. Alan Corre (corre@csd4.csd.uwm.edu) writes:
  2420. >It [MS-DOS] is
  2421. >meant for use by ordinary people who have no interest in looking under
  2422. >the hood.
  2423.  
  2424. But as you point out later, you DO want to look under the hood!
  2425.  
  2426. >Its commands are named with humans,
  2427. >not machines, in mind. Compare dir, erase, rename with ls, rm and mv.
  2428.  
  2429. Actually, the only reason that dir, erase, and rename are used is because
  2430. they have been used on computer systems for years before the PC (my TRS-80
  2431. is one example, I believe CP/M is another).  Ask any non-computer person
  2432. what "dir" means, and they'll look at you kind of funny.  From the name
  2433. "erase", can you tell if it actually erases the file, or does it just mark
  2434. the directory entry as unavailable?  Also, "rename" was fine in the old
  2435. days where there weren't hierarchial file systems, but it is not intuitive
  2436. that you can "rename" something to put it somewhere else in the directory
  2437. tree (after all, there is a big distinction made between a directory and a
  2438. file, and all of a sudden that distinction no longer applies), but you
  2439. aren't allowed to "rename" it to a different file system.
  2440.  
  2441. ls, rm, and mv were named with humans in mind; the attempt was to reduce
  2442. the number of keystrokes to perform a common command (I know that this
  2443. causes other problems for humans, but the original idea was to help
  2444. humans).  It is utterly obsurd to think that the two letter commands were
  2445. designed for the machine's sake.
  2446.  
  2447. >  I only realised this when I shifted to using ProIcon on the Mac.
  2448. >...
  2449. >But how difficult it was for me as developer to
  2450. >achieve!
  2451.  
  2452. But now you are tinkering UNDER THE HOOD; that's what developers DO!  It
  2453. isn't fair to compare USING system A with PROGRAMMING system B!  I could
  2454. claim that using a Mac is much easier than programming a PC, and I don't
  2455. think I'll get much argument from the PC community.  In general, using an
  2456. arbituary computer system X is always easier than programming arbituary
  2457. computer system Y.
  2458.  
  2459. Now, I also believe that we have a long way to go on our development
  2460. environments (or, to fit it into the analogy:  it should be easy for those
  2461. home mechanics to do the very common stuff like oil changes), but that is a
  2462. very different topic, and as inappropriate for this newsgroup/mailing list
  2463. as this one is (sorry folks).
  2464. ___
  2465. NEVIN ":-)" LIBER,  Speech Recognition Guy
  2466.  email: nevin@apple.com         paper:  Apple Computer, Inc.
  2467.  voice: (408) 974-MIX1                  20525 Mariani Avenue, MS: 76-7E
  2468.  AppleLink: NEVIN.LIBER                 Cupertino, California 95014
  2469.  
  2470.  
  2471. From corre@convex.csd.uwm.edu  Wed Feb  5 08:08:06 1992
  2472. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Wed, 5 Feb 92 08:08:06 MST
  2473. Received: from convex.csd.uwm.edu by optima.cs.arizona.edu (4.1/15)
  2474.     id AA12168; Wed, 5 Feb 92 08:08:02 MST
  2475. Received: by convex.csd.uwm.edu; id AA02512; Wed, 5 Feb 92 09:07:59 -0600
  2476. Date: Wed, 5 Feb 92 09:07:59 -0600
  2477. From: Alan D Corre <corre@convex.csd.uwm.edu>
  2478. Message-Id: <9202051507.AA02512@convex.csd.uwm.edu>
  2479. To: icon-group@cs.arizona.edu, nevin@apple.com
  2480. Subject: Re: Icon and MSDOS
  2481.  
  2482. My comparison was writing Icon programs on the Zenith and Icon programs
  2483. on the Mac. I'm sorry if I didn't make this clear, but I was not comparing
  2484. apples and oranges.
  2485.  
  2486. From TELLEFSENGW@HIRAMB.BITNET  Thu Feb  6 12:22:17 1992
  2487. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Thu, 6 Feb 92 12:22:17 MST
  2488. Received: from Arizona.edu (Hopey.Telcom.Arizona.EDU) by optima.cs.arizona.edu (4.1/15)
  2489.     id AA29878; Thu, 6 Feb 92 12:22:14 MST
  2490. Received: from HIRAMB (TELLEFSE@HIRAMB) by Arizona.edu (PMDF #12663) id
  2491.  <01GG74IH91YO9D5A62@Arizona.edu>; Thu, 6 Feb 1992 11:45 MST
  2492. Date: Thu, 6 Feb 1992 13:41 EST
  2493. From: TELLEFSENGW@HIRAMB.BITNET
  2494. Subject: Question on generators
  2495. To: icon-group@cs.arizona.edu
  2496. Message-Id: <12444929E060142A@HIRAMB>
  2497. X-Envelope-To: icon-group@cs.arizona.edu
  2498. X-Vms-To: IN%"icon-group@cs.arizona.edu"
  2499.  
  2500.         I was reading through the Icon Programming Language book last
  2501. night and I came across a line something like this:
  2502.  
  2503.         if (&features = = "co-expressions") then....
  2504.  
  2505.         Is there a space between the equals signs, or is it a "==" string
  2506. comparison? And if it is, why isn't there an "every" before the expression in
  2507. parentheses (to continue generating values from &features until it fails or
  2508. matches "co-expressions")? And if it isn't, what do the two equals signs do?
  2509.         I'm sure I'm missing something very basic here, but I still don't know
  2510. what it is... any help would be appreciated!
  2511.  
  2512.                                                 Thanks,
  2513.                                                         Guy Tellefsen
  2514.  
  2515. From isidev!nowlin@uunet.uu.net  Thu Feb  6 13:27:27 1992
  2516. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Thu, 6 Feb 92 13:27:27 MST
  2517. Received: from relay2.UU.NET by optima.cs.arizona.edu (4.1/15)
  2518.     id AA03838; Thu, 6 Feb 92 13:27:23 MST
  2519. Received: from uunet.uu.net (via LOCALHOST.UU.NET) by relay2.UU.NET with SMTP 
  2520.     (5.61/UUNET-internet-primary) id AA18697; Thu, 6 Feb 92 15:27:25 -0500
  2521. Date: Thu, 6 Feb 92 15:27:25 -0500
  2522. From: isidev!nowlin@uunet.uu.net
  2523. Message-Id: <9202062027.AA18697@relay2.UU.NET>
  2524. Received: from isidev.UUCP by uunet.uu.net with UUCP/RMAIL
  2525.     (queueing-rmail) id 152632.3443; Thu, 6 Feb 1992 15:26:32 EST
  2526. To: uunet!cs.arizona.edu!icon-group@uunet.uu.net
  2527. Subject: Re: ? on generators
  2528.  
  2529.  >         I was reading through the Icon Programming Language book last night
  2530.  > and I came across a line something like this:
  2531.  > 
  2532.  >         if (&features = = "co-expressions") then....
  2533.  > 
  2534.  >         Is there a space between the equals signs, or is it a "==" string
  2535.  > comparison?  And if it is, why isn't there an "every" before the expression
  2536.  > in parentheses (to continue generating values from &features until it fails
  2537.  > or matches "co-expressions")?  And if it isn't, what do the two equals
  2538.  > signs do?
  2539.  > 
  2540.  >         I'm sure I'm missing something very basic here, but I still don't
  2541.  > know what it is...  any help would be appreciated!
  2542.  > 
  2543.  >                                                 Thanks,
  2544.  >                                                 Guy Tellefsen
  2545.  
  2546. I'm sure given the context, the operator is supposed to be a string
  2547. comparison, the ==.  This illustrates one of the real snazzy features of
  2548. Icon, goal directed evaluation.  I'd suggest reading up on it in the book
  2549. now that your curiosity is aroused.  Goal directed evaluation is very handy
  2550. for expressions like this where the goal is to determine if co-expressions
  2551. are one of the features in the version of Icon being executed.  Since
  2552. &features is a generator, all of its results are generated until the
  2553. comparison succeeds or the generator is exhausted and the comparison
  2554. expression fails.
  2555.  
  2556. You have to be cautions with goal directed evaluation since it can sneak up
  2557. on you when you don't expect it.  The first example that comes to mind is
  2558. when you only want the first element in a list and you use !list as a quick
  2559. way to get it.  If you inadvertently include this expression in a larger
  2560. comparison expression you will end up generating all the elements in the
  2561. list until the expression is satisfied or the list is exhausted.  I learned
  2562. this the hard way.  I'm sure there are other examples of goal directed
  2563. evaluation gotchas.  The more powerful the tool the more dangerous.  Any
  2564. horror stories out there (not related to pipes in MS-DOS)?
  2565.  
  2566. --- ---
  2567.  | S | Iconic Software, Inc.  -  Jerry Nowlin  -  uunet!isidev!nowlin
  2568. --- ---
  2569.  
  2570.  
  2571. From ercn72@festival.edinburgh.ac.uk  Mon Feb 10 10:47:29 1992
  2572. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Mon, 10 Feb 92 10:47:29 MST
  2573. Received: from sun2.nsfnet-relay.ac.uk by optima.cs.arizona.edu (4.1/15)
  2574.     id AA24310; Mon, 10 Feb 92 10:47:19 MST
  2575. Received: from festival.edinburgh.ac.uk by sun2.nsfnet-relay.ac.uk via JANET 
  2576.           with NIFTP id <19325-0@sun2.nsfnet-relay.ac.uk>;
  2577.           Mon, 10 Feb 1992 15:49:58 +0000
  2578. From: "R.J.Hare" <ercn72@festival.edinburgh.ac.uk>
  2579. Subject: Various
  2580. To: icon-group@cs.arizona.edu
  2581. Date: Mon, 10 Feb 92 15:56:24 GMT
  2582. Message-Id: <9202101556.aa02286@uk.ac.ed.festival>
  2583.  
  2584.  
  2585. 1) Is there a charge currently for Icon reports? 
  2586.  
  2587. 2) I read the stuff about pipes in the last Analyst with some interest as I
  2588.    have a need for a 'one line calculator' at the moment. 
  2589.  
  2590.    Accordingly, I modified the simple code example in the Analyst (last
  2591.    example,in col2 of p2) to accept an Icon expression rather than just the
  2592.    'write("Hello World")' text. 
  2593.  
  2594.    I then read in an expression (say, 3+4) at run time and got the answer I
  2595.    expected. I then modified the program to accept a command line argument -
  2596.    no problems until I entered something like sin(1) when I got a syntax error
  2597.    message. If I entered sin(1) as the input to the read statement (ie: not on
  2598.    the command line) it works fine. However, if I enter "sin(1)" as a command
  2599.    line argument, it works - am I missing something about the differnce
  2600.    between 'simple' things like '3+4' and 'difficult' things like 'sin(1)'?
  2601.  
  2602. 3) Apart from the advantages outlined in the Newsletter of November 1991, is
  2603.    there any advantage in using the 386 version of Icon? Is it 'faster' or
  2604.    more 'efficient' for instance?
  2605.  
  2606. Thanks.
  2607.  
  2608. Roger Hare.
  2609.  
  2610. From pbewig@netcom.netcom.com  Mon Feb 10 11:21:47 1992
  2611. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Mon, 10 Feb 92 11:21:47 MST
  2612. Received: from netcomsv.netcom.com by optima.cs.arizona.edu (4.1/15)
  2613.     id AA27340; Mon, 10 Feb 92 11:21:34 MST
  2614. Received: from netcom.netcom.com by netcomsv.netcom.com (4.1/SMI-4.1)
  2615.     id AA01946; Mon, 10 Feb 92 10:22:00 PST
  2616. Received: by netcom.netcom.com (4.1/SMI-4.1)
  2617.     id AA24509; Mon, 10 Feb 92 10:22:00 PST
  2618. From: pbewig@netcom.netcom.com (Phil Bewig)
  2619. Message-Id: <9202101822.AA24509@netcom.netcom.com>
  2620. To: icon-group@cs.arizona.edu
  2621. Subject: Permuted Index for Icon Program Library
  2622. Date: Mon, 10 Feb 1992 10:20:02 -0800
  2623.  
  2624. The following simple pipeline, run from the /usr/icon/v8/ipl directory,
  2625. will produce a permuted index of all procs and progs in the library:
  2626.  
  2627.     grep "Title:" */*.icn |
  2628.     sed 's/.icn.*:[ \t]*/ /' |
  2629.     ptx -frt | troff -mptx | ...
  2630.  
  2631. The pipeline works as follows:  First, extract the title line from the
  2632. header in each ipl file; grep prepends the filename to each line.  Then,
  2633. replace everything from the ".icn" filename suffix to the white space
  2634. after the word "Title:" with a single space.  The options to ptx fold
  2635. upper and lower case together and ignore non-letters (-f), take the first
  2636. word on each line to be an index entry (-r), and produce output suitable
  2637. for troff (-t); some of these options may vary on some systems.  Finally,
  2638. the index is printed by troff through whatever post-processors your system
  2639. requires.  You can vary the pipeline to do such things as specify an ignore
  2640. file for the ptx command or specify additional text or formatting details
  2641. to troff.
  2642.  
  2643. I hope you find this useful.
  2644.  
  2645. Phil
  2646. pbewig@netcom.com
  2647.  
  2648. From nevin@apple.com  Mon Feb 10 12:48:06 1992
  2649. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Mon, 10 Feb 92 12:48:06 MST
  2650. Received: from colossus.apple.com by optima.cs.arizona.edu (4.1/15)
  2651.     id AA02532; Mon, 10 Feb 92 12:48:03 MST
  2652. Received: from [90.1.0.10] by colossus.apple.com with SMTP (5.65/11-Dec-1991-eef)
  2653.     id AA01902; Mon, 10 Feb 92 11:44:44 -0800
  2654.     for 
  2655. Received: from [90.134.16.31] (peachfuzz.apple.com) by goofy.apple.com with SMTP (5.61/27-Sep-1991-eef)
  2656.     id AA00449; Mon, 10 Feb 92 11:44:38 -0800
  2657.     for ercn72@festival.edinburgh.ac.uk
  2658. Message-Id: <9202101944.AA00449@internal.apple.com>
  2659. Date: Mon, 10 Feb 1992 11:46:38 -0800
  2660. To: icon-group@cs.arizona.edu
  2661. From: nevin@apple.com (Nevin ":-]" Liber)
  2662. Subject: Re: Various
  2663. Cc: "R.J.Hare" <ercn72@festival.edinburgh.ac.uk>
  2664.  
  2665. Roger Hare <ercn72@festival.edinburgh.ac.uk> writes:
  2666. >   no problems until I entered something like sin(1) when I got a syntax error
  2667. >   message. If I entered sin(1) as the input to the read statement (ie: not on
  2668. >   the command line) it works fine. However, if I enter "sin(1)" as a command
  2669. >   line argument, it works - am I missing something about the differnce
  2670. >   between 'simple' things like '3+4' and 'difficult' things like 'sin(1)'?
  2671.  
  2672. (I assume you meant didn't work from the command line).  Many shell
  2673. languages use parentheses as special characters, and may need to be quoted
  2674. to remove their special meaning so they can be passed directly from the
  2675. shell to your Icon program.  Try something like sin\(1\) or 'sin(1)'
  2676. (backslashes and single quotes included) and see if that works.
  2677. ___
  2678. NEVIN ":-)" LIBER,  Speech Recognition Guy
  2679.  email: nevin@apple.com         paper:  Apple Computer, Inc.
  2680.  voice: (408) 974-MIX1                  20525 Mariani Avenue, MS: 76-7E
  2681.  AppleLink: NEVIN.LIBER                 Cupertino, California 95014
  2682.  
  2683.  
  2684. From pbewig@netcom.netcom.com  Mon Feb 10 16:05:44 1992
  2685. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Mon, 10 Feb 92 16:05:44 MST
  2686. Received: from netcomsv.netcom.com by optima.cs.arizona.edu (4.1/15)
  2687.     id AA18593; Mon, 10 Feb 92 16:05:32 MST
  2688. Received: from netcom.netcom.com by netcomsv.netcom.com (4.1/SMI-4.1)
  2689.     id AA02403; Mon, 10 Feb 92 15:05:55 PST
  2690. Received: by netcom.netcom.com (4.1/SMI-4.1)
  2691.     id AA22714; Mon, 10 Feb 92 15:03:53 PST
  2692. Date: Mon, 10 Feb 92 15:03:53 PST
  2693. From: pbewig@netcom.netcom.com (Phil Bewig)
  2694. Message-Id: <9202102303.AA22714@netcom.netcom.com>
  2695. Subject:  Untranslated Mode in &input
  2696. Apparently-To: icon-group@cs.arizona.edu
  2697.  
  2698. In the MS-DOS/386 version of icon from Catspaw, it appears that the
  2699. file &input is opened in translated mode.  I would like to access the
  2700. bytes of &input one at a time in untranslated mode using reads().  Is
  2701. there any way to close &input and re-open it in untranslated mode?
  2702.  
  2703. Thanks,
  2704.  
  2705. Phil Bewig
  2706. pbewig@netcom.com
  2707.  
  2708. From ralph  Mon Feb 10 16:36:51 1992
  2709. Date: Mon, 10 Feb 92 16:36:51 MST
  2710. From: "Ralph Griswold" <ralph>
  2711. Message-Id: <9202102336.AA15909@cheltenham.cs.arizona.edu>
  2712. Received: by cheltenham.cs.arizona.edu; Mon, 10 Feb 92 16:36:51 MST
  2713. To: pbewig@netcom.netcom.com
  2714. Subject: Re:  Untranslated Mode in &input
  2715. Cc: icon-group
  2716.  
  2717. Standard input (&input) is always opened in the translated mode.  You
  2718. can't do anything about it -- it's a property of the C I/O library.
  2719. The same is true of the standard MS-DOS Icon.  To the best of
  2720. my knowledge, this "feature" is true of all MS-DOS C libraries.
  2721.  
  2722. The thing I usually do to work around this is to pass a file name
  2723. as a command-line argument and open the file in untranslated mode
  2724. inside the program.
  2725.  
  2726. Incidentally, there probably is a good reason for always opening
  2727. standard input in the translated mode.  Perhaps someone more knowledgeable
  2728. than I am can illuminate this.
  2729.     
  2730.     Ralph Griswold / Department of Computer Science 
  2731.     The University of Arizona / Tucson, AZ 85721
  2732.     
  2733.     ralph@cs.arizona.edu / uunet!arizona!ralph
  2734.     
  2735.     voice: 602-621-6609 / fax: 602-621-9618
  2736.  
  2737. From pbewig@netcom.netcom.com  Fri Feb 14 13:05:56 1992
  2738. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Fri, 14 Feb 92 13:05:56 MST
  2739. Received: from netcomsv.netcom.com by optima.cs.arizona.edu (4.1/15)
  2740.     id AA03220; Fri, 14 Feb 92 13:05:31 MST
  2741. Received: from netcom.netcom.com by netcomsv.netcom.com (4.1/SMI-4.1)
  2742.     id AA24327; Fri, 14 Feb 92 12:05:58 PST
  2743. Received: by netcom.netcom.com (4.1/SMI-4.1)
  2744.     id AA27907; Fri, 14 Feb 92 12:05:56 PST
  2745. Date: Fri, 14 Feb 92 12:05:56 PST
  2746. From: pbewig@netcom.netcom.com (Phil Bewig)
  2747. Message-Id: <9202142005.AA27907@netcom.netcom.com>
  2748. X-Mailer: Mail User's Shell (7.2.3 5/22/91)
  2749. To: icon-group@cs.arizona.edu
  2750. Subject: Lists, Timing, and Memory Consumption
  2751.  
  2752. Hello,
  2753.  
  2754. I've been studying the chapter on lists in the icon implementation book.
  2755. An interesting conclusion of that study is that the manner in which a
  2756. list is created can have a drastic effect on the memory consumed by the
  2757. list and the time taken to access the elements of the list.  The following
  2758. program shows the difference between pre-initializing a list by using a
  2759. L := list(n, 0) statement, to allocate space for the list, or using stack-
  2760. and-queue statements to build from an initially empty list:
  2761.  
  2762. procedure main(args)
  2763.  
  2764.     # write headings, initialize variables
  2765.     write("            Pre-initialize List        Successive Insertions")
  2766.     write("                                                            ")
  2767.     write("           Block  Set-Up  Search       Block  Set-Up  Search")
  2768.     write(" Items    Memory   Time    Time       Memory   Time    Time ")
  2769.     write("------    ------  ------  ------      ------  ------  ------")
  2770.     trials := [25, 100, 500, 1000, 2000, 5000, 10000, 25000, 50000]
  2771.     memory := []
  2772.  
  2773.     # performs tests
  2774.     every n := !trials do {
  2775.         writes(right(n, 6))
  2776.  
  2777.         # pre-initialize list
  2778.         every put(memory, -&storage)
  2779.         timer := -&time
  2780.         L := list(n, 0)
  2781.         every L[1 to n] := 1992 # a very good year
  2782.         timer +:= &time
  2783.         i := 0
  2784.         every s := &storage do memory[i +:= 1] +:= s
  2785.         writes(right(memory[3], 10), right(timer, 8))
  2786.         timer := -&time
  2787.         every k := L[1 to n]
  2788.         timer +:= &time
  2789.         writes(right(timer, 8))
  2790.         L := []
  2791.         collect()
  2792.  
  2793.         # successive insertions
  2794.         every put(memory, -&storage)
  2795.         timer := -&time
  2796.         M := []
  2797.         every 1 to n do put(M, 1992)
  2798.         timer +:= &time
  2799.         i := 0
  2800.         every s := &storage do memory[i +:= 1] +:= s
  2801.         writes(right(memory[3], 12), right(timer, 8))
  2802.         timer := -&time
  2803.         every k := M[1 to n]
  2804.         timer +:= &time
  2805.         writes(right(timer, 8))
  2806.         M := []
  2807.         collect()
  2808.         write() }
  2809. end
  2810.  
  2811. Here is the output from one run of the program:
  2812.  
  2813.             Pre-initialize List        Successive Insertions
  2814.                                                             
  2815.            Block  Set-Up  Search       Block  Set-Up  Search
  2816.  Items    Memory   Time    Time       Memory   Time    Time 
  2817. ------    ------  ------  ------      ------  ------  ------
  2818.     25       248       0       0        1124       0       0
  2819.    100      2632      50       0        4476      60       0
  2820.    500      9184     110     280       15136     110     110
  2821.   1000     23936     380     220       36024     390     220
  2822.   2000     52948     600     610       70660     600     660
  2823.   5000    111584    1370    1370      168372    1320    1540
  2824.  10000    249468    2360    2800      334160    2690    3680
  2825.  25000    535256    7090    6980      817432    6920    9120
  2826.  50000   1218528   14060   14280     1640988   13510   18780
  2827.  
  2828. I am running on a Compaq 386 at 16mhz using the MS-DOS/386 version
  2829. of Icon from Catspaw.
  2830.  
  2831. I have several questions:
  2832.  
  2833. 1) Is there a better way to extract the amount of block memory used
  2834. from the &storage keyword?  What I did is just too ugly.
  2835.  
  2836. 2) When pre-initializing, why does the memory consumed per item vary?
  2837. It is 10 bytes per item for 25 items, 26 bytes per item for 100, 24
  2838. bytes at 1000, 22 bytes at 5000, 25 bytes at 10000, 21 bytes at 25000,
  2839. and 24 bytes at 50000.
  2840.  
  2841. 3) Memory consumed per item for successive insertions also varies, from
  2842. 45 bytes per item at 25 and 100 items, to 30 bytes per item at 500, back
  2843. up to 36 bytes at 1000, decreasing at each step to 32 bytes per item at
  2844. 25000, and then increasing to 33 bytes at 50000.  Why?
  2845.  
  2846. The moral of the story is to pre-initialize lists whenever possible so
  2847. that space is allocated more efficiently, especially when making a
  2848. large number of searches in a static array.
  2849.  
  2850. Phil Bewig
  2851. pbewig@netcom.com
  2852.  
  2853. From icon-group-request  Sat Feb 15 16:04:22 1992
  2854. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Sat, 15 Feb 92 16:04:22 MST
  2855. Received: from ucbvax.Berkeley.EDU by optima.cs.arizona.edu (4.1/15)
  2856.     id AA07253; Sat, 15 Feb 92 16:04:16 MST
  2857. Received: by ucbvax.Berkeley.EDU (5.63/1.43)
  2858.     id AA15789; Sat, 15 Feb 92 14:53:38 -0800
  2859. Received: from USENET by ucbvax.Berkeley.EDU with netnews
  2860.     for icon-group@cs.arizona.edu (icon-group@cs.arizona.edu)
  2861.     (contact usenet@ucbvax.Berkeley.EDU if you have questions)
  2862. Date: 10 Feb 92 22:46:33 GMT
  2863. From: csus.edu!wupost!zaphod.mps.ohio-state.edu!uwm.edu!convex.csd.uwm.edu!corre@ucdavis.ucdavis.edu  (Alan D Corre)
  2864. Organization: University of Wisconsin - Milwaukee
  2865. Subject: ProIcon Program
  2866. Message-Id: <1992Feb10.224633.15785@uwm.edu>
  2867. Sender: icon-group-request@cs.arizona.edu
  2868. To: icon-group@cs.arizona.edu
  2869.  
  2870. Since I have not seen much here on ProIcon I offer a program which is a small 
  2871. part of the package to which I referred in a previous posting. This is the one
  2872. that prints mixed Hebrew and English text. It is not a word processor,
  2873. although it has some of the characteristics of one. Since in this system
  2874. students are encouraged to regard as Hebrew words what goes into their heads
  2875. and not what goes on paper, this program is psychologically important, since
  2876. it enables the student to produce nicely printed "real" Hebrew. Part of the
  2877. point is to avoid the archaic, difficult, addictive massoretic vowel point
  2878. system. I realise that it could be greatly improved, but it works well
  2879. enough, and sufficient unto the day is the evil thereof.
  2880. ----------------------------------------------------------------------------
  2881. #This program is written in ProIcon for the Macintosh computer. Alan D. Corre
  2882. #August 1991. It takes input in a transcription of Hebrew which represents
  2883. #current pronunciation adequately but mimics the peculiarities of Hebrew
  2884. #spelling. Here are some sentences from the beginning of Agnon's story 
  2885. #"Friendship": marat qliyngel 'i$ah mefursemet haytah umenahelet beyt sefer
  2886. #haytah qowdem liymowt hamilHamah. mi$eni$tanu sidrey ha`owlam,neHtexah
  2887. #migdulatah..wexol miy $eyac'u low mowniyTiyn ba`owlam haytah mitqarevet
  2888. #'eclow weyowce't wenixneset leveytow" The letter sin is represented by the
  2889. #German ess-zed which is alt-s on the Mac and cannot be represented here.
  2890. #The tilde (~)toggles between English and Hebrew, so the word "bar" will be
  2891. #the English word "bar" or the Hebrew beyt-rey$ according to the current
  2892. #mode of the program. Finals are inserted automatically. Justification
  2893. #both ways occurs unless the program detects a blank or empty line, in
  2894. #which case the previous line is not justified.
  2895. #Since I took out non-ASCII chars, and have not rechecked that this
  2896. #works with the corresponding octal chars, there could be some slips in
  2897. #this text.
  2898.  
  2899.  
  2900. global outfilename, outvar, outwin,hebrew_string_flag, hebrew_text_flag,
  2901.     screenwidth,screenheight,markers
  2902.  
  2903. procedure main()
  2904. #message() creates a standard Mac message box
  2905.     if message("Do you wish to create a new text or print an old one?","New",
  2906.         "Old") then newtext() else
  2907.         oldtext()
  2908. #Empty and hide the interactive window
  2909.     wset(0,5)
  2910.     wset(0,0)
  2911. end
  2912.  
  2913.  
  2914. procedure newtext()
  2915.     set_markers()
  2916.     get_info()
  2917.     get_screensize()
  2918.     create_file()
  2919.     go()
  2920. end
  2921.  
  2922. procedure oldtext()
  2923. #getfile() allows selection of a file already available
  2924.     outfilename := getfile("Please select file.",,)
  2925. #attempt to open a window with the name of the file
  2926.     if not (outwin := wopen(outfilename,"f")) then stop()
  2927. #put a font in this window which has Hebrew letters in high ASCII numbers
  2928.     wfont(outwin,"Ivrit")
  2929. #use 12-point
  2930.     wfontsize(outwin,12)
  2931. #show the window. The user wishing to edit must make the window active
  2932. #and use the appropriate alt keys to edit the Hebrew text. This is not
  2933. #necessary when using the transcription initially
  2934.     wset(outwin,1)
  2935.     if message("Do you wish to edit? (Press return when through editing.)","Yes","No") then
  2936.             read()
  2937.     if message("Do you wish to print?","Yes","No") then
  2938. #send the window to the printer if the user desires
  2939.             wprint(outwin,1,1)
  2940. end
  2941.  
  2942. procedure set_markers()
  2943. #five letters preceding these characters take a special final shape
  2944.     markers := ' ,.;:-\324\"?)]}'
  2945. end
  2946.  
  2947.  
  2948. procedure get_info()
  2949. local dimlist
  2950.     outfilename := gettext("What is the name of your output file?",,"Cancel")
  2951.     if /outfilename then stop()
  2952. #the program has to know what is the principal language in order to leave
  2953. #blanks at paragraph endings properly. When the text flag is set, then the
  2954. #program overall is operating in Hebrew mode. When the string flag is set
  2955. #the current string is Hebrew
  2956.     if message("What is the principal language of the text?","Hebrew","English") then
  2957.         hebrew_string_flag := hebrew_text_flag := 1
  2958.     if \hebrew_text_flag then {
  2959.         if not message("The principal language used is Hebrew.","Okay","Cancel") then
  2960.         stop()} else
  2961.     if not message("The principal language used is English.","Okay","Cancel") then
  2962.         stop()
  2963. end
  2964.  
  2965. procedure get_screensize()
  2966. local dimlist
  2967. #&screen is a list. Work with the old standard mac screen
  2968.     dimlist := &screen
  2969.     screenheight := dimlist[3]
  2970.     screenwidth := dimlist[4]
  2971.     if screenwidth > 470 then screenwidth := 470
  2972. end
  2973.  
  2974.  
  2975. procedure create_file()
  2976. #arrange the various fonts and sizes
  2977.     outwin := wopen(outfilename,"n")
  2978.     outvar := open(outfilename,"w")
  2979.     wsize(0,screenwidth,(screenheight / 2 - 40))
  2980.     wsize(outwin,screenwidth,(screenheight / 2 - 40))
  2981.     wfont(outwin,"Ivrit")
  2982.     wfontsize(outwin,12) 
  2983.     wfont(0,"Geneva")
  2984.     wfontsize(0,12)
  2985. #position windows
  2986.     wmove(0,0,40)
  2987.     wmove(outwin,0,screenheight / 2 + 20)
  2988.     wset(outwin,1) #show the output window
  2989. end
  2990.     
  2991. procedure process(l)
  2992. local cursor,substring,newline
  2993. if *l = 0 then return " "
  2994.     cursor := 1
  2995.     newline := ""
  2996. #look for a tilde, and piece together a new line accordingly
  2997.     l ? while substring := tab(upto('~')) do {
  2998.     move(1)
  2999.     if \hebrew_string_flag then substring := hebraize(substring)
  3000.     if /hebrew_text_flag then newline ||:= substring else
  3001.         newline := (substring || newline)
  3002. #string flag toggle
  3003.     (/hebrew_string_flag := 1) | (hebrew_string_flag := &null)
  3004.     cursor := &pos}
  3005.     substring := l[cursor:0]
  3006.     if \hebrew_string_flag then substring := hebraize(substring) 
  3007.     if /hebrew_text_flag then newline ||:= substring else
  3008.         newline := (substring || newline)
  3009. return newline
  3010. end
  3011.  
  3012. procedure justify(l)
  3013. #doesnt give perfect right justification, but its good enough
  3014. local stringlength,counter,n,increment,newline
  3015.     stringlength := wtextwidth(outwin,l)
  3016.     newline := l
  3017.     increment := 1
  3018.     while stringlength < screenwidth do {
  3019.         counter := 0
  3020.         l ? every n := upto(' ') do {
  3021.                     newline[n + (counter * increment)] := "  "
  3022.                     counter +:= 1
  3023.                     stringlength +:= 4
  3024.                     if stringlength >= screenwidth then break}
  3025.         increment +:= 1}
  3026. return newline
  3027. end
  3028.  
  3029. procedure go()
  3030. #the appearence of the Hebrew/English window lags one line behind the
  3031. #input window
  3032. local line,line2,counter,mess
  3033.     counter := 0
  3034.     line := read()    
  3035. #octal 263 is option-period.
  3036.     if line == "\263" then stop()
  3037.     while (line2 := read()) ~== "\263" do {
  3038.         counter +:= 1
  3039.         if ((not match(" ",line2)) & (*line2 ~= 0)) then
  3040.         line := justify(process(line)) else 
  3041.           if /hebrew_text_flag then line := process(line) else
  3042.                 line := rt(process(line))
  3043.         if (wtextwidth(outwin,line) - screenwidth) > 10 then {
  3044.             mess := "Warning. Line " || counter || " is " || (wtextwidth(outwin,line) -
  3045.             screenwidth) || " pixels too long."
  3046.             message(mess,"Okay","")}
  3047.         write(outvar,line)
  3048.         line := line2}
  3049.     if /hebrew_text_flag then line := process(line) else
  3050.         line := rt(process(line))
  3051.             if (wtextwidth(outwin,line) - screenwidth) > 10 then {
  3052.             mess := "Warning. Last Line is " || (wtextwidth(outwin,line) -
  3053.             screenwidth) || " pixels too long."
  3054.             message(mess,"Okay","")}
  3055.     write(outvar,line)
  3056.     if message("Do you wish to print?","Yes","No") then wprint(outwin,1,1)
  3057.     close(outvar)
  3058.     wclose(outwin,"")
  3059. end
  3060.  
  3061. procedure hebraize(l)
  3062. static s2,s3
  3063. #' is used for aleph. For the abreviation sign use either alt-] which gives
  3064. #an appropriate sign, or alt-' which is easier to remember but gives a funny
  3065. #looking digraph on the screen
  3066.     initial{ s2 := "u\'\276\324bvgdhwzHTykKlmMnNs`pfFcCqr$\247tx\261\335(){}[]X"
  3067.                      s3 := "\267\324\'\'\272\272\355\266\372\267\275\305\303\264\373\373\302\265_
  3068.                                      \265\176\176\247\322\304\304\304\215\215\317\250\246\244\240_
  3069.                                     \373+$)(}{][\373"}
  3070. #the following (1) inserts initial aleph in case the student has forgotten it
  3071. #(2) takes care of final x with vowel (all other finals are vowelless in
  3072. #modern Hebrew (3) takes out vowels except u which is usually represented in
  3073. #modern Hebrew (4) takes care of other finals (5) converts to Hebrew letters
  3074. #(6) reverses to Hebrew direction
  3075.     l := reverse(map(finals(devowel(xa(aleph(l)))),s2,s3))
  3076. return l
  3077. end
  3078.  
  3079. procedure aleph(l)
  3080. #inserts an aleph in words beginning with vowels only
  3081. #this alters the duplicate line; compare procedure devowel which rebuilds
  3082. #the line from scratch
  3083. local newl,offset
  3084.     newl := l
  3085.     offset := 0
  3086.     if upto('aeiou',l[1]) then {
  3087.         offset +:= 1
  3088.         newl[1] := ("\'" || l[1])}
  3089.         l ?  while tab(upto(' ')) do {
  3090.                         tab(many(' '))
  3091.                         if upto('aeiou',l[&pos]) then {
  3092.                             newl[&pos + offset] := ("\'" || l[&pos])
  3093.                             offset +:= 1}}
  3094. return newl
  3095. end
  3096.  
  3097. procedure xa(s)
  3098. #takes care of the special case of final xa
  3099. local substr,newstr
  3100.     newstr := ""
  3101.     s ||:= " "
  3102.     s ? {while substr := tab(find("xa")) || move(2) || tab(any(markers)) do {
  3103.                     substr[-3] := char(170)
  3104.                     newstr ||:= substr}
  3105.                 newstr ||:= s[&pos:-1]}
  3106. return newstr
  3107. end
  3108.  
  3109.  
  3110. procedure finals(l)
  3111. #arranges the final letters
  3112. static finals,corresp
  3113. local newline
  3114. initial {finals := 'xmncf'
  3115.                      corresp := table("")
  3116.                      corresp["x"] := "\301"
  3117.                      corresp["m"] := "\243"
  3118.                      corresp["n"] := "\242"
  3119.                      corresp["f"] := "\354"
  3120.                      corresp["c"] := "\260"}
  3121.     newline := l
  3122.     l ? while tab(upto(finals)) do {
  3123.                 move(1)
  3124.                 if (any(markers)) | (&pos = *l + 1) then
  3125.                     newline[&pos - 1] := corresp[l[&pos - 1]]
  3126.                                                                     }
  3127. return newline
  3128. end
  3129.  
  3130. procedure rt(l)
  3131. #for right justification; chars are of different size
  3132. local stringlength,newline
  3133.     stringlength := wtextwidth(outwin,l)
  3134.     newline := l
  3135.     if (screenwidth-stringlength) > 0 then
  3136.     newline := (repl(" ",(screenwidth-stringlength +2) / 4) || l)
  3137. return newline
  3138. end
  3139.  
  3140. procedure devowel(l)
  3141. local newline,substring
  3142.     newline := ""
  3143.     l ? {while substring := tab(upto('aeio')) do {
  3144.         newline ||:= substring
  3145.         move(1)}
  3146.         newline ||:= l[&pos:0]}
  3147. return newline
  3148. end
  3149.  
  3150. From icon-group-request  Mon Feb 17 00:08:37 1992
  3151. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Mon, 17 Feb 92 00:08:37 MST
  3152. Received: from ucbvax.Berkeley.EDU by optima.cs.arizona.edu (4.1/15)
  3153.     id AA01005; Mon, 17 Feb 92 00:08:34 MST
  3154. Received: by ucbvax.Berkeley.EDU (5.63/1.43)
  3155.     id AA29116; Sun, 16 Feb 92 23:04:29 -0800
  3156. Received: from USENET by ucbvax.Berkeley.EDU with netnews
  3157.     for icon-group@cs.arizona.edu (icon-group@cs.arizona.edu)
  3158.     (contact usenet@ucbvax.Berkeley.EDU if you have questions)
  3159. Date: 16 Feb 92 19:45:07 GMT
  3160. From: world!ksr!tim@uunet.uu.net  (Tim Peters)
  3161. Organization: Kendall Square Research Corp.
  3162. Subject: Re: Lists, Timing, and Memory Consumption
  3163. Message-Id: <9855@ksr.com>
  3164. References: <9202142005.AA27907@netcom.netcom.com>
  3165. Sender: icon-group-request@cs.arizona.edu
  3166. To: icon-group@cs.arizona.edu
  3167.  
  3168. In article <9202142005.AA27907@netcom.netcom.com> pbewig@NETCOM.NETCOM.COM (Phil Bewig) writes:
  3169. >I've been studying the chapter on lists in the icon implementation book. ...
  3170. > ...[stuff deleted]...
  3171. >...
  3172. >1) Is there a better way to extract the amount of block memory used
  3173. >from the &storage keyword?  What I did is just too ugly.
  3174.  
  3175. Suggest hiding the trickery in a procedure.  E.g.,
  3176.  
  3177. procedure block_memory()
  3178.     local temp
  3179.     every temp := &storage  # block memory is the last one
  3180.     return temp
  3181. end
  3182.  
  3183. Co-expressions are another way, but (I believe) less portable.
  3184.  
  3185. >2) When pre-initializing, why does the memory consumed per item vary?
  3186. >...
  3187. >3) Memory consumed per item for successive insertions also varies, ...
  3188. >...  Why?
  3189.  
  3190. Suspect you'll be surprised if you put the line
  3191.  
  3192.     every write(!memory)
  3193.  
  3194. at the end of your program; don't think you quite managed to measure
  3195. what you intended to measure.  Here are all the lines that affect the
  3196. `memory' vrbl:
  3197.  
  3198. >procedure main(args)
  3199. >    ...
  3200. >    memory := []
  3201. >    ...
  3202. >    every n := !trials do {
  3203. >     ...
  3204. >     every put(memory, -&storage)
  3205. >     ...
  3206. >     i := 0
  3207. >     every s := &storage do memory[i +:= 1] +:= s
  3208. >     writes(right(memory[3], 10), right(timer, 8))
  3209. >     ...
  3210. >     every put(memory, -&storage)
  3211. >     ...
  3212. >     i := 0
  3213. >     every s := &storage do memory[i +:= 1] +:= s
  3214. >     writes(right(memory[3], 12), right(timer, 8))
  3215. >     ...
  3216.  
  3217. The scoop is that `memory' keeps growing in length (6 additional
  3218. elements are appended on each loop iteration), but the elements after
  3219. memory[3] are never referenced.     Expect that what you really want is to
  3220. delete the
  3221.     memory := []
  3222. line before the loop and insert it before each of the two `put' lines.
  3223.  
  3224. When I did that, the bytes/element reported for the preinitialized case
  3225. settled down to a very steady 8; in the successive-insertion case, I
  3226. believe Icon needs additional memory to chain in overflow blocks as
  3227. needed.
  3228.  
  3229. >The moral of the story is to pre-initialize lists whenever possible so
  3230. >that space is allocated more efficiently, especially when making a
  3231. >large number of searches in a static array.
  3232.  
  3233. I don't know much about Icon's implementation, but believe your
  3234. conclusion holds (albeit with somewhat less force) anyway; on the other
  3235. hand, there's almost no measurable difference until the number of
  3236. elements in the list is on the order of a thousand, so for "almost all"
  3237. lists I wouldn't worry about it.
  3238.  
  3239. was-actually-quite-surprised-at-how-efficiently-icon-managed-to-implement-
  3240.    dynamic-length-list-indexing!-ly y'rs  - tim
  3241.  
  3242. Tim Peters   Kendall Square Research Corp
  3243. tim@ksr.com,         ksr!tim@uunet.uu.net
  3244.  
  3245. ps:  for comparison, here's the output of the program after making the
  3246. changes described above; this is on a Solbourne (souped-up SPARC):
  3247.  
  3248.         Pre-initialize List           Successive Insertions
  3249.  
  3250.        Block  Set-Up  Search       Block  Set-Up  Search
  3251.  Items      Memory   Time       Time          Memory   Time    Time
  3252. ------      ------  ------  ------      ------  ------  ------
  3253.     25         248       0       0     420      16       0
  3254.    100         848       0       0    1184       0       0
  3255.    500        4048       0      17    5200      16       0
  3256.   1000        8048      34      33       11336      33      17
  3257.   2000       16048      50      67       16836      66      67
  3258.   5000       40048     133     117       55912     150     167
  3259.  10000       79936     266     250       83644     300     317
  3260.  25000      199936     650     600      281128     766     800
  3261.  50000      399936    1334    1250      421412    1566    1650
  3262.  
  3263. >>> END OF MSG
  3264.  
  3265. From pbewig@netcom.com  Tue Feb 18 13:35:46 1992
  3266. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Tue, 18 Feb 92 13:35:46 MST
  3267. Received: from netcom.netcom.com by optima.cs.arizona.edu (4.1/15)
  3268.     id AA09531; Tue, 18 Feb 92 13:35:44 MST
  3269. Received: by netcom.netcom.com (4.1/SMI-4.1)
  3270.     id AA15491; Tue, 18 Feb 92 12:36:10 PST
  3271. Date: Tue, 18 Feb 92 12:36:10 PST
  3272. From: pbewig@netcom.com (Phil Bewig)
  3273. Message-Id: <9202182036.AA15491@netcom.netcom.com>
  3274. Apparently-To: icon-group@cs.arizona.edu
  3275.  
  3276. Tim Peters, responding to my earlier post, writes:
  3277.     The scoop is that 'memory' keeps growing in length but the
  3278.     elements after memory[3] are never referenced.
  3279.  
  3280. Oops!  Kernighan and Plauger's book The Elements of Programming
  3281. Style taught me that ugly code is quite frequently wrong, too.
  3282. I think I'll have to re-read that classic book.
  3283.  
  3284. Tim Peters also writes:
  3285.     was-actually-quite-surprised-at-how-efficiently-icon-
  3286.     managed-to-implement-dynamic-length-list-indexing!
  3287.  
  3288. So was I.  In fact, the first chapter I read from the implementation
  3289. book was the chapter on lists, to see how they did it.
  3290.  
  3291. From icon-group-request  Tue Feb 18 20:36:36 1992
  3292. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Tue, 18 Feb 92 20:36:36 MST
  3293. Received: from ucbvax.Berkeley.EDU by optima.cs.arizona.edu (4.1/15)
  3294.     id AA00482; Tue, 18 Feb 92 20:36:32 MST
  3295. Received: by ucbvax.Berkeley.EDU (5.63/1.43)
  3296.     id AA03670; Tue, 18 Feb 92 19:26:54 -0800
  3297. Received: from USENET by ucbvax.Berkeley.EDU with netnews
  3298.     for icon-group@cs.arizona.edu (icon-group@cs.arizona.edu)
  3299.     (contact usenet@ucbvax.Berkeley.EDU if you have questions)
  3300. Date: 18 Feb 92 22:10:31 GMT
  3301. From: van-bc!rsoft!agate!spool.mu.edu!sdd.hp.com!think.com!rpi!sarah!eve.albany.edu!lg4248@ucbvax.berkeley.edu  (The Sea Nymph)
  3302. Organization: State University of New York at Albany
  3303. Subject: implementation book[s]?
  3304. Message-Id: <LG4248.92Feb18161031@eve.albany.edu>
  3305. Sender: icon-group-request@cs.arizona.edu
  3306. To: icon-group@cs.arizona.edu
  3307.  
  3308.  
  3309. I have only seen one book on implementing Icon (in C). Unfortunately
  3310. I can't remember the specific title or author.. but in general,
  3311. does anyone know if there is more than one book, and can you
  3312. tell me what book[s] there is/are?
  3313.  
  3314. many thanks,
  3315. lg
  3316.  
  3317. ****************IAMNOTASIGNATUREIAMAFREETHINKINGINDIVIDUAL******************
  3318.  
  3319. From dorsaidm!idealord@uu.psi.com  Wed Feb 19 14:44:00 1992
  3320. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Wed, 19 Feb 92 14:44:00 MST
  3321. Received: from uu.psi.com by optima.cs.arizona.edu (4.1/15)
  3322.     id AA26562; Wed, 19 Feb 92 14:42:25 MST
  3323. Received: from dorsaidm.UUCP by uu.psi.com (5.65b/4.1.011392-PSI/PSINet)
  3324.     id AA18826; Wed, 19 Feb 92 16:06:41 -0500
  3325. Received: by dorsai.com (1.64/waf)
  3326.     via UUCP; Wed, 19 Feb 92 15:39:26 EST
  3327.     for cs.arizona.edu!icon-group
  3328. To: icon-group@cs.arizona.edu
  3329. Subject: ICON Procedures for Reading and Writing Standard MIDI Files
  3330. From: idealord@dorsai.com (Jeff Harrington)
  3331. Message-Id: <FksegB2w164w@dorsai.com>
  3332. Date: Wed, 19 Feb 92 15:39:26 EST
  3333. Organization: The Dorsai Diplomatic Mission, New York's Computer Consulate
  3334.  
  3335. I am interested in archive sites or individuals who have ICON 
  3336. code for this purpose.  I am currently developing such a set of
  3337. procedures and was wondering if others had done work in this area yet.
  3338.  
  3339. I am developing the capability for algorithmic composition and
  3340. decomposition ;) of MIDI files and MIDI files containing "gestural"
  3341. MIDI streams.  I would like to be able to convert such files to 
  3342. human readable text and back.  
  3343.  
  3344. Thanks for your consideration of this project.
  3345.  
  3346. Jeff Harrington
  3347. idealord@dorsai.com
  3348.  
  3349. From senac@laas.laas.fr  Thu Feb 20 02:16:17 1992
  3350. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Thu, 20 Feb 92 02:16:17 MST
  3351. Received: from chenas.inria.fr by optima.cs.arizona.edu (4.1/15)
  3352.     id AA06911; Thu, 20 Feb 92 02:16:10 MST
  3353. Received: from laas.laas.fr by chenas.inria.fr (5.65c8d/91.12.15)
  3354.     via Fnet-EUnet id AA04012; Thu, 20 Feb 1992 10:15:59 +0100 (MET)
  3355. Received: by laas.laas.fr, Thu, 20 Feb 92 10:11:40 +0100,Sendmail 5.61+
  3356. Date: Thu, 20 Feb 92 10:11:40 +0100
  3357. From: Patrick Senac <senac@laas.laas.fr>
  3358. Message-Id: <9202200911.AA15654@laas.laas.fr>
  3359. Return-Receipt-To: senac@laas.laas.fr
  3360. To: icon-group@cs.arizona.edu
  3361. Subject: How to get Icon ?
  3362.  
  3363.  Could you tell me please how to get a free software version of an Icon
  3364. compiler ( for MS-DOS )from an ftp with your university. 
  3365. I am researcher in CS at LAAS in Toulouse, France, 
  3366. and I am interested by the Icon's string handling capabilities.
  3367.  
  3368. Thank You very much.
  3369.  
  3370.  
  3371. From ralph  Fri Feb 21 10:28:44 1992
  3372. Date: Fri, 21 Feb 92 10:28:44 MST
  3373. From: "Ralph Griswold" <ralph>
  3374. Message-Id: <9202211728.AA00530@cheltenham.cs.arizona.edu>
  3375. Received: by cheltenham.cs.arizona.edu; Fri, 21 Feb 92 10:28:44 MST
  3376. To: icon-group
  3377. Subject: Version 8.5 of Icon
  3378.  
  3379. Executables and source code for Version 8.5 of Icon for MS-DOS are
  3380. now available by anonymous FTP from cs.arizona.edu.
  3381.  
  3382.     cd /icon/interpr/packages/msdos
  3383.  
  3384. and look around.
  3385.  
  3386. Stand-alone Macintosh executables are in the parallel macintosh
  3387. subdirectory.
  3388.  
  3389. These files will show up on our RBBS in a couple of days.
  3390.     
  3391.  
  3392.     Ralph Griswold / Department of Computer Science 
  3393.     The University of Arizona / Tucson, AZ 85721
  3394.     
  3395.     ralph@cs.arizona.edu / uunet!arizona!ralph
  3396.     
  3397.     voice: 602-621-6609 / fax: 602-621-9618
  3398.  
  3399. From TENAGLIA@mis.mcw.edu  Sat Feb 22 07:45:36 1992
  3400. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Sat, 22 Feb 92 07:45:36 MST
  3401. Received: from ADM.MIS.MCW.EDU by optima.cs.arizona.edu (4.1/15)
  3402.     id AA02828; Sat, 22 Feb 92 07:45:32 MST
  3403. Received: from mis.mcw.edu by mis.mcw.edu (PMDF #12252) id
  3404.  <01GGTAWRVDF4AFTRXL@mis.mcw.edu>; Sat, 22 Feb 1992 08:46 CST
  3405. Date: Sat, 22 Feb 1992 08:46 CST
  3406. From: Chris Tenaglia - 257-8765 <TENAGLIA@mis.mcw.edu>
  3407. Subject: Word Finder Puzzle
  3408. To: icon-group@cs.arizona.edu
  3409. Message-Id: <01GGTAWRVDF4AFTRXL@mis.mcw.edu>
  3410. X-Organization: Medical College of Wisconsin (Milwaukee, WI)
  3411. X-Vms-To: IN%"icon-group@cs.arizona.edu"
  3412.  
  3413.  
  3414. I noticed a word finder puzzle in comp.lang.icon this past week from
  3415. Richard Goerwitz. Working from a VMS platform, and lacking some of the
  3416. links he had, it took me a little while to get it working. But it was
  3417. intriguing, and I recalled I forgot to post a holiday code for the
  3418. Valentines/Presidents day. So I'm including my hack of a word finder
  3419. puzzle generator. I think mine uses more 'brute force' than Richards'
  3420. and I've only tested it with 8 to 12 words. It should work as well in
  3421. DOS or Unix. It seems to take too long (probably has too much table
  3422. copying). Oh well. Enjoy!
  3423.  
  3424. Chris Tenaglia (System Manager) |  "The past explained,     
  3425. Medical College of Wisconsin    |   the future fortold, 
  3426. 8701 W. Watertown Plank Rd.     |   the present largely appologized for."
  3427. Milwaukee, WI 53226             |   Organon to The Doctor
  3428. (414)257-8765                   |     
  3429. tenaglia@mis.mcw.edu, mcwmis!tenaglia
  3430.  
  3431. ############################################################
  3432. #                                                          #
  3433. # puzz.icn          2/21/92          by tenaglia           #
  3434. #                                                          #
  3435. # this program generates a word search puzzle              #
  3436. # usage : puzz <word_list_file >puzz_out_file x y          #
  3437. #                                                          #
  3438. ############################################################
  3439.  
  3440. global matrix,      # the actual puzzle board
  3441.        width,       # width of the puzzle
  3442.        height,      # height of the puzzle
  3443.        completed    # number of completed word placements
  3444.  
  3445. procedure main(param)
  3446. #
  3447. # initial set up : x=20, y=20 by default
  3448. #
  3449.   width  := param[1] | 20
  3450.   height := param[2] | 20
  3451.   words  := []
  3452. #
  3453. # load words to place in a space delimited
  3454. # file. more than one word per line is ok.
  3455. #
  3456.   while line := map(read()) do
  3457.     {
  3458.     tokens := parse(line,' \t')
  3459.     while put(words,pop(tokens))
  3460.     }
  3461. #
  3462. # get ready for main processing
  3463. #
  3464.   matrix    := table(" ")
  3465.   pass      := 0
  3466.   completed := 0
  3467.   &random:= map(&clock,":","0")
  3468. #
  3469. # here's the actual word placement rouinte
  3470. #
  3471.   every word := !words do place(word)
  3472. #
  3473. # fill in the unchosen areas with random alphas
  3474. #
  3475.   every i := 1 to height do
  3476.     every j := 1 to width do
  3477.       if matrix[i||","||j] == " " then
  3478.          matrix[i||","||j] := ?(&ucase)
  3479. #
  3480. # output results (for the test giver, words are lcase, noise is ucase)
  3481. #
  3482.   write(completed," words inserted out of ",*words," words.\n")
  3483.   write("\nNow for the puzzle you've been waiting for! (ANSWER)\n")
  3484.   every i := 1 to height do
  3485.     {
  3486.     every j := 1 to width do writes(matrix[i||","||j]," ")
  3487.     write()
  3488.     }
  3489. #
  3490. # output results (for the test taker, everything is upper case
  3491. #
  3492.   write("\fNow for the puzzle you've been waiting for! (PUZZLE)\n")
  3493.   every i := 1 to height do
  3494.     {
  3495.     every j := 1 to width do writes(map(matrix[i||","||j],&lcase,&ucase)," ")
  3496.     write()
  3497.     }
  3498.   end
  3499.  
  3500. #
  3501. # this procedure tries to place the word in a copy of the matrix
  3502. # if successful the updated copy is moved into the original
  3503. # if not, the problem word is skipped after 20 tries
  3504. #
  3505. procedure place(str)
  3506.  
  3507.   static xstep,ystep
  3508.   initial {
  3509.           xstep := [0,1,1,1,0,-1,-1,-1]
  3510.           ystep := [-1,-1,0,1,1,1,0,-1]
  3511.           }
  3512.   pass := 0
  3513.  
  3514.   repeat  {
  3515.   if (pass +:= 1) > 20 then
  3516.     { 
  3517.     write("skipping ",str)
  3518.     fail
  3519.     }
  3520.   direction := ?8
  3521.   xinc      := integer(xstep[direction])
  3522.   yinc      := integer(ystep[direction])
  3523.  
  3524.   if xinc < 0 then x := *str + ?(width - *str)
  3525.   if xinc = 0 then x := ?height
  3526.   if xinc > 0 then x := ?(width - *str)
  3527.  
  3528.   if yinc < 0 then y := *str + ?(height - *str)
  3529.   if yinc = 0 then y := ?width
  3530.   if yinc > 0 then y := ?(height - *str)
  3531.  
  3532.   if (x < 1) | (y < 1) then stop(str," too long.")
  3533.  
  3534.   construct := copy(matrix)
  3535.   item      := str
  3536.   write("placing ",item)
  3537.   every byte := !item do
  3538.     {
  3539.     if (construct[x||","||y] ~== " ")  &
  3540.        (construct[x||","||y] ~== byte) then break next
  3541.     construct[x||","||y] := byte
  3542.     x +:= xinc
  3543.     y +:= yinc
  3544.     }
  3545.   matrix     := copy(construct)
  3546.   completed +:= 1
  3547.   return "ok"
  3548.   } # end repeat
  3549.   return "ok"
  3550.   end
  3551.  
  3552. #
  3553. # parse a string into a list with respect to a delimiter (cset)
  3554. #
  3555. procedure parse(line,delims)  
  3556.   static chars
  3557.   chars  := &cset -- delims
  3558.   tokens := []
  3559.   line ? while tab(upto(chars)) do put(tokens,tab(many(chars)))
  3560.   return tokens
  3561.   end
  3562.   
  3563.  
  3564. From icon-group-request  Sat Feb 22 13:12:40 1992
  3565. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Sat, 22 Feb 92 13:12:40 MST
  3566. Received: from ucbvax.Berkeley.EDU by optima.cs.arizona.edu (4.1/15)
  3567.     id AA11503; Sat, 22 Feb 92 13:12:34 MST
  3568. Received: by ucbvax.Berkeley.EDU (5.63/1.43)
  3569.     id AA05518; Sat, 22 Feb 92 11:54:54 -0800
  3570. Received: from USENET by ucbvax.Berkeley.EDU with netnews
  3571.     for icon-group@cs.arizona.edu (icon-group@cs.arizona.edu)
  3572.     (contact usenet@ucbvax.Berkeley.EDU if you have questions)
  3573. Date: 6 Feb 92 15:41:29 GMT
  3574. From: hsi!mlfarm!rosie!ron@uunet.uu.net  (Ronald Florence)
  3575. Organization: Maple Lawn Farm, Stonington, CT
  3576. Subject: mr.icn - a mail (and news) reader
  3577. Message-Id: <1992Feb6.154129.26508@mlfarm.com>
  3578. Sender: icon-group-request@cs.arizona.edu
  3579. To: icon-group@cs.arizona.edu
  3580.  
  3581. Mr is a simple reader for mail.  It won't replace elm, mush, mailtool,
  3582. or the emacs mail readers, but it is small, quick, easy-to-use, and
  3583. robust.  Mr has commands to page, reply-to, save, append, print,
  3584. forward, pipe, conceal and reveal headers, originate, delete, and
  3585. undelete mail.  An alternate mailspool, or a newspool created by
  3586. bsnews, a news system for leaf nodes, can be specified on the command
  3587. line.  Mr is written entirely in Icon.
  3588.  
  3589. To build mr, you need iolib.icn, available from the IPL.  Rename
  3590. Makefile.unix or Makefile.dos to Makefile, configure mr.icn
  3591. (instructions are in the header comments), and do `make'.  The Unix
  3592. Makefile includes an install option.  On a non-Unix system, make sure
  3593. the TERM and TERMCAP environmental variables are set correctly; see
  3594. the comments in iolib.icn if you are not familiar with termcap.  Mr
  3595. has not been tested on ms-dos: it might run up against memory limits
  3596. on large mail spools, and while the ms-dos pseudo-pipes in popen.icn
  3597. should work to send a mail message thru a simple pipe command like
  3598. `uudecode' or `unshar', they probably will not work on a pipeline like
  3599. `pretty-formatter | print-spooler'.
  3600.  
  3601. A list of the commands is available by entering `h' or `?' in mr.  The
  3602. shar file also included a man page, and for those without troff, a
  3603. formatted version of the man page using backspaces for bolds and
  3604. underlines.
  3605.  
  3606. In the interest of portability and simplicity, mr does not use getch()
  3607. command input.  Nor does it include a lot of other bells and whistles
  3608. that are pretty standard in sophisticated mail readers.  Mr might be
  3609. useful to someone with simpler mail needs.
  3610.  
  3611. Ronald Florence
  3612.  
  3613.  
  3614. #! /bin/sh
  3615. # This is a shell archive, meaning:
  3616. # 1. Remove everything above the #! /bin/sh line.
  3617. # 2. Save the resulting text in a file.
  3618. # 3. Execute the file with /bin/sh (not csh) to create:
  3619. #    mr.icn
  3620. #    popen.icn
  3621. #    mr.man
  3622. #    Makefile.unix
  3623. #    Makefile.dos
  3624. #    manpage.mr
  3625. # This archive created: Thu Feb  6 10:24:02 1992
  3626. # By:    Ronald Florence (Maple Lawn Farm, Stonington, CT )
  3627. export PATH; PATH=/bin:/usr/bin:$PATH
  3628. echo shar: "extracting 'mr.icn'" '(11250 characters)'
  3629. if test -f 'mr.icn'
  3630. then
  3631.     echo shar: "will not over-write existing file 'mr.icn'"
  3632. else
  3633. sed 's/^X//' << \SHAR_EOF > 'mr.icn'
  3634. X############################################################################
  3635. X#
  3636. X#    Name:    mr.icn
  3637. X#
  3638. X#    Title:    Mail (and News) Reader
  3639. X#
  3640. X#    Author:    Ronald Florence (ron@mlfarm.com)
  3641. X#
  3642. X#    Date:    7 February 1992
  3643. X#
  3644. X#    Version: 1.0
  3645. X#
  3646. X############################################################################
  3647. X#
  3648. X#  This simple mail reader will also work with bsnews news spools (see
  3649. X#  comp.sources.misc).
  3650. X#
  3651. X#  Configuration:
  3652. X#    Editor    for replies or new mail.
  3653. X#    Host      optional upstream routing address for outgoing mail;
  3654. X#        a domained Host is appended to the address, a uucp
  3655. X#        Host prefixes the address.
  3656. X#    Print_cmd     command to format and/or spool material for the printer.
  3657. X#    Mail_cmd      the system mailer (usually sendmail, smail, or mail).
  3658. X#    Ignore      a list of headers to ignore when paging messages.
  3659. X#
  3660. X#    On non-Unix systems, change DUNNO in the Mailspool assignment to
  3661. X#    the full path of the default mailspool.  Ms-dos users could set
  3662. X#    dir in popen.icn to a directory on a virtual (RAM) disk.  Make
  3663. X#    sure the TERMCAP and TERM environment variables are set correctly
  3664. X#    for displays other than ms-dos mono.  If you are not familiar with
  3665. X#    termcap, see the header section of iolib.icn.
  3666. X#
  3667. X############################################################################
  3668. X
  3669. Xlink popen, iolib
  3670. Xglobal Host, Editor, Spool, Status, Ignore, 
  3671. X       Print_cmd, Mail_cmd, Mailspool, Md, Me, Ce
  3672. X
  3673. Xprocedure main(arg)
  3674. X  local i, cmd, art
  3675. X                # configuration 
  3676. X  Editor := "vi"
  3677. X  Host := &null
  3678. X  Print_cmd := "mp -F | lpr"
  3679. X  Mail_cmd := "/usr/lib/sendmail -t"
  3680. X  Ignore := ["From ", "Message-Id", "Received", "Return-path", "\tid", 
  3681. X         "Path", "Xref", "References", "X-mailer", "Errors-to", 
  3682. X         "Resent-Message-Id", "Status", "X-lines"]
  3683. X  if "UNIX" == &features then 
  3684. X      Mailspool := "/usr/spool/mail/" || getenv("LOGNAME"|"USER")
  3685. X  else Mailspool := getenv("MAILSPOOL") | "DUNNO"
  3686. X
  3687. X                # end of configuration
  3688. X
  3689. X  Md := ckval("md" | "so") | "\e[1m"
  3690. X  Me := ckval("me" | "se") | "\e[m"
  3691. X  Ce := (ckval("up") || ckval("ce")) | "\e[A\e[K"
  3692. X  (*arg > 0) & Mailspool := arg[1]
  3693. X  i := readin(Mailspool)
  3694. X  headers(i)
  3695. X  repeat {
  3696. X    cmd := query("\n[" || i || "/" || *Status || "]: ", " ")
  3697. X    if integer(cmd) & (cmd > 0) & (cmd <= *Status) then headers(i := cmd)
  3698. X    else case map(!cmd) of {
  3699. X      "a":  save(query("Append to: "), i, "append")
  3700. X      "x":  upto('yY', query("Are you sure? ")) & exit(1) 
  3701. X      "l":  headers(i)
  3702. X      "r":  reply(i)
  3703. X      "d":  { (Status[i] ++:= 'D'); writes(Ce); i := inc(i) }
  3704. X      "f":  forward(query("Forward to: "), i)
  3705. X      "g":  readin(Mailspool, "update") & headers(i)
  3706. X      "s":  save(query("Filename: "), i)
  3707. X      "q":  quit()
  3708. X      "|":  pipeto(query("Command: "), i)
  3709. X      " ":  { showart(i); i := inc(i) }
  3710. X      "-":  { if (i -:= 1) = 0 then i := *Status; showart(i) }
  3711. X      "n"|"+":  showart(i := inc(i))
  3712. X      "u":  { (Status[i] --:= 'D'); writes(Ce); i := inc(i) }
  3713. X      "m":  newmail(query("Address: "))
  3714. X      "p":  { pipeto(Print_cmd, i) & Status[i] ++:= 'P'; writes(Ce) }
  3715. X      "v":  showart(i, "all")
  3716. X      "!":  { system(query("Command: ")) 
  3717. X          write() & query("Press <return> to continue") }
  3718. X      "?"|"h":  help()
  3719. X      default: { writes(Ce); writes("\^g") }
  3720. X    }
  3721. X  }
  3722. Xend
  3723. X
  3724. X                # Read the mail spool into a list of
  3725. X                # lists and set up a status list.
  3726. Xprocedure readin(spoolname, update)
  3727. X  local sf, i, article
  3728. X
  3729. X  Spool := []
  3730. X  \update | Status := []
  3731. X  sf := open(spoolname) | stop("Can't read " || spoolname)
  3732. X  i := 0
  3733. X  every !sf ? {
  3734. X    ="From " & {
  3735. X      ((i +:= 1) > 1) & put(Spool, article)
  3736. X      article := []      
  3737. X      /update | /Status[i] & put(Status, 'N')
  3738. X    }
  3739. X    (i > 0) & put(article, &subject)
  3740. X  }
  3741. X  (i > 0) & {
  3742. X    put(Spool, article)
  3743. X    i := 1
  3744. X  }
  3745. X  close(sf)
  3746. X  return i
  3747. Xend
  3748. X
  3749. X                # Parse messages for author & subject,
  3750. X                # highlight the current message.
  3751. Xprocedure headers(art)
  3752. X  local hlist, i, entry, author, subj
  3753. X
  3754. X  hlist := []
  3755. X  every i := 1 to *Status do {
  3756. X    entry := if i = art then Md else ""
  3757. X    entry ||:= left(i, 3, " ") || left(Status[i], 4, " ")
  3758. X    author := ""
  3759. X    subj := ""
  3760. X    while  (*author = 0) | (*subj = 0) do !Spool[i] ? {
  3761. X      ="From: " & author := tab(0)
  3762. X      ="Subject: " & subj := tab(0)
  3763. X      (*&subject = 0) & break
  3764. X    }
  3765. X    entry ||:= " [" || right(*Spool[i], 3, " ") || ":" 
  3766. X    entry ||:= left(author, 17, " ") || "]  " || left(subj, 45, " ")
  3767. X    (i = art) & entry ||:= Me
  3768. X    put(hlist, entry)
  3769. X  }
  3770. X  put(hlist, "")
  3771. X  more(Mailspool, hlist)
  3772. Xend
  3773. X
  3774. X                # Check if any messages are deleted;
  3775. X                # if the spool cannot be written,
  3776. X                # write a temporary spool.  Rename
  3777. X                # would be convenient, but won't work
  3778. X                # across file systems.
  3779. Xprocedure quit()
  3780. X  local msave, f, tfn, i
  3781. X
  3782. X  every !Status ? { find("D") & break msave := 1 }
  3783. X  \msave & {
  3784. X    (f := open(Mailspool, "w")) | {
  3785. X      f := open(tfn := tempfile("spool."), "w")      
  3786. X      write("Cannot write " || Mailspool || ".  Saving changes to " || tfn)
  3787. X    }
  3788. X    every i := 1 to *Status do {
  3789. X      find("D", Status[i]) | every write(f, !Spool[i])
  3790. X    }
  3791. X  }
  3792. X  exit(0)
  3793. Xend
  3794. X
  3795. X
  3796. Xprocedure save(where, art, append)
  3797. X  local mode, outf
  3798. X
  3799. X  mode := if \append then "a" else "w"
  3800. X  outf := open(where, mode) | { write("Can't write ", where) & fail }
  3801. X  every write(outf, !Spool[art])
  3802. X  Status[art] ++:= 'S'
  3803. X  return close(outf)
  3804. Xend
  3805. X
  3806. X
  3807. X                # A pipe for Unix; pseudo-pipe for ms-dos.
  3808. Xprocedure pipeto(cmd, art)
  3809. X  local p
  3810. X
  3811. X  p := popen(cmd, "w")
  3812. X  every write(p, !Spool[art])
  3813. X  return pclose(p)
  3814. Xend
  3815. X
  3816. X
  3817. X                # Lots of case-insensitive parsing.
  3818. Xprocedure reply(art)
  3819. X  local tfn, fullname, address, quoter, date, id, subject, newsgroup, refs, r
  3820. X
  3821. X  r := open(tfn := tempfile("reply."), "w")
  3822. X  every !Spool[art] ? {
  3823. X    tab(match("from: " | "reply-to: ", map(&subject))) & {
  3824. X      if find("<") then {
  3825. X    fullname := tab(upto('<'))
  3826. X    address := (move(1), tab(find(">")))
  3827. X      }
  3828. X      else {
  3829. X    address := trim(tab(upto('(') | 0))
  3830. X    fullname := (move(1), tab(find(")")))
  3831. X      }
  3832. X      while match(" ", \fullname, *fullname) do fullname ?:= tab(-1)
  3833. X      quoter := if *\fullname > 0 then fullname else address
  3834. X    }
  3835. X    tab(match("date: ", map(&subject))) & date := tab(0)
  3836. X    tab(match("message-id: ", map(&subject))) & id := tab(0)
  3837. X    match("subject: ", map(&subject)) & subject := tab(0)
  3838. X    match("newsgroups: ", map(&subject)) & newsgroup := tab(upto(',') | 0)
  3839. X    match("references: ", map(&subject)) & refs := tab(0)
  3840. X    (\address & *&subject = 0) & {
  3841. X      writes(r, "To: " || address)
  3842. X      write(r, if *\fullname > 0 then " (" || fullname || ")" else "")
  3843. X      \subject & write(r, subject)
  3844. X      \newsgroup & write(r, newsgroup)
  3845. X      \refs & write(r, refs, " ", id)
  3846. X      write(r, "In-reply-to: ", quoter, "'s message of ", date);
  3847. X      write(r, "\nIn ", id, ", ", quoter, " writes:\n")
  3848. X      break
  3849. X    }
  3850. X  }
  3851. X  every write(r, " > ", !Spool[art])
  3852. X  send(tfn, address) & {
  3853. X    Status[art] ++:= 'RO'
  3854. X    Status[art] --:= 'N'
  3855. X  }
  3856. Xend
  3857. X
  3858. X                # Put user in an editor with a temp
  3859. X                # file, query for confirmation, if
  3860. X                # necessary rewrite address, and send.
  3861. Xprocedure send(what, where)
  3862. X  local edstr, mailstr, done
  3863. X  static console
  3864. X
  3865. X  initial {
  3866. X    if "UNIX" == &features then console := "/dev/tty"
  3867. X    else if "MS-DOS" == &features then console := "CON"
  3868. X    else write("Need to configure `console' in mr.icn.") & fail
  3869. X  }
  3870. X  edstr := getenv("EDITOR") | Editor || " " || what || " < " || console
  3871. X  system(edstr)
  3872. X  upto('nN', query( "Send to " || where || " y/n? ")) & {
  3873. X    if upto('yY', query("Save your draft y/n? ")) then 
  3874. X      writes(Ce) & write("Your draft is saved in " || what || "\n")
  3875. X    else writes(Ce) & remove(what)
  3876. X    fail
  3877. X  }
  3878. X  writes(Ce)
  3879. X  \Host & not find(map(Host), map(where)) & upto('!@', where) & {
  3880. X    find("@", where) & where ? {
  3881. X      name := tab(upto('@'))
  3882. X      where := (move(1), tab(upto(' ') | 0)) || "!" || name
  3883. X    }
  3884. X    if find(".", Host) then where ||:= "@" || Host
  3885. X    else where := Host || "!" || where
  3886. X  }
  3887. X  mailstr := Mail_cmd || " " || where || " < " || what
  3888. X  done := system(mailstr)
  3889. X  remove(what)
  3890. X  return done
  3891. Xend
  3892. X
  3893. X
  3894. Xprocedure forward(who, art)
  3895. X  local out, tfn
  3896. X
  3897. X  out := open(tfn := tempfile("forward."), "w")
  3898. X  write(out, "To: " || who)
  3899. X  write(out, "Subject: FYI (forwarded mail)\n")
  3900. X  write(out, "-----[begin forwarded message]-----")
  3901. X  every write(out, !Spool[art])
  3902. X  write(out, "------[end forwarded message]------")
  3903. X  send(tfn, who) & Status[art] ++:= 'F'
  3904. Xend
  3905. X
  3906. X  
  3907. Xprocedure newmail(address)
  3908. X  local out, tfn
  3909. X
  3910. X  out := open(tfn := tempfile("mail."), "w")
  3911. X  write(out, "To: " || address)
  3912. X  write(out, "Subject:\n")
  3913. X  return send(tfn, address)
  3914. Xend
  3915. X
  3916. X
  3917. Xprocedure showart(art, eoh)
  3918. X  local out
  3919. X
  3920. X  out := []
  3921. X  every !Spool[art] ? {
  3922. X    /eoh := *&subject = 0
  3923. X    if \eoh | not match(map(!Ignore), map(&subject)) then put(out, tab(0))
  3924. X  }
  3925. X  more("Message " || art, out, "End of Message " || art)
  3926. X  Status[art] ++:= 'O'
  3927. X  Status[art] --:= 'N'
  3928. Xend
  3929. X      
  3930. X
  3931. Xprocedure help()
  3932. X  local hlist
  3933. X  static pr, sts
  3934. X
  3935. X  initial {
  3936. X    pr := ["Append message to a file",
  3937. X       "Delete message", 
  3938. X       "eXit, without saving changes", 
  3939. X       "Forward message",
  3940. X       "Get new mail",
  3941. X       "Help", 
  3942. X       "List headers",
  3943. X       "Mail to a new recipient", 
  3944. X       "Next message", 
  3945. X       "Print message", 
  3946. X       "Quit, saving changes", 
  3947. X       "Reply to message", 
  3948. X       "Save message", 
  3949. X       "Undelete message", 
  3950. X       "View all headers",
  3951. X       "| pipe message to a command",
  3952. X       "+ next message",
  3953. X       "- previous message",
  3954. X       "! execute command",
  3955. X       "# make # current message"]
  3956. X    sts := ["New", "Old", "Replied-to", "Saved", 
  3957. X        "Deleted", "Forwarded", "Printed"]
  3958. X  }
  3959. X  hlist := []
  3960. X  every !pr ? put(hlist, "  " || tab(upto(&ucase++'!|+-#') \1) || 
  3961. X          Md || move(1) || Me || tab(0))
  3962. X  put(hlist, "")
  3963. X  every !sts ? put(hlist, "  " || tab(upto(&ucase)) || 
  3964. X           Md || move(1) || Me || tab(0))
  3965. X  put(hlist, "")
  3966. X  more("Commands & Status Symbols", hlist)
  3967. Xend
  3968. X
  3969. X                # The second parameter specifies a
  3970. X                # default response if the user presses
  3971. X                # <return>.
  3972. Xprocedure query(prompt, def)
  3973. X  local ans
  3974. X
  3975. X  writes(Ce)
  3976. X  writes(prompt)
  3977. X  ans := read()
  3978. X  return (*ans = 0 & \def) | ans
  3979. Xend
  3980. X
  3981. X                # Increment the count, then cycle
  3982. X                # through again when user reaches the
  3983. X                # end of the list.
  3984. Xprocedure inc(art)
  3985. X
  3986. X  if (art +:= 1) > *Status then art := 1
  3987. X  return art
  3988. Xend
  3989. X
  3990. X
  3991. Xprocedure more(header, what, footer)
  3992. X  local ans, lines
  3993. X  static li, so, se, co, cl, us, ue
  3994. X
  3995. X  initial {
  3996. X    li := ckval("li") | 25
  3997. X    co := ckval("co") | 80
  3998. X    so := ckval("so") | "\e[7m"
  3999. X    se := ckval("se") | "\e[m"
  4000. X    cl := ckval("cl") | "\e[H\e[2J"
  4001. X    us := ckval("us"|"so") | "\e[4m"
  4002. X    ue := ckval("ue"|"se") | "\e[m"
  4003. X  }
  4004. X  writes(cl)
  4005. X  if \header then {
  4006. X    write(us || header || ue)
  4007. X    lines := 1
  4008. X  }
  4009. X  else lines := 0
  4010. X  every !what ? {
  4011. X    write(tab(0))
  4012. X    ((lines +:= 1 + *&subject/co) % (li - 1) = 0) & {
  4013. X      writes(so || "-MORE-(", (100 > (lines - 2)*100/*what) | 100, "%)" || se)
  4014. X      ans := read() & writes(Ce)
  4015. X      upto('nNqQ', ans) & fail
  4016. X    }
  4017. X  }
  4018. X  \footer & {
  4019. X    writes(so || footer || se) 
  4020. X    read() & writes(Ce)
  4021. X  }
  4022. Xend
  4023. X
  4024. X
  4025. Xprocedure ckval(titem)
  4026. X  static termcap
  4027. X
  4028. X  initial {
  4029. X    if \getenv("TERMCAP") | close(open("/etc/termcap")) then termcap := 1
  4030. X    else if "MS-DOS" == &features then termcap := &null
  4031. X    else stop("Need TERMCAP & TERM environment variables")
  4032. X  }
  4033. X  \termcap & return getval(titem)
  4034. X  fail
  4035. Xend
  4036. X
  4037. SHAR_EOF
  4038. if test 11250 -ne "`wc -c < 'mr.icn'`"
  4039. then
  4040.     echo shar: "error transmitting 'mr.icn'" '(should have been 11250 characters)'
  4041. fi
  4042. fi
  4043. echo shar: "extracting 'popen.icn'" '(1855 characters)'
  4044. if test -f 'popen.icn'
  4045. then
  4046.     echo shar: "will not over-write existing file 'popen.icn'"
  4047. else
  4048. sed 's/^X//' << \SHAR_EOF > 'popen.icn'
  4049. X########################################################################
  4050. X#    
  4051. X#    Name:    popen.icn
  4052. X#    
  4053. X#    Title:    Pipes for Unix and non-Unix systems
  4054. X#    
  4055. X#    Author:    Ronald Florence (ron@mlfarm.com)
  4056. X#
  4057. X#    Version: 1.0
  4058. X#
  4059. X#########################################################################
  4060. X#
  4061. X#  Contents:
  4062. X#
  4063. X#  popen(command, mode)
  4064. X#    mode == "w" writes to a pipe
  4065. X#    mode == "r" reads from a pipe
  4066. X#
  4067. X#  pclose(pipe)
  4068. X#
  4069. X#  On systems without real pipes (ms-dos), popen and pclose imitate
  4070. X#  pipes; pclose must be called after popen.  The code should run
  4071. X#  faster on ms-dos if dir in tempfile() points to a directory on a
  4072. X#  virtual disk.
  4073. X#
  4074. X#  On systems with real pipes, popen & pclose open and close a pipe.
  4075. X# 
  4076. X##########################################################################
  4077. X
  4078. Xglobal PIPE_cmd, PIPE_fname
  4079. X
  4080. Xprocedure popen(cmd, mode)
  4081. X  local tfn, p
  4082. X
  4083. X  initial ("pipes" == &features) | {
  4084. X    PIPE_cmd := table()
  4085. X    PIPE_fname := table()
  4086. X  }
  4087. X  (type(PIPE_fname) ~== "table") & return open(cmd, mode || "p")
  4088. X  tfn := tempfile("pipe.")
  4089. X  upto('r', mode) & system(cmd || " > " || tfn)
  4090. X  p := open(tfn, mode)
  4091. X  PIPE_fname[p] := tfn
  4092. X  upto('w', mode) & PIPE_cmd[p] := cmd
  4093. X  return p
  4094. Xend
  4095. X
  4096. X
  4097. Xprocedure pclose(pipe)
  4098. X  local status
  4099. X
  4100. X  (type(PIPE_fname) ~== "table") & return close(pipe)
  4101. X  if \PIPE_cmd[pipe] then {
  4102. X    close(pipe) 
  4103. X    PIPE_cmd[pipe] ||:= " < " || PIPE_fname[pipe]
  4104. X    status := system(PIPE_cmd[pipe])
  4105. X  }
  4106. X  else status := close(pipe)
  4107. X  remove(PIPE_fname[pipe])
  4108. X  PIPE_cmd[pipe] := PIPE_fname[pipe] := &null
  4109. X  return status
  4110. Xend
  4111. X
  4112. X    # Richard Goerwitz's ever-useful generator.
  4113. X
  4114. Xprocedure tempfile(template)
  4115. X  local temp_name
  4116. X  static dir
  4117. X
  4118. X  initial {
  4119. X    if "UNIX" == &features then dir := "/tmp/"
  4120. X    else dir := ""
  4121. X  }
  4122. X  every temp_name := dir || template || right(1 to 999,3,"0") do {
  4123. X    close(open(temp_name)) & next
  4124. X    suspend \temp_name
  4125. X  }
  4126. Xend
  4127. SHAR_EOF
  4128. if test 1855 -ne "`wc -c < 'popen.icn'`"
  4129. then
  4130.     echo shar: "error transmitting 'popen.icn'" '(should have been 1855 characters)'
  4131. fi
  4132. fi
  4133. echo shar: "extracting 'mr.man'" '(2580 characters)'
  4134. if test -f 'mr.man'
  4135. then
  4136.     echo shar: "will not over-write existing file 'mr.man'"
  4137. else
  4138. sed 's/^X//' << \SHAR_EOF > 'mr.man'
  4139. X.\" mr.man version 1.0
  4140. X.\" copyright 1991 Ronald Florence
  4141. X.TH MR LOCAL "7 Feb 1992"
  4142. X.SH NAME
  4143. Xmr \- mail (or news) reader
  4144. X.SH SYNOPSIS
  4145. X.B mr
  4146. X[
  4147. X.I spool 
  4148. X]
  4149. X.SH DESCRIPTION
  4150. XMr is a simple reader for mail and/or news spools.  It won't obsolete
  4151. Xelm, mailtool, emacs, mush, or even /usr/ucb/Mail, but it allows a
  4152. Xreader to page, reply-to, save, append, print, forward, pipe,
  4153. Xoriginate, conceal or reveal headers, and delete or undelete mail.  Mr
  4154. Xcan also be used to read the news spools produced by the bsnews news
  4155. Xsystem for leaf nodes.
  4156. X.SH COMMANDS
  4157. XAn alternate mail or news spool can be named on the command line.  The
  4158. Xinitial display lists waiting messages:
  4159. X.ta .5i 1i 3.5i
  4160. X.sp
  4161. X.nf
  4162. X.if t .ft CR
  4163. X1    FOP    [ 22:ron@mlfarm.com (R]    How to use mr
  4164. X.ie t .ft CB
  4165. X.el .ft B
  4166. X2    DOR    [985:goer@sophist.uchi]    Improving MR (part I)
  4167. X.ie t .ft CR
  4168. X.el .ft R
  4169. X3    N    [ 61:ralph@cs.arizona.]    MS-Dos Pipes
  4170. X.ft R
  4171. X.fi
  4172. X.P
  4173. XThe letters after the message number indicate the status of the
  4174. Xmessage; New, Old, Replied-to, Printed, Deleted, Saved, Forwarded.
  4175. XThe number inside the square brackets is the number of lines in the
  4176. Xmessage, followed by the author's name and/or email address, and the
  4177. Xsubject.  The current message is highlighted in bold or reverse video,
  4178. Xdepending on the capabilities of the display.  The prompt shows the
  4179. Xcurrent message number and the total number of messages.  The
  4180. Xfollowing commands can be given:
  4181. X.sp
  4182. X.nf
  4183. X.RS
  4184. XA    Append current message to a file
  4185. XD    Delete current message
  4186. XF    Forward current message
  4187. XG    Get new mail
  4188. XH    Help
  4189. XL    List headers
  4190. XM    Mail to a new recipient
  4191. XN    Next message
  4192. XP    Print current message
  4193. XQ    Quit, saving changes
  4194. XR    Reply-to current message
  4195. XS    Save current message to a file
  4196. XU    Undelete current message
  4197. XV    View all headers
  4198. XX    eXit without saving changes
  4199. X|    pipe current message to a command
  4200. X!    execute command
  4201. X#    make # current message
  4202. X+    next message
  4203. X-    previous message
  4204. X?    help
  4205. X.RE
  4206. X.fi
  4207. X.P
  4208. XPressing 
  4209. X.RI < return > 
  4210. Xwill page thru the current message, then advance the current message
  4211. Xnumber.  Press
  4212. X.I Q 
  4213. Xor 
  4214. X.I N
  4215. Xat a 
  4216. X.SM MORE
  4217. Xprompt to return to the command prompt.
  4218. X.SH ENVIRONMENT
  4219. XThe 
  4220. X.SM EDITOR
  4221. Xand 
  4222. X.SM MAILSPOOL
  4223. Xenvironmental variables can be used to override default settings.  Mr
  4224. Xuses the
  4225. X.SM TERM
  4226. Xand
  4227. X.SM TERMCAP
  4228. Xvariables to lookup screen parameters and control strings.
  4229. X.SH SEE ALSO
  4230. Xmail(1), sendmail(1), bsnews(\s-1LOCAL\s0)
  4231. X.SH BUGS
  4232. XThe pseudo-pipes used for ms-dos cannot handle a complex command.
  4233. XSome users would undoubtedly prefer getch() style command parsing.
  4234. XThe pager used to display messages does not back-up.
  4235. X.SH AUTHOR
  4236. XRonald Florence (ron\s-2@\s0mlfarm.com).  
  4237. SHAR_EOF
  4238. if test 2580 -ne "`wc -c < 'mr.man'`"
  4239. then
  4240.     echo shar: "error transmitting 'mr.man'" '(should have been 2580 characters)'
  4241. fi
  4242. fi
  4243. echo shar: "extracting 'Makefile.unix'" '(276 characters)'
  4244. if test -f 'Makefile.unix'
  4245. then
  4246.     echo shar: "will not over-write existing file 'Makefile.unix'"
  4247. else
  4248. sed 's/^X//' << \SHAR_EOF > 'Makefile.unix'
  4249. X# Makefile for mr
  4250. X
  4251. X.SUFFIXES: .icn .u1
  4252. X
  4253. X.icn.u1:
  4254. X    icont -c $<
  4255. X
  4256. X.icn:
  4257. X    icont $@
  4258. X
  4259. XBINDIR = /usr/local/bin
  4260. XMANDIR = /usr/man/mann
  4261. XMANEXT = n
  4262. X
  4263. Xmr:     popen.u1 iolib.u1 mr.icn
  4264. X    icont -u $@
  4265. X
  4266. Xinstall: mr mr.man
  4267. X    cp mr $(BINDIR)
  4268. X    cp mr.man $(MANDIR)/mr.$(MANEXT)
  4269. X
  4270. Xclean:
  4271. X    rm -f *.u[12]
  4272. SHAR_EOF
  4273. if test 276 -ne "`wc -c < 'Makefile.unix'`"
  4274. then
  4275.     echo shar: "error transmitting 'Makefile.unix'" '(should have been 276 characters)'
  4276. fi
  4277. fi
  4278. echo shar: "extracting 'Makefile.dos'" '(129 characters)'
  4279. if test -f 'Makefile.dos'
  4280. then
  4281.     echo shar: "will not over-write existing file 'Makefile.dos'"
  4282. else
  4283. sed 's/^X//' << \SHAR_EOF > 'Makefile.dos'
  4284. X# ms-dos makefile for mr
  4285. X
  4286. X.SUFFIXES: .icn .u1 .icx
  4287. X
  4288. X.icn.u1:
  4289. X    icont -c $<
  4290. X
  4291. X.icn.icx:
  4292. X    icont $*
  4293. X
  4294. Xmr.icx:    popen.u1 iolib.u1 mr.icn
  4295. SHAR_EOF
  4296. if test 129 -ne "`wc -c < 'Makefile.dos'`"
  4297. then
  4298.     echo shar: "error transmitting 'Makefile.dos'" '(should have been 129 characters)'
  4299. fi
  4300. fi
  4301. echo shar: "extracting 'manpage.mr'" '(3534 characters)'
  4302. if test -f 'manpage.mr'
  4303. then
  4304.     echo shar: "will not over-write existing file 'manpage.mr'"
  4305. else
  4306. sed 's/^X//' << \SHAR_EOF > 'manpage.mr'
  4307. X
  4308. X
  4309. X
  4310. XMR(LOCAL)                                               MR(LOCAL)
  4311. X
  4312. X
  4313. XNNAAMMEE
  4314. X       mr - mail (or news) reader
  4315. X
  4316. XSSYYNNOOPPSSIISS
  4317. X       mmrr [ _s_p_o_o_l ]
  4318. X
  4319. XDDEESSCCRRIIPPTTIIOONN
  4320. X       Mr  is  a  simple  reader for mail and/or news spools.  It
  4321. X       won't  obsolete  elm,  mailtool,  emacs,  mush,  or   even
  4322. X       /usr/ucb/Mail,  but  it allows a reader to page, reply-to,
  4323. X       save, append, print, forward, pipe, originate, conceal  or
  4324. X       reveal  headers, and delete or undelete mail.  Mr can also
  4325. X       be used to read the news spools  produced  by  the  bsnews
  4326. X       news system for leaf nodes.
  4327. X
  4328. XCCOOMMMMAANNDDSS
  4329. X       An  alternate  mail or news spool can be named on the com-
  4330. X       mand line.  The initial display lists waiting messages:
  4331. X
  4332. X       1    FOP  [ 22:ron@mlfarm.com (R]  How to use mr
  4333. X       22    DDOORR  [[998855::ggooeerr@@ssoopphhiisstt..uucchhii]]  IImmpprroovviinngg MMRR ((ppaarrtt II))
  4334. X       3    N    [ 61:ralph@cs.arizona.]  MS-Dos Pipes
  4335. X
  4336. X       The letters after the message number indicate  the  status
  4337. X       of  the  message;  New, Old, Replied-to, Printed, Deleted,
  4338. X       Saved, Forwarded.  The number inside the  square  brackets
  4339. X       is  the  number  of  lines in the message, followed by the
  4340. X       author's name and/or email address, and the subject.   The
  4341. X       current  message  is highlighted in bold or reverse video,
  4342. X       depending on the capabilities of the display.  The  prompt
  4343. X       shows  the  current message number and the total number of
  4344. X       messages.  The following commands can be given:
  4345. X
  4346. X              A    Append current message to a file
  4347. X              D    Delete current message
  4348. X              F    Forward current message
  4349. X              G    Get new mail
  4350. X              H    Help
  4351. X              L    List headers
  4352. X              M    Mail to a new recipient
  4353. X              N    Next message
  4354. X              P    Print current message
  4355. X              Q    Quit, saving changes
  4356. X              R    Reply-to current message
  4357. X              S    Save current message to a file
  4358. X              U    Undelete current message
  4359. X              V    View all headers
  4360. X              X    eXit without saving changes
  4361. X              |    pipe current message to a command
  4362. X              !    execute command
  4363. X              #    make # current message
  4364. X              +    next message
  4365. X              -    previous message
  4366. X              ?    help
  4367. X
  4368. X
  4369. X
  4370. X                            7 Feb 1992                          1
  4371. X
  4372. X
  4373. X
  4374. X
  4375. X
  4376. XMR(LOCAL)                                               MR(LOCAL)
  4377. X
  4378. X
  4379. X       Pressing <_r_e_t_u_r_n> will page thru the current message, then
  4380. X       advance  the  current  message  number.  Press _Q or _N at a
  4381. X       MORE prompt to return to the command prompt.
  4382. X
  4383. XEENNVVIIRROONNMMEENNTT
  4384. X       The EDITOR and MAILSPOOL environmental  variables  can  be
  4385. X       used  to  override default settings.  Mr uses the TERM and
  4386. X       TERMCAP variables to lookup screen parameters and  control
  4387. X       strings.
  4388. X
  4389. XSSEEEE AALLSSOO
  4390. X       mail(1), sendmail(1), bsnews(LOCAL)
  4391. X
  4392. XBBUUGGSS
  4393. X       The  pseudo-pipes  used for ms-dos cannot handle a complex
  4394. X       command.  Some  users  would  undoubtedly  prefer  getch()
  4395. X       style command parsing.  The pager used to display messages
  4396. X       does not back-up.
  4397. X
  4398. XAAUUTTHHOORR
  4399. X       Ronald Florence (ron@mlfarm.com).
  4400. X
  4401. X
  4402. X
  4403. X
  4404. X
  4405. X
  4406. X
  4407. X
  4408. X
  4409. X
  4410. X
  4411. X
  4412. X
  4413. X
  4414. X
  4415. X
  4416. X
  4417. X
  4418. X
  4419. X
  4420. X
  4421. X
  4422. X
  4423. X
  4424. X
  4425. X
  4426. X
  4427. X
  4428. X
  4429. X
  4430. X
  4431. X
  4432. X
  4433. X
  4434. X
  4435. X
  4436. X                            7 Feb 1992                          2
  4437. X
  4438. X
  4439. echo shar: "119 control characters may be missing from 'manpage.mr'"
  4440. SHAR_EOF
  4441. if test 3534 -ne "`wc -c < 'manpage.mr'`"
  4442. then
  4443.     echo shar: "error transmitting 'manpage.mr'" '(should have been 3534 characters)'
  4444. fi
  4445. fi
  4446. exit 0
  4447. #    End of shell archive
  4448. -- 
  4449.  
  4450.                 Ronald Florence
  4451.                 ron@mlfarm.com
  4452.  
  4453. From TENAGLIA@mis.mcw.edu  Sun Feb 23 07:51:22 1992
  4454. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Sun, 23 Feb 92 07:51:22 MST
  4455. Received: from ADM.MIS.MCW.EDU by optima.cs.arizona.edu (4.1/15)
  4456.     id AA12627; Sun, 23 Feb 92 07:51:19 MST
  4457. Received: from mis.mcw.edu by mis.mcw.edu (PMDF #12252) id
  4458.  <01GGUPEH8A34AFTSC7@mis.mcw.edu>; Sun, 23 Feb 1992 08:52 CST
  4459. Date: Sun, 23 Feb 1992 08:52 CST
  4460. From: Chris Tenaglia - 257-8765 <TENAGLIA@mis.mcw.edu>
  4461. Subject: Word Puzzle Times
  4462. To: icon-group@cs.arizona.edu
  4463. Message-Id: <01GGUPEH8A34AFTSC7@mis.mcw.edu>
  4464. X-Organization: Medical College of Wisconsin (Milwaukee, WI)
  4465. X-Vms-To: IN%"icon-group@cs.arizona.edu"
  4466.  
  4467.  
  4468. I had a chance to try out the word puzzle I posted earlier on a number
  4469. of different platforms and noticed something totally unexpected.
  4470.  
  4471.           VAX 780          1MIP          36 sec
  4472.           VAX4500         25MIP          28 sec
  4473.           VAX6620         70MIP          33 sec
  4474.           MSDOS-286        ?MIP          11 sec
  4475.           DEC-Risc        20MIP           1 sec
  4476.  
  4477. This was on the same piece of code during off hours, so there were no
  4478. other competing loads. VMS icon usually doesn't make such a bad showing
  4479. but I wonder if this might be something worth looking into. Perhaps there
  4480. is some aspect of Icon and VMS where certain coding pratices should be
  4481. watched out for.
  4482.  
  4483. Chris Tenaglia (System Manager) | Medical College of Wisconsin
  4484. 8701 W. Watertown Plank Rd.     | Milwaukee, WI 53226
  4485. (414)257-8765                   | tenaglia@mis.mcw.edu, mcwmis!tenaglia
  4486.  
  4487.  
  4488. From icon-group-request  Tue Feb 25 07:40:17 1992
  4489. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Tue, 25 Feb 92 07:40:17 MST
  4490. Received: from ucbvax.Berkeley.EDU by optima.cs.arizona.edu (4.1/15)
  4491.     id AA21544; Tue, 25 Feb 92 07:40:14 MST
  4492. Received: by ucbvax.Berkeley.EDU (5.63/1.43)
  4493.     id AA15085; Tue, 25 Feb 92 06:32:10 -0800
  4494. Received: from USENET by ucbvax.Berkeley.EDU with netnews
  4495.     for icon-group@cs.arizona.edu (icon-group@cs.arizona.edu)
  4496.     (contact usenet@ucbvax.Berkeley.EDU if you have questions)
  4497. Date: 21 Feb 92 09:58:23 GMT
  4498. From: optima.UUCP@arizona.edu  (Clinton Jeffery)
  4499. Subject: Re: Beginner questions
  4500. Message-Id: <13140@optima.cs.arizona.edu>
  4501. References: <1992Feb21.042030.4668@midway.uchicago.edu>
  4502. Sender: icon-group-request@cs.arizona.edu
  4503. To: icon-group@cs.arizona.edu
  4504.  
  4505. From article <1992Feb21.042030.4668@midway.uchicago.edu>, by goer@ellis.uchicago.edu (Richard L. Goerwitz):
  4506. > rahard@ee.umanitoba.ca (Budi Rahardjo) writes:
  4507. >>- I'd like to add my own function (written in C). How would
  4508. >>  I call/link that function with my icon program ?
  4509. > You would need to recompile the Icon run-time system with your function
  4510. Richard is right.  There is a C-callout mechanism, or you can always write
  4511. your own Icon "builtin function" that calls your C function.  The details
  4512. are not too hard once you are familiar with Icon's C-based implementation.
  4513. Lastly, note that Version 8.5 has different details than Version 8.0.
  4514.  
  4515. >>- Is there an ICON compiler for the MS-DOS (ie. produce .exe file) ?
  4516. >>  (I don't want to run the program with 'iconx'  :-)
  4517. Well, many Icon systems feature executable headers that call iconx when
  4518. they are run, so you don't have to type it.  Under this approach, icont
  4519. would put out a .COM file or .EXE file, but MS-DOS Icon doesn't have
  4520. this feature.  We'd love it if someone would get it working, bearing in
  4521. mind that memory is so precious under MS-DOS that only a few kilobytes
  4522. could be spared for it at runtime.  Richard's comments about a REAL Icon
  4523. compiler under MS-DOS are right on target.  Not likely to fit on less
  4524. than a 386; I don't know of anyone doing one.  Does anyone else?
  4525.  
  4526. >>Sorry if those questions are in the FAQ.
  4527. > There *is* no FAQ; we answer as we go.  Please don't feel you need to
  4528. > apologize.
  4529. Would anyone like to start and maintain an icon-group/comp.lang.icon FAQ?
  4530.  
  4531. > I'd kinda like for one of the more technically inclined readers of this
  4532. > group to post a followup to this reply.  I'm not really qualified to give
  4533. > definitive answers to your queries (although I hope I've helped sketch
  4534. > things out).
  4535. Your answers are generally very high quality, Richard.  Please don't feel
  4536. you need to apologize for them! :-)
  4537. --
  4538. Clint Jeffery, U. of Arizona Dept. of Computer Science
  4539. cjeffery@cs.arizona.edu -or- {noao allegra}!arizona!cjeffery
  4540. --
  4541.  
  4542. From @um.cc.umich.edu:Paul_Abrahams@MTS.cc.Wayne.edu  Tue Feb 25 10:52:38 1992
  4543. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Tue, 25 Feb 92 10:52:38 MST
  4544. Received: from mailrus.cc.umich.edu by optima.cs.arizona.edu (4.1/15)
  4545.     id AA29961; Tue, 25 Feb 92 10:52:35 MST
  4546. Received: from um.cc.umich.edu by mailrus.cc.umich.edu (5.61/1123-1.0)
  4547.     id AA13119; Tue, 25 Feb 92 12:48:33 -0500
  4548. Received: from MTS.cc.Wayne.edu by um.cc.umich.edu via MTS-Net; Tue, 25 Feb 92 12:47:51 EST
  4549. Date: Tue, 25 Feb 92 12:47:56 EST
  4550. From: Paul_Abrahams@mts.cc.wayne.edu
  4551. To: icon-group@cs.arizona.edu
  4552. Message-Id: <422067@MTS.cc.Wayne.edu>
  4553. Subject: Element generation
  4554.  
  4555. On page 12 of the October 1991 issue of the Icon Analyst, a technique
  4556. is suggested for providing a multi-line macro definition facility for
  4557. input streams.  The essence of the method is that you have a loop of
  4558. the form:
  4559.    every s := !input do {
  4560.       ...
  4561.    }
  4562. When you encounter a macro definition, you place its lines into a list;
  4563. when you encounter a use of a macro, you "change" the value of `input'
  4564. to the list associated with the macro.
  4565.  
  4566. The trouble with this suggestion is that you can't make the change to
  4567. `input' in the obvious way, by executing an assignment to `input' from
  4568. within the loop.  The value (and result sequence) of `input' is
  4569. determined when you enter the loop, and subsequent assignments to
  4570. `input' are ineffective.  It's possible to get the desired effect by
  4571. breaking out of the loop and restarting it when a macro is encountered,
  4572. but the necessity of restarting the loop is not obvious from the
  4573. article.
  4574.  
  4575. Nevertheless, it's a useful technique to know about.
  4576.  
  4577. Paul Abrahams 
  4578.  
  4579. From icon-group-request  Sat Feb 29 19:30:48 1992
  4580. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Sat, 29 Feb 92 19:30:48 MST
  4581. Received: from ucbvax.Berkeley.EDU by optima.cs.arizona.edu (4.1/15)
  4582.     id AA24504; Sat, 29 Feb 92 19:30:44 MST
  4583. Received: by ucbvax.Berkeley.EDU (5.63/1.43)
  4584.     id AA19317; Sat, 29 Feb 92 18:17:11 -0800
  4585. Received: from USENET by ucbvax.Berkeley.EDU with netnews
  4586.     for icon-group@cs.arizona.edu (icon-group@cs.arizona.edu)
  4587.     (contact usenet@ucbvax.Berkeley.EDU if you have questions)
  4588. Date: 20 Feb 92 16:30:34 GMT
  4589. From: bonnie.concordia.ca!ccu.umanitoba.ca!news@uunet.uu.net  (Budi Rahardjo)
  4590. Organization: University of Manitoba
  4591. Subject: Beginner questions
  4592. Message-Id: <1992Feb20.163034.253@ccu.umanitoba.ca>
  4593. Sender: icon-group-request@cs.arizona.edu
  4594. To: icon-group@cs.arizona.edu
  4595.  
  4596. I've just got the Icon book and installed icont and iconx on my PC.
  4597. Some questions:
  4598.  
  4599. - I'd like to add my own function (written in C). How would
  4600.   I call/link that function with my icon program ?
  4601.   (The book mentioned something about 'reference 8', is this
  4602.   another document ? ftp-able ?)
  4603.  
  4604. - In MS-DOS how can I get a list of files in certain directory ?
  4605.   Is there an 'opendir()' function ?
  4606.   (Would be nice if I can pipe a 'dir' or 'ls' command in MS-DOS)
  4607.  
  4608. - Is there an ICON compiler for the MS-DOS (ie. produce .exe file) ?
  4609.   (I don't want to run the program with 'iconx'  :-)
  4610.  
  4611. Sorry if those questions are in the FAQ.
  4612.  
  4613. -- budi
  4614.  
  4615. --
  4616. Budi Rahardjo
  4617. <rahardj@ccu.umanitoba.ca>      <rahard@ee.umanitoba.ca> 
  4618. Electrical Engineering - University of Manitoba - Canada
  4619.  
  4620. From icon-group-request  Sat Feb 29 20:46:05 1992
  4621. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Sat, 29 Feb 92 20:46:05 MST
  4622. Received: from ucbvax.Berkeley.EDU by optima.cs.arizona.edu (4.1/15)
  4623.     id AA26299; Sat, 29 Feb 92 20:46:02 MST
  4624. Received: by ucbvax.Berkeley.EDU (5.63/1.43)
  4625.     id AA22981; Sat, 29 Feb 92 19:37:21 -0800
  4626. Received: from USENET by ucbvax.Berkeley.EDU with netnews
  4627.     for icon-group@cs.arizona.edu (icon-group@cs.arizona.edu)
  4628.     (contact usenet@ucbvax.Berkeley.EDU if you have questions)
  4629. Date: 28 Feb 92 07:08:19 GMT
  4630. From: uchinews!ellis!goer@uunet.uu.net  (Richard L. Goerwitz)
  4631. Organization: University of Chicago Computing Organizations
  4632. Subject: sample BNFs
  4633. Message-Id: <1992Feb28.070819.8756@midway.uchicago.edu>
  4634. Sender: icon-group-request@cs.arizona.edu
  4635. To: icon-group@cs.arizona.edu
  4636.  
  4637. #
  4638. # Here, by the way, is the sample grammar offered in the magazine
  4639. # article that got me wondering about Icon-based chart parsers:
  4640. #
  4641. <S>    ::= <NP> <VP> | <S> <CONJ> <S>
  4642. <VP>   ::= <VP> <CONJ> <VP> | <IV> ( () | <PP> ) | \
  4643.        <TV> ( <NP> | <NP> <PP> | <NP> <VP> | <REL> <S> )
  4644. <NP>   ::= <DET> ( <NP> | <ADJ> <NP> | <ADJ> <NP> <PP> | <NP> <PP> ) | \
  4645.        <ADJ> <NP> |  <N> | <N> <CONJ> <N> | \
  4646.        <NP> <CONJ> <NP>
  4647. <PP>   ::= <P> ( <NP> | <ADJ> <NP> ) | <PP> <CONJ> <PP>
  4648. <ADJ>  ::= <ADJ> <CONJ> <ADJ>
  4649. <CONJ> ::= and
  4650. <DET>  ::= the | a | his | her
  4651. <NP>   ::= her | he | they
  4652. <N>    ::= nurse | nurses | book | books | travel | arrow | arrows | \
  4653.       fortune | fortunes | report
  4654. <ADJ>  ::= outrageous | silly | blue | green | heavy | white | red | \
  4655.       black | yellow
  4656. <IV>   ::= travel | travels | report | see | suffer
  4657. <TV>   ::= hear | see | suffer
  4658. <P>    ::= on | of
  4659. <REL>  ::= that
  4660.  
  4661. -- 
  4662.  
  4663.    -Richard L. Goerwitz              goer%sophist@uchicago.bitnet
  4664.    goer@sophist.uchicago.edu         rutgers!oddjob!gide!sophist!goer
  4665.  
  4666. From icon-group-request  Sun Mar  1 17:35:55 1992
  4667. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Sun, 1 Mar 92 17:35:55 MST
  4668. Received: from ucbvax.Berkeley.EDU by optima.cs.arizona.edu (4.1/15)
  4669.     id AA07815; Sun, 1 Mar 92 17:35:54 MST
  4670. Received: by ucbvax.Berkeley.EDU (5.63/1.43)
  4671.     id AA10682; Sun, 1 Mar 92 16:20:57 -0800
  4672. Received: from USENET by ucbvax.Berkeley.EDU with netnews
  4673.     for icon-group@cs.arizona.edu (icon-group@cs.arizona.edu)
  4674.     (contact usenet@ucbvax.Berkeley.EDU if you have questions)
  4675. Date: 16 Feb 92 19:45:07 GMT
  4676. From: world!ksr!tim@uunet.uu.net  (Tim Peters)
  4677. Organization: Kendall Square Research Corp.
  4678. Subject: Re: Lists, Timing, and Memory Consumption
  4679. Message-Id: <9855@ksr.com>
  4680. References: <9202142005.AA27907@netcom.netcom.com>
  4681. Sender: icon-group-request@cs.arizona.edu
  4682. To: icon-group@cs.arizona.edu
  4683.  
  4684. In article <9202142005.AA27907@netcom.netcom.com> pbewig@NETCOM.NETCOM.COM (Phil Bewig) writes:
  4685. >I've been studying the chapter on lists in the icon implementation book. ...
  4686. > ...[stuff deleted]...
  4687. >...
  4688. >1) Is there a better way to extract the amount of block memory used
  4689. >from the &storage keyword?  What I did is just too ugly.
  4690.  
  4691. Suggest hiding the trickery in a procedure.  E.g.,
  4692.  
  4693. procedure block_memory()
  4694.     local temp
  4695.     every temp := &storage  # block memory is the last one
  4696.     return temp
  4697. end
  4698.  
  4699. Co-expressions are another way, but (I believe) less portable.
  4700.  
  4701. >2) When pre-initializing, why does the memory consumed per item vary?
  4702. >...
  4703. >3) Memory consumed per item for successive insertions also varies, ...
  4704. >...  Why?
  4705.  
  4706. Suspect you'll be surprised if you put the line
  4707.  
  4708.     every write(!memory)
  4709.  
  4710. at the end of your program; don't think you quite managed to measure
  4711. what you intended to measure.  Here are all the lines that affect the
  4712. `memory' vrbl:
  4713.  
  4714. >procedure main(args)
  4715. >    ...
  4716. >    memory := []
  4717. >    ...
  4718. >    every n := !trials do {
  4719. >     ...
  4720. >     every put(memory, -&storage)
  4721. >     ...
  4722. >     i := 0
  4723. >     every s := &storage do memory[i +:= 1] +:= s
  4724. >     writes(right(memory[3], 10), right(timer, 8))
  4725. >     ...
  4726. >     every put(memory, -&storage)
  4727. >     ...
  4728. >     i := 0
  4729. >     every s := &storage do memory[i +:= 1] +:= s
  4730. >     writes(right(memory[3], 12), right(timer, 8))
  4731. >     ...
  4732.  
  4733. The scoop is that `memory' keeps growing in length (6 additional
  4734. elements are appended on each loop iteration), but the elements after
  4735. memory[3] are never referenced.     Expect that what you really want is to
  4736. delete the
  4737.     memory := []
  4738. line before the loop and insert it before each of the two `put' lines.
  4739.  
  4740. When I did that, the bytes/element reported for the preinitialized case
  4741. settled down to a very steady 8; in the successive-insertion case, I
  4742. believe Icon needs additional memory to chain in overflow blocks as
  4743. needed.
  4744.  
  4745. >The moral of the story is to pre-initialize lists whenever possible so
  4746. >that space is allocated more efficiently, especially when making a
  4747. >large number of searches in a static array.
  4748.  
  4749. I don't know much about Icon's implementation, but believe your
  4750. conclusion holds (albeit with somewhat less force) anyway; on the other
  4751. hand, there's almost no measurable difference until the number of
  4752. elements in the list is on the order of a thousand, so for "almost all"
  4753. lists I wouldn't worry about it.
  4754.  
  4755. was-actually-quite-surprised-at-how-efficiently-icon-managed-to-implement-
  4756.    dynamic-length-list-indexing!-ly y'rs  - tim
  4757.  
  4758. Tim Peters   Kendall Square Research Corp
  4759. tim@ksr.com,         ksr!tim@uunet.uu.net
  4760.  
  4761. ps:  for comparison, here's the output of the program after making the
  4762. changes described above; this is on a Solbourne (souped-up SPARC):
  4763.  
  4764.         Pre-initialize List           Successive Insertions
  4765.  
  4766.        Block  Set-Up  Search       Block  Set-Up  Search
  4767.  Items      Memory   Time       Time          Memory   Time    Time
  4768. ------      ------  ------  ------      ------  ------  ------
  4769.     25         248       0       0     420      16       0
  4770.    100         848       0       0    1184       0       0
  4771.    500        4048       0      17    5200      16       0
  4772.   1000        8048      34      33       11336      33      17
  4773.   2000       16048      50      67       16836      66      67
  4774.   5000       40048     133     117       55912     150     167
  4775.  10000       79936     266     250       83644     300     317
  4776.  25000      199936     650     600      281128     766     800
  4777.  50000      399936    1334    1250      421412    1566    1650
  4778.  
  4779. >>> END OF MSG
  4780.  
  4781. From icon-group-request  Sun Mar  1 21:22:35 1992
  4782. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Sun, 1 Mar 92 21:22:35 MST
  4783. Received: from ucbvax.Berkeley.EDU by optima.cs.arizona.edu (4.1/15)
  4784.     id AA16165; Sun, 1 Mar 92 21:22:32 MST
  4785. Received: by ucbvax.Berkeley.EDU (5.63/1.43)
  4786.     id AA20359; Sun, 1 Mar 92 20:11:28 -0800
  4787. Received: from USENET by ucbvax.Berkeley.EDU with netnews
  4788.     for icon-group@cs.arizona.edu (icon-group@cs.arizona.edu)
  4789.     (contact usenet@ucbvax.Berkeley.EDU if you have questions)
  4790. Date: 27 Feb 92 09:31:44 GMT
  4791. From: uchinews!ellis!goer@uunet.uu.net  (Richard L. Goerwitz)
  4792. Organization: University of Chicago Computing Organizations
  4793. Subject: NLP & Icon
  4794. Message-Id: <1992Feb27.093144.1315@midway.uchicago.edu>
  4795. Sender: icon-group-request@cs.arizona.edu
  4796. To: icon-group@cs.arizona.edu
  4797.  
  4798.  
  4799. ############################################################################
  4800. #
  4801. #    Name:     ichartp.icn
  4802. #
  4803. #    Title:     Iconish implementation of a simple chart parser
  4804. #
  4805. #    Author:     Richard L. Goerwitz
  4806. #
  4807. #    Version: 1.2
  4808. #
  4809. ############################################################################
  4810. #
  4811. #      I was reading Byte Magazine (vol. 17:2 [February, 1992]), and
  4812. #  ran into an article entitled "A Natural Solution" (pages 237-244)
  4813. #  in which a standard chart parser was described in terms of its C++
  4814. #  implementation.  The author remarked at how his optimizations made
  4815. #  it possible to parse a 14-word sentence in only 32 seconds (versus
  4816. #  146 for a straight Gazdar-Mellish LISP chart parser).  32 seconds
  4817. #  struck me as hardly anything to write home about, so started coding
  4818. #  up a quick system in Icon to see how it compared.  This library is
  4819. #  the result.
  4820. #
  4821. #      The library has a small stub main() procedure that can be used
  4822. #  to get an idea of what is going on.  If compiled, the resulting
  4823. #  program takes just a single argument - the name of a BNF file
  4824. #  containing the grammar to use for parsing.  Parsing is done
  4825. #  line-by-line on the fly, using the standard input.  The results of
  4826. #  the parse are reported using the notation for trees described in
  4827. #  Griswold & Griswold, and also in the IPL collection entitled
  4828. #  "structs.icn."  There is often more than one possible parse, and
  4829. #  these are suspended successively, as they are encountered.  Unknown
  4830. #  vocabulary is flagged immediately as an error.  The tokenizing
  4831. #  routine folds uppercase letters into their lowercase equivalents,
  4832. #  and ignores anything that is not a &letter.
  4833. #
  4834. #      The parser itself operates in bottom-up fashion, but it might
  4835. #  just as well have been coded as a top-down parser.  It also tends
  4836. #  to do things in breadth-first fashion, rather than walking through
  4837. #  each alternative until it is exhausted.  BNFs are specified using
  4838. #  the same notation used in Griswold & Griswold, and as described in
  4839. #  the IPL program "pargen.icn," with the difference that all
  4840. #  metacharacters (space, tab, vertical slash, right/left parends,
  4841. #  brackets and angle brackets) can be converted to literals by
  4842. #  prepending a backslash (rendering <lb>, <rb>, etc. as notations for
  4843. #  these characters unnecessary).  Comments can be include along with
  4844. #  BNFs using the same notation as for Icon code (i.e. #-sign).
  4845. #
  4846. #      Pitfalls to be aware of include things like <L> ::= <L> | ha |
  4847. #  () (a weak attempt at a laugh recognizer).  This grammar will
  4848. #  accept "ha," "ha ha," etc. but will suspend an infinite number of
  4849. #  possible parses.  The right way to do this sort of thing is <L> ::=
  4850. #  ha <S> | ha, or if you really insist on having the empty string as
  4851. #  a possibility, try things like:
  4852. #
  4853. #          <S>      ::= () | <LAUGHS>
  4854. #          <LAUGHS> ::= ha <LAUGHS> | ha
  4855. #
  4856. #      Ichartp was kinda thrown together just to see how well Icon
  4857. #  would do at jobs traditionally assigned to LISP, Prolog, etc.  I'm
  4858. #  sure it could be very much improved upon.
  4859. #
  4860. ############################################################################
  4861. #
  4862. #  Links: structs, slashbal, rewrap, strip, stripcom (and ximage for debugging)
  4863. #
  4864. #  Requires:  an up-to-date IPL
  4865. #
  4866. ############################################################################
  4867.  
  4868. # I use ximage for debugging purposes.
  4869. link structs, slashbal, rewrap, strip, stripcom#, ximage
  4870.  
  4871. record stats(edge_list, lhs_table, term_set)
  4872. record chart(inactive, active)               # inactive - set; active - list
  4873. record retval(no, item)
  4874.  
  4875. record edge(LHS, RHS, LEN, DONE, BEG, END, SEEN)
  4876. record short_edge(LHS, RHS)
  4877.  
  4878. #
  4879. # For debugging only.
  4880. #
  4881. procedure main(a)
  4882.  
  4883.     local res, filename
  4884.     # &trace := -1
  4885.     filename := \a[1] | "bnfs.byte"
  4886.     while line := read(&input) do {
  4887.         every res := parse_sentence(line, filename, "S") do {
  4888.             if res.no = 0 then
  4889.             write(stree(edge2tree(res.item)))
  4890. #            write(ximage(res.item))
  4891.         else if res.no = 1 then
  4892.         write("unknown vocabulary item, ", res.item)
  4893.         }
  4894.     }
  4895.  
  4896. end
  4897.  
  4898.  
  4899. #
  4900. # parse_sentence:  string x string -> edge records
  4901. #                  (s, filename) -> Es
  4902. #     where s is a chunk of text presumed to constitute a sentence
  4903. #     where filename is the name of a grammar file containing BNFs
  4904. #     where Es are edge records containing possible parses of s
  4905. #
  4906. procedure parse_sentence(s, filename, start_symbol)
  4907.  
  4908.     local file, e, i, elist, ltbl, tset, ch, tokens, st, 
  4909.         memb, new_e, token_set, none_found, active_modified
  4910.     static master, old_filename
  4911.     initial master := table()
  4912.  
  4913.     #
  4914.     # Initialize and store stats for filename (if not already stored).
  4915.     #
  4916.     if not (filename == \old_filename) then {
  4917.         file := open(filename, "r") | p_err(filename, 7)
  4918.         #
  4919.         # Read BNFs from file; turn them into edge structs, and
  4920.         # store them all in a list; insert terminal symbols into a set.
  4921.         #
  4922.         elist := list(); ltbl := table(); tset := set()
  4923.         every e := bnf_file_2_edges(file) do {
  4924.             put(elist, e)                      # main edge list (active)
  4925.             (/ltbl[e.LHS] := set([e])) | insert(ltbl[e.LHS], e) # index LHSs
  4926.             every i := 1 to e.LEN do           # LEN holds length of e.RHS
  4927.                 if /e.RHS[i].RHS then          # RHS for terminals is null
  4928.                     insert(tset, e.RHS[i].LHS) & break
  4929.         }
  4930.         insert(master, filename, stats(elist, ltbl, tset))
  4931.         old_filename := filename
  4932.         close(file)
  4933.     }
  4934.     elist := fullcopy(master[filename].edge_list)
  4935.     ltbl  := fullcopy(master[filename].lhs_table)
  4936.     tset  := master[filename].term_set
  4937.     
  4938.     #
  4939.     # Make edge list into the active section of chart; tokenize the
  4940.     # sentence s & check for unrecognized vocabulary.
  4941.     #
  4942.     ch := chart(set(), elist)
  4943.     tokens := tokenize(s)
  4944.  
  4945.     #
  4946.     # Begin parse by entering all tokens in s into the inactive set
  4947.     # in the chart as edges with no RHS (a NULL RHS is characteristic
  4948.     # of all terminals).
  4949.     #
  4950.     token_set := set(tokens)
  4951.     every i := 1 to *tokens do {
  4952.         # Flag words not in the grammar as errors.
  4953.         if not member(tset, tokens[i]) then
  4954.             suspend retval(1, tokens[i])
  4955.         # Now, give us an inactive edge corresponding to word i.
  4956.         insert(ch.inactive, e := edge(tokens[i], &null, 1, 1, i, i+1))
  4957.         # Insert word i into the LHS table.
  4958.         (/ltbl[tokens[i]] := set([e])) | insert(ltbl[tokens[i]], e)
  4959.     # Watch out for those empty RHSs.
  4960.     insert(ch.inactive, e := edge("", &null, 1, 1, i, i))
  4961.         (/ltbl[""] := set([e])) | insert(ltbl[""], e)
  4962.     }
  4963.     *tokens = 0 & i := 0
  4964.     insert(ch.inactive, e := edge("", &null, 1, 1, i+1, i+1))
  4965.     (/ltbl[""] := set([e])) | insert(ltbl[""], e)
  4966.  
  4967.     #
  4968.     # Until no new active edges can be built, keep ploughing through
  4969.     # the active edge list, trying to match unconfirmed members of their
  4970.     # RHSs up with inactive edges.
  4971.     #
  4972.     until \none_found do {
  4973. #    write(ximage(ch))
  4974.         none_found := 1
  4975.         every e := !ch.active do {
  4976.             active_modified := &null
  4977.             # keep track of inactive edges we've already tried
  4978.             /e.SEEN := set()
  4979.             #
  4980.             # e.RHS[e.DONE+1] is the first unconfirmed category in the
  4981.             # RHS of e; ltbl[e.RHS[e.DONE+1].LHS] are all edges having
  4982.             # as their LHS the LHS of the first unconfirmed category in
  4983.             # e's RHS; we simply intersect this set with the inactives,
  4984.             # and then subtract out those we've seen before in connec-
  4985.             # tion with this edge -
  4986.             #
  4987.             if *(st := \ltbl[e.RHS[e.DONE+1].LHS] ** ch.inactive -- e.SEEN) > 0
  4988.             then {
  4989.                 # record all the inactive edges being looked at as seen
  4990.                 e.SEEN ++:= st
  4991.                 every memb := !st do {
  4992.             # make sure this inactive edge starts where the
  4993.             # last confirmed edge in e.RHS ends!
  4994.             if memb.BEG ~= \e.RHS[e.DONE].END then next
  4995.             # set none_found to indicate we've created a new edge
  4996.             else none_found := &null
  4997.                     # create a new edge, having the LHS of e, the RHS of e,
  4998.                     # the start point of e, the end point of st, and one more
  4999.                     # confirmed RHS members than e
  5000.                     new_e := edge(e.LHS, fullcopy(e.RHS),
  5001.                   e.LEN, e.DONE+1, e.BEG, memb.END)
  5002.                     new_e.RHS[new_e.DONE] := memb
  5003.                     /new_e.BEG := memb.BEG
  5004.                     if new_e.LEN = new_e.DONE then {      # it's inactive
  5005.                         insert(ch.inactive, new_e)
  5006.                         insert(ltbl[e.LHS], new_e)
  5007.                         if new_e.BEG = 1 & new_e.END = (*tokens+1) then {
  5008.                             if new_e.LHS == start_symbol  # complete parse
  5009.                             then suspend retval(0, new_e)
  5010.                         }
  5011.                     } else {
  5012.                         put(ch.active, new_e)            # it's active
  5013.                         active_modified := 1
  5014.                     }
  5015.                 }
  5016.             }
  5017.             # restart if the ch.active list has been modified
  5018.             if \active_modified then break next
  5019.         }
  5020.     }
  5021.  
  5022. end
  5023.  
  5024.  
  5025. #
  5026. # tokenize:  break up a sentence into constituent words, using spaces,
  5027. #            tabs, and other punctuation as separators (we'll need to
  5028. #            change this a bit later on to cover apostrophed words)
  5029. #
  5030. procedure tokenize(s)
  5031.  
  5032.     local l, word
  5033.  
  5034.     l := list()
  5035.     s ? {
  5036.         while tab(upto(&letters)) do
  5037.             put(l, map(tab(many(&letters))))
  5038.     }
  5039.     return l
  5040.  
  5041. end
  5042.  
  5043.  
  5044. #
  5045. # edge2tree:  edge -> tree
  5046. #             e -> t
  5047. #
  5048. #    where e is an edge structure (active or inactive; both are okay)
  5049. #    where t is a tree like what's described in Ralph Griswold's
  5050. #    structs library (IPL); I don't know about the 2nd ed. of
  5051. #    Griswold & Griswold, but the structure is described in the 1st
  5052. #    ed. in section 16.1
  5053. #
  5054. #    fails if, for some reason, the conversion can't be made (e.g. the
  5055. #    edge structure has been screwed around with in some way)
  5056. #
  5057. procedure edge2tree(e)
  5058.  
  5059.     local memb, t
  5060.  
  5061.     t := [e.LHS]
  5062.     \e.RHS | (return t)                                 # a terminal
  5063.     type(e) == "edge" | (return put(t, []))             # incomplete edge
  5064.     every memb := !e.RHS do                             # has daughters
  5065.     put(t, edge2tree(memb))
  5066.     return t
  5067.  
  5068. end
  5069.  
  5070.  
  5071. #
  5072. # bnf_file_2_edges: concatenate backslash-final lines & parse
  5073. #
  5074. procedure bnf_file_2_edges(f)
  5075.  
  5076.     while line := read(f) do {
  5077.     line := stripcom(line)
  5078.         while line ?:= 1(tab(-2) || tab(slashupto('\\')), pos(-1)) || !f
  5079.         suspend bnf_2_edges(line)
  5080.     }
  5081.  
  5082. end
  5083.  
  5084.  
  5085. #
  5086. # bnf_2_edges: string -> edge records
  5087. #              s -> Es (a generator)
  5088. #    where s is a CFPSG rule in BNF form
  5089. #    where Es are edges
  5090. #
  5091. procedure bnf_2_edges(s)
  5092.     
  5093.     #
  5094.     # Take out non-backslashed whitespace (i.e. spaces and tabs).
  5095.     #
  5096.     stripped_s := ""
  5097.     s ? {
  5098.         while stripped_s ||:= tab(slashupto(' \t')) do
  5099.             tab(many(' \t'))
  5100.         stripped_s ||:= tab(0)
  5101.     }
  5102.  
  5103.     #
  5104.     # Break BNF-style CFPSG rule into LHS and RHS.  If there is more
  5105.     # than one RHS (a la the | alternation op), suspend multiple re-
  5106.     # sults.
  5107.     #
  5108.     stripped_s ? {
  5109.         LHS := 1("" ~== tab(slashbal(':', '<', '>')), ="::=") | p_err(s,1)
  5110.         LHS ?:= strip(2(="<", tab(-1), =">"), '\\') | p_err(s, 2)
  5111.     LHS == "" & p_err(s, 6)
  5112.         every RHS := do_slash(tab(0) \ 1) do {
  5113.             RHS := string_2_list(RHS)
  5114.             suspend edge(LHS, RHS, *RHS, 0, &null, &null)
  5115.         }
  5116.     }
  5117.  
  5118. end
  5119.  
  5120.  
  5121. #
  5122. # string_2_list:  string -> list
  5123. #                 s -> L
  5124. #    where L is a list of partially constructed (short) edges, having
  5125. #    only LHS and RHS; in the case of nonterminals, the RHS is set
  5126. #    to 1, while for terminals the RHS is null (and remains that way
  5127. #    throughout the parse)
  5128. #
  5129. procedure string_2_list(s)
  5130.  
  5131.     local RHS_list, LHS
  5132.  
  5133.     (s || "\x00") ? {
  5134.         pos(-1) & (return [short_edge("", &null)])
  5135.         RHS_list := list()
  5136.         until pos(-1) do {
  5137.             if match("<") then {
  5138.                 LHS := ("" ~== tab(slashbal(&cset, '<', '>'))) | p_err(s, 4)
  5139.                 LHS ?:= strip(2(="<", tab(-1), =">"), '\\') | p_err(s, 4)
  5140.                 put(RHS_list, short_edge(LHS, 1))
  5141.             } else {
  5142.                 LHS := tab(slashupto('<') | -1)
  5143.                 slashupto('>', LHS) & p_err(s, 5)
  5144.                 put(RHS_list, short_edge(strip(LHS, '\\'), &null))
  5145.             }
  5146.         }
  5147.     }
  5148.     return RHS_list
  5149.  
  5150. end
  5151.  
  5152.  
  5153. #
  5154. # slashupto:  cset x string x integer x integer -> integers
  5155. #             (c, s, i, j) -> Is (a generator)
  5156. #    where Is are the integer positions in s[i:j] before characters
  5157. #    in c that is not preceded by a backslash escape
  5158. #
  5159. procedure slashupto(c, s, i, j)
  5160.  
  5161.     if /s := &subject
  5162.     then /i := &pos
  5163.     else /i := 1
  5164.     /j := *s + 1
  5165.     
  5166.     /c := &cset
  5167.     c ++:= '\\'
  5168.     s[1:j] ? {
  5169.         tab(i)
  5170.         while tab(upto(c)) do {
  5171.             if (="\\", move(1)) then next
  5172.             suspend .&pos
  5173.             move(1)
  5174.         }
  5175.     }
  5176.  
  5177. end
  5178.  
  5179.  
  5180. #
  5181. # fullcopy:  make full recursive copy of object
  5182. #
  5183. procedure fullcopy(obj)
  5184.  
  5185.     local retval, i, k
  5186.  
  5187.     case type(obj) of {
  5188.         "co-expression"  : return obj
  5189.         "cset"           : return obj
  5190.         "file"           : return obj
  5191.         "integer"        : return obj
  5192.         "list"           : {
  5193.             retval := list(*obj)
  5194.             every i := 1 to *obj do
  5195.                 retval[i] := fullcopy(obj[i])
  5196.             return retval
  5197.         }
  5198.         "null"           :  return &null
  5199.         "procedure"      :  return obj
  5200.         "real"           :  return obj
  5201.         "set"            :  {
  5202.             retval := set()
  5203.             every insert(retval, fullcopy(!obj))
  5204.             return retval
  5205.         }
  5206.         "string"         :  return obj
  5207.         "table"          :  {
  5208.             retval := table(obj[[]])
  5209.             every k := key(obj) do
  5210.                 insert(retval, fullcopy(k), fullcopy(obj[k]))
  5211.             return retval
  5212.         }
  5213.         # probably a record; if not, we're dealing with a new
  5214.         # version of Icon or a nonstandard implementation, and
  5215.     # we're screwed
  5216.         default          :  {
  5217.             retval := copy(obj)
  5218.             every i := 1 to *obj do
  5219.                 retval[i] := fullcopy(obj[i])
  5220.             return retval
  5221.         }
  5222.     }
  5223.  
  5224. end
  5225.  
  5226.  
  5227. #
  5228. # do_slash:  string -> string(s)
  5229. #     Given a|b suspend a then b.  Used in conjunction with do_parends().
  5230. #
  5231. procedure do_slash(s)
  5232.  
  5233.     local chunk
  5234.     s ? {
  5235.     while chunk := tab(slashbal('|', '(', ')')) do {
  5236.         suspend do_parends(chunk)
  5237.         move(1)
  5238.     }
  5239.     suspend do_parends(tab(0))
  5240.     }
  5241.  
  5242. end
  5243.  
  5244.  
  5245. #
  5246. # do_parends:  string -> string(s)
  5247. #    Given a(b)c suspend abc; given a(b|c)d suspend abd and acd, etc.
  5248. #    Used in conjuction with do_slash().
  5249. #
  5250. procedure do_parends(s)
  5251.  
  5252.     local chunk, i, j
  5253.     s ? {
  5254.     if not (i := slashupto('(')) then {
  5255.         chunk := tab(0)
  5256.         slashupto(')') & p_err(s, 8)
  5257.         suspend chunk
  5258.     } else {
  5259.         j := i + slashbal(')', '(', ')', s[i+1:0]) | p_err(s, 9)
  5260.         suspend tab(i) ||
  5261.         (move(1), do_slash(tab(j))) ||
  5262.         (move(1), do_parends(tab(0)))
  5263.     }
  5264.     }
  5265.  
  5266. end
  5267.  
  5268.  
  5269. #
  5270. # p_err:  print error message to stderr & abort
  5271. #
  5272. procedure p_err(s, n)
  5273.  
  5274.     local i, msg
  5275.     static errlist
  5276.     initial {
  5277.         errlist := [[1, "malformed LHS"],
  5278.                     [2, "nonterminal lacks proper <> enclosure"],
  5279.                     [3, "missing left angle bracket"],
  5280.                     [4, "unmatched left angle bracket"],
  5281.                     [5, "unmatched right angle bracket"],
  5282.             [6, "empty symbol in LHS"],
  5283.                     [7, "unable to open file"],
  5284.                     [8, "unmatched right parenthesis"],
  5285.                     [9, "unmatched left parenthesis"]
  5286.                    ]
  5287.     }
  5288.     every i := 1 to *errlist do
  5289.         if errlist[i][1] = n then msg := errlist[i][2]
  5290.     writes(&errout, "error ", n, " (", msg, ") in \n")
  5291.     every write("\t", rewrap(s) | rewrap())
  5292.     exit(n)
  5293.  
  5294. end
  5295.  
  5296. -- 
  5297.  
  5298.    -Richard L. Goerwitz              goer%sophist@uchicago.bitnet
  5299.    goer@sophist.uchicago.edu         rutgers!oddjob!gide!sophist!goer
  5300.  
  5301. From icon-group-request  Sun Mar  8 12:53:23 1992
  5302. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Sun, 8 Mar 92 12:53:23 MST
  5303. Received: from ucbvax.Berkeley.EDU by optima.cs.arizona.edu (4.1/15)
  5304.     id AA05923; Sun, 8 Mar 92 12:53:16 MST
  5305. Received: by ucbvax.Berkeley.EDU (5.63/1.43)
  5306.     id AA27992; Sun, 8 Mar 92 11:48:31 -0800
  5307. Received: from USENET by ucbvax.Berkeley.EDU with netnews
  5308.     for icon-group@cs.arizona.edu (icon-group@cs.arizona.edu)
  5309.     (contact usenet@ucbvax.Berkeley.EDU if you have questions)
  5310. Date: 27 Feb 92 09:31:44 GMT
  5311. From: uchinews!ellis!goer@uunet.uu.net  (Richard L. Goerwitz)
  5312. Organization: University of Chicago Computing Organizations
  5313. Subject: NLP & Icon
  5314. Message-Id: <1992Feb27.093144.1315@midway.uchicago.edu>
  5315. Sender: icon-group-request@cs.arizona.edu
  5316. To: icon-group@cs.arizona.edu
  5317.  
  5318.  
  5319. ############################################################################
  5320. #
  5321. #    Name:     ichartp.icn
  5322. #
  5323. #    Title:     Iconish implementation of a simple chart parser
  5324. #
  5325. #    Author:     Richard L. Goerwitz
  5326. #
  5327. #    Version: 1.2
  5328. #
  5329. ############################################################################
  5330. #
  5331. #      I was reading Byte Magazine (vol. 17:2 [February, 1992]), and
  5332. #  ran into an article entitled "A Natural Solution" (pages 237-244)
  5333. #  in which a standard chart parser was described in terms of its C++
  5334. #  implementation.  The author remarked at how his optimizations made
  5335. #  it possible to parse a 14-word sentence in only 32 seconds (versus
  5336. #  146 for a straight Gazdar-Mellish LISP chart parser).  32 seconds
  5337. #  struck me as hardly anything to write home about, so started coding
  5338. #  up a quick system in Icon to see how it compared.  This library is
  5339. #  the result.
  5340. #
  5341. #      The library has a small stub main() procedure that can be used
  5342. #  to get an idea of what is going on.  If compiled, the resulting
  5343. #  program takes just a single argument - the name of a BNF file
  5344. #  containing the grammar to use for parsing.  Parsing is done
  5345. #  line-by-line on the fly, using the standard input.  The results of
  5346. #  the parse are reported using the notation for trees described in
  5347. #  Griswold & Griswold, and also in the IPL collection entitled
  5348. #  "structs.icn."  There is often more than one possible parse, and
  5349. #  these are suspended successively, as they are encountered.  Unknown
  5350. #  vocabulary is flagged immediately as an error.  The tokenizing
  5351. #  routine folds uppercase letters into their lowercase equivalents,
  5352. #  and ignores anything that is not a &letter.
  5353. #
  5354. #      The parser itself operates in bottom-up fashion, but it might
  5355. #  just as well have been coded as a top-down parser.  It also tends
  5356. #  to do things in breadth-first fashion, rather than walking through
  5357. #  each alternative until it is exhausted.  BNFs are specified using
  5358. #  the same notation used in Griswold & Griswold, and as described in
  5359. #  the IPL program "pargen.icn," with the difference that all
  5360. #  metacharacters (space, tab, vertical slash, right/left parends,
  5361. #  brackets and angle brackets) can be converted to literals by
  5362. #  prepending a backslash (rendering <lb>, <rb>, etc. as notations for
  5363. #  these characters unnecessary).  Comments can be include along with
  5364. #  BNFs using the same notation as for Icon code (i.e. #-sign).
  5365. #
  5366. #      Pitfalls to be aware of include things like <L> ::= <L> | ha |
  5367. #  () (a weak attempt at a laugh recognizer).  This grammar will
  5368. #  accept "ha," "ha ha," etc. but will suspend an infinite number of
  5369. #  possible parses.  The right way to do this sort of thing is <L> ::=
  5370. #  ha <S> | ha, or if you really insist on having the empty string as
  5371. #  a possibility, try things like:
  5372. #
  5373. #          <S>      ::= () | <LAUGHS>
  5374. #          <LAUGHS> ::= ha <LAUGHS> | ha
  5375. #
  5376. #      Ichartp was kinda thrown together just to see how well Icon
  5377. #  would do at jobs traditionally assigned to LISP, Prolog, etc.  I'm
  5378. #  sure it could be very much improved upon.
  5379. #
  5380. ############################################################################
  5381. #
  5382. #  Links: structs, slashbal, rewrap, strip, stripcom (and ximage for debugging)
  5383. #
  5384. #  Requires:  an up-to-date IPL
  5385. #
  5386. ############################################################################
  5387.  
  5388. # I use ximage for debugging purposes.
  5389. link structs, slashbal, rewrap, strip, stripcom#, ximage
  5390.  
  5391. record stats(edge_list, lhs_table, term_set)
  5392. record chart(inactive, active)               # inactive - set; active - list
  5393. record retval(no, item)
  5394.  
  5395. record edge(LHS, RHS, LEN, DONE, BEG, END, SEEN)
  5396. record short_edge(LHS, RHS)
  5397.  
  5398. #
  5399. # For debugging only.
  5400. #
  5401. procedure main(a)
  5402.  
  5403.     local res, filename
  5404.     # &trace := -1
  5405.     filename := \a[1] | "bnfs.byte"
  5406.     while line := read(&input) do {
  5407.         every res := parse_sentence(line, filename, "S") do {
  5408.             if res.no = 0 then
  5409.             write(stree(edge2tree(res.item)))
  5410. #            write(ximage(res.item))
  5411.         else if res.no = 1 then
  5412.         write("unknown vocabulary item, ", res.item)
  5413.         }
  5414.     }
  5415.  
  5416. end
  5417.  
  5418.  
  5419. #
  5420. # parse_sentence:  string x string -> edge records
  5421. #                  (s, filename) -> Es
  5422. #     where s is a chunk of text presumed to constitute a sentence
  5423. #     where filename is the name of a grammar file containing BNFs
  5424. #     where Es are edge records containing possible parses of s
  5425. #
  5426. procedure parse_sentence(s, filename, start_symbol)
  5427.  
  5428.     local file, e, i, elist, ltbl, tset, ch, tokens, st, 
  5429.         memb, new_e, token_set, none_found, active_modified
  5430.     static master, old_filename
  5431.     initial master := table()
  5432.  
  5433.     #
  5434.     # Initialize and store stats for filename (if not already stored).
  5435.     #
  5436.     if not (filename == \old_filename) then {
  5437.         file := open(filename, "r") | p_err(filename, 7)
  5438.         #
  5439.         # Read BNFs from file; turn them into edge structs, and
  5440.         # store them all in a list; insert terminal symbols into a set.
  5441.         #
  5442.         elist := list(); ltbl := table(); tset := set()
  5443.         every e := bnf_file_2_edges(file) do {
  5444.             put(elist, e)                      # main edge list (active)
  5445.             (/ltbl[e.LHS] := set([e])) | insert(ltbl[e.LHS], e) # index LHSs
  5446.             every i := 1 to e.LEN do           # LEN holds length of e.RHS
  5447.                 if /e.RHS[i].RHS then          # RHS for terminals is null
  5448.                     insert(tset, e.RHS[i].LHS) & break
  5449.         }
  5450.         insert(master, filename, stats(elist, ltbl, tset))
  5451.         old_filename := filename
  5452.         close(file)
  5453.     }
  5454.     elist := fullcopy(master[filename].edge_list)
  5455.     ltbl  := fullcopy(master[filename].lhs_table)
  5456.     tset  := master[filename].term_set
  5457.     
  5458.     #
  5459.     # Make edge list into the active section of chart; tokenize the
  5460.     # sentence s & check for unrecognized vocabulary.
  5461.     #
  5462.     ch := chart(set(), elist)
  5463.     tokens := tokenize(s)
  5464.  
  5465.     #
  5466.     # Begin parse by entering all tokens in s into the inactive set
  5467.     # in the chart as edges with no RHS (a NULL RHS is characteristic
  5468.     # of all terminals).
  5469.     #
  5470.     token_set := set(tokens)
  5471.     every i := 1 to *tokens do {
  5472.         # Flag words not in the grammar as errors.
  5473.         if not member(tset, tokens[i]) then
  5474.             suspend retval(1, tokens[i])
  5475.         # Now, give us an inactive edge corresponding to word i.
  5476.         insert(ch.inactive, e := edge(tokens[i], &null, 1, 1, i, i+1))
  5477.         # Insert word i into the LHS table.
  5478.         (/ltbl[tokens[i]] := set([e])) | insert(ltbl[tokens[i]], e)
  5479.     # Watch out for those empty RHSs.
  5480.     insert(ch.inactive, e := edge("", &null, 1, 1, i, i))
  5481.         (/ltbl[""] := set([e])) | insert(ltbl[""], e)
  5482.     }
  5483.     *tokens = 0 & i := 0
  5484.     insert(ch.inactive, e := edge("", &null, 1, 1, i+1, i+1))
  5485.     (/ltbl[""] := set([e])) | insert(ltbl[""], e)
  5486.  
  5487.     #
  5488.     # Until no new active edges can be built, keep ploughing through
  5489.     # the active edge list, trying to match unconfirmed members of their
  5490.     # RHSs up with inactive edges.
  5491.     #
  5492.     until \none_found do {
  5493. #    write(ximage(ch))
  5494.         none_found := 1
  5495.         every e := !ch.active do {
  5496.             active_modified := &null
  5497.             # keep track of inactive edges we've already tried
  5498.             /e.SEEN := set()
  5499.             #
  5500.             # e.RHS[e.DONE+1] is the first unconfirmed category in the
  5501.             # RHS of e; ltbl[e.RHS[e.DONE+1].LHS] are all edges having
  5502.             # as their LHS the LHS of the first unconfirmed category in
  5503.             # e's RHS; we simply intersect this set with the inactives,
  5504.             # and then subtract out those we've seen before in connec-
  5505.             # tion with this edge -
  5506.             #
  5507.             if *(st := \ltbl[e.RHS[e.DONE+1].LHS] ** ch.inactive -- e.SEEN) > 0
  5508.             then {
  5509.                 # record all the inactive edges being looked at as seen
  5510.                 e.SEEN ++:= st
  5511.                 every memb := !st do {
  5512.             # make sure this inactive edge starts where the
  5513.             # last confirmed edge in e.RHS ends!
  5514.             if memb.BEG ~= \e.RHS[e.DONE].END then next
  5515.             # set none_found to indicate we've created a new edge
  5516.             else none_found := &null
  5517.                     # create a new edge, having the LHS of e, the RHS of e,
  5518.                     # the start point of e, the end point of st, and one more
  5519.                     # confirmed RHS members than e
  5520.                     new_e := edge(e.LHS, fullcopy(e.RHS),
  5521.                   e.LEN, e.DONE+1, e.BEG, memb.END)
  5522.                     new_e.RHS[new_e.DONE] := memb
  5523.                     /new_e.BEG := memb.BEG
  5524.                     if new_e.LEN = new_e.DONE then {      # it's inactive
  5525.                         insert(ch.inactive, new_e)
  5526.                         insert(ltbl[e.LHS], new_e)
  5527.                         if new_e.BEG = 1 & new_e.END = (*tokens+1) then {
  5528.                             if new_e.LHS == start_symbol  # complete parse
  5529.                             then suspend retval(0, new_e)
  5530.                         }
  5531.                     } else {
  5532.                         put(ch.active, new_e)            # it's active
  5533.                         active_modified := 1
  5534.                     }
  5535.                 }
  5536.             }
  5537.             # restart if the ch.active list has been modified
  5538.             if \active_modified then break next
  5539.         }
  5540.     }
  5541.  
  5542. end
  5543.  
  5544.  
  5545. #
  5546. # tokenize:  break up a sentence into constituent words, using spaces,
  5547. #            tabs, and other punctuation as separators (we'll need to
  5548. #            change this a bit later on to cover apostrophed words)
  5549. #
  5550. procedure tokenize(s)
  5551.  
  5552.     local l, word
  5553.  
  5554.     l := list()
  5555.     s ? {
  5556.         while tab(upto(&letters)) do
  5557.             put(l, map(tab(many(&letters))))
  5558.     }
  5559.     return l
  5560.  
  5561. end
  5562.  
  5563.  
  5564. #
  5565. # edge2tree:  edge -> tree
  5566. #             e -> t
  5567. #
  5568. #    where e is an edge structure (active or inactive; both are okay)
  5569. #    where t is a tree like what's described in Ralph Griswold's
  5570. #    structs library (IPL); I don't know about the 2nd ed. of
  5571. #    Griswold & Griswold, but the structure is described in the 1st
  5572. #    ed. in section 16.1
  5573. #
  5574. #    fails if, for some reason, the conversion can't be made (e.g. the
  5575. #    edge structure has been screwed around with in some way)
  5576. #
  5577. procedure edge2tree(e)
  5578.  
  5579.     local memb, t
  5580.  
  5581.     t := [e.LHS]
  5582.     \e.RHS | (return t)                                 # a terminal
  5583.     type(e) == "edge" | (return put(t, []))             # incomplete edge
  5584.     every memb := !e.RHS do                             # has daughters
  5585.     put(t, edge2tree(memb))
  5586.     return t
  5587.  
  5588. end
  5589.  
  5590.  
  5591. #
  5592. # bnf_file_2_edges: concatenate backslash-final lines & parse
  5593. #
  5594. procedure bnf_file_2_edges(f)
  5595.  
  5596.     while line := read(f) do {
  5597.     line := stripcom(line)
  5598.         while line ?:= 1(tab(-2) || tab(slashupto('\\')), pos(-1)) || !f
  5599.         suspend bnf_2_edges(line)
  5600.     }
  5601.  
  5602. end
  5603.  
  5604.  
  5605. #
  5606. # bnf_2_edges: string -> edge records
  5607. #              s -> Es (a generator)
  5608. #    where s is a CFPSG rule in BNF form
  5609. #    where Es are edges
  5610. #
  5611. procedure bnf_2_edges(s)
  5612.     
  5613.     #
  5614.     # Take out non-backslashed whitespace (i.e. spaces and tabs).
  5615.     #
  5616.     stripped_s := ""
  5617.     s ? {
  5618.         while stripped_s ||:= tab(slashupto(' \t')) do
  5619.             tab(many(' \t'))
  5620.         stripped_s ||:= tab(0)
  5621.     }
  5622.  
  5623.     #
  5624.     # Break BNF-style CFPSG rule into LHS and RHS.  If there is more
  5625.     # than one RHS (a la the | alternation op), suspend multiple re-
  5626.     # sults.
  5627.     #
  5628.     stripped_s ? {
  5629.         LHS := 1("" ~== tab(slashbal(':', '<', '>')), ="::=") | p_err(s,1)
  5630.         LHS ?:= strip(2(="<", tab(-1), =">"), '\\') | p_err(s, 2)
  5631.     LHS == "" & p_err(s, 6)
  5632.         every RHS := do_slash(tab(0) \ 1) do {
  5633.             RHS := string_2_list(RHS)
  5634.             suspend edge(LHS, RHS, *RHS, 0, &null, &null)
  5635.         }
  5636.     }
  5637.  
  5638. end
  5639.  
  5640.  
  5641. #
  5642. # string_2_list:  string -> list
  5643. #                 s -> L
  5644. #    where L is a list of partially constructed (short) edges, having
  5645. #    only LHS and RHS; in the case of nonterminals, the RHS is set
  5646. #    to 1, while for terminals the RHS is null (and remains that way
  5647. #    throughout the parse)
  5648. #
  5649. procedure string_2_list(s)
  5650.  
  5651.     local RHS_list, LHS
  5652.  
  5653.     (s || "\x00") ? {
  5654.         pos(-1) & (return [short_edge("", &null)])
  5655.         RHS_list := list()
  5656.         until pos(-1) do {
  5657.             if match("<") then {
  5658.                 LHS := ("" ~== tab(slashbal(&cset, '<', '>'))) | p_err(s, 4)
  5659.                 LHS ?:= strip(2(="<", tab(-1), =">"), '\\') | p_err(s, 4)
  5660.                 put(RHS_list, short_edge(LHS, 1))
  5661.             } else {
  5662.                 LHS := tab(slashupto('<') | -1)
  5663.                 slashupto('>', LHS) & p_err(s, 5)
  5664.                 put(RHS_list, short_edge(strip(LHS, '\\'), &null))
  5665.             }
  5666.         }
  5667.     }
  5668.     return RHS_list
  5669.  
  5670. end
  5671.  
  5672.  
  5673. #
  5674. # slashupto:  cset x string x integer x integer -> integers
  5675. #             (c, s, i, j) -> Is (a generator)
  5676. #    where Is are the integer positions in s[i:j] before characters
  5677. #    in c that is not preceded by a backslash escape
  5678. #
  5679. procedure slashupto(c, s, i, j)
  5680.  
  5681.     if /s := &subject
  5682.     then /i := &pos
  5683.     else /i := 1
  5684.     /j := *s + 1
  5685.     
  5686.     /c := &cset
  5687.     c ++:= '\\'
  5688.     s[1:j] ? {
  5689.         tab(i)
  5690.         while tab(upto(c)) do {
  5691.             if (="\\", move(1)) then next
  5692.             suspend .&pos
  5693.             move(1)
  5694.         }
  5695.     }
  5696.  
  5697. end
  5698.  
  5699.  
  5700. #
  5701. # fullcopy:  make full recursive copy of object
  5702. #
  5703. procedure fullcopy(obj)
  5704.  
  5705.     local retval, i, k
  5706.  
  5707.     case type(obj) of {
  5708.         "co-expression"  : return obj
  5709.         "cset"           : return obj
  5710.         "file"           : return obj
  5711.         "integer"        : return obj
  5712.         "list"           : {
  5713.             retval := list(*obj)
  5714.             every i := 1 to *obj do
  5715.                 retval[i] := fullcopy(obj[i])
  5716.             return retval
  5717.         }
  5718.         "null"           :  return &null
  5719.         "procedure"      :  return obj
  5720.         "real"           :  return obj
  5721.         "set"            :  {
  5722.             retval := set()
  5723.             every insert(retval, fullcopy(!obj))
  5724.             return retval
  5725.         }
  5726.         "string"         :  return obj
  5727.         "table"          :  {
  5728.             retval := table(obj[[]])
  5729.             every k := key(obj) do
  5730.                 insert(retval, fullcopy(k), fullcopy(obj[k]))
  5731.             return retval
  5732.         }
  5733.         # probably a record; if not, we're dealing with a new
  5734.         # version of Icon or a nonstandard implementation, and
  5735.     # we're screwed
  5736.         default          :  {
  5737.             retval := copy(obj)
  5738.             every i := 1 to *obj do
  5739.                 retval[i] := fullcopy(obj[i])
  5740.             return retval
  5741.         }
  5742.     }
  5743.  
  5744. end
  5745.  
  5746.  
  5747. #
  5748. # do_slash:  string -> string(s)
  5749. #     Given a|b suspend a then b.  Used in conjunction with do_parends().
  5750. #
  5751. procedure do_slash(s)
  5752.  
  5753.     local chunk
  5754.     s ? {
  5755.     while chunk := tab(slashbal('|', '(', ')')) do {
  5756.         suspend do_parends(chunk)
  5757.         move(1)
  5758.     }
  5759.     suspend do_parends(tab(0))
  5760.     }
  5761.  
  5762. end
  5763.  
  5764.  
  5765. #
  5766. # do_parends:  string -> string(s)
  5767. #    Given a(b)c suspend abc; given a(b|c)d suspend abd and acd, etc.
  5768. #    Used in conjuction with do_slash().
  5769. #
  5770. procedure do_parends(s)
  5771.  
  5772.     local chunk, i, j
  5773.     s ? {
  5774.     if not (i := slashupto('(')) then {
  5775.         chunk := tab(0)
  5776.         slashupto(')') & p_err(s, 8)
  5777.         suspend chunk
  5778.     } else {
  5779.         j := i + slashbal(')', '(', ')', s[i+1:0]) | p_err(s, 9)
  5780.         suspend tab(i) ||
  5781.         (move(1), do_slash(tab(j))) ||
  5782.         (move(1), do_parends(tab(0)))
  5783.     }
  5784.     }
  5785.  
  5786. end
  5787.  
  5788.  
  5789. #
  5790. # p_err:  print error message to stderr & abort
  5791. #
  5792. procedure p_err(s, n)
  5793.  
  5794.     local i, msg
  5795.     static errlist
  5796.     initial {
  5797.         errlist := [[1, "malformed LHS"],
  5798.                     [2, "nonterminal lacks proper <> enclosure"],
  5799.                     [3, "missing left angle bracket"],
  5800.                     [4, "unmatched left angle bracket"],
  5801.                     [5, "unmatched right angle bracket"],
  5802.             [6, "empty symbol in LHS"],
  5803.                     [7, "unable to open file"],
  5804.                     [8, "unmatched right parenthesis"],
  5805.                     [9, "unmatched left parenthesis"]
  5806.                    ]
  5807.     }
  5808.     every i := 1 to *errlist do
  5809.         if errlist[i][1] = n then msg := errlist[i][2]
  5810.     writes(&errout, "error ", n, " (", msg, ") in \n")
  5811.     every write("\t", rewrap(s) | rewrap())
  5812.     exit(n)
  5813.  
  5814. end
  5815.  
  5816. -- 
  5817.  
  5818.    -Richard L. Goerwitz              goer%sophist@uchicago.bitnet
  5819.    goer@sophist.uchicago.edu         rutgers!oddjob!gide!sophist!goer
  5820.  
  5821. From icon-group-request  Mon Mar  9 02:26:56 1992
  5822. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Mon, 9 Mar 92 02:26:56 MST
  5823. Received: from ucbvax.Berkeley.EDU by optima.cs.arizona.edu (4.1/15)
  5824.     id AA03693; Mon, 9 Mar 92 02:26:53 MST
  5825. Received: by ucbvax.Berkeley.EDU (5.63/1.43)
  5826.     id AA28760; Mon, 9 Mar 92 01:17:17 -0800
  5827. Received: from USENET by ucbvax.Berkeley.EDU with netnews
  5828.     for icon-group@cs.arizona.edu (icon-group@cs.arizona.edu)
  5829.     (contact usenet@ucbvax.Berkeley.EDU if you have questions)
  5830. Date: 18 Feb 92 22:10:31 GMT
  5831. From: dog.ee.lbl.gov!overload.lbl.gov!agate!spool.mu.edu!sdd.hp.com!think.com!rpi!sarah!eve.albany.edu!lg4248@ucbvax.berkeley.edu  (The Sea Nymph)
  5832. Organization: State University of New York at Albany
  5833. Subject: implementation book[s]?
  5834. Message-Id: <LG4248.92Feb18161031@eve.albany.edu>
  5835. Sender: icon-group-request@cs.arizona.edu
  5836. To: icon-group@cs.arizona.edu
  5837.  
  5838.  
  5839. I have only seen one book on implementing Icon (in C). Unfortunately
  5840. I can't remember the specific title or author.. but in general,
  5841. does anyone know if there is more than one book, and can you
  5842. tell me what book[s] there is/are?
  5843.  
  5844. many thanks,
  5845. lg
  5846.  
  5847. ****************IAMNOTASIGNATUREIAMAFREETHINKINGINDIVIDUAL******************
  5848.  
  5849. From @castle.edinburgh.ac.uk,@emas-a.edinburgh.ac.uk:R.J.Hare@edinburgh.ac.uk  Thu Mar 12 22:00:41 1992
  5850. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Thu, 12 Mar 92 22:00:41 MST
  5851. Received: from  by optima.cs.arizona.edu (4.1/15)
  5852.     id AB27665; Thu, 12 Mar 92 22:00:27 MST
  5853. Received: from castle.edinburgh.ac.uk by sun2.nsfnet-relay.ac.uk via JANET 
  5854.           with NIFTP id <9035-0@sun2.nsfnet-relay.ac.uk>;
  5855.           Wed, 11 Mar 1992 15:04:49 +0000
  5856. Received: from emas-a.ed.ac.uk by castle.ed.ac.uk id aa17676;
  5857.           11 Mar 92 11:58 WET
  5858. Date: 11 Mar 92 11:58:36 gmt
  5859. From: R.J.Hare@edinburgh.ac.uk
  5860. Subject: Soundex
  5861. To: icon-group@cs.arizona.edu
  5862. Message-Id: <11 Mar 92 11:58:36 gmt 320969@EMAS-A>
  5863. Sender: "R.J.Hare" <@emas-a.edinburgh.ac.uk:R.J.Hare@edinburgh.ac.uk>
  5864.  
  5865. Somewhere, recently, I saw Icon code for the Soundex algorithm. I now need
  5866. this code and can't find it. It doesn't seem to be in the Icon Program
  5867. Library. Was it posted here? If yes, I'd be grateful if the originator would
  5868. re-post it.
  5869.  
  5870. Thanks.
  5871.  
  5872. Roger Hare.
  5873.  
  5874. From TENAGLIA@mis.mcw.edu  Fri Mar 13 05:14:32 1992
  5875. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Fri, 13 Mar 92 05:14:32 MST
  5876. Received: from ADM.MIS.MCW.EDU by optima.cs.arizona.edu (4.1/15)
  5877.     id AA21865; Fri, 13 Mar 92 05:14:28 MST
  5878. Received: from mis.mcw.edu by mis.mcw.edu (PMDF #12865) id
  5879.  <01GHL3GOT2CGAFUGQM@mis.mcw.edu>; Fri, 13 Mar 1992 06:15 CST
  5880. Date: Fri, 13 Mar 1992 06:15 CST
  5881. From: Chris Tenaglia - 257-8765 <TENAGLIA@mis.mcw.edu>
  5882. Subject: Re: Soundex
  5883. To: R.J.Hare@edinburgh.ac.uk
  5884. Cc: icon-group@cs.arizona.edu
  5885. Message-Id: <01GHL3GOT2CGAFUGQM@mis.mcw.edu>
  5886. X-Organization: Medical College of Wisconsin (Milwaukee, WI)
  5887. X-Vms-To: IN%"R.J.Hare@edinburgh.ac.uk"
  5888. X-Vms-Cc: IN%"icon-group@cs.arizona.edu"
  5889.  
  5890. > From:    IN%"R.J.Hare@edinburgh.ac.uk" 12-MAR-1992 23:12:53.41
  5891. > To:    IN%"icon-group@cs.arizona.edu"
  5892. > Subj:    Soundex
  5893.  
  5894. > Somewhere, recently, I saw Icon code for the Soundex algorithm. I now need
  5895. > this code and can't find it. It doesn't seem to be in the Icon Program
  5896. > Library. Was it posted here? If yes, I'd be grateful if the originator would
  5897. > re-post it.
  5898.  
  5899. > Thanks.
  5900. > Roger Hare.
  5901.  
  5902. Here's my posting from earlier this year. Dr. Griswold also had mentioned
  5903. that another version is available from the IPL.
  5904.  
  5905. Chris Tenaglia (System Manager) |  "The past explained,
  5906. Medical College of Wisconsin    |   the future fortold, 
  5907. 8701 W. Watertown Plank Rd.     |   the present largely appologized for."
  5908. Milwaukee, WI 53226             |   Organon to The Doctor
  5909. (414)257-8765                   |     
  5910. tenaglia@mis.mcw.edu
  5911.  
  5912. #
  5913. # SOUNDEX.ICN          8/28/91          TENAGLIA
  5914. #
  5915. # THIS ICON PROGRAM IMPLEMENTS A SOUNDEX CATALOGUING
  5916. # KEY COMPRESSOR.
  5917. #
  5918. procedure main()
  5919.   while map(line := input("Str:")) ~== "quit" do write(soundex(line))
  5920.   end
  5921.  
  5922. #
  5923. # STR IS A STRING (USUALLY A LAST NAME) PHONETICALLY SPELLED.
  5924. # NUMBER IS RETURNED WHICH IS A CATALOGUE LOOK UP KEY MADE FROM IT.
  5925. # THE STEPS ARE AS FOLLOWS :
  5926. #          1. SAVE THE FIRST CHARACTER FOR LATER USE
  5927. #          2. REMOVE W AND H                                 
  5928. #          3. REMOVE ALL VOWELS EXCEPT WHEN IN FIRST POSITION
  5929. #          4. MAP LEFTOVER STRING WITH A NUMBER TABLE
  5930. #          5. DELETE DUPLICATE ADJACENT DIGITS
  5931. #          6. MAKE NUMBER 6 CHARACTERS LONG (TRUNCATE OR PAD WITH 0S)
  5932. #          7. REPLACE FIRST DIGIT WITH SAVED FIRST CHARACTER
  5933. #
  5934. procedure soundex(str)
  5935.   static vowels, tbl
  5936.   initial
  5937.     {
  5938.     vowels := 'aeiouy'
  5939.     tbl    := "0123012 02245501262301 202"
  5940.     }
  5941.   str := map(str)
  5942.   first := str[1] ; tmp := first ; tmp2 := ""
  5943.   while i := find("w"|"h",str) do str[i] := ""
  5944.   every i := 2 to *str do tmp ||:= if any(vowels,str,i) then "" else str[i]
  5945.   str2 := map(tmp,&lcase,tbl) || "?"
  5946.   every i := 1 to *str2-1 do
  5947.     if str2[i] ~== str2[i+1] then tmp2 ||:= str2[i]
  5948.   number := if *tmp2 < 6 then left(tmp2,6,"0") else tmp2[1+:6]
  5949.   number[1] := first
  5950.   return number
  5951.   end
  5952.   
  5953. #
  5954. # GET A STRING OF INPUT FROM THE KEYBOARD
  5955. #
  5956.  
  5957. procedure input(prompt)
  5958.   writes(prompt)
  5959.   return read()
  5960.   end
  5961.  
  5962.  
  5963. From stone@hilbert.math.grin.edu  Fri Mar 13 07:47:43 1992
  5964. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Fri, 13 Mar 92 07:47:43 MST
  5965. Received: from hilbert.math.grin.edu (HILBERT-GW.MATH.GRIN.EDU) by optima.cs.arizona.edu (4.1/15)
  5966.     id AA25589; Fri, 13 Mar 92 07:47:40 MST
  5967. Received: from russell.math.grin.edu by hilbert.math.grin.edu (4.1/Stone-5);
  5968.     id AA10637; Fri, 13 Mar 92 08:47:02 CST
  5969. Date: Fri, 13 Mar 92 08:47:02 CST
  5970. From: John David Stone <stone@hilbert.math.grin.edu>
  5971. Message-Id: <9203131447.AA10637@hilbert.math.grin.edu>
  5972. Received: by russell.math.grin.edu (4.1/Stone-2);
  5973.     id AA04081; Fri, 13 Mar 92 08:46:59 CST
  5974. To: icon-group@cs.arizona.edu
  5975. Subject: Soundex algorithm
  5976.  
  5977.         I'm not the original poster of the Soundex algorithm, but I have
  5978. a version that should serve your purpose:
  5979.  
  5980. ----------------------------------------------------------------------------
  5981. # When names are communicated by telephone, they are often transcribed
  5982. # incorrectly.  An organization that has to keep track of a lot of names has
  5983. # a need, therefore, for some system of representing or encoding a name that
  5984. # will mitigate the effects of transcription errors.  One idea, originally
  5985. # proposed by Margaret K. Odell and Robert C. Russell, uses the following
  5986. # encoding system to try to bring together occurrences of the same surname,
  5987. # variously spelled:
  5988. #
  5989. # Encode each of the letters of the name according to the
  5990. # following equivalences:
  5991. #
  5992. #       a, e, h, i, o, u, w, y -> *
  5993. #       b, f, p, v             -> 1
  5994. #       c, g, j, k, q, s, x, z -> 2
  5995. #       d, t                   -> 3
  5996. #       l                      -> 4
  5997. #       m, n                   -> 5
  5998. #       r                      -> 6
  5999. #
  6000. #
  6001. # If any two adjacent letters have the same code, change the code for the
  6002. # second one to *.
  6003. #
  6004. # The Soundex representation consists of four characters: the initial letter
  6005. # of the name, and the first three digit (non-asterisk) codes corresponding
  6006. # to letters after the initial.  If there are fewer than three such digit
  6007. # codes, use all that there are, and add zeroes at the end to make up the
  6008. # four-character representation.
  6009. #
  6010. # This program reads in surnames from standard input, one to a line, and
  6011. # echoes them with their Soundex representations attached, in the following
  6012. # format:
  6013. #
  6014. # Stone                         S350
  6015. #
  6016. # Programmer: Exotic Programming Languages Study Group, Grinnell College.
  6017. # Original version: November 26, 1991.
  6018.  
  6019. procedure main()
  6020. local
  6021.     name
  6022.  
  6023.     while name := read() do
  6024.         write(name, repl(" ", 40 - *name), soundex(name))
  6025. end
  6026.  
  6027. procedure soundex(name)
  6028. local
  6029.     coded_name, new_name
  6030.  
  6031.     coded_name := encode(strip(name))
  6032.     new_name := name[1]
  6033.     every pos := 2 to *coded_name do {
  6034.         if coded_name[pos] ~== "*" then
  6035.             new_name := new_name || coded_name[pos]
  6036.         if *new_name = 4 then
  6037.             break
  6038.     }
  6039.     return new_name || repl ("0", 4 - *new_name)
  6040. end
  6041.  
  6042. procedure encode(name)
  6043.  
  6044.     name := map(name, &ucase, &lcase)
  6045.     name := map(name, "aehiouwybfpvcgjkqsxzdtlmnr",
  6046.         "********111122222222334556")
  6047.     every pos := *name to 2 by -1 do
  6048.         if name[pos - 1] == name[pos] then
  6049.             name[pos] := "*"
  6050.     return name
  6051. end
  6052.  
  6053. ------------------------------------------------------------------------------
  6054.         John David Stone - Lecturer in Computer Science and Philosophy
  6055.                 Manager of the Mathematics Local-Area Network
  6056.                 Grinnell College - Grinnell, Iowa 50112 - USA
  6057.           stone@math.grin.edu - (515) 269-3181 - stone@grin1.bitnet
  6058. ------------------------------------------------------------------------------
  6059.  
  6060.  
  6061. From stone@hilbert.math.grin.edu  Fri Mar 13 08:24:55 1992
  6062. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Fri, 13 Mar 92 08:24:55 MST
  6063. Received: from hilbert.math.grin.edu (HILBERT-GW.MATH.GRIN.EDU) by optima.cs.arizona.edu (4.1/15)
  6064.     id AA27079; Fri, 13 Mar 92 08:24:51 MST
  6065. Received: from russell.math.grin.edu by hilbert.math.grin.edu (4.1/Stone-5);
  6066.     id AA10645; Fri, 13 Mar 92 09:24:09 CST
  6067. Date: Fri, 13 Mar 92 09:24:09 CST
  6068. From: John David Stone <stone@hilbert.math.grin.edu>
  6069. Message-Id: <9203131524.AA10645@hilbert.math.grin.edu>
  6070. Received: by russell.math.grin.edu (4.1/Stone-2);
  6071.     id AA04092; Fri, 13 Mar 92 09:24:07 CST
  6072. To: icon-group@cs.arizona.edu
  6073. Subject: Missing procedure from Soundex algorithm
  6074.  
  6075.         I see I dropped one procedure from the Soundex algorithm I sent
  6076. earlier.  Here's the missing part:
  6077.  
  6078. -------------------------------------------------------------------------
  6079. procedure strip(name)
  6080. local
  6081.     result
  6082. static
  6083.     alphabet
  6084. initial alphabet := string(&letters)
  6085.  
  6086.     result := ""
  6087.     every ch := !name do
  6088.         if find(ch, alphabet) then
  6089.             result ||:= ch
  6090.     return result
  6091. end
  6092.  
  6093. ------------------------------------------------------------------------------
  6094.         John David Stone - Lecturer in Computer Science and Philosophy
  6095.                 Manager of the Mathematics Local-Area Network
  6096.                 Grinnell College - Grinnell, Iowa 50112 - USA
  6097.           stone@math.grin.edu - (515) 269-3181 - stone@grin1.bitnet
  6098. ------------------------------------------------------------------------------
  6099.  
  6100.  
  6101. From ralph  Fri Mar 13 16:33:16 1992
  6102. Date: Fri, 13 Mar 92 16:33:16 MST
  6103. From: "Ralph Griswold" <ralph>
  6104. Message-Id: <9203132333.AA05170@cheltenham.cs.arizona.edu>
  6105. Received: by cheltenham.cs.arizona.edu; Fri, 13 Mar 92 16:33:16 MST
  6106. To: icon-group
  6107. Subject: Icon electronic mail and news
  6108.  
  6109.  
  6110. Normally, e-mail to icon-group is passed on to comp.lang.icon newsgroup and
  6111. news posted to comp.lang.icon is passed on to the icon-group mailing list.
  6112.  
  6113. At present, however, it appears that news posted to comp.lang.icon is
  6114. not coming to icon-group.
  6115.  
  6116. We are looking into the problem.  But until it's solved, if you want your
  6117. postings to get to icon-group, send e-mail to icon-group@cs.arizona.edu
  6118. (or uunet!arizona!icon-group) rather than posting news to comp.lang.icon.
  6119.     
  6120.     Ralph Griswold / Department of Computer Science 
  6121.     The University of Arizona / Tucson, AZ 85721
  6122.     
  6123.     ralph@cs.arizona.edu / uunet!arizona!ralph
  6124.     
  6125.     voice: 602-621-6609 / fax: 602-621-9618
  6126.  
  6127. From goer@midway.uchicago.edu  Sat Mar 14 19:12:39 1992
  6128. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Sat, 14 Mar 92 19:12:39 MST
  6129. Received: from midway.uchicago.edu by optima.cs.arizona.edu (4.1/15)
  6130.     id AA01733; Sat, 14 Mar 92 19:12:34 MST
  6131. Received: from ellis.uchicago.edu by midway.uchicago.edu Sat, 14 Mar 92 20:12:32 CST
  6132. Date: Sat, 14 Mar 92 20:12:32 CST
  6133. From: "Richard L. Goerwitz" <goer@midway.uchicago.edu>
  6134. Message-Id: <9203150212.AA18731@midway.uchicago.edu>
  6135. To: icon-group@cs.arizona.edu
  6136. Subject: newer puzzle maker
  6137.  
  6138. I have received some requests for the latest version of the
  6139. puzzle making toy I posted a while back.  Seems sensible just
  6140. to post it at this point.
  6141.  
  6142. -Richard
  6143.  
  6144. ############################################################################
  6145. #
  6146. #    Name:     makepuzz.icn
  6147. #
  6148. #    Title:     find-the-word puzzle maker
  6149. #
  6150. #    Author:     Richard L. Goerwitz
  6151. #
  6152. #    Version: 1.18
  6153. #
  6154. ############################################################################
  6155. #
  6156. #     This program doesn't do anything fancy.  It simply takes a list
  6157. #  of words, and constructs out of them one of those square
  6158. #  find-the-word puzzles that some people like to bend their minds
  6159. #  over.  Usage is:
  6160. #
  6161. #      makepuzz [-f input-file] [-o output-file] [-h puzzle-height]
  6162. #         -w puzzle-width] [-t how-many-seconds-to-keep-trying]
  6163. #         [-r maximum-number-of-rejects] [-s] [-d]
  6164. #
  6165. #  where input-file is a file containing words, one to a line
  6166. #  (defaults to &input), and ouput-file is the file you would like the
  6167. #  puzzle written to (defaults to &output).  Puzzle-height and width
  6168. #  are the basic dimensions you want to try to fit your word game into
  6169. #  (default 20x20).  If the -s argument is present, makepuzz will
  6170. #  scramble its output, by putting random letters in all the blank
  6171. #  spaces.  The -t tells the computer when to give up, and construct
  6172. #  the puzzle (letting you know if any words didn't make it in).
  6173. #  Defaults to 60 (i.e. one minute).  The -r argument tells makepuzz to
  6174. #  run until it arrives at a solution with number-of-rejects or less
  6175. #  un-inserted words.  -d turns on certain diagnostic messages.
  6176. #
  6177. #      Most of these options can safely be ignored.  Just type
  6178. #  something like "makepuzz -f wordlist," where wordlist is a file
  6179. #  containing about sixty words, one word to a line.  Out will pop a
  6180. #  "word-find" puzzle.  Once you get the hang of what is going on,
  6181. #  try out the various options.
  6182. #
  6183. #      The algorithm used here is a combination of random insertions
  6184. #  and mindless, brute-force iterations through possible insertion
  6185. #  points and insertion directions.  If you don't like makepuzz's per-
  6186. #  formance on one run, run it again.  If your puzzle is large, try
  6187. #  increasing the timeout value (see -t above).
  6188. #
  6189. ############################################################################
  6190. #
  6191. #  Links: options, irandom, colmize
  6192. #  Requires:  An up-to-date IPL (2/10/92)
  6193. #
  6194. ############################################################################
  6195.  
  6196. link options, irandom, colmize
  6197. global height, width, _debug_
  6198.  
  6199. procedure main(a)
  6200.  
  6201.     local usage, opttbl, inputfile, outputfile, maxrejects, puzzle,
  6202.     wordlist, rejects, master_list, word, timeout, x, y, l_puzzle,
  6203.     l_wordlist, l_rejects, no_ltrs, l_no_ltrs, try
  6204.  
  6205.     # Filename is the only mandatory argument; they can come in any order.
  6206.     usage := "makepuzz [-f infile] [-o outfile] [-h height] [-w width] _
  6207.     [-t secs] [-r rejects] [-s]"
  6208.  
  6209.     # Set up puzzle height and width (default 20x20); set up defaults
  6210.     # such as the input & output files, time to spend, target reject
  6211.     # count, etc.
  6212.     opttbl := options(a, "w+h+f:o:t+sr+d") # stop(usage)
  6213.     width  := \opttbl["w"] | 20
  6214.     height := \opttbl["h"] | 20
  6215.     timeout := &time + (1000 * (\opttbl["t"] | 60))
  6216.     inputfile := open(\opttbl["f"], "r") | &input
  6217.     outputfile := open(\opttbl["o"], "w") | &output
  6218.     maxrejects := \opttbl["r"] | 0
  6219.     _debug_ := \opttbl["d"] & try := 0
  6220.  
  6221.     # Set random number seed.
  6222.     irandom()
  6223.  
  6224.     # Read, check, and sort word list hardest to easiest.
  6225.     master_list := list()
  6226.     every word := "" ~== trim(map(!inputfile)) do {
  6227.     upto(~(&lcase++&ucase), word) &
  6228.         stop("makepuzz:  non-letter found in ", word)
  6229.     write(&errout, "makepuzz:  warning, ",3 > *word,
  6230.           "-letter word (", word, ")")
  6231.     put(master_list, word)
  6232.     }
  6233.     master_list := sort_words(master_list)
  6234.     if \_debug_ then write(&errout, "makepuzz:  thinking...")
  6235.  
  6236.     # Now, try to insert the words in the master list into a puzzle.
  6237.     # Stop when the timeout limit is reached (see -t above).
  6238.     until &time > timeout do {
  6239.  
  6240.     wordlist := copy(master_list); rejects := list()
  6241.     puzzle := list(height); every !puzzle := list(width)
  6242.     blind_luck_insert(puzzle, wordlist, rejects)
  6243.     brute_force_insert(puzzle, wordlist, rejects, timeout)
  6244.  
  6245.     # Count the number of letters left over.
  6246.     no_ltrs := 0; every no_ltrs +:= *(!wordlist | !rejects)
  6247.     l_no_ltrs := 0; every l_no_ltrs +:= *(!\l_wordlist | !\l_rejects)
  6248.     # If our last best try at making a puzzle was worse...
  6249.     if /l_puzzle |
  6250.         (*\l_wordlist + *l_rejects) > (*wordlist + *rejects) |
  6251.         ((*\l_wordlist + *l_rejects) = (*wordlist + *rejects) &
  6252.          l_no_ltrs > no_ltrs)
  6253.     then {
  6254.         # ...then save the current (better) one.
  6255.         l_puzzle   := puzzle
  6256.         l_wordlist := wordlist
  6257.         l_rejects  := rejects
  6258.     }
  6259.  
  6260.     # Tell the user how we're doing.
  6261.     if \_debug_ then
  6262.         write(&errout, "makepuzz:  try number ", try +:= 1, "; ",
  6263.           *wordlist + *rejects, " rejects")
  6264.  
  6265.     # See the -r argument above.  Stop if we get to a number of
  6266.     # rejects deemed acceptable to the user.
  6267.     if (*\l_wordlist + *l_rejects) <= maxrejects then break
  6268.     }
  6269.  
  6270.     # Signal to user that we're done, and set puzzle, wordlist, and
  6271.     # rejects to their best values in this run of makepuzz.
  6272.     write(&errout, "makepuzz:  done")
  6273.     puzzle   := \l_puzzle
  6274.     wordlist := \l_wordlist
  6275.     rejects  := \l_rejects
  6276.  
  6277.     # Print out original word list, and list of words that didn't make
  6278.     # it into the puzzle.
  6279.     write(outputfile, "Original word list (sorted hardest-to-easiest): \n")
  6280.     every write(outputfile, colmize(master_list))
  6281.     write(outputfile, "")
  6282.     if *rejects + *wordlist > 0 then {
  6283.     write(outputfile, "Couldn't insert the following words: \n")
  6284.     every write(outputfile, colmize(wordlist ||| rejects))
  6285.     write(outputfile, "")
  6286.     }
  6287.  
  6288.     # Scramble (i.e. put in letters for remaining spaces) if the user
  6289.     # put -s on the command line.
  6290.     if \opttbl["s"] then {
  6291.     every y := !puzzle do
  6292.         every x := 1 to *y do
  6293.             /y[x] := ?&ucase
  6294.  
  6295.         # Print out puzzle structure (answers in lowercase).
  6296.     every y := !puzzle do {
  6297.         every x := !y do
  6298.         writes(outputfile, \x | " ", " ")
  6299.         write(outputfile, "")
  6300.     }
  6301.     write(outputfile, "")
  6302.     }
  6303.  
  6304.     # Print out puzzle structure, all lowercase.
  6305.     every y := !puzzle do {
  6306.     every x := !y do
  6307.         writes(outputfile, map(\x) | " ", " ")
  6308.         write(outputfile, "")
  6309.     }
  6310.  
  6311.     # Exit with default OK status for this system.
  6312.     every close(inputfile | outputfile)
  6313.     exit()
  6314.  
  6315. end
  6316.  
  6317.  
  6318. procedure sort_words(wordlist)
  6319.  
  6320.     local t, t2, word, sum, l
  6321.  
  6322.     # Obtain a rough character count.
  6323.     t := table(0)
  6324.     every t[!!wordlist] +:= 1
  6325.     t2 := table()
  6326.  
  6327.     # Obtain weighted values for each word, essentially giving longer
  6328.     # words and words with uncommon letters the highest values.  Later
  6329.     # we'll reverse the order (-> hardest-to-easiest), and return a list.
  6330.     every word := !wordlist do {
  6331.     "" == word & next
  6332.     sum := 0
  6333.     every sum +:= t[!word]
  6334.     insert(t2, word, (sum / *word) - (2 * *word))
  6335.     }
  6336.     t2 := sort(t2, 4)
  6337.     l := list()
  6338.  
  6339.     # Put the hardest words first.  These will get laid down when the
  6340.     # puzzle is relatively empty.  Save the small, easy words for last.
  6341.     every put(l, t2[1 to *t2-1 by 2])
  6342.     return l
  6343.  
  6344. end
  6345.  
  6346.  
  6347. procedure blind_luck_insert(puzzle, wordlist, rejects)
  6348.  
  6349.     local s, s2, s3, begy, begx, y, x, diry, dirx, diry2, dirx2, i
  6350.     # global height, width
  6351.  
  6352.     # Try using blind luck to make as many insertions as possible.
  6353.     while s := get(wordlist) do {
  6354.  
  6355.     # First try squares with letters already on them, but don't
  6356.     # try every direction yet (we're relying on luck just now).
  6357.     # Start at a random spot in the puzzle, and wrap around.
  6358.     begy := ?height; begx := ?width
  6359.     every y := (begy to height) | (1 to begy - 1) do {
  6360.         every x := (begx to width) | (1 to begx - 1) do  {
  6361.         every i := find(\puzzle[y][x], s) do {
  6362.             diry := ?3; dirx := ?3
  6363.             s2 := s[i:0]
  6364.             diry2 := 4 > (diry + 2) | 0 < (diry - 2) | 2
  6365.             dirx2 := 4 > (dirx + 2) | 0 < (dirx - 2) | 2
  6366.             s3 := reverse(s[1:i+1])
  6367.             if insert_word(puzzle, s2, diry, dirx, y, x) &
  6368.             insert_word(puzzle, s3, diry2, dirx2, y, x)
  6369.             then break { break break next }
  6370.         }
  6371.         }
  6372.     }
  6373.  
  6374.     # If the above didn't work, give up on spaces with characters
  6375.     # in them; use blank squares as well.
  6376.     every 1 to 512 do
  6377.         if insert_word(puzzle, s, ?3, ?3, ?height, ?width) then
  6378.            break next
  6379.     # If this word doesn't submit to easy insertion, save it for
  6380.     # later.
  6381.     put(rejects, s)
  6382.     }
  6383.  
  6384.     # Nothing useful to return (puzzle, wordlist, and rejects objects
  6385.     # are themselves modified; not copies of them).
  6386.     return
  6387.  
  6388. end
  6389.  
  6390.  
  6391. procedure brute_force_insert(puzzle, wordlist, rejects, timeout)
  6392.  
  6393.     local s, start, dirs, begy, begx, y, x
  6394.     
  6395.     # Use brute force on the remaining forms.
  6396.     if *rejects > 0 then {
  6397.     wordlist |||:= rejects; rejects := []
  6398.     while s := pop(wordlist) do {
  6399.         start := ?3; dirs := ""
  6400.         every dirs ||:= ((start to 3) | (1 to start-1))
  6401.         begy := ?height; begx := ?width
  6402.         every y := (begy to height) | (1 to begy - 1) do {
  6403.         if &time > timeout then fail
  6404.         every x := (begx to width) | (1 to begx - 1) do  {
  6405.             if insert_word(puzzle, s, !dirs, !dirs, y, x) then
  6406.             break { break next }
  6407.         }
  6408.         }
  6409.         # If we can't find a place for s, put it in the rejects list.
  6410.         put(rejects, s)
  6411.     }
  6412.     }
  6413.  
  6414.     # Nothing useful to return (puzzle, wordlist, and rejects objects
  6415.     # are themselves modified; not copies of them).
  6416.     return
  6417.  
  6418. end
  6419.  
  6420.  
  6421. procedure insert_word(puzzle, s, ydir, xdir, y, x)
  6422.  
  6423.     local incry, incrx, firstchar
  6424.  
  6425.     # If s is zero length, we've matched it in it's entirety!
  6426.     if *s = 0 then {
  6427.     return
  6428.  
  6429.     } else {
  6430.  
  6431.     # Make sure there's enough space in the puzzle in the direction
  6432.     # we're headed.
  6433.     case ydir of {
  6434.         "3":  if (height - y) < (*s - 1) then fail
  6435.         "1":  if y < (*s - 1) then fail
  6436.     }
  6437.     case xdir of {
  6438.         "3":  if (width - x) < (*s - 1) then fail
  6439.         "1":  if x < (*s - 1) then fail
  6440.     }
  6441.  
  6442.     # Check to be sure everything's in range, and that both the x and
  6443.     # y increments aren't zero (in which case, we aren't headed in any
  6444.     # direction at all...).
  6445.     incry := (ydir - 2); incrx := (xdir - 2)
  6446.     if incry = 0 & incrx = 0 then fail
  6447.     height >= y >= 1 | fail
  6448.     width >= x >= 1 | fail
  6449.  
  6450.     # Try laying the first char in s down at puzzle[y][x].  If it
  6451.     # works, head off in some direction, and try laying down the rest
  6452.     # of s along that vector.  If at any point we fail, we must
  6453.     # reverse the assignment (<- below).
  6454.     firstchar := !s
  6455.     ((/puzzle[y][x] <- firstchar) | (\puzzle[y][x] == firstchar)) &
  6456.         insert_word(puzzle, s[2:0], ydir, xdir, y + incry, x + incrx) &
  6457.         suspend
  6458.     fail
  6459.     }
  6460.  
  6461. end
  6462.  
  6463. From @castle.edinburgh.ac.uk,@emas-a.edinburgh.ac.uk:R.J.Hare@edinburgh.ac.uk  Thu Mar 19 19:20:50 1992
  6464. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Thu, 19 Mar 92 19:20:50 MST
  6465. Received: from  by optima.cs.arizona.edu (4.1/15)
  6466.     id AB12498; Thu, 19 Mar 92 19:20:39 MST
  6467. Received: from castle.edinburgh.ac.uk by sun2.nsfnet-relay.ac.uk via JANET 
  6468.           with NIFTP id <10992-0@sun2.nsfnet-relay.ac.uk>;
  6469.           Wed, 18 Mar 1992 17:01:28 +0000
  6470. Received: from emas-a.ed.ac.uk by castle.ed.ac.uk id aa16668;
  6471.           18 Mar 92 16:58 WET
  6472. Date: 18 Mar 92 16:58:56 gmt
  6473. From: R.J.Hare@edinburgh.ac.uk
  6474. Subject: Matchhing of place names
  6475. To: icon-group@cs.arizona.edu
  6476. Message-Id: <18 Mar 92 16:58:56 gmt 320503@EMAS-A>
  6477. Sender: "R.J.Hare" <@emas-a.edinburgh.ac.uk:R.J.Hare@edinburgh.ac.uk>
  6478.  
  6479. I'm writing a program to extract map number and grid references from a
  6480. gazeteer of place names. I want to allow for 'mis-spellings' on entering the
  6481. place names. I am currently trying soundex as a 'fuzzy' matching procedure for
  6482. this, but it is not working well, for example, 'Milhill' (a misspelling of
  6483. Millhill) is turning up only 'Millwell' when doing a soundex match.
  6484.  
  6485. Is anyone out there aware of any more sophisticated methods of doing this sort
  6486. of thing?
  6487.  
  6488. Thanks.
  6489.  
  6490. Roger Hare.
  6491.  
  6492. From icon-group-request  Thu Mar 19 19:49:18 1992
  6493. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Thu, 19 Mar 92 19:49:18 MST
  6494. Received: from ucbvax.Berkeley.EDU by optima.cs.arizona.edu (4.1/15)
  6495.     id AA13569; Thu, 19 Mar 92 19:49:16 MST
  6496. Received: by ucbvax.Berkeley.EDU (5.63/1.43)
  6497.     id AA27989; Thu, 19 Mar 92 18:41:50 -0800
  6498. Received: from USENET by ucbvax.Berkeley.EDU with netnews
  6499.     for icon-group@cs.arizona.edu (icon-group@cs.arizona.edu)
  6500.     (contact usenet@ucbvax.Berkeley.EDU if you have questions)
  6501. Date: 11 Mar 92 07:41:35 GMT
  6502. From: att!linac!uchinews!ellis!goer@ucbvax.berkeley.edu  (Richard L. Goerwitz)
  6503. Organization: University of Chicago Computing Organizations
  6504. Subject: Re: puzzle maker #3
  6505. Message-Id: <1992Mar11.074135.3834@midway.uchicago.edu>
  6506. References: <1992Mar3.225850.28211@midway.uchicago.edu>
  6507. Sender: icon-group-request@cs.arizona.edu
  6508. To: icon-group@cs.arizona.edu
  6509.  
  6510. Did anyone notice the two minor, but annoying bugs in puzzle maker
  6511. #3 (posted a week or so ago)?  If you noticed them, you get a cigar.
  6512. The first is that some words occasionally got inserted l
  6513.                                                           i
  6514.                                                              k
  6515.                                                                 e
  6516. that, instead of l
  6517.                    i
  6518.                      k
  6519.                        e that.  The other prevented certain attempts
  6520. at creating intersecting words from working properly, and under certain
  6521. rare circumstances brought about the formation of unusual sequences
  6522. like "tortract" (from "tractor").
  6523.  
  6524. Sorry about these bugs.  They are fixed in the most recent puzzle-maker
  6525. version.  If anyone wants this version, please contact me directly.
  6526. My son's diligence in uncovering obscure bugs is what drives the re-
  6527. vision process onward....
  6528.  
  6529. -- 
  6530.  
  6531.    -Richard L. Goerwitz              goer%sophist@uchicago.bitnet
  6532.    goer@sophist.uchicago.edu         rutgers!oddjob!gide!sophist!goer
  6533.  
  6534. From TENAGLIA@mis.mcw.edu  Fri Mar 20 05:07:28 1992
  6535. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Fri, 20 Mar 92 05:07:28 MST
  6536. Received: from ADM.MIS.MCW.EDU ([141.106.64.10]) by optima.cs.arizona.edu (4.1/15)
  6537.     id AA02759; Fri, 20 Mar 92 05:07:24 MST
  6538. Received: from mis.mcw.edu by mis.mcw.edu (PMDF #12865) id
  6539.  <01GHUV8YC7Z4BDJEEP@mis.mcw.edu>; Fri, 20 Mar 1992 06:08 CST
  6540. Date: Fri, 20 Mar 1992 06:08 CST
  6541. From: Chris Tenaglia - 257-8765 <TENAGLIA@mis.mcw.edu>
  6542. Subject: Re: Matchhing of place names
  6543. To: R.J.Hare@edinburgh.ac.uk
  6544. Cc: icon-group@cs.arizona.edu
  6545. Message-Id: <01GHUV8YC7Z4BDJEEP@mis.mcw.edu>
  6546. X-Organization: Medical College of Wisconsin (Milwaukee, WI)
  6547. X-Vms-To: IN%"R.J.Hare@edinburgh.ac.uk"
  6548. X-Vms-Cc: IN%"icon-group@cs.arizona.edu"
  6549.  
  6550. > From:    IN%"R.J.Hare@edinburgh.ac.uk" 19-MAR-1992 20:28:57.50
  6551. > To:    IN%"icon-group@cs.arizona.edu"
  6552. > Subj:    Matchhing of place names
  6553.  
  6554. > I'm writing a program to extract map number and grid references from a
  6555. > gazeteer of place names. I want to allow for 'mis-spellings' on entering the
  6556. > place names. I am currently trying soundex as a 'fuzzy' matching procedure for
  6557. > this, but it is not working well, for example, 'Milhill' (a misspelling of
  6558. > Millhill) is turning up only 'Millwell' when doing a soundex match.
  6559.  
  6560. > Is anyone out there aware of any more sophisticated methods of doing this sort
  6561. > of thing?
  6562. > Thanks.
  6563. > Roger Hare.
  6564.  
  6565. It almost sounds like a spell checker. If you could redirect the dictionary
  6566. to point to your place table with some kind of spell check software. Well
  6567. that may or may not be possible.
  6568.  
  6569. I wrote I spelling test program for my daughter, that tries to guess which
  6570. word was wrong. It works as long as the misspelling isn't too lexically
  6571. different and the list of words aren't too lexically similar. Again, this
  6572. might not be appropriate to your goals. I am including it, as it might give
  6573. you other ideas. Good luck!
  6574.  
  6575. Chris Tenaglia (System Manager) |  "The past explained,     
  6576. Medical College of Wisconsin    |   the future fortold, 
  6577. 8701 W. Watertown Plank Rd.     |   the present largely appologized for."
  6578. Milwaukee, WI 53226             |   Organon to The Doctor
  6579. (414)257-8765                   |     
  6580. tenaglia@mis.mcw.edu
  6581.  
  6582. #
  6583. # SPELLTEST.ICN          11/26/90          BY TENAGLIA
  6584. #
  6585. # THIS SIMPLE PROGRAM ADMINISTERS A SPELLING TEST. THE WORDS SHOULD BE LISTED
  6586. # ONE PER LINE IN AN ANSWER FILE. THE TEACHER CAN ISSUE THE WORDS IN ANY ORDER
  6587. # AS THE TRIES AND ANSWERS ARE FINALY SORTED AND COMPARED IN PARALLEL. THIS
  6588. # SORT OF IMPLIES THAT THE WORDS SHOULD NOT BE TOO LEXICALLY ALIKE. THE GOOF
  6589. # UPS AND SCORES ARE OUTPUT AT THE END OF THE TEST. THE ANSWER FILE IS PIPED
  6590. # INTO STDIN. USAGE : ICONX SPELLTEST <ANSWERS
  6591. #
  6592. global tty
  6593. procedure main()
  6594.  
  6595.   answers := []          # THE CORRECT WORDS LOADED HERE
  6596.   words   := []          # THE STUDENTS TRIES STORED HERE
  6597.   tally   := table(0)    # SCORE KEEPER
  6598.   tty     := open("tt:","b")
  6599. #
  6600. # INITIAL DIALOG
  6601. #
  6602.   write("\e[2J\e[H\e#3Spelling Test")  
  6603.   write("\e#4Spelling Test")
  6604.   write("\nLoading spelling words...")
  6605.   while put(answers,map(read()))
  6606.   write("Spelling words loaded. Commencing test. ",*answers," problems.\n")
  6607.  
  6608. #
  6609. # ADMINISTER THE TEST
  6610. #
  6611.   every i := 1 to *answers do
  6612.     put(words,map(input("\e#6" || i || ". ")))
  6613.  
  6614. #
  6615. # SORT FOR CORRECTING
  6616. #
  6617.   first  := sort(answers)
  6618.   second := sort(words)
  6619.  
  6620. #
  6621. # CORRECT THE RESULTS
  6622. #
  6623.   every i := 1 to *first do
  6624.     {
  6625.     result := if first[i] == second[i] then "correct" else "incorrect"
  6626.     tally[result] +:= 1
  6627.     (first[i] == second[i]) | write("\e[1;5m",second[i],"\e[m is wrong. It should have been spelled \e[1;5m",first[i],"\e[m")
  6628.     }
  6629.  
  6630. #
  6631. # SUMMARY OF PERFORMANCE
  6632. #
  6633.   write("\n",tally["incorrect"]," were incorrect.")
  6634.   write(tally["correct"]," were correct out of ",*answers," words.")
  6635.   write("Final score is ",tally["correct"]*100/(*answers),"%.")
  6636.   end
  6637.  
  6638. #
  6639. # THIS PROCEDURE TAKES A PROMPTED STRING INPUT
  6640. #
  6641. procedure input(prompt)
  6642.   writes(prompt)
  6643.   return read(tty)
  6644.   end
  6645.  
  6646.  
  6647.  
  6648. From cargo@cherry.cray.com  Fri Mar 20 13:12:51 1992
  6649. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Fri, 20 Mar 92 13:12:51 MST
  6650. Received: from timbuk.cray.com by optima.cs.arizona.edu (4.1/15)
  6651.     id AA22598; Fri, 20 Mar 92 13:12:42 MST
  6652. Received: from cherry04.cray.com by timbuk.cray.com (4.1/CRI-MX 1.6ac)
  6653.     id AA01991; Fri, 20 Mar 92 14:12:38 CST
  6654. Received: by cherry04.cray.com
  6655.     id AA07859; 4.1/CRI-5.6; Fri, 20 Mar 92 14:12:37 CST
  6656. Date: Fri, 20 Mar 92 14:12:37 CST
  6657. From: cargo@cherry.cray.com (David S. Cargo)
  6658. Message-Id: <9203202012.AA07859@cherry04.cray.com>
  6659. To: icon-group@cs.arizona.edu
  6660. Subject: Recognizer Generator
  6661.  
  6662. The February issue of the Icon Analyst had a good, in-depth article
  6663. about a recognizer generator.  The last couple of paragraphs in the
  6664. article said, "Having posed these problems, we'll now have to solve
  6665. them ourselves.  The result may be in the Icon program library before
  6666. this issue of the Analyst is published."
  6667.  
  6668. I've looked through the library and not found a sign of the original
  6669. program, much less the one that solves the problems mentioned in
  6670. the article.  Anybody know if such a program (or even the original)
  6671. is forthcoming?          o       o
  6672. cargo@escargot.cray.com  \_____/
  6673. (612) 683-5591           /=O=O=\     _______
  6674. DDDD      SSSS   CCCC   /   ^   \   /\\\\\\\\
  6675. D   D    S      C       \ \___/ /  /\   ___  \
  6676. D   D     SSS   C        \_ V _/  /\   /\\\\  \
  6677. D   D        S  C          \  \__/\   /\ @_/  /
  6678. DDDDavid SSSS.   CCCCargo   \____\____\______/
  6679.  
  6680. From wgg@cs.ucsd.edu  Fri Mar 20 17:48:46 1992
  6681. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Fri, 20 Mar 92 17:48:46 MST
  6682. Received: from ucsd.edu by optima.cs.arizona.edu (4.1/15)
  6683.     id AA18306; Fri, 20 Mar 92 17:48:43 MST
  6684. Received: from odin.ucsd.edu by ucsd.edu; id AA28325
  6685.     sendmail 5.64/UCSD-2.2-sun via SMTP
  6686.     Fri, 20 Mar 92 16:48:31 -0800 for icon-group@cs.arizona.edu
  6687. Received: from gremlin.ucsd.edu by odin.ucsd.edu (4.1/UCSDPSEUDO.4)
  6688.     id AA23150 for icon-group@cs.arizona.edu; Fri, 20 Mar 92 16:48:30 PST
  6689. Received: by gremlin.ucsd.edu (4.1/UCSDPSEUDO.4)
  6690.     id AA10028 for icon-group@cs.arizona.edu; Fri, 20 Mar 92 16:48:29 PST
  6691. Date: Fri, 20 Mar 92 16:48:29 PST
  6692. From: wgg@cs.ucsd.edu (William Griswold)
  6693. Message-Id: <9203210048.AA10028@gremlin.ucsd.edu>
  6694. To: icon-group@cs.arizona.edu
  6695. Subject: converting troff bib information to bibtex (and vv)
  6696.  
  6697. Any of you consummate Icon programs out there have a program for converting
  6698. from the troff bib format to latex's bibtex format, or vice versa?
  6699.  
  6700. Thanks.
  6701.  
  6702.                         bill
  6703.  
  6704. From icon-group-request  Sat Mar 21 09:44:08 1992
  6705. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Sat, 21 Mar 92 09:44:08 MST
  6706. Received: from ucbvax.Berkeley.EDU by optima.cs.arizona.edu (4.1/15)
  6707.     id AA16774; Sat, 21 Mar 92 09:44:06 MST
  6708. Received: by ucbvax.Berkeley.EDU (5.63/1.43)
  6709.     id AA04848; Sat, 21 Mar 92 08:41:29 -0800
  6710. Received: from USENET by ucbvax.Berkeley.EDU with netnews
  6711.     for icon-group@cs.arizona.edu (icon-group@cs.arizona.edu)
  6712.     (contact usenet@ucbvax.Berkeley.EDU if you have questions)
  6713. Date: 20 Mar 92 02:32:58 GMT
  6714. From: rudy.rutgers.edu!pilot.njin.net!gajarsky@rutgers.edu  (Bob Gajarsky)
  6715. Organization: Somewhere in Hoboken
  6716. Subject: SURVEY:Please read, for scholastic purposes.
  6717. Message-Id: <Mar.19.21.32.58.1992.7407@pilot.njin.net>
  6718. Sender: icon-group-request@cs.arizona.edu
  6719. To: icon-group@cs.arizona.edu
  6720.  
  6721.  
  6722.     Please note this message is being crossposted to a large number
  6723. of groups.  I am sorry for any inconvenience, but there are members of
  6724. many newsgroups that I wish to reach , and this is the only way that
  6725. I can accomplish this.  Thank you for your understanding.
  6726.  
  6727. =========================================================================
  6728.  
  6729.     My name is Bob Gajarsky.  I am a graduate level management student, 
  6730. and am conducting a survey for one of my classes.  It would greatly help my 
  6731. studies if you could take a few minutes and complete the following survey.  
  6732. All results will be kept completely confidential, and your e-mail addresses 
  6733. will not be seen by anyone but me.
  6734.     
  6735.     Also, I am only looking for complete surveys from people who are
  6736. actually out in the workplace as computer programmers, as opposed to those 
  6737. (like me) who are students.  Additionally, I would request that only people 
  6738. who work in the United States reply to this.  Thank you in advance for your 
  6739. responses.
  6740.  
  6741. --------------------------- BEGINNING OF SURVEY -----------------------------
  6742.  
  6743. What city is your place of work?    -
  6744. (OPTIONAL) What company do you work at?    -
  6745.  
  6746. How many years of programming experience do you have?
  6747.  
  6748. How many years of post-high school education have you had?
  6749.     
  6750. How many computer languages do you know?
  6751.     If you program in any of the following languages, please check it:
  6752.  
  6753.     Ada        APL        Cobol
  6754.     C        C++        Fortran
  6755.     Lisp        Pascal
  6756.  
  6757. How many software packages do you know how to use (ie. Lotus, MS-Works, etc.)
  6758.  
  6759.     1-2        3-5        6-8
  6760.     9-10        over 10
  6761.  
  6762. Do you know any databases? (Y/N)
  6763.     If so, which ones?
  6764.  
  6765. On the average, how many hours does it take you to learn a application (ie. 
  6766.     Word Processor, Graphics Package, etc.)?
  6767.     
  6768. How do you prefer to learn new applications?  More than one may be checked:
  6769.     Tutorials
  6770.     Videos
  6771.     Self-Instruction
  6772.     Other  _________________________
  6773.  
  6774. Do you personally have a VCR? (Y/N)
  6775.  
  6776. Does your workplace have a VCR? (Y/N)
  6777.  
  6778. Have you ever used a video to learn an application before? (Y/N)
  6779.     If so, how would you rate it?
  6780.     (10 is an excellent experience, 1 is an awful experience)
  6781.     Based on your past experiences, would you be receptive to learning
  6782.         another application via video?
  6783.         (10 is very receptive; 1 is not receptive at all)
  6784.  
  6785.     If not, how receptive would you be to learning a application via video?
  6786.         (10 is very receptive; 1 is not receptive at all)
  6787.  
  6788. How many hours of video would you be able to successfully watch for
  6789.     a specific application?
  6790.  
  6791. How much would you or your company pay for the following:
  6792.     A) A 15 hour video that teaches how to generally work with databases,
  6793.         program in them, and utilize them.  (Between 40$ and 150$)
  6794.     B) A 3 hour video that teaches a specific database, (Oracle, etc.)
  6795.         (Between 15$ and 75$).
  6796.     C) A packaged of both (A) and (B).
  6797.         (Between 50$ and 225$).
  6798.  
  6799. Which systems do you have a familiarity with?
  6800.     VAX/VMS        UNIX
  6801.     Macintosh    IBM Compatible
  6802.     Other
  6803.  
  6804. -------------------   END OF SURVEY ---------------------------------
  6805.  
  6806. Thanks! - Bob Gajarsky
  6807.  
  6808. From kohl@socrates.umd.edu  Thu Mar 26 09:33:02 1992
  6809. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Thu, 26 Mar 92 09:33:02 MST
  6810. Message-Id: <9203261632.AA05499@optima.cs.arizona.edu>
  6811. Received: from socrates.umd.edu by optima.cs.arizona.edu (4.1/15)
  6812.     id AA05499; Thu, 26 Mar 92 09:32:58 MST
  6813. Received: by socrates.umd.edu
  6814.     (16.6/16.2) id AA02735; Thu, 26 Mar 92 11:31:33 -0500
  6815. From: John Kohl <kohl@socrates.umd.edu>
  6816. Subject: Windows 3.0
  6817. To: icon-group@cs.arizona.edu
  6818. Date: Thu, 26 Mar 92 11:31:31 EST
  6819. X-Mailer: ELM [version 2.3 PL11]
  6820.  
  6821.  
  6822. A friend of mine is developing a game under Windows 3.0 using
  6823. Microsoft's QuickC.  We would like to use Icon for prototyping
  6824. the computer playing the game.
  6825.  
  6826. Icon is capable of calling and being called by C.  (I haven't
  6827. tried this yet.)  Understandably, Icon hasn't been ported to
  6828. Windows 3.0.  With XIcon there is no serious reason to port.
  6829.  
  6830. Is there a way to have to have a QuickC Windows 3 program invoke
  6831. MS-DOS Icon as a subprogram?  If so, how.
  6832.  
  6833.         Thanks,
  6834.  
  6835.         John Kohl
  6836.  
  6837.         kohl@socrates.umd.edu
  6838.  
  6839.  
  6840. From cjeffery  Thu Mar 26 11:40:15 1992
  6841. Received: from chuckwalla.cs.arizona.edu by cheltenham.cs.arizona.edu; Thu, 26 Mar 92 11:40:15 MST
  6842. Date: Thu, 26 Mar 92 11:40:13 MST
  6843. From: "Clinton Jeffery" <cjeffery>
  6844. Message-Id: <9203261840.AA15783@chuckwalla.cs.arizona.edu>
  6845. Received: by chuckwalla.cs.arizona.edu; Thu, 26 Mar 92 11:40:13 MST
  6846. To: kohl@socrates.umd.edu
  6847. Cc: icon-group@cs.arizona.edu
  6848. In-Reply-To: John Kohl's message of Thu, 26 Mar 92 11:31:31 EST <9203261632.AA05499@optima.cs.arizona.edu>
  6849. Subject: Windows 3.0
  6850.  
  6851.    John Kohl, kohl@socrates.umd.edu, writes:
  6852.    > Understandably, Icon hasn't been ported to Windows 3.0.
  6853.    > With XIcon there is no serious reason to port.
  6854.  
  6855. Well, there are "good" reasons to port to Windows 3.0, Macintosh, Amiga, etc.
  6856. Icon runs on all these machines, but can't access the graphics and mouse
  6857. capabilities on them.  Unfortunately, this is not a matter of research.
  6858.  
  6859. It is up to commercial implementors or dedicated users of each particular
  6860. window system to add graphics access to Icon.  X-Icon proves such a task
  6861. can be done, but does not purport to be "complete" and implementors on
  6862. other window systems are likely to add system-specific features.  I am
  6863. always interested in talking to people doing graphics access for Icon.
  6864.  
  6865. Clint Jeffery
  6866.  
  6867. From icon-group-request  Sat Mar 28 22:05:59 1992
  6868. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Sat, 28 Mar 92 22:05:59 MST
  6869. Received: from ucbvax.Berkeley.EDU by optima.cs.arizona.edu (4.1/15)
  6870.     id AA21623; Sat, 28 Mar 92 22:05:55 MST
  6871. Received: by ucbvax.Berkeley.EDU (5.63/1.43)
  6872.     id AA24267; Sat, 28 Mar 92 21:03:09 -0800
  6873. Received: from USENET by ucbvax.Berkeley.EDU with netnews
  6874.     for icon-group@cs.arizona.edu (icon-group@cs.arizona.edu)
  6875.     (contact usenet@ucbvax.Berkeley.EDU if you have questions)
  6876. Date: 24 Mar 92 11:06:46 GMT
  6877. From: mcsun!uknet!pcl!hcvec@uunet.uu.net  (John Ditrolio)
  6878. Organization: Polytechnic of Central London
  6879. Subject: Tree Implementation
  6880. Message-Id: <1992Mar24.110646.896@sun.pcl.ac.uk>
  6881. Sender: icon-group-request@cs.arizona.edu
  6882. To: icon-group@cs.arizona.edu
  6883.  
  6884. To whoever can help, 
  6885.  
  6886. I am trying to write a grammar checking program and I am intendingto set up a
  6887. dictionary file with corresponding tokens for each word. 
  6888.  
  6889. Can anyone tell me what is the most efficient way of handling the large amount
  6890. of data? I could possibly pull the contents of a dictionary file into a tree
  6891. structure of some sort (maybe records) which I will need to access
  6892. continuously. 
  6893.  
  6894. I've looked in the Icon "bible" (Icon Programming Language Manual) and I cannot
  6895. see how I can implement a binary tree structure similar to that in C.
  6896.  
  6897. Please can someone help ????
  6898.  
  6899. I am relatively new to Icon and so beg forgiveness for my stupidity.
  6900.  
  6901.  
  6902.  
  6903.  
  6904. John Ditrolio.
  6905.  
  6906. From janpeter@mpi.kun.nl  Sun Mar 29 07:20:04 1992
  6907. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Sun, 29 Mar 92 07:20:04 MST
  6908. Received: from wn1.sci.kun.nl by optima.cs.arizona.edu (4.1/15)
  6909.     id AA06924; Sun, 29 Mar 92 07:19:58 MST
  6910. Received: by wn1.sci.kun.nl (5.57/2.1) on NUNET
  6911.      id AA10682; Sun, 29 Mar 92 16:20:50 +0200
  6912. Received: by mpix10.mpi.kun.nl (5.57/2.0) on NUNET
  6913.      id AA03440; Sun, 29 Mar 92 16:18:53 +0200
  6914. Date: Sun, 29 Mar 92 16:18:53 +0200
  6915. From: Jan Peter de Ruiter <janpeter@mpi.kun.nl>
  6916. Message-Id: <9203291418.AA03440@mpix10.mpi.kun.nl>
  6917. To: icon-group@cs.arizona.edu, mcsun!uknet!pcl!hcvec@uunet.uu.net
  6918. Subject: Re:  Tree Implementation
  6919.  
  6920. Hi,
  6921.  
  6922. I'm new to the ICON group as well, but I think I might have a useful
  6923. suggestion for the representation of a lexicon (the problem that John
  6924. Ditrolio has in his parser).
  6925.  
  6926. The problem he stated has not much to do with computer languages, but
  6927. with representation techniques in general. Once a useful representation
  6928. is decided upon, implementing it in ICON will probably be not very hard,
  6929. given the tremendous flexibility of ICON data structures.
  6930.  
  6931. One of the most efficient techniques for "lexical lookup" is the use of the
  6932. so called "TRIE" data structure [Fredkin, 1960]. I'll give a reference
  6933. below, but the basic idea is the following:
  6934.  
  6935. Suppose (for simplicity) that we want to store the items "apple", "ape",
  6936. "an" and "bee". The trie then looks like this:
  6937.  
  6938.                         [ROOT]
  6939.                         /    \
  6940.                       [a]     [b]
  6941.                     /    \       \
  6942.                   [p]    [n]*     [e]
  6943.                 /    \              \
  6944.              [p]     [e]*           [e]*
  6945.             /
  6946.           [l]
  6947.          /
  6948.        [e]*
  6949.  
  6950. The algorithm to build and search a TRIE is not very complicated, so
  6951. I won't waste space and time on that. I use this representation for
  6952. fast lookup in large lexical databases, but i've written that program
  6953. in C. If any one of you has an implementation of 'TRIES' in ICON, I
  6954. would be interested!.
  6955.  
  6956. REFERENCE: Fredkin, E.H. 1960. Trie memory, CACM 3:9 (sept), 490-500.
  6957.  
  6958. Jan Peter de Ruiter
  6959. Netherlands (Europe)
  6960. email: janpeter@mpi.kun.nl
  6961.  
  6962.  
  6963.  
  6964. From janpeter@mpi.kun.nl  Sun Mar 29 11:13:33 1992
  6965. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Sun, 29 Mar 92 11:13:33 MST
  6966. Received: from wn1.sci.kun.nl by optima.cs.arizona.edu (4.1/15)
  6967.     id AA12070; Sun, 29 Mar 92 11:13:28 MST
  6968. Received: by wn1.sci.kun.nl (5.57/2.1) on NUNET
  6969.      id AA11456; Sun, 29 Mar 92 20:14:21 +0200
  6970. Received: by mpix10.mpi.kun.nl (5.57/2.0) on NUNET
  6971.      id AA03709; Sun, 29 Mar 92 20:12:24 +0200
  6972. Date: Sun, 29 Mar 92 20:12:24 +0200
  6973. From: Jan Peter de Ruiter <janpeter@mpi.kun.nl>
  6974. Message-Id: <9203291812.AA03709@mpix10.mpi.kun.nl>
  6975. To: icon-group@cs.arizona.edu
  6976. Subject: RE: tree implementation.
  6977.  
  6978. Hi,
  6979.  
  6980. I'm new to the ICON group as well, but I think I might have a useful
  6981. suggestion for the representation of a lexicon (the problem that John
  6982. Ditrolio has in his parser).
  6983.  
  6984. The problem he stated has not much to do with computer languages, but
  6985. with representation techniques in general. Once a useful representation
  6986. is decided upon, implementing it in ICON will probably be not very hard,
  6987. given the tremendous flexibility of ICON data structures.
  6988.  
  6989. In chapter 15 of the "Bible" (second edition) a very clear explanation
  6990. can be found on how to implement trees in ICON.
  6991.  
  6992. One of the most efficient techniques for "lexical lookup" is the use of the
  6993. so called "TRIE" data structure [Fredkin, 1960]. I'll give a reference
  6994. below, but the basic idea is the following:
  6995.  
  6996. Suppose (for simplicity) that we want to store the items "apple", "ape",
  6997. "an" and "bee". The trie then looks like this:
  6998.  
  6999.                         [ROOT]
  7000.                         /    \
  7001.                       [a]     [b]
  7002.                     /    \       \
  7003.                   [p]    [n]*     [e]
  7004.                 /    \              \
  7005.              [p]     [e]*           [e]*
  7006.             /
  7007.           [l]
  7008.          /
  7009.        [e]*
  7010.  
  7011. One can also choose to explicitly store whole items at the 'leaves'
  7012. instead of a marker (like '*') but that is wasting storage.
  7013.  
  7014. The algorithm to build and search a TRIE is not very complicated, so
  7015. I won't waste space and time on that. I use this representation for
  7016. fast lookup in large lexical databases, but I've written that program
  7017. in C. If any one of you has an implementation of 'TRIES' in ICON, I
  7018. would be interested!.
  7019.  
  7020. REFERENCE: Fredkin, E.H. 1960. Trie memory, CACM 3:9 (sept), 490-500.
  7021.  
  7022. Jan Peter de Ruiter
  7023. Netherlands (Europe)
  7024. email: janpeter@mpi.kun.nl
  7025.  
  7026.  
  7027.  
  7028. From gmt  Sun Mar 29 18:22:10 1992
  7029. Received: from owl.cs.arizona.edu by cheltenham.cs.arizona.edu; Sun, 29 Mar 92 18:22:10 MST
  7030. Date: Sun, 29 Mar 92 18:22:14 MST
  7031. From: "Gregg Townsend" <gmt>
  7032. Message-Id: <9203300122.AA01012@owl.cs.arizona.edu>
  7033. Received: by owl.cs.arizona.edu; Sun, 29 Mar 92 18:22:14 MST
  7034. To: icon-group@cs.arizona.edu, mcsun!uknet!pcl!hcvec@uunet.uu.net
  7035. Subject: Re:  Tree Implementation
  7036.  
  7037. I think some people can't see the forest for the trees (groan).  While you
  7038. can certainly implement tree structures in Icon, the original question asked
  7039. for the best way to hold a dictionary for use in a grammar checking program.
  7040. For that, a table indexed by words is the obvious solution.  Internally,
  7041. it's implemented efficiently by a hash table.
  7042.  
  7043.     Gregg Townsend / Computer Science Dept / Univ of Arizona / Tucson, AZ 85721
  7044.     +1 602 621 4325     gmt@cs.arizona.edu     110 57 16 W / 32 13 45 N / +758m
  7045.  
  7046. From icon-group-request  Tue Mar 31 01:01:04 1992
  7047. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Tue, 31 Mar 92 01:01:04 MST
  7048. Received: from ucbvax.Berkeley.EDU by optima.cs.arizona.edu (4.1/15)
  7049.     id AA07738; Tue, 31 Mar 92 01:01:01 MST
  7050. Received: by ucbvax.Berkeley.EDU (5.63/1.43)
  7051.     id AA13393; Mon, 30 Mar 92 23:45:44 -0800
  7052. Received: from USENET by ucbvax.Berkeley.EDU with netnews
  7053.     for icon-group@cs.arizona.edu (icon-group@cs.arizona.edu)
  7054.     (contact usenet@ucbvax.Berkeley.EDU if you have questions)
  7055. Date: 30 Mar 92 15:45:57 GMT
  7056. From: mcsun!unido!infbssys!neitzel@uunet.uu.net  (Martin Neitzel)
  7057. Organization: Inst. f. Informatik, TU Braunschweig, FRG
  7058. Subject: old startup header in icode files
  7059. Message-Id: <1992Mar30.154557.6906@ips.cs.tu-bs.de>
  7060. Sender: icon-group-request@cs.arizona.edu
  7061. To: icon-group@cs.arizona.edu
  7062.  
  7063. I just installed Icon (v8) on a second architecture at our site.
  7064. Which made me ask myself:  Would icode files with old v7-style headers
  7065. give me architecure independent executables?
  7066.  
  7067. (For those who need to know: icode files were made executable by
  7068. directing the unix kernel with the first line '#!/usr/local/bin/iconx'
  7069. to the proper interpreter for the rest of the file, ie. the icode.
  7070. Given that there no troubles due to, say, byte sex, you could develop
  7071. and share icon programs across architectures.)
  7072.  
  7073. My questions to the experts: Would #defining NoHeader help?  And: why
  7074. were the new machine specific headers introduced, anyway?
  7075.  
  7076.                         Martin Neitzel
  7077.  
  7078. From janpeter@mpi.kun.nl  Tue Mar 31 06:13:28 1992
  7079. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Tue, 31 Mar 92 06:13:28 MST
  7080. Received: from wn1.sci.kun.nl by optima.cs.arizona.edu (4.1/15)
  7081.     id AA19607; Tue, 31 Mar 92 06:13:20 MST
  7082. Received: by wn1.sci.kun.nl (5.57/2.1) on NUNET
  7083.      id AA02448; Tue, 31 Mar 92 14:27:07 +0200
  7084. Received: by mpix10.mpi.kun.nl (5.57/2.0) on NUNET
  7085.      id AA02399; Tue, 31 Mar 92 14:25:20 +0200
  7086. Date: Tue, 31 Mar 92 14:25:20 +0200
  7087. From: Jan Peter de Ruiter <janpeter@mpi.kun.nl>
  7088. Message-Id: <9203311225.AA02399@mpix10.mpi.kun.nl>
  7089. To: icon-group@cs.arizona.edu
  7090. Subject: ICON-C INTERFACE
  7091.  
  7092. I have as yet been unable to figure out how to call C from ICON. Speci-
  7093. fically, I don't know how to build c modules that are callable. Of course
  7094. the infamous document tr90-8.doc is in my possession, but it is beyond my
  7095. intellectual capacity to figure out from that document how to do it.
  7096.  
  7097. Is there any document available that explains the ICON->C interface (I don't
  7098. care about C->ICON, unless I need that one for ICON->C) to someone who can
  7099. program in ICON and C, but has no knowledge of how icon is implemented?
  7100.  
  7101. Greetings,
  7102.  
  7103. Jan Peter de Ruiter
  7104. email: janpeter@mpi.kun.nl
  7105.  
  7106. From ralph  Tue Mar 31 06:47:07 1992
  7107. Date: Tue, 31 Mar 92 06:47:07 MST
  7108. From: "Ralph Griswold" <ralph>
  7109. Message-Id: <9203311347.AA25651@cheltenham.cs.arizona.edu>
  7110. Received: by cheltenham.cs.arizona.edu; Tue, 31 Mar 92 06:47:07 MST
  7111. To: icon-group@cs.arizona.edu, janpeter@mpi.kun.nl
  7112. Subject: Re:  ICON-C INTERFACE
  7113.  
  7114. Unfortunately, you cannot, except in the most trivial cases, call C
  7115. functions from Icon without knowing something about both Icon and C
  7116. data structures.  The two have different representations of data,
  7117. and it's necessary to convert between them.
  7118.  
  7119. TR90-8 lists the functions that are available for conversion and gives
  7120. examples.  Admittedly, it's not trivial.  But it's the only interface
  7121. available at the moment.
  7122.  
  7123. By the way, it is not necessary to know anything about calling Icon
  7124. from C to call C from Icon; the two facilities are independent.
  7125.     
  7126.     Ralph Griswold / Department of Computer Science 
  7127.     The University of Arizona / Tucson, AZ 85721
  7128.     
  7129.     ralph@cs.arizona.edu / uunet!arizona!ralph
  7130.     
  7131.     voice: 602-621-6609 / fax: 602-621-9618
  7132.  
  7133. From mff@princeton.edu  Tue Mar 31 14:39:32 1992
  7134. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Tue, 31 Mar 92 14:39:32 MST
  7135. Received: from Princeton.EDU by optima.cs.arizona.edu (4.1/15)
  7136.     id AA14201; Tue, 31 Mar 92 14:39:29 MST
  7137. Received: from fs.Princeton.EDU by Princeton.EDU (5.65b/2.88/princeton)
  7138.     id AA14036; Tue, 31 Mar 92 16:39:26 -0500
  7139. Received: from cs.Princeton.EDU (elan.Princeton.EDU) by fs.Princeton.EDU (4.0/1.105)
  7140.     id AA22299; Tue, 31 Mar 92 16:39:24 EST
  7141. Received: by cs.Princeton.EDU (5.57/1.105)
  7142.     id AA05809; Tue, 31 Mar 92 16:39:23 -0500
  7143. Date: Tue, 31 Mar 92 16:39:23 -0500
  7144. From: Mary F. Fernandez <mff@princeton.edu>
  7145. Message-Id: <9203312139.AA05809@cs.Princeton.EDU>
  7146. To: icon-group@cs.arizona.edu
  7147. Subject: Interpreting expressions in strings
  7148.  
  7149.  
  7150. Version 8 allows the application of an operator
  7151. represented by a string (e.g. "*"(2,4) === 2*4),
  7152. but it does not appear to interpret operands which
  7153. are represented as string (e.g. "*(2,4)" is not 2*4).
  7154. I thought there was a facility for interpreting
  7155. an expression read as input.  Does this exist?  Is
  7156. it built-in?  If not, if you have such an interpreter,
  7157. could you post it?
  7158. Thanks,
  7159. Mary Fernandez
  7160. mff@cs.princeton.edu
  7161. Dept. of Computer Science
  7162. Princeton University
  7163. 35 Olden St.
  7164. Princeton, NJ 08544-2087
  7165.  
  7166. From ralph  Wed Apr  1 17:02:02 1992
  7167. Date: Wed, 1 Apr 92 17:02:02 MST
  7168. From: "Ralph Griswold" <ralph>
  7169. Message-Id: <9204020002.AA17860@cheltenham.cs.arizona.edu>
  7170. Received: by cheltenham.cs.arizona.edu; Wed, 1 Apr 92 17:02:02 MST
  7171. To: icon-group
  7172. Subject: Version 8.6 of Icon for UNIX platforms
  7173.  
  7174. Version 8.6 of Icon is now available for UNIX platforms. Both the interpreter
  7175. and the optimizing compiler are included.
  7176.  
  7177. Version 8.6 adds a few functions to Icon as described in Icon Newsletter 38
  7178. and provides support for keyboard functions for some UNIX platforms. The
  7179. most significant language extension in Version 8.6, however, is the addition
  7180. of graphics capabilities for platforms that have X Window facilities.
  7181.  
  7182. The UNIX distribution includes source code, documentation in machine-readable
  7183. form, the Icon program library, and support for variant translators.
  7184.  
  7185. The new version is available via anonymous FTP from cs.arizona.edu.
  7186. cd /icon/packages/unix and get unix_tar.Z in binary (image) mode.
  7187.  
  7188. Version 8.6 of Icon for UNIX also is available on magnetic media together
  7189. with printed documentation. Tapes and cartridges can be ordered as
  7190. described in recent Icon Newsletters. It also is available on three 1.44MB
  7191. MS-DOS format diskettes. The price for diskettes is $25. Add $5 for
  7192. shipping to countries other than the United States, Canada, and Mexico.
  7193.  
  7194. Direct any questions about Version 8.6 of Icon for UNIX to
  7195.  
  7196.     icon-project@cs.arizon.edu
  7197.  
  7198.  
  7199.     Ralph Griswold / Department of Computer Science 
  7200.     The University of Arizona / Tucson, AZ 85721
  7201.     
  7202.     ralph@cs.arizona.edu / uunet!arizona!ralph
  7203.     
  7204.     voice: 602-621-6609 / fax: 602-621-9618
  7205.  
  7206. From ms@informatik.uni-hannover.dbp.de  Thu Apr  2 06:48:38 1992
  7207. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Thu, 2 Apr 92 06:48:38 MST
  7208. Received: from ixgate.gmd.de by optima.cs.arizona.edu (4.1/15)
  7209.     id AA24102; Thu, 2 Apr 92 06:48:02 MST
  7210. Received: by ixgate.gmd.de id AA14751; Thu, 2 Apr 92 15:48:08 +0200
  7211. Date: 2  Apr 92  9:57 
  7212. From: "(Michael Sperber)" <ms@informatik.uni-hannover.dbp.de>
  7213. Message-Id: <RFC-822:>
  7214. Subject: Icon 8.5 /386 problems
  7215. Apparently-To: icon-group@cs.arizona.edu
  7216.  
  7217. RFC-822-HEADERS:
  7218. Return-Path: <@CDC2.RRZN.UNI-HANNOVER.DE:ms@informatik.uni-hannover.de>
  7219. To: @CDC2:icon-group@cs.arizona.edu
  7220.  
  7221. ==================
  7222. I've been playing around with the 386 version of Icon 8.5
  7223. (the one out of Intel's Code Builder). I've written a
  7224. disk cataloguing system for MSDOS that can look into compressed
  7225. archives (LHARC, ARJ, PKZIP, PKARC). It shells out to
  7226. external programs both to get the directory contents and
  7227. the archive contents. However, bizarre non-reproducible
  7228. things happen to my output files after any external program has
  7229. been called (looks like memory dump right in the middle of things).
  7230. Has anyone else encountered problems like that? Also, Icon/386 doesn't
  7231. seem to work with GNUish make 3.58. Any comments?
  7232.  
  7233. Chipsy Sperber :-> ms@wega.informatik.uni-hannover.de
  7234.  
  7235. In case anyone is interested in the cataloguing system, please
  7236. mail me. It's free for anyone.
  7237.  
  7238. From kwalker  Thu Apr  2 13:58:08 1992
  7239. Received: from ponderosa.cs.arizona.edu by cheltenham.cs.arizona.edu; Thu, 2 Apr 92 13:58:08 MST
  7240. Date: Thu, 2 Apr 92 13:58:07 MST
  7241. From: "Kenneth Walker" <kwalker>
  7242. Message-Id: <9204022058.AA03343@ponderosa.cs.arizona.edu>
  7243. Received: by ponderosa.cs.arizona.edu; Thu, 2 Apr 92 13:58:07 MST
  7244. To: icon-group
  7245. Subject: Re:  old startup header in icode files
  7246.  
  7247. I didn't see anyone respond to this, so I'll give it a try:
  7248.  
  7249. > Date: 30 Mar 92 15:45:57 GMT
  7250. > From: mcsun!unido!infbssys!neitzel@uunet.uu.net  (Martin Neitzel)
  7251. >
  7252. > I just installed Icon (v8) on a second architecture at our site.
  7253. > Which made me ask myself:  Would icode files with old v7-style headers
  7254. > give me architecure independent executables?
  7255. >
  7256. > (For those who need to know: icode files were made executable by
  7257. > directing the unix kernel with the first line '#!/usr/local/bin/iconx'
  7258. > to the proper interpreter for the rest of the file, ie. the icode.
  7259. > Given that there no troubles due to, say, byte sex, you could develop
  7260. > and share icon programs across architectures.)
  7261. >
  7262. > My questions to the experts: Would #defining NoHeader help?  And: why
  7263. > were the new machine specific headers introduced, anyway?
  7264.  
  7265. If the C data types, including some structs, used in the implemention of
  7266. Icon (or at least those stored in the icode file) are implemented the same
  7267. on both systems, it should work.
  7268.  
  7269. Defining NoHeader will force you to explicitly call iconx.
  7270.  
  7271. Here is an untested suggestion:
  7272.  
  7273.     change MaxHdr in h/define.h to 24 (double check this number, it must
  7274.        match the size of array changed in the next step)
  7275.  
  7276.     change the contents of the iconxhdr array in icont/hdr.h to
  7277.        "#!/usr/local/bin/iconx\n"
  7278.  
  7279.     change icont/Makefile so it does not rebuild hdr.h from ixhdr.c
  7280.  
  7281.     rebuild icont and iconx
  7282.  
  7283. Good luck.
  7284.  
  7285.   Ken Walker / Computer Science Dept / Univ of Arizona / Tucson, AZ 85721
  7286.   +1 602 621-4252  kwalker@cs.arizona.edu   uunet!arizona!kwalker
  7287.  
  7288. From cjeffery  Thu Apr  2 17:06:12 1992
  7289. Received: from chuckwalla.cs.arizona.edu by cheltenham.cs.arizona.edu; Thu, 2 Apr 92 17:06:12 MST
  7290. Date: Thu, 2 Apr 92 17:06:11 MST
  7291. From: "Clinton Jeffery" <cjeffery>
  7292. Message-Id: <9204030006.AA10942@chuckwalla.cs.arizona.edu>
  7293. Received: by chuckwalla.cs.arizona.edu; Thu, 2 Apr 92 17:06:11 MST
  7294. To: icon-group
  7295. In-Reply-To: "Kenneth Walker"'s message of Thu, 2 Apr 92 13:58:07 MST <9204022058.AA03343@ponderosa.cs.arizona.edu>
  7296. Subject:  old startup header in icode files
  7297.  
  7298. Martin Neitzel recently asked why #!/usr/local/bin/iconx was dropped
  7299. in favor of the current scheme.  I can't speak for the people who made
  7300. this decision, but I would note that the #! syntax for redirecting
  7301. "shell scripts" to the appropriate interpreter is not portable and just
  7302. doesn't work on a lot of UNIX systems.
  7303.  
  7304. On the other hand, a VERY plain shell script that asks to run iconx on
  7305. the "shell script" itself ought to be fairly portable if done correctly.
  7306. I would love to see this if anyone did it well.
  7307.  
  7308. As another aside, the executable headers we are using now do various
  7309. interesting things before calling iconx, such as looking at environment
  7310. variables and allowing patches (in Version 8.5 and above) to override
  7311. the default name of iconx that icont uses.
  7312.  
  7313. Martin's questions also raise the possibility of a truly portable icode
  7314. file format that would run unmodified on *any* iconx.  This is in principle
  7315. not very difficult and should be implemented by someone who needs it, or
  7316. a commercial Icon implementor who wants to add value to their product.
  7317.  
  7318. Icode files already contain interesting offset-based instructions that
  7319. modify themselves into direct pointer-based instructions the first time
  7320. they are executed.  The same approach could be applied to the job of
  7321. making icode portable, adding extra instructions for things like
  7322. architecture-neutral integers that convert themselves into machine
  7323. integers the first time they are executed.  Network-knowledgable
  7324. hackers would see this as simply a matter of adding some calls to ntohl()
  7325. to the interpreter, and it likely wouldn't slow performance significantly.
  7326.  
  7327. From alex@laguna.metaphor.com  Thu Apr  2 17:55:46 1992
  7328. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Thu, 2 Apr 92 17:55:46 MST
  7329. Received: from relay.metaphor.com by optima.cs.arizona.edu (4.1/15)
  7330.     id AA24380; Thu, 2 Apr 92 17:55:43 MST
  7331. Received: from laguna.Metaphor.COM by relay.metaphor.com (4.1/SMI-4.1)
  7332.     id AA07769; Thu, 2 Apr 92 16:52:37 PST
  7333. Received: by laguna.Metaphor.COM (4.1/SMI-4.0)
  7334.     id AA07885; Thu, 2 Apr 92 16:56:13 PST
  7335. Date: Thu, 2 Apr 92 16:56:13 PST
  7336. From: alex@laguna.metaphor.com (Bob Alexander)
  7337. Message-Id: <9204030056.AA07885@laguna.Metaphor.COM>
  7338. To: icon-group@cs.arizona.edu
  7339. Subject: Re: old startup header in icode files
  7340.  
  7341. > On the other hand, a VERY plain shell script that asks to run iconx on
  7342. > the "shell script" itself ought to be fairly portable if done correctly.
  7343. > I would love to see this if anyone did it well.
  7344.  
  7345. Your request granted:
  7346.  
  7347.     #!/bin/sh
  7348.     exec "${ICONX-iconx}" "$0" "$@"
  7349.  
  7350. How "well" this is done is probably a subject for debate!
  7351.  
  7352. The Icon Newsletter recently had an article on alternative iconx
  7353. headers (written by me).  Included in the article is this shell script
  7354. approach.  The text of the article is attached.
  7355.  
  7356. This article was printed with a disclaimer stating that the #! approach
  7357. was once used for icode files, but was discarded because of numerous
  7358. problems.  I think the worst was that the path length is quite limited
  7359. -- something like 32 characters in Sun UNIX -- which caused a support
  7360. headache for the Icon Project.
  7361.  
  7362. Wierdly, if the #! line is omitted from this script (in sun4 UNIX, at
  7363. least) it won't work.  With the #! line, $0 produces the full path name
  7364. of the command used to invoke the script (which is the icode file
  7365. name); without the #! only the command name is substituted.  The full
  7366. path is necessary for the script to be able to find the icode file
  7367. (i.e. itself) if it does not reside in the current working directory.
  7368. This subtle behavior difference is a likely source of incompatiblilties
  7369. among UNIX variants.
  7370.  
  7371. On sun3 and sun4 systems, each icode file is over 10K smaller using
  7372. this approach!  That makes a big difference to me since I have over 100
  7373. misc Icon programs around -- a total of over 1M saved.
  7374.  
  7375. Anyway, header fans, enjoy:
  7376.  
  7377. -- Bob Alexander
  7378.  
  7379. Metaphor Computer Systems   (415) 961-3600 x751   alex@metaphor.com
  7380. ====^=== Mountain View, CA  ...{uunet}!{decwrl,apple}!metaphor!alex
  7381.  
  7382. ============================================================
  7383.  
  7384. Smaller Icode Files for UNIX-based Icon Implementations
  7385. -------------------------------------------------------
  7386.  
  7387. In this article, a method is discussed that can decrease the size of
  7388. Icon icode files (the "executable" files produced by icont).  The
  7389. techniques discussed here apply only to Icon implementations that
  7390. support the "direct execution" feature.  Implementations that do not
  7391. support direct execution, such as MS-DOS, cannot benefit from these
  7392. techniques.  In particular, this discussion applies to UNIX
  7393. implementations, but the techniques may apply to other platforms (they
  7394. are currently used in the standard Macintosh Programmer's Workshop
  7395. implementation).
  7396.  
  7397. An icode file consists of a header part and an icode part.  The icode
  7398. part contains the operations and data specifications that make up an
  7399. Icon program.  The header is the part that allows the icode file to be
  7400. directly executable as a command, without having to type "iconx".
  7401.  
  7402.     +---------------+    Beginning of icode file
  7403.     |        |
  7404.     |    header    |
  7405.     |        |
  7406.     +---------------+
  7407.     |        |
  7408.     |        |
  7409.     |    icode    |
  7410.     |        |
  7411.     |        |
  7412.     +---------------+    End of icode file
  7413.  
  7414. In UNIX implementations of Icon, the header takes the form of a small
  7415. program that invokes the iconx interpreter to execute the icode part of
  7416. itself.  In some versions of UNIX, the small header program ends up
  7417. being disturbingly large once all the needed library code is linked in
  7418. (something like 16K bytes on a Sun 3!).  Since the Icon program is
  7419. contained in the icode part, the header is just an overhead part of the
  7420. file.  For that reason, and since the header is replicated in each
  7421. icode file, it is desirable that the header be as small as possible.
  7422. This article discusses some alternative approaches to the header that
  7423. can result in significantly smaller icode files.
  7424.  
  7425. The header program as implemented in the current Icon UNIX distribution
  7426. is a C program.  The header itself is the executable code produced by
  7427. the C compiler and linker.  Two other approaches are examined here:
  7428. (1) using UNIX's shell-invocation format in place of a header, and (2)
  7429. using a shell script as a header.
  7430.  
  7431.  
  7432. Shell Invocation Line Approach
  7433. ------------------------------
  7434.  
  7435. A "shell" program to execute a script file can be specified in UNIX by
  7436. beginning the file with a line of the following format:
  7437.  
  7438.     #!shell-command-name<carriage return>
  7439.  
  7440. When such a file MyScript is executed as a command (it must have
  7441. execute permission), the system behaves as if the following command had
  7442. been issued:
  7443.  
  7444.     shell-command-name MyScript
  7445.  
  7446. Viewing iconx (the Icon executor program) as a "shell" that executes
  7447. icode files, the header can consist of a #! line instead of executable
  7448. machine code.
  7449.  
  7450.     #!/usr/icon/v8/bin/iconx
  7451.     .........icode..........
  7452.  
  7453. Advantages:
  7454.  
  7455.     - Very small
  7456.     - Fast execution
  7457.  
  7458. Disadvantages:
  7459.  
  7460.     - Length of iconx file path name is limited (max of 32
  7461.       characters in SunOS)
  7462.     - Doesn't fully support the documentation (e.g. doesn't
  7463.       recognize the ICONX environment variable)
  7464.     - Requires full path specification of the iconx interpreter
  7465.       (no variables permitted)
  7466.  
  7467.  
  7468. Shell Script Approach
  7469. ---------------------
  7470.  
  7471. A shell script as a header can match the documentation, but is not as
  7472. streamlined as the Shell Invocation approach.  However, it is the
  7473. solution that I have adopted, and I've found it to be quite
  7474. satisfactory in my SPARCstation 2 environment.
  7475.  
  7476. Advantages:
  7477.  
  7478.     - Small
  7479.     - Fully lives up to the documented behavior
  7480.     - Finds iconx interpreter in PATH directories
  7481.  
  7482. Disadvantages:
  7483.  
  7484.     - Not quite as fast as the #! method
  7485.  
  7486. I wanted the script to be for the Bourne shell, since that is the
  7487. ubiquitous shell available with all UNIX systems.
  7488.  
  7489. Here is a Bourne shell version that does the job nicely (thanks to
  7490. Gregg Townsend for suggesting this elegant and compact solution):
  7491.  
  7492.     #!/bin/sh
  7493.     exec "${ICONX-iconx}" "$0" "$@"
  7494.  
  7495. If the ICONX shell variable is undefined, the iconx executable is
  7496. located via the current PATH variable.  A small variation to this
  7497. script could point to an iconx executor in a specific hard-wired
  7498. location; change the second line to:
  7499.  
  7500.     exec "${ICONX-/usr/icon/v8/bin/iconx}" "$0" "$@"
  7501.  
  7502. Be warned:  the first line, "#!/bin/sh", MUST BE PRESENT for this
  7503. script to work properly under all circumstances.  Even though UNIX will
  7504. default to executing the Bourne shell if no "#!" line is present, the
  7505. shell behaves somewhat differently depending on whether or not the "#!"
  7506. line is included.
  7507.  
  7508. Even if you prefer another shell for interactive command entry (such as
  7509. the C or Korn shell), usage of the above Bourne shell header presents
  7510. no conflict.  However, just for fun, the following slightly longer
  7511. C-shell script could be used and is functionally equivalent:
  7512.  
  7513.     #!/bin/csh -f
  7514.     if ($?ICONX) set ICONX=iconx
  7515.     exec "$ICONX" "$0" $*:q
  7516.  
  7517. Note the -f option provided to csh in the first line of the C shell
  7518. script.  The -f option (for "fast") bypasses the usual act of executing
  7519. the .cshrc startup script, making it quicker.
  7520.  
  7521.  
  7522. How do I convert my Icon system to use small headers?
  7523. -----------------------------------------------------
  7524.  
  7525. The required steps are as follows:
  7526.  
  7527.     1. Modify the icont makefile to omit construction of
  7528.        the C header.
  7529.     2. Hand-code a .h file for the script header.
  7530.     3. Reduce the space reserved in each output icode file for
  7531.        the header.
  7532.  
  7533. The header that is copied to every icode file resides in the the
  7534. translator/linker tool, icont.  The makefiles provided with the Icon
  7535. distribution compile the C program that comprises the header portion of
  7536. normal icode files.  A utility program is then executed that converts
  7537. the resulting executable machine code to a .h text file that is #included
  7538. in icont.
  7539.  
  7540. The makefile for icont (in the src/icont directory) should be modified:
  7541.  
  7542.     - omit the compile and link of the C header
  7543.       (ixhdr.c -> ixhdr.o -> iconx.hdr)
  7544.     - omit the conversion of the resulting executable to a .h file
  7545.       (iconx.hdr -> hdr.h)
  7546.  
  7547. Then a hand-coded hdr.h file is constructed containing the desired
  7548. script; e.g. (note that all lines in this example must be flush against
  7549. the left margin):
  7550.  
  7551.     static char iconxhdr[MaxHdr+1] = "\
  7552.     #!/bin/sh\n\
  7553.     exec \"${ICONX-iconx}\" \"$0\" \"$@"\n";
  7554.  
  7555. Be careful; if you didn't modify your makefile correctly, the build
  7556. could clobber your painstakingly hand-written hdr.h file.
  7557.  
  7558. Finally, adjust the size of the area reserved for the header in the
  7559. file src/h/define.h.
  7560.  
  7561.     #define MaxHdr 256
  7562.  
  7563. The script I use (the example above) is fewer than 100 characters, but
  7564. I specify a size of 256 to allow room for, dare I say, future expansion
  7565. (for example, adding commands to set the region size environment
  7566. variables).  It's still a lot smaller than 16K!
  7567.  
  7568. Now, rebuild icont, and enjoy smaller icode files!
  7569.  
  7570. From janpeter@mpi.kun.nl  Fri Apr 10 04:26:27 1992
  7571. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Fri, 10 Apr 92 04:26:27 MST
  7572. Received: from wn1.sci.kun.nl by optima.cs.arizona.edu (4.1/15)
  7573.     id AA29573; Fri, 10 Apr 92 04:26:20 MST
  7574. Received: by wn1.sci.kun.nl (5.57/2.1) on NUNET
  7575.      id AA08740; Fri, 10 Apr 92 13:27:26 +0200
  7576. Received: by mpix10.mpi.kun.nl (5.57/2.0) on NUNET
  7577.      id AA20777; Fri, 10 Apr 92 13:25:20 +0200
  7578. Date: Fri, 10 Apr 92 13:25:20 +0200
  7579. From: Jan Peter de Ruiter <janpeter@mpi.kun.nl>
  7580. Message-Id: <9204101125.AA20777@mpix10.mpi.kun.nl>
  7581. To: icon-group@cs.arizona.edu
  7582. Subject: ICON debugger
  7583.  
  7584. Is an interactive debugger available for ICON? Sometimes, playing
  7585. around with &trace and putting in al lot of write() statements just
  7586. is not convenient anymore. I gather, people who test and debug large
  7587. ICON programs must have some means to help their debugging. I would be
  7588. interested to know how other people debug their ICON programs.
  7589.  
  7590. Jan Peter de Ruiter
  7591. Max Planck Institute for Psycholinguistics
  7592. EMAIL: janpeter@mpi.kun.nl
  7593.  
  7594.  
  7595. From icon-group-request  Sat Apr 11 10:58:43 1992
  7596. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Sat, 11 Apr 92 10:58:43 MST
  7597. Received: from ucbvax.Berkeley.EDU by optima.cs.arizona.edu (4.1/15)
  7598.     id AA08205; Sat, 11 Apr 92 10:58:41 MST
  7599. Received: by ucbvax.Berkeley.EDU (5.63/1.43)
  7600.     id AA17253; Sat, 11 Apr 92 10:46:16 -0700
  7601. Received: from USENET by ucbvax.Berkeley.EDU with netnews
  7602.     for icon-group@cs.arizona.edu (icon-group@cs.arizona.edu)
  7603.     (contact usenet@ucbvax.Berkeley.EDU if you have questions)
  7604. Date: 9 Apr 92 20:05:49 GMT
  7605. From: micro-heart-of-gold.mit.edu!wupost!uwm.edu!linac!convex!convex!tchrist@bloom-beacon.mit.edu  (Tom Christiansen)
  7606. Organization: CONVEX Realtime Development, Colorado Springs, CO
  7607. Subject: Re: should I use ICON for a specific problem ?
  7608. Message-Id: <1992Apr9.200549.10279@news.eng.convex.com>
  7609. References: <1992Apr6.163124.15685@midway.uchicago.edu>, <rantapaa.702783275@s6.math.umn.edu>, <1992Apr9.045725.15554@midway.uchicago.edu>
  7610. Sender: icon-group-request@cs.arizona.edu
  7611. To: icon-group@cs.arizona.edu
  7612.  
  7613. From the keyboard of goer@midway.uchicago.edu:
  7614. :
  7615. :There's no reason to worry about flames here.  PERL is a system adminis-
  7616. :trator's tool par excellance, with a C interface that's actually much bet-
  7617. :ter than Icon's.  Icon is a much cleaner and more disciplined language,
  7618. :with a lot more options for control and data structures, coexpressions,
  7619. :and what not.  I find PERL a mess, but that's just me.  Probably I just
  7620. :don't know it well enough.
  7621.  
  7622. Nope, you're right -- in more ways than I care to enumerate, it *is* a
  7623. mess.  The amazing thing is how well it gets the job done anyway.
  7624.  
  7625. --tom
  7626.  
  7627. From icon-group-request  Sat Apr 11 15:14:43 1992
  7628. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Sat, 11 Apr 92 15:14:43 MST
  7629. Received: from ucbvax.Berkeley.EDU by optima.cs.arizona.edu (4.1/15)
  7630.     id AA15023; Sat, 11 Apr 92 15:14:36 MST
  7631. Received: by ucbvax.Berkeley.EDU (5.63/1.43)
  7632.     id AA26737; Sat, 11 Apr 92 15:04:00 -0700
  7633. Received: from USENET by ucbvax.Berkeley.EDU with netnews
  7634.     for icon-group@cs.arizona.edu (icon-group@cs.arizona.edu)
  7635.     (contact usenet@ucbvax.Berkeley.EDU if you have questions)
  7636. Date: 9 Apr 92 12:50:13 GMT
  7637. From: mailer.cc.fsu.edu!sun13!sun8.scri.fsu.edu!nall@gatech.edu  (John Nall)
  7638. Organization: SCRI, Florida State University
  7639. Subject: Re: should I use ICON for a specific problem ?
  7640. Message-Id: <8139@sun13.scri.fsu.edu>
  7641. References: <1992Apr6.163124.15685@midway.uchicago.edu>, <rantapaa.702783275@s6.math.umn.edu>, <1992Apr9.045725.15554@midway.uchicago.edu>
  7642. Sender: icon-group-request@cs.arizona.edu
  7643. To: icon-group@cs.arizona.edu
  7644.  
  7645. In article <1992Apr9.045725.15554@midway.uchicago.edu> goer@midway.uchicago.edu writes:
  7646.  
  7647.    [ ... stuff deleted ... ]
  7648. >
  7649. >There's no reason to worry about flames here.  PERL is a system adminis-
  7650. >trator's tool par excellance, with a C interface that's actually much bet-
  7651. >ter than Icon's.  Icon is a much cleaner and more disciplined language,
  7652. >with a lot more options for control and data structures, coexpressions,
  7653. >and what not.  I find PERL a mess, but that's just me.  Probably I just
  7654. >don't know it well enough.
  7655.  
  7656.    It is so refreshing to see a well reasoned discussion of ICON vs PERL
  7657.    that I can't resist the temptation to say "WELL PUT!!"  I agree with
  7658.    everything that Richard said, completely, even to the part of "I find
  7659.    PERL a mess, but that's just me".  But it is certainly a gawdawful
  7660.    powerful tool in the hands of those who can deal with it :-)
  7661.  
  7662. John
  7663.  
  7664.  
  7665. --
  7666. John W. Nall              | Supercomputer Computations Research Institute
  7667. nall@mailer.scri.fsu.edu  | Florida State University, Tallahassee, FL 32306
  7668.  
  7669.  "Disclaimer:  A world which requires disclaimers has too many lawyers."
  7670.  
  7671. From icon-group-request  Sun Apr 12 06:18:10 1992
  7672. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Sun, 12 Apr 92 06:18:10 MST
  7673. Received: from ucbvax.Berkeley.EDU by optima.cs.arizona.edu (4.1/15)
  7674.     id AA12340; Sun, 12 Apr 92 06:18:07 MST
  7675. Received: by ucbvax.Berkeley.EDU (5.63/1.43)
  7676.     id AA01492; Sun, 12 Apr 92 06:03:33 -0700
  7677. Received: from USENET by ucbvax.Berkeley.EDU with netnews
  7678.     for icon-group@cs.arizona.edu (icon-group@cs.arizona.edu)
  7679.     (contact usenet@ucbvax.Berkeley.EDU if you have questions)
  7680. Date: 24 Mar 92 11:06:46 GMT
  7681. From: mcsun!uknet!pcl!hcvec@uunet.uu.net  (John Ditrolio)
  7682. Organization: Polytechnic of Central London
  7683. Subject: Tree Implementation
  7684. Message-Id: <1992Mar24.110646.896@sun.pcl.ac.uk>
  7685. Sender: icon-group-request@cs.arizona.edu
  7686. To: icon-group@cs.arizona.edu
  7687.  
  7688. To whoever can help, 
  7689.  
  7690. I am trying to write a grammar checking program and I am intendingto set up a
  7691. dictionary file with corresponding tokens for each word. 
  7692.  
  7693. Can anyone tell me what is the most efficient way of handling the large amount
  7694. of data? I could possibly pull the contents of a dictionary file into a tree
  7695. structure of some sort (maybe records) which I will need to access
  7696. continuously. 
  7697.  
  7698. I've looked in the Icon "bible" (Icon Programming Language Manual) and I cannot
  7699. see how I can implement a binary tree structure similar to that in C.
  7700.  
  7701. Please can someone help ????
  7702.  
  7703. I am relatively new to Icon and so beg forgiveness for my stupidity.
  7704.  
  7705.  
  7706.  
  7707.  
  7708. John Ditrolio.
  7709.  
  7710. From icon-group-request  Sun Apr 12 08:03:22 1992
  7711. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Sun, 12 Apr 92 08:03:22 MST
  7712. Received: from ucbvax.Berkeley.EDU by optima.cs.arizona.edu (4.1/15)
  7713.     id AA14353; Sun, 12 Apr 92 08:03:19 MST
  7714. Received: by ucbvax.Berkeley.EDU (5.63/1.43)
  7715.     id AA05256; Sun, 12 Apr 92 07:57:01 -0700
  7716. Received: from USENET by ucbvax.Berkeley.EDU with netnews
  7717.     for icon-group@cs.arizona.edu (icon-group@cs.arizona.edu)
  7718.     (contact usenet@ucbvax.Berkeley.EDU if you have questions)
  7719. Date: 10 Apr 92 17:39:51 GMT
  7720. From: micro-heart-of-gold.mit.edu!wupost!csus.edu!netcomsv!mork!nagle@bloom-beacon.mit.edu  (John Nagle)
  7721. Organization: Netcom - Online Communication Services  (408 241-9760 guest)
  7722. Subject: Re: lang comparison (not war)
  7723. Message-Id: <0#tj+5g.nagle@netcom.com>
  7724. References: <1992Apr7.212144.13007@xilinx.com>
  7725. Sender: icon-group-request@cs.arizona.edu
  7726. To: icon-group@cs.arizona.edu
  7727.  
  7728. holen@xilinx.com (Victor A. Holen ) writes:
  7729.  
  7730. >Is there somewhere (book, ftp, ...) a reasonably objective 
  7731. >comparison of icon with eiffel with a few other (perhaps c++,
  7732. >smalltalk, mainsail..). 
  7733.  
  7734.        I haven't heard much about Icon in years.  It was intended as
  7735. a replacement for Snobol, and perhaps as an alternative to the horrible
  7736. "string languages" ("awk", "sed") that come with UNIX.  Icon offers
  7737. Snobol-like matching with C-like syntax.  It's intended for a 
  7738. different class of applications than is Eiffel.
  7739.  
  7740.                     John Nagle
  7741.  
  7742. From ames.arc.nasa.gov!amdcad!cpsolv!para!john@hellgate.utah.edu  Mon Apr 13 21:48:50 1992
  7743. Received: from univers.cs.arizona.edu by cheltenham.cs.arizona.edu; Mon, 13 Apr 92 21:48:50 MST
  7744. Received: from hellgate.utah.edu by univers.cs.arizona.edu; Mon, 13 Apr 92 21:48:49 MST
  7745. Received: from ames.arc.nasa.gov by hellgate.utah.edu (5.65/utah-2.19s-cs)
  7746.     id AA21107; Mon, 13 Apr 92 22:48:34 -0600
  7747. Received: from amdcad.UUCP by ames.arc.nasa.gov (5.65c/1.21)
  7748.     with UUCP id AA11010 for hellgate.utah.edu!arizona!icon-group
  7749.     on Mon, 13 Apr 1992 21:48:27 -0700
  7750. Received: from cpsolv.UUCP by amd.com (5.65c/AMD-1.27)
  7751.     with UUCP id AA08329 for ames!hellgate.utah.edu!arizona!icon-group; 
  7752.     Mon, 13 Apr 1992 21:46:05 -0700
  7753. Received: by cpsolv.CPS.COM (smail2.5rhg)
  7754.     id AA10278; Mon, 13 Apr 1992 20:44:52 CDT
  7755. Received: by para.UUCP (smail2.5rhg)
  7756.     id AA01808; Mon, 13 Apr 1992 20:37:17 CST
  7757. Subject: unsub
  7758. To: icon-group@cs.arizona.edu
  7759. Date: Mon, 13 Apr 92 20:37:13 CST
  7760. From: John O'Brien <para.cps.com!john@hellgate.utah.edu>
  7761. X-Mailer: ELM [version 2.3 PL6]
  7762. Message-Id: <920413203715.AA01804@para.UUCP>
  7763.  
  7764. Thanks for the mail the last few months.  I don't need this list 
  7765. as I have regained USENET access.  See you on the net!
  7766. john@para.cps.com  also  jdo@genco.com
  7767.  
  7768.  
  7769. From cliff  Wed Apr 15 09:08:42 1992
  7770. Received: from javelina.cs.arizona.edu by cheltenham.cs.arizona.edu; Wed, 15 Apr 92 09:08:42 MST
  7771. Date: Wed, 15 Apr 92 09:08:42 MST
  7772. From: "Cliff Hathaway" <cliff>
  7773. Message-Id: <9204151608.AA28692@javelina.cs.arizona.edu>
  7774. Received: by javelina.cs.arizona.edu; Wed, 15 Apr 92 09:08:42 MST
  7775. To: icon-group
  7776. Subject: address for administrative matters
  7777.  
  7778.  
  7779. If you wish to subscribe/unsubscribe/change your address for the icon-group
  7780. mailing list, the correct "place" to send it is:
  7781.  
  7782.     icon-group-request@cs.arizona.edu
  7783.  
  7784. This will ensure that it receives prompt attention, and keep it from being
  7785. broadcast out to everyone else on the list, and the comp.lang.icon newsgroup,
  7786. too!
  7787.  
  7788. Thanks.
  7789.  
  7790.  
  7791.  
  7792.     Cliff Hathaway
  7793.     Dept. of Computer Science (602)621-4291
  7794.     University of Arizona     cliff@cs.arizona.edu             (internet) 
  7795.     Tucson, Ariz. 85721          {cmcl2,noao,uunet}!arizona!cliff    (uucp)
  7796.  
  7797.  
  7798.  
  7799. From icon-group-request  Thu Apr 16 14:25:05 1992
  7800. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Thu, 16 Apr 92 14:25:05 MST
  7801. Received: from ucbvax.Berkeley.EDU by optima.cs.arizona.edu (4.1/15)
  7802.     id AA21088; Thu, 16 Apr 92 14:25:02 MST
  7803. Received: by ucbvax.Berkeley.EDU (5.63/1.43)
  7804.     id AA23155; Thu, 16 Apr 92 14:13:06 -0700
  7805. Received: from USENET by ucbvax.Berkeley.EDU with netnews
  7806.     for icon-group@cs.arizona.edu (icon-group@cs.arizona.edu)
  7807.     (contact usenet@ucbvax.Berkeley.EDU if you have questions)
  7808. Date: 15 Apr 92 16:43:14 GMT
  7809. From: micro-heart-of-gold.mit.edu!wupost!uwm.edu!linac!uchinews!ellis!goer@bloom-beacon.mit.edu  (Richard L. Goerwitz)
  7810. Organization: University of Chicago Computing Organizations
  7811. Subject: Re: features from Icon Language in lisp
  7812. Message-Id: <1992Apr15.164314.8991@midway.uchicago.edu>
  7813. References: <1992Apr14.173407.28762@adobe.com>
  7814. Sender: icon-group-request@cs.arizona.edu
  7815. To: icon-group@cs.arizona.edu
  7816.  
  7817. In article <1992Apr14.173407.28762@adobe.com> yost@adobe.COM writes:
  7818. >My first exposure to a seriously higher level language than C
  7819. >was Icon.  (Thank you Ralph Griswold, et al.)  Finally, I got around
  7820. >to learning lisp, where I wish I had started, and found that much
  7821. >of what I liked about Icon (automatic storage, everything is an
  7822. >expression, lists, tables, success->value/failure->nil) was there
  7823. >in Common Lisp with a (shall we say) different syntax (and a whole
  7824. >lot more, of course).
  7825. >
  7826. >Has anyone implemented any other of our favorite iconish things
  7827. >in Common Lisp or Scheme?  Like goal-directed evaluation,
  7828. >string scanning, ... ?
  7829.  
  7830. Personally, I feel good about Common LISP.  It's even more bloated than
  7831. Icon, though, and people who are really into clean LISP dialects seem
  7832. to prefer Scheme.  LISP, of course, isn't object-oriented (yes, another
  7833. level of indirection that seems to be the rage these days).  LISP
  7834. people are always quick to point out that you can do object-oriented pro-
  7835. gramming in LISP, but this is also true of C, Pascal, or even assembler.
  7836.  
  7837. The bottom line, I guess, is that we have to be bi- or better yet tri-
  7838. lingual, if not quadrilingual+ (e.g. Icon, C, LISP, and perhaps a func-
  7839. tional or object-oriented language, and PERL, sed, awk, etc.).  You'll
  7840. never get into AI (or Emacs :-)) without LISP, and you'll never run any
  7841. thing in real time without C.  You won't get elegant string scanning
  7842. outside of Icon.  You won't get your system adminstration work done un-
  7843. less you can do shell and awk/sed programming (or PERL).
  7844.  
  7845. My gut feeling is that you'll be better off using Icon and LISP, Dave,
  7846. when either is appropriate.
  7847.  
  7848. -- 
  7849.  
  7850.    -Richard L. Goerwitz              goer%ellis@uchicago.bitnet
  7851.    goer@ellis.uchicago.edu           rutgers!oddjob!ellis!goer
  7852.  
  7853. From robert@hpfcase.sde.hp.com  Thu Apr 16 14:53:24 1992
  7854. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Thu, 16 Apr 92 14:53:24 MST
  7855. Received: from hpfcla.fc.hp.com by optima.cs.arizona.edu (4.1/15)
  7856.     id AA21778; Thu, 16 Apr 92 14:53:19 MST
  7857. Received: from hpfcbig.sde.hp.com by hpfcla.fc.hp.com with SMTP
  7858.     (15.11.1.6/15.5+IOS 3.20) id AA05338; Thu, 16 Apr 92 15:52:17 -0600
  7859. Received: from hpfcnml.sde.hp.com by hpfcbig.sde.hp.com with SMTP
  7860.     (16.6/15.5+IOS 3.12) id AA23657; Thu, 16 Apr 92 15:52:48 -0600
  7861. Received: by hpfcase.sde.hp.com
  7862.     (16.6/15.5+IOS 3.12) id AA26026; Thu, 16 Apr 92 15:52:46 -0600
  7863. From: Robert Heckendorn <robert@hpfcase.sde.hp.com>
  7864. Message-Id: <9204162152.AA26026@hpfcase.sde.hp.com>
  7865. Subject: Re: features from Icon Language in lisp
  7866. To: micro-heart-of-gold.mit.edu!wupost!uwm.edu!linac!uchinews!ellis!goer@bloom-beacon.mit.edu  (Richard L. Goerwitz) (Richard L. Goerwitz)
  7867. Date: Thu, 16 Apr 92 15:52:44 MDT
  7868. Cc: icon-group@cs.arizona.edu
  7869. In-Reply-To: <1992Apr15.164314.8991@midway.uchicago.edu>; from "Richard L. Goerwitz" at Apr 15, 92 4:43 pm
  7870. Physical-Location: 
  7871. Mailer: Elm [revision: 66.25]
  7872.  
  7873. > In article <1992Apr14.173407.28762@adobe.com> yost@adobe.COM writes:
  7874. > >My first exposure to a seriously higher level language than C
  7875. > >was Icon.  (Thank you Ralph Griswold, et al.)  Finally, I got around
  7876. > >to learning lisp, where I wish I had started, and found that much
  7877. > >of what I liked about Icon (automatic storage, everything is an
  7878. > >expression, lists, tables, success->value/failure->nil) was there
  7879. > >in Common Lisp with a (shall we say) different syntax (and a whole
  7880. > >lot more, of course).
  7881. > >
  7882. > >Has anyone implemented any other of our favorite iconish things
  7883. > >in Common Lisp or Scheme?  Like goal-directed evaluation,
  7884. > >string scanning, ... ?
  7885.  
  7886. I haven't done this yet, but I have thought about it.  I think it is
  7887. an excellent idea.  Lisp is a *tremendously* flexible language and
  7888. adapts well to having layered systems added into it without scrambling
  7889. the syntax. (It helps that the syntax is simplistic :-)) The CLOS OO
  7890. extensions are an example of how far you can go.  It is great to add
  7891. on systems to LISP.  Go for it!
  7892.  
  7893. > Personally, I feel good about Common LISP.  It's even more bloated than
  7894. > Icon, though, and people who are really into clean LISP dialects seem
  7895. > to prefer Scheme.  LISP, of course, isn't object-oriented (yes, another
  7896.  
  7897. There is CLOS for OO LISP.  This is a fantastical [sic] OO package.
  7898.  
  7899. > level of indirection that seems to be the rage these days).  LISP
  7900. > people are always quick to point out that you can do object-oriented pro-
  7901. > gramming in LISP, but this is also true of C, Pascal, or even assembler.
  7902.  
  7903. I think it is almost debateable if C++ is OO.  :-P
  7904.  
  7905. > The bottom line, I guess, is that we have to be bi- or better yet tri-
  7906. > lingual, if not quadrilingual+ (e.g. Icon, C, LISP, and perhaps a func-
  7907. > tional or object-oriented language, and PERL, sed, awk, etc.).  You'll
  7908. > never get into AI (or Emacs :-)) without LISP, and you'll never run any
  7909. > thing in real time without C.  You won't get elegant string scanning
  7910. > outside of Icon.  You won't get your system adminstration work done un-
  7911. > less you can do shell and awk/sed programming (or PERL).
  7912. > My gut feeling is that you'll be better off using Icon and LISP, Dave,
  7913. > when either is appropriate.
  7914.  
  7915. My feeling is that Lisp offers a great playground for experimenting
  7916. with new ideas in programming functionality.  Note that I say
  7917. functionality and not syntax.  If you want to have your cake and eat
  7918. it to, build a package for the Icon features you like in Lisp and play
  7919. with it.  You may be able to take the knowledge back with you to Icon
  7920. and suggest changes in the language.  Coming up with as elegant an
  7921. expression in Lisp for the icon expressions may be a little more
  7922. difficult.
  7923.  
  7924.     Robert Heckendorn
  7925.     robert@fc.sde.hp.com
  7926.  
  7927. >    -Richard L. Goerwitz              goer%ellis@uchicago.bitnet
  7928. >    goer@ellis.uchicago.edu           rutgers!oddjob!ellis!goer
  7929.  
  7930. From callas@eris.enet.dec.com  Thu Apr 16 15:07:56 1992
  7931. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Thu, 16 Apr 92 15:07:56 MST
  7932. Received: from enet-gw.pa.dec.com by optima.cs.arizona.edu (4.1/15)
  7933.     id AA22285; Thu, 16 Apr 92 15:05:37 MST
  7934. Received: by enet-gw.pa.dec.com; id AA01193; Thu, 16 Apr 92 15:03:26 -0700
  7935. Message-Id: <9204162203.AA01193@enet-gw.pa.dec.com>
  7936. Received: from eris.enet; by decwrl.enet; Thu, 16 Apr 92 15:03:50 PDT
  7937. Date: Thu, 16 Apr 92 15:03:52 PDT
  7938. From: What good is rain that falls up?  16-Apr-1992 1800 <callas@eris.enet.dec.com>
  7939. To: icon-group@cs.arizona.edu
  7940. Apparently-To: icon-group@cs.arizona.edu
  7941. Subject: Lisp, Icon, and OO
  7942.  
  7943.     "LISP, of course, isn't object-oriented (yes, another level of indirection
  7944.     that seems to be the rage these days)."
  7945.  
  7946. Well, actually, it is. The definition of CLOS (Common Lisp Object System) in
  7947. CLtL2 (Common Lisp : the Language, second edition) and the soon-to-be-ANSI
  7948. standard make it object oriented.
  7949.  
  7950. All Lisp objects are in a class hierarchy, and you can write methods that
  7951. handle ordinary Lisp objects, defstruct structures, and of course CLOS objects.
  7952.  
  7953. Anyone who isn't writing completely OO Lisp is doing so because they choose to,
  7954. or they have an old Lisp system.
  7955.  
  7956.     Jon
  7957.  
  7958. From icon-group-request  Thu Apr 16 17:37:17 1992
  7959. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Thu, 16 Apr 92 17:37:17 MST
  7960. Received: from ucbvax.Berkeley.EDU by optima.cs.arizona.edu (4.1/15)
  7961.     id AA29194; Thu, 16 Apr 92 17:37:13 MST
  7962. Received: by ucbvax.Berkeley.EDU (5.63/1.43)
  7963.     id AA04367; Thu, 16 Apr 92 17:26:46 -0700
  7964. Received: from USENET by ucbvax.Berkeley.EDU with netnews
  7965.     for icon-group@cs.arizona.edu (icon-group@cs.arizona.edu)
  7966.     (contact usenet@ucbvax.Berkeley.EDU if you have questions)
  7967. Date: 9 Apr 92 04:57:25 GMT
  7968. From: cis.ohio-state.edu!pacific.mps.ohio-state.edu!linac!uchinews!ellis!goer@ucbvax.berkeley.edu  (Richard L. Goerwitz)
  7969. Organization: University of Chicago Computing Organizations
  7970. Subject: Re: should I use ICON for a specific problem ?
  7971. Message-Id: <1992Apr9.045725.15554@midway.uchicago.edu>
  7972. References: <1992Apr6.104410.12693@news.uni-stuttgart.de>, <1992Apr6.163124.15685@midway.uchicago.edu>, <rantapaa.702783275@s6.math.umn.edu>
  7973. Sender: icon-group-request@cs.arizona.edu
  7974. To: icon-group@cs.arizona.edu
  7975.  
  7976. rantapaa@s6.math.umn.edu (Erik E. Rantapaa) writes:
  7977. >>>
  7978. >>>I wrote a long nawk-file for a machine where no awk-compiler is available.
  7979. >>>Now I'm searching for a language with the following spezifications:
  7980. >
  7981. >Not wishing to get into a Perl vs. Icon flame fest, I would suggest that
  7982. >you seriously consider using Perl.  Not only does Perl have many of the
  7983. >features that you require, but it also comes with a program called 'a2p'
  7984. >which converts awk programs to Perl.
  7985.  
  7986. This is probably good advice.  PERL is much closer to AWK than Icon is, and
  7987. if you want familiarity from this standpoint, go with PERL.  This answer
  7988. just didn't occur to me (I'd guess because the question was phrased, "Can
  7989. I do X in Icon?").
  7990.  
  7991. There's no reason to worry about flames here.  PERL is a system adminis-
  7992. trator's tool par excellance, with a C interface that's actually much bet-
  7993. ter than Icon's.  Icon is a much cleaner and more disciplined language,
  7994. with a lot more options for control and data structures, coexpressions,
  7995. and what not.  I find PERL a mess, but that's just me.  Probably I just
  7996. don't know it well enough.
  7997.  
  7998. -- 
  7999.  
  8000.    -Richard L. Goerwitz              goer%ellis@uchicago.bitnet
  8001.    goer@ellis.uchicago.edu           rutgers!oddjob!ellis!goer
  8002.  
  8003. From janpeter@mpi.kun.nl  Fri Apr 17 05:00:28 1992
  8004. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Fri, 17 Apr 92 05:00:28 MST
  8005. Received: from wn1.sci.kun.nl by optima.cs.arizona.edu (4.1/15)
  8006.     id AA19956; Fri, 17 Apr 92 05:00:23 MST
  8007. Received: by wn1.sci.kun.nl (5.57/2.1) on NUNET
  8008.      id AA26259; Fri, 17 Apr 92 14:01:02 +0200
  8009. Received: by mpix10.mpi.kun.nl (5.57/2.0) on NUNET
  8010.      id AA02910; Fri, 17 Apr 92 13:59:26 +0200
  8011. Date: Fri, 17 Apr 92 13:59:26 +0200
  8012. From: Jan Peter de Ruiter <janpeter@mpi.kun.nl>
  8013. Message-Id: <9204171159.AA02910@mpix10.mpi.kun.nl>
  8014. To: icon-group@cs.arizona.edu
  8015. Subject: icon/awk
  8016.  
  8017. I don't know excactly how relevant this is to the discussion of ICON vs
  8018. PERL vs AWK, but in order to convince colleagues at our institute of the
  8019. usefulness of ICON, (they're all AWK freaks) I wrote an ICON lib that
  8020. emulates AWK. Once you load this library into an ICON program, you can
  8021. do "AWK" and ICON in the same program. Of course, some names (like the $
  8022. operator in AWK) have different names in my LIB, but who cares? 
  8023.  
  8024. Of course, is is not exactly the same as AWK. For instance, you cannot
  8025. use (literally) the /pattern/ { action ... } form of AWK. But this is
  8026. something ICON is especially suited for, so why not do *that* in ICON
  8027. qua ICON? So functionally, what you end up with (in my
  8028. opinion) is a mixture of advanced pattern matching, and the ease of 
  8029. having files conveniently split up in addressable columns. These
  8030. programs are of course somewhat slower than original gawk or nawk 
  8031. programs, unless you compile them, perhaps.
  8032.  
  8033. A nice thing about this mixture (seen from the viewpoint of an AWK user)
  8034. is that you can use CSETs as field separators and that you can use the 
  8035. (beautiful) ICON SET datatype. 
  8036.  
  8037. Currently, I'm trying to implement this module using co-expressions,
  8038. which would in principle mean that you can open many AWK-streams at
  8039. the same time, which would make the combination even more fruitful.
  8040.  
  8041. I'm interested in some comments.
  8042.  
  8043. Jan Peter de Ruiter
  8044. Max Planck Institute for Psycholinguistics
  8045. Nijmegen
  8046. The Netherlands
  8047. janpeter@mpi.kun.nl
  8048.  
  8049. From icon-group-request  Fri Apr 17 06:38:37 1992
  8050. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Fri, 17 Apr 92 06:38:37 MST
  8051. Received: from ucbvax.Berkeley.EDU by optima.cs.arizona.edu (4.1/15)
  8052.     id AA23021; Fri, 17 Apr 92 06:38:35 MST
  8053. Received: by ucbvax.Berkeley.EDU (5.63/1.43)
  8054.     id AA18607; Fri, 17 Apr 92 06:29:10 -0700
  8055. Received: from USENET by ucbvax.Berkeley.EDU with netnews
  8056.     for icon-group@cs.arizona.edu (icon-group@cs.arizona.edu)
  8057.     (contact usenet@ucbvax.Berkeley.EDU if you have questions)
  8058. Date: 26 Mar 92 20:15:56 GMT
  8059. From: dog.ee.lbl.gov!network.ucsd.edu!swrinde!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!linac!uchinews!ellis!goer@ucbvax.berkeley.edu  (Richard L. Goerwitz)
  8060. Organization: University of Chicago Computing Organizations
  8061. Subject: Re: Windows 3.0
  8062. Message-Id: <1992Mar26.201556.16013@midway.uchicago.edu>
  8063. References: <9203261632.AA05499@optima.cs.arizona.edu>, <9203261840.AA15783@chuckwalla.cs.arizona.edu>
  8064. Sender: icon-group-request@cs.arizona.edu
  8065. To: icon-group@cs.arizona.edu
  8066.  
  8067. cjeffery@CS.ARIZONA.EDU ("Clinton Jeffery") writes:
  8068. >
  8069. >   John Kohl, kohl@socrates.umd.edu, writes:
  8070. >   > Understandably, Icon hasn't been ported to Windows 3.0.
  8071. >   > With XIcon there is no serious reason to port.
  8072. >
  8073. >It is up to commercial implementors or dedicated users of each particular
  8074. >window system to add graphics access to Icon.  X-Icon proves such a task
  8075. >can be done, but does not purport to be "complete" and implementors on
  8076. >other window systems are likely to add system-specific features.  I am
  8077. >always interested in talking to people doing graphics access for Icon.
  8078.  
  8079. I just want to add to this that, if anyone is considering adding such
  8080. functionality to a specific platform, it might be nice to keep
  8081. close to the X-Icon specs.  One of the great virtues of Icon is its
  8082. portability.
  8083.  
  8084. -- 
  8085.  
  8086.    -Richard L. Goerwitz              goer%sophist@uchicago.bitnet
  8087.    goer@sophist.uchicago.edu         rutgers!oddjob!gide!sophist!goer
  8088.  
  8089. From icon-group-request  Fri Apr 17 09:23:58 1992
  8090. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Fri, 17 Apr 92 09:23:58 MST
  8091. Received: from ucbvax.Berkeley.EDU by optima.cs.arizona.edu (4.1/15)
  8092.     id AA28353; Fri, 17 Apr 92 09:23:51 MST
  8093. Received: by ucbvax.Berkeley.EDU (5.63/1.43)
  8094.     id AA27698; Fri, 17 Apr 92 09:17:19 -0700
  8095. Received: from USENET by ucbvax.Berkeley.EDU with netnews
  8096.     for icon-group@cs.arizona.edu (icon-group@cs.arizona.edu)
  8097.     (contact usenet@ucbvax.Berkeley.EDU if you have questions)
  8098. Date: 15 Apr 92 20:55:38 GMT
  8099. From: adobe!yost@decwrl.dec.com  (David Yost)
  8100. Organization: Adobe Systems Incorporated
  8101. Subject: Re: features from Icon Language in lisp
  8102. Message-Id: <1992Apr15.205538.8848@adobe.com>
  8103. References: <1992Apr14.173407.28762@adobe.com>, <1992Apr15.164314.8991@midway.uchicago.edu>
  8104. Sender: icon-group-request@cs.arizona.edu
  8105. To: icon-group@cs.arizona.edu
  8106.  
  8107. In article <1992Apr15.164314.8991@midway.uchicago.edu> goer@midway.uchicago.edu writes:
  8108. >LISP, of course, isn't object-oriented
  8109.  
  8110. Heavens!  I guess you haven't hear of Common Lisp Object System, which is
  8111. IMHO considerably more advanced than the usual other suspects.  Anyone
  8112. interested in OO programming in any language should read Object Oriented
  8113. Programmin in Lisp by Sonya Keene.  CLOS is a standard part of Common Lisp
  8114. now.
  8115.  
  8116.  --dave yost
  8117.  
  8118. From whm@shepard.sunquest.com  Fri Apr 17 11:37:21 1992
  8119. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Fri, 17 Apr 92 11:37:21 MST
  8120. Received: from ALPHA.SUNQUEST.COM by optima.cs.arizona.edu (4.1/15)
  8121.     id AA03779; Fri, 17 Apr 92 11:37:12 MST
  8122. Received: from sunquest.sunquest.com by ALPHA.SUNQUEST.COM with SMTP; 
  8123.           Fri, 17 Apr 1992 11:37:00 -0700 (MST)
  8124. Received: from shepard.sunquest.com by sunquest.sunquest.com (4.1/SMI-4.1)
  8125.     id AA22970; Fri, 17 Apr 92 11:35:48 MST
  8126. Received: by shepard.sunquest.com (4.1/SMI-4.1)
  8127.     id AA10232; Fri, 17 Apr 92 11:36:33 MST
  8128. Date: Fri, 17 Apr 92 11:36:33 MST
  8129. From: whm@shepard.sunquest.com (Bill Mitchell)
  8130. Message-Id: <9204171836.AA10232@shepard.sunquest.com>
  8131. To: icon-group@cs.arizona.edu
  8132. Subject: Icon bloated?
  8133.  
  8134.  
  8135.     Richard L. Goerwitz wrote:
  8136.  
  8137.     ...
  8138.  
  8139.     Personally, I feel good about Common LISP.  It's even more bloated than
  8140.     Icon, though, and people who are really into clean LISP dialects seem
  8141.     to prefer Scheme.  ...
  8142.  
  8143. I just can't let this comment pass.  "[Common Lisp is] even more bloated
  8144. than Icon" implies that Icon is bloated.  The reference manual in the 2e of
  8145. the Icon book is a slim forty pages.  Icon is certainly not a small language
  8146. and I've heard Ralph say it's big, but "bloated" goes too far.  I think just
  8147. the opposite -- Icon has very good ratio of expressability to size of
  8148. language specification.
  8149.  
  8150. From icon-group-request  Fri Apr 17 12:45:40 1992
  8151. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Fri, 17 Apr 92 12:45:40 MST
  8152. Received: from ucbvax.Berkeley.EDU by optima.cs.arizona.edu (4.1/15)
  8153.     id AA06472; Fri, 17 Apr 92 12:45:38 MST
  8154. Received: by ucbvax.Berkeley.EDU (5.63/1.43)
  8155.     id AA06009; Fri, 17 Apr 92 11:43:16 -0700
  8156. Received: from USENET by ucbvax.Berkeley.EDU with netnews
  8157.     for icon-group@cs.arizona.edu (icon-group@cs.arizona.edu)
  8158.     (contact usenet@ucbvax.Berkeley.EDU if you have questions)
  8159. Date: 7 Apr 92 21:21:44 GMT
  8160. From: cis.ohio-state.edu!zaphod.mps.ohio-state.edu!rpi!ispd-newsserver!psinntp!xilinx!holen@ucbvax.berkeley.edu  (Victor A. Holen )
  8161. Organization: Xilinx Inc.
  8162. Subject: lang comparison (not war)
  8163. Message-Id: <1992Apr7.212144.13007@xilinx.com>
  8164. Sender: icon-group-request@cs.arizona.edu
  8165. To: icon-group@cs.arizona.edu
  8166.  
  8167. Is there somewhere (book, ftp, ...) a reasonably objective 
  8168. comparison of icon with eiffel with a few other (perhaps c++,
  8169. smalltalk, mainsail..). Comparison of features, robustness ( 
  8170. maturity of compilers), clarity in use, availability, standard-status (!),
  8171. development environment (debuger +...), performance, suitability for
  8172. large CAD (and  other) projects ..   ?
  8173. Just the basics :)  ?
  8174. Thanks.
  8175.  
  8176. -- 
  8177.  victor ....  ___  ._..  .  _.     holen@xilinx.com
  8178.  
  8179. From icon-group-request  Fri Apr 17 15:17:48 1992
  8180. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Fri, 17 Apr 92 15:17:48 MST
  8181. Received: from ucbvax.Berkeley.EDU by optima.cs.arizona.edu (4.1/15)
  8182.     id AA11991; Fri, 17 Apr 92 15:17:44 MST
  8183. Received: by ucbvax.Berkeley.EDU (5.63/1.43)
  8184.     id AA14507; Fri, 17 Apr 92 14:15:01 -0700
  8185. Received: from USENET by ucbvax.Berkeley.EDU with netnews
  8186.     for icon-group@cs.arizona.edu (icon-group@cs.arizona.edu)
  8187.     (contact usenet@ucbvax.Berkeley.EDU if you have questions)
  8188. Date: 9 Apr 92 12:50:13 GMT
  8189. From: mailer.cc.fsu.edu!sun13!sun8.scri.fsu.edu!nall@gatech.edu  (John Nall)
  8190. Organization: SCRI, Florida State University
  8191. Subject: Re: should I use ICON for a specific problem ?
  8192. Message-Id: <8139@sun13.scri.fsu.edu>
  8193. References: <1992Apr6.163124.15685@midway.uchicago.edu>, <rantapaa.702783275@s6.math.umn.edu>, <1992Apr9.045725.15554@midway.uchicago.edu>
  8194. Sender: icon-group-request@cs.arizona.edu
  8195. To: icon-group@cs.arizona.edu
  8196.  
  8197. In article <1992Apr9.045725.15554@midway.uchicago.edu> goer@midway.uchicago.edu writes:
  8198.  
  8199.    [ ... stuff deleted ... ]
  8200. >
  8201. >There's no reason to worry about flames here.  PERL is a system adminis-
  8202. >trator's tool par excellance, with a C interface that's actually much bet-
  8203. >ter than Icon's.  Icon is a much cleaner and more disciplined language,
  8204. >with a lot more options for control and data structures, coexpressions,
  8205. >and what not.  I find PERL a mess, but that's just me.  Probably I just
  8206. >don't know it well enough.
  8207.  
  8208.    It is so refreshing to see a well reasoned discussion of ICON vs PERL
  8209.    that I can't resist the temptation to say "WELL PUT!!"  I agree with
  8210.    everything that Richard said, completely, even to the part of "I find
  8211.    PERL a mess, but that's just me".  But it is certainly a gawdawful
  8212.    powerful tool in the hands of those who can deal with it :-)
  8213.  
  8214. John
  8215.  
  8216.  
  8217. --
  8218. John W. Nall              | Supercomputer Computations Research Institute
  8219. nall@mailer.scri.fsu.edu  | Florida State University, Tallahassee, FL 32306
  8220.  
  8221.  "Disclaimer:  A world which requires disclaimers has too many lawyers."
  8222.  
  8223. From icon-group-request  Fri Apr 17 18:31:09 1992
  8224. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Fri, 17 Apr 92 18:31:09 MST
  8225. Received: from ucbvax.Berkeley.EDU by optima.cs.arizona.edu (4.1/15)
  8226.     id AA18601; Fri, 17 Apr 92 18:31:07 MST
  8227. Received: by ucbvax.Berkeley.EDU (5.63/1.43)
  8228.     id AA27572; Fri, 17 Apr 92 18:09:38 -0700
  8229. Received: from USENET by ucbvax.Berkeley.EDU with netnews
  8230.     for icon-group@cs.arizona.edu (icon-group@cs.arizona.edu)
  8231.     (contact usenet@ucbvax.Berkeley.EDU if you have questions)
  8232. Date: 9 Apr 92 20:05:49 GMT
  8233. From: cis.ohio-state.edu!pacific.mps.ohio-state.edu!linac!convex!convex!tchrist@ucbvax.berkeley.edu  (Tom Christiansen)
  8234. Organization: CONVEX Realtime Development, Colorado Springs, CO
  8235. Subject: Re: should I use ICON for a specific problem ?
  8236. Message-Id: <1992Apr9.200549.10279@news.eng.convex.com>
  8237. References: <1992Apr6.163124.15685@midway.uchicago.edu>, <rantapaa.702783275@s6.math.umn.edu>, <1992Apr9.045725.15554@midway.uchicago.edu>
  8238. Sender: icon-group-request@cs.arizona.edu
  8239. To: icon-group@cs.arizona.edu
  8240.  
  8241. From the keyboard of goer@midway.uchicago.edu:
  8242. :
  8243. :There's no reason to worry about flames here.  PERL is a system adminis-
  8244. :trator's tool par excellance, with a C interface that's actually much bet-
  8245. :ter than Icon's.  Icon is a much cleaner and more disciplined language,
  8246. :with a lot more options for control and data structures, coexpressions,
  8247. :and what not.  I find PERL a mess, but that's just me.  Probably I just
  8248. :don't know it well enough.
  8249.  
  8250. Nope, you're right -- in more ways than I care to enumerate, it *is* a
  8251. mess.  The amazing thing is how well it gets the job done anyway.
  8252.  
  8253. --tom
  8254.  
  8255. From icon-group-request  Fri Apr 17 18:33:45 1992
  8256. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Fri, 17 Apr 92 18:33:45 MST
  8257. Received: from ucbvax.Berkeley.EDU by optima.cs.arizona.edu (4.1/15)
  8258.     id AA18792; Fri, 17 Apr 92 18:33:41 MST
  8259. Received: by ucbvax.Berkeley.EDU (5.63/1.43)
  8260.     id AA27458; Fri, 17 Apr 92 18:08:07 -0700
  8261. Received: from USENET by ucbvax.Berkeley.EDU with netnews
  8262.     for icon-group@cs.arizona.edu (icon-group@cs.arizona.edu)
  8263.     (contact usenet@ucbvax.Berkeley.EDU if you have questions)
  8264. Date: 9 Apr 92 20:02:08 GMT
  8265. From: cis.ohio-state.edu!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!linac!convex!convex!tchrist@ucbvax.berkeley.edu  (Tom Christiansen)
  8266. Organization: CONVEX Realtime Development, Colorado Springs, CO
  8267. Subject: Re: should I use ICON for a specific problem ?
  8268. Message-Id: <1992Apr9.200208.6455@news.eng.convex.com>
  8269. References: <1992Apr6.104410.12693@news.uni-stuttgart.de>, <1992Apr6.163124.15685@midway.uchicago.edu>, <rantapaa.702783275@s6.math.umn.edu>
  8270. Sender: icon-group-request@cs.arizona.edu
  8271. To: icon-group@cs.arizona.edu
  8272.  
  8273. From the keyboard of rantapaa@s6.math.umn.edu (Erik E. Rantapaa):
  8274.  
  8275. At the risk of raising Richard's ire, I'm going to clarify 
  8276. a couple of Erik's points.
  8277.  
  8278. :>>2. multidimension arrays should be available   (nawk-synax:  array[1,2])
  8279. :
  8280. :--- Perl loses here.  Only singly dimensioned arrays are supported, but
  8281. :multi-dimensional arrays can be simulated, e.g. array["1,2"].
  8282.  
  8283. Not precisely correct: simulated multi-dimensional arrays via index
  8284. concatenation are directly supported syntactically you can say $array{$x}
  8285. or $array{$x, $y} or $array{$x, $y, $z}, etc.
  8286.  
  8287. :>>5. same loops as for, do and while in C should be available (not the 
  8288. :>>   same syntax is needed ...)
  8289. :
  8290. :+++ Perl has loops with equivalents for 'continue' and 'break'.
  8291.  
  8292. Furthermore, since loops can be labeled, you can name which loop
  8293. you want to break or continue, something you can't do in C.  There's
  8294. also a third form of loop control, redo, which is like continue
  8295. without doing the 3rd for of the for loop (the re-init portion).
  8296. Furthermore, there's a "foreach elt (list)" looping construct as well.
  8297.  
  8298. :>>6. total computer-readable documentation is needed (I don't want to buy a
  8299. :>>   book of a thing, that maybe don't do it ...)
  8300. :
  8301. :+++ Perl comes with lots of free documentation -- in texinfo format.
  8302.  
  8303. You can also use the online man page, which is nearly booklength.
  8304. Also, the book examples are available on-line, as is all of 
  8305. comp.lang.perl from all time, as well as various database and
  8306. retrieval methods for perusing it.
  8307.  
  8308. :Perl has its roots in the Unix utilities sed, ed, grep, sh and, yes, awk.
  8309. :(Yes, yes is a Unix utility; no, it's not related to Perl :) My knowledge
  8310. :of genealogical terminalogy is not that great, so maybe someone else can
  8311. :fill in what relationship Perl, awk and Icon have with each other.
  8312.  
  8313. The current list of tools from which perl derives something of its
  8314. eclectic nature includes but is not limited to the Bourne shell, csh, 
  8315. awk, sed, tr, cpp, C (classic and ANSI), BASIC-PLUS, Pascal, Ada, Lisp,
  8316. APL, Fortran, Algol, egrep, nroff, /bin/test, vi, and emacs.  Seriously.
  8317.  
  8318. :Perl arrays function for the most part just like awk's.
  8319.  
  8320. Well, Perl has two kinds of things you might call arrays, but are perhaps
  8321. better characterized as lists and tables.  Lists one uses numeric indices
  8322. on as well as push and pop kinds of operations, whereas tables are generic
  8323. hash tables employing arbitrary indices.  Both data structures dynamically
  8324. resize internally to avoid performance degradations.  Tables can also be
  8325. bound directly to dbm files for rapid-access persistent data.
  8326.  
  8327. :In general, Icon has better support for data structures than Perl does.
  8328. :It's not real easy to implement 'recursive' data structures in Perl, although
  8329. :it can be done (although usually a way is found to get around it.)
  8330.  
  8331. True enough.  The major hurdle is lack of syntactic sugar.  You can
  8332. make a table of pointers to lists of pointers to lists of pointers
  8333. to tables, but the dereferencing requires a temporary variable for
  8334. each dereference.
  8335.  
  8336. :Icon wins with the arbitrarily large integers.
  8337.  
  8338. Perl has arbitrarily large integers, rationals, and floats 
  8339. available via the libbig (bigfloat, bigint, bigrat) library package, 
  8340. with normal arithmetic operations on them supported via library
  8341. routines.  Of course, these haven't a change of being as fast
  8342. as binary machine floats, since they're stored as strings.
  8343.  
  8344. :>Question #4:  Does Icon have subroutines?  If by this you mean that you can
  8345. :>define your own procedures, then yes.  If you mean, "does it let you use
  8346. :>labels," then the answer is "no."
  8347. :
  8348. :Perl has labels like C does.  Icon has more powerful subroutines, however.
  8349. :They are, in fact, more like co-routines, something I wish Perl had.
  8350.  
  8351. Well, perl labels are a little neater than C's because of the way you can
  8352. use them to label loops and as operands for loop-control statements, as
  8353. previously explained.
  8354.  
  8355. Subroutines in perl can also be called indirectly; recursion is 
  8356. supported; they can be autoloaded; they can live in protected 
  8357. namespaces (somewhat like file statics in C); they can for 
  8358. good or evil be overridden via dynamic scoping.
  8359.  
  8360. --tom
  8361.  
  8362. From icon-group-request  Sat Apr 18 02:47:17 1992
  8363. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Sat, 18 Apr 92 02:47:17 MST
  8364. Received: from ucbvax.Berkeley.EDU by optima.cs.arizona.edu (4.1/15)
  8365.     id AA04963; Sat, 18 Apr 92 02:47:13 MST
  8366. Received: by ucbvax.Berkeley.EDU (5.63/1.43)
  8367.     id AA01534; Sat, 18 Apr 92 02:40:35 -0700
  8368. Received: from USENET by ucbvax.Berkeley.EDU with netnews
  8369.     for icon-group@cs.arizona.edu (icon-group@cs.arizona.edu)
  8370.     (contact usenet@ucbvax.Berkeley.EDU if you have questions)
  8371. Date: 10 Apr 92 03:05:33 GMT
  8372. From: att!linac!uchinews!ellis!goer@ucbvax.berkeley.edu  (Richard L. Goerwitz)
  8373. Organization: University of Chicago Computing Organizations
  8374. Subject: upto() with backslash escaping
  8375. Message-Id: <1992Apr10.030533.16431@midway.uchicago.edu>
  8376. Sender: icon-group-request@cs.arizona.edu
  8377. To: icon-group@cs.arizona.edu
  8378.  
  8379.  
  8380. Anybody else need one of these?
  8381. -Richard
  8382.  
  8383. ############################################################################
  8384. #
  8385. #    Name:     slashupto.icn
  8386. #
  8387. #    Title:     slashupto (upto with backslash escaping)
  8388. #
  8389. #    Author:     Richard L. Goerwitz
  8390. #
  8391. #    Version: 1.1
  8392. #
  8393. ############################################################################
  8394. #
  8395. #  Slashupto works just like upto, except that it ignores backslash
  8396. #  escaped characters.  I can't even begin to express how often I've
  8397. #  run into problems applying Icon's string scanning facilities to
  8398. #  to input that uses backslash escaping.  Normally, I tokenize first,
  8399. #  and then work with lists.  With slashupto() I can now postpone or
  8400. #  even eliminate the traditional tokenizing step, and let Icon's
  8401. #  string scanning facilities to more of the work.
  8402. #
  8403. #  If you're confused:
  8404. #
  8405. #  Typically UNIX utilities (and probably others) use backslashes to
  8406. #  "escape" (i.e. remove the special meaning of) metacharacters.  For
  8407. #  instance, UNIX shells normally accept "*" as a shorthand for "any
  8408. #  series of zero or more characters.  You can make the "*" a literal
  8409. #  "*," with no special meaning, by prepending a backslash.  The rou-
  8410. #  tine slashupto() understands these backslashing conventions.  You
  8411. #  can use it to find the "*" and other special characters because it
  8412. #  will ignore "escaped" characters.
  8413. #
  8414. ############################################################################
  8415. #
  8416. #  Links: none
  8417. #
  8418. #  See also: slashbal.icn
  8419. #
  8420. ############################################################################
  8421.  
  8422. #
  8423. # slashupto:  cset x string x integer x integer -> integers
  8424. #             (c, s, i, j) -> Is (a generator)
  8425. #    where Is are the integer positions in s[i:j] before characters
  8426. #    in c that is not preceded by a backslash escape
  8427. #
  8428. procedure slashupto(c, s, i, j)
  8429.  
  8430.     if /s := &subject
  8431.     then /i := &pos
  8432.     else /i := 1
  8433.     /j := *s + 1
  8434.     
  8435.     /c := &cset
  8436.     c ++:= '\\'
  8437.     s[1:j] ? {
  8438.         tab(i)
  8439.         while tab(upto(c)) do {
  8440.             if (="\\", move(1)) then next
  8441.             suspend .&pos
  8442.             move(1)
  8443.         }
  8444.     }
  8445.  
  8446. end
  8447.  
  8448. -- 
  8449.  
  8450.    -Richard L. Goerwitz              goer%ellis@uchicago.bitnet
  8451.    goer@ellis.uchicago.edu           rutgers!oddjob!ellis!goer
  8452.  
  8453. From icon-group-request  Sun Apr 19 05:33:58 1992
  8454. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Sun, 19 Apr 92 05:33:58 MST
  8455. Received: from ucbvax.Berkeley.EDU by optima.cs.arizona.edu (4.1/15)
  8456.     id AA14073; Sun, 19 Apr 92 05:33:55 MST
  8457. Received: by ucbvax.Berkeley.EDU (5.63/1.43)
  8458.     id AA19963; Sun, 19 Apr 92 05:32:40 -0700
  8459. Received: from USENET by ucbvax.Berkeley.EDU with netnews
  8460.     for icon-group@cs.arizona.edu (icon-group@cs.arizona.edu)
  8461.     (contact usenet@ucbvax.Berkeley.EDU if you have questions)
  8462. Date: 10 Apr 92 17:39:51 GMT
  8463. From: cis.ohio-state.edu!zaphod.mps.ohio-state.edu!usc!wupost!csus.edu!netcomsv!mork!nagle@ucbvax.berkeley.edu  (John Nagle)
  8464. Organization: Netcom - Online Communication Services  (408 241-9760 guest)
  8465. Subject: Re: lang comparison (not war)
  8466. Message-Id: <0#tj+5g.nagle@netcom.com>
  8467. References: <1992Apr7.212144.13007@xilinx.com>
  8468. Sender: icon-group-request@cs.arizona.edu
  8469. To: icon-group@cs.arizona.edu
  8470.  
  8471. holen@xilinx.com (Victor A. Holen ) writes:
  8472.  
  8473. >Is there somewhere (book, ftp, ...) a reasonably objective 
  8474. >comparison of icon with eiffel with a few other (perhaps c++,
  8475. >smalltalk, mainsail..). 
  8476.  
  8477.        I haven't heard much about Icon in years.  It was intended as
  8478. a replacement for Snobol, and perhaps as an alternative to the horrible
  8479. "string languages" ("awk", "sed") that come with UNIX.  Icon offers
  8480. Snobol-like matching with C-like syntax.  It's intended for a 
  8481. different class of applications than is Eiffel.
  8482.  
  8483.                     John Nagle
  8484.  
  8485. From icon-group-request  Sun Apr 19 06:49:40 1992
  8486. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Sun, 19 Apr 92 06:49:40 MST
  8487. Received: from ucbvax.Berkeley.EDU by optima.cs.arizona.edu (4.1/15)
  8488.     id AA16210; Sun, 19 Apr 92 06:49:38 MST
  8489. Received: by ucbvax.Berkeley.EDU (5.63/1.43)
  8490.     id AA22845; Sun, 19 Apr 92 06:44:54 -0700
  8491. Received: from USENET by ucbvax.Berkeley.EDU with netnews
  8492.     for icon-group@cs.arizona.edu (icon-group@cs.arizona.edu)
  8493.     (contact usenet@ucbvax.Berkeley.EDU if you have questions)
  8494. Date: 10 Apr 92 18:32:35 GMT
  8495. From: cis.ohio-state.edu!zaphod.mps.ohio-state.edu!usc!nic!netlabs!lwall@ucbvax.berkeley.edu  (Larry Wall)
  8496. Organization: NetLabs, Inc.
  8497. Subject: Re: should I use ICON for a specific problem ?
  8498. Message-Id: <1992Apr10.183235.10731@netlabs.com>
  8499. References: <rantapaa.702783275@s6.math.umn.edu>, <1992Apr9.045725.15554@midway.uchicago.edu>, <1992Apr9.200549.10279@news.eng.convex.com>
  8500. Sender: icon-group-request@cs.arizona.edu
  8501. To: icon-group@cs.arizona.edu
  8502.  
  8503. In article <1992Apr9.200549.10279@news.eng.convex.com> tchrist@convex.COM (Tom Christiansen) writes:
  8504. : From the keyboard of goer@midway.uchicago.edu:
  8505. : :
  8506. : :There's no reason to worry about flames here.  PERL is a system adminis-
  8507. : :trator's tool par excellance, with a C interface that's actually much bet-
  8508. : :ter than Icon's.  Icon is a much cleaner and more disciplined language,
  8509. : :with a lot more options for control and data structures, coexpressions,
  8510. : :and what not.  I find PERL a mess, but that's just me.  Probably I just
  8511. : :don't know it well enough.
  8512. : Nope, you're right -- in more ways than I care to enumerate, it *is* a
  8513. : mess.  The amazing thing is how well it gets the job done anyway.
  8514.  
  8515. Perl was intended to be a mess from the start, so it's a very, um,
  8516. systematic mess...  :-)
  8517.  
  8518. Larry
  8519.  
  8520. From icon-group-request  Sun Apr 19 09:33:55 1992
  8521. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Sun, 19 Apr 92 09:33:55 MST
  8522. Received: from ucbvax.Berkeley.EDU by optima.cs.arizona.edu (4.1/15)
  8523.     id AA19416; Sun, 19 Apr 92 09:33:53 MST
  8524. Received: by ucbvax.Berkeley.EDU (5.63/1.43)
  8525.     id AA01725; Sun, 19 Apr 92 09:20:34 -0700
  8526. Received: from USENET by ucbvax.Berkeley.EDU with netnews
  8527.     for icon-group@cs.arizona.edu (icon-group@cs.arizona.edu)
  8528.     (contact usenet@ucbvax.Berkeley.EDU if you have questions)
  8529. Date: 18 Apr 92 17:37:43 GMT
  8530. From: sol.ctr.columbia.edu!zaphod.mps.ohio-state.edu!news.acns.nwu.edu!uicvm.uic.edu!u47041@lll-winken.llnl.gov
  8531. Organization: University of Illinois at Chicago
  8532. Subject: wanted:ftp sites for icon
  8533. Message-Id: <92109.123743U47041@uicvm.uic.edu>
  8534. Sender: icon-group-request@cs.arizona.edu
  8535. To: icon-group@cs.arizona.edu
  8536.  
  8537. helo folks, i used snobol for a while and seems its time for the
  8538. next one. can anyone tell me where can i ftp
  8539.  
  8540. icon( for pc's and unix)?
  8541. thanx in advance
  8542.  
  8543. u47041@uicvm.bintet
  8544. kapoulas@lac.math.uic.edu
  8545.  
  8546. From icon-group-request  Sun Apr 19 13:06:21 1992
  8547. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Sun, 19 Apr 92 13:06:21 MST
  8548. Received: from ucbvax.Berkeley.EDU by optima.cs.arizona.edu (4.1/15)
  8549.     id AA25497; Sun, 19 Apr 92 13:06:18 MST
  8550. Received: by ucbvax.Berkeley.EDU (5.63/1.43)
  8551.     id AA12880; Sun, 19 Apr 92 12:56:55 -0700
  8552. Received: from USENET by ucbvax.Berkeley.EDU with netnews
  8553.     for icon-group@cs.arizona.edu (icon-group@cs.arizona.edu)
  8554.     (contact usenet@ucbvax.Berkeley.EDU if you have questions)
  8555. Date: 19 Apr 92 01:02:53 GMT
  8556. From: dog.ee.lbl.gov!network.ucsd.edu!swrinde!zaphod.mps.ohio-state.edu!magnus.acs.ohio-state.edu!usenet.ins.cwru.edu!ncoast!allbery@ucbvax.berkeley.edu  (Brandon S. Allbery KF8NH)
  8557. Organization: North Coast Public Access *NIX, Cleveland, OH
  8558. Subject: Re: Icon bloated?
  8559. Message-Id: <1992Apr19.010253.8767@NCoast.ORG>
  8560. References: <9204171836.AA10232@shepard.sunquest.com>
  8561. Sender: icon-group-request@cs.arizona.edu
  8562. To: icon-group@cs.arizona.edu
  8563.  
  8564. As quoted from <9204171836.AA10232@shepard.sunquest.com> by whm@SHEPARD.SUNQUEST.COM (Bill Mitchell):
  8565. +---------------
  8566. |     Richard L. Goerwitz wrote:
  8567. |     Personally, I feel good about Common LISP.  It's even more bloated than
  8568. |     Icon, though, and people who are really into clean LISP dialects seem
  8569. |     to prefer Scheme.  ...
  8570. | I just can't let this comment pass.  "[Common Lisp is] even more bloated
  8571. | than Icon" implies that Icon is bloated.  The reference manual in the 2e of
  8572. | the Icon book is a slim forty pages.  Icon is certainly not a small language
  8573. | and I've heard Ralph say it's big, but "bloated" goes too far.  I think just
  8574. | the opposite -- Icon has very good ratio of expressability to size of
  8575. | language specification.
  8576. +---------------
  8577.  
  8578. Very much agreed.  In fact, I've currently encountered only *one* thing that
  8579. might make a worthwhile extension to Icon; and it looks like a logical
  8580. extension of existing features, so it's not exactly out of place.  I
  8581. encountered an application where I wanted to use something like Icon's pattern
  8582. matching on what amounted to token streams.  The generalized form is "pattern
  8583. matching" on types other than strings; I've implemented it (well, sort of) as
  8584. a library loosely modeled on Icon's string pattern matching and using
  8585. coroutines.  But I think it also needs a lot more though before it can be
  8586. considered for inclusion into Icon.  (The problem with the library is it's
  8587. still rather type-dependent.)
  8588.  
  8589. Other than that one possible future extension (again, ONLY when it's ready,
  8590. which it very much isn't in at least my current visualization) it seems to me
  8591. that Icon is quite expressive for all its essential simplicity.  It's amazing
  8592. (at least to those of us accustomed to "conventional" programming languages)
  8593. how much cruft can be avoided by the use of Iconisms such as goal-directed
  8594. evaluation, etc.
  8595.  
  8596. ++Brandon
  8597. -- 
  8598. Brandon S. Allbery, KF8NH [44.70.4.88]        allbery@NCoast.ORG
  8599. Senior Programmer, Telotech, Inc. (if I may call myself that...)
  8600.  
  8601. From wgg@cs.ucsd.edu  Sun Apr 19 13:43:03 1992
  8602. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Sun, 19 Apr 92 13:43:03 MST
  8603. Received: from ucsd.edu by optima.cs.arizona.edu (4.1/15)
  8604.     id AA26642; Sun, 19 Apr 92 13:43:00 MST
  8605. Received: from odin.ucsd.edu by ucsd.edu; id AA04163
  8606.     sendmail 5.64/UCSD-2.2-sun via SMTP
  8607.     Sun, 19 Apr 92 13:42:44 -0700 for icon-group@cs.arizona.edu
  8608. Received: from gremlin.ucsd.edu by odin.ucsd.edu (4.1/UCSDPSEUDO.4)
  8609.     id AA29599 for dog.ee.lbl.gov!network.ucsd.edu!swrinde!zaphod.mps.ohio-state.edu!magnus.acs.ohio-state.edu!usenet.ins.cwru.edu!ncoast!allbery@ucbvax.berkeley.edu; Sun, 19 Apr 92 13:42:43 PDT
  8610. Received: by gremlin.ucsd.edu (4.1/UCSDPSEUDO.4)
  8611.     id AA24368 for icon-group@cs.arizona.edu; Sun, 19 Apr 92 13:42:42 PDT
  8612. Date: Sun, 19 Apr 92 13:42:42 PDT
  8613. From: wgg@cs.ucsd.edu (William Griswold)
  8614. Message-Id: <9204192042.AA24368@gremlin.ucsd.edu>
  8615. To: dog.ee.lbl.gov!network.ucsd.edu!swrinde!zaphod.mps.ohio-state.edu!magnus.acs.ohio-state.edu!usenet.ins.cwru.edu!ncoast!allbery@ucbvax.berkeley.edu,
  8616.         icon-group@cs.arizona.edu
  8617. Subject: Re: Icon bloated?
  8618.  
  8619. Icon is tiny compared to Common Lisp (CL).  The recent 2nd edition manual
  8620. for CL is some 1000 pages, in smaller print than the Icon book.  Fortunately
  8621. for programmers, Icon and CL subset nicely, allowing a gentle introduction
  8622. to each.  However, there is still the problem that it is often faster to
  8623. code a function yourself than to find the Icon/CL function that does the
  8624. equivalent thing.
  8625.  
  8626. Another problem with language bloating is implementing programming tools
  8627. for a language.  Although a programmer can learn one feature at a time,
  8628. few tools will work at all unless they support the whole language.  I would
  8629. guess that much of Ralph's objection to the size of Icon is due to the cost
  8630. of maintaining the Icon Project's language systems, not the learning curve.
  8631.  
  8632. As software engineers push for ever-higher programmer productivity, they
  8633. are increasingly looking at tool solutions to programming problems, rather
  8634. than languages.  However, language size is a considerable barrier when
  8635. moving from research into practice.  For example, I have a program
  8636. restructuring tool for a subset of the LISP dialect Scheme.  To move this
  8637. system to CL is such a monumental task that I cannot consider it in a
  8638. research environment.  For the same reason DARPA/DoD is looking for Ada
  8639. subsets that researchers can use for their tools research.  No sane
  8640. researcher would ever build a tool for a complete language as complex as Ada.
  8641.  
  8642.                     Bill Griswold
  8643.                     UC San Diego
  8644.  
  8645. From icon-group-request  Sun Apr 19 19:35:17 1992
  8646. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Sun, 19 Apr 92 19:35:17 MST
  8647. Received: from ucbvax.Berkeley.EDU by optima.cs.arizona.edu (4.1/15)
  8648.     id AA06041; Sun, 19 Apr 92 19:35:14 MST
  8649. Received: by ucbvax.Berkeley.EDU (5.63/1.43)
  8650.     id AA05043; Sun, 19 Apr 92 19:26:55 -0700
  8651. Received: from USENET by ucbvax.Berkeley.EDU with netnews
  8652.     for icon-group@cs.arizona.edu (icon-group@cs.arizona.edu)
  8653.     (contact usenet@ucbvax.Berkeley.EDU if you have questions)
  8654. Date: 13 Apr 92 18:33:36 GMT
  8655. From: cis.ohio-state.edu!zaphod.mps.ohio-state.edu!sol.ctr.columbia.edu!ira.uka.de!sun1.ruf.uni-freiburg.de!news.belwue.de!news.uni-stuttgart.de!helpdesk.rus.uni-stuttgart.de!zrzm0111@ucbvax.Berkeley  (MUFTI)
  8656. Organization: User Helpdesk Comp. Cent. (RUS) U of Stuttgart, FRG
  8657. Subject: Why I can't use perl
  8658. Message-Id: <1992Apr13.183336.3439@news.uni-stuttgart.de>
  8659. Sender: icon-group-request@cs.arizona.edu
  8660. To: icon-group@cs.arizona.edu
  8661.  
  8662. Dear Sirs,
  8663.  
  8664. Unfortunatly I started a icon vs. perl language war with my question if
  8665. I should use icon for my awk-script.
  8666.  
  8667. I thougth about using perl, before I thougth about icon, but perl seams to be 
  8668. too slow:
  8669.  
  8670.  1. Cause perl don't support "dump" on my system, the program needs with 
  8671.     perl the same big amount of time to startup, as with nawk/gawk. In this
  8672.     point wins the semicompiling concect of icon. 
  8673.  
  8674.  2. So I know perl doesn't support integer. Cause my machine has no 
  8675.     Floating Point Unit, a perl program is slower than a "tuned" gawk-version
  8676.     where 
  8677.     #define AWKTYPE long    (instead of double)
  8678.  
  8679. thanks to all for help
  8680.  
  8681. yours 
  8682. MUFTI
  8683.  
  8684. ps: the a2p -program doesn't work for my program, cause it don't know some-
  8685.     thing about the "do { } while()" -loop, which is a nawk-special feature
  8686.  
  8687. From icon-group-request  Sun Apr 19 20:22:03 1992
  8688. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Sun, 19 Apr 92 20:22:03 MST
  8689. Received: from ucbvax.Berkeley.EDU by optima.cs.arizona.edu (4.1/15)
  8690.     id AA07247; Sun, 19 Apr 92 20:22:01 MST
  8691. Received: by ucbvax.Berkeley.EDU (5.63/1.43)
  8692.     id AA07843; Sun, 19 Apr 92 20:17:45 -0700
  8693. Received: from USENET by ucbvax.Berkeley.EDU with netnews
  8694.     for icon-group@cs.arizona.edu (icon-group@cs.arizona.edu)
  8695.     (contact usenet@ucbvax.Berkeley.EDU if you have questions)
  8696. Date: 19 Apr 92 21:22:01 GMT
  8697. From: shack@arizona.edu  (David Shackelford)
  8698. Organization: U of Arizona CS Dept, Tucson
  8699. Subject: Re: wanted:ftp sites for icon
  8700. Message-Id: <3669@caslon.cs.arizona.edu>
  8701. References: <92109.123743U47041@uicvm.uic.edu>
  8702. Sender: icon-group-request@cs.arizona.edu
  8703. To: icon-group@cs.arizona.edu
  8704.  
  8705. In article <92109.123743U47041@uicvm.uic.edu> U47041@uicvm.uic.edu writes:
  8706. >helo folks, i used snobol for a while and seems its time for the
  8707. >next one. can anyone tell me where can i ftp
  8708.  
  8709. Icon is available by anonymous FTP from the University of Arizona
  8710. at cs.arizona.edu.  Versions are available for many op. systems including
  8711. UNIX, VMS, DOS, and OS/2.
  8712.  
  8713. From janpeter@mpi.kun.nl  Tue Apr 21 05:55:54 1992
  8714. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Tue, 21 Apr 92 05:55:54 MST
  8715. Received: from wn1.sci.kun.nl by optima.cs.arizona.edu (4.1/15)
  8716.     id AA27238; Tue, 21 Apr 92 05:55:45 MST
  8717. Received: by wn1.sci.kun.nl (5.57/2.1) on NUNET
  8718.      id AA05307; Tue, 21 Apr 92 14:57:00 +0200
  8719. Received: by mpix10.mpi.kun.nl (5.57/2.0) on NUNET
  8720.      id AA06445; Tue, 21 Apr 92 14:54:49 +0200
  8721. Date: Tue, 21 Apr 92 14:54:49 +0200
  8722. From: Jan Peter de Ruiter <janpeter@mpi.kun.nl>
  8723. Message-Id: <9204211254.AA06445@mpix10.mpi.kun.nl>
  8724. To: icon-group@cs.arizona.edu
  8725. Subject: icon/awk
  8726.  
  8727. Since I received many reactions concerning my "icon/awk" library, I will
  8728. send it to the group-adress (see below).
  8729.  
  8730. However, I think it is appropriate to add a disclaimer: like I said
  8731. in my previous mail on the subject, the /pattern/ { action } form is not
  8732. emulated, for obvious reasons. ICON itself is (in my opinion) better
  8733. equipped to handle pattern scanning, and I wouldn't like to spend long
  8734. nights hacking away to emulate grep-type regular expressions, when ICON
  8735. already has equivalent facilities. Besides, the lib would then become
  8736. even slower than it is already. However, for some AWK users, exactly
  8737. this feature (grep-type expressions) is their reason for using AWK.
  8738.  
  8739. What I like about AWK is the possibility of adressing the columns in a stream,
  8740. given a certain set of separator characters. It is that aspect that I wanted to
  8741. use in ICON, and it is that functionality that I've tried to implement in a LIB.
  8742.  
  8743. If anyone of you improves upon the library, I'd appreciate hearing about it. 
  8744.  
  8745. keil@apollo.hp.com has suggested that the $ symbol *could* be used instead of 
  8746. "FLD" for field identifyers. I do not know, however, how this can be done.
  8747. Has any of the ICON guru's a suggestion? 
  8748.  
  8749. The lib:
  8750.  
  8751. #   AWK emulation library.
  8752. #
  8753. #   USAGE:
  8754. #
  8755. #   compile AWEKA.ICN with the -c option.
  8756. #   At the top of your program declare:
  8757. #
  8758. #       link aweka
  8759. #
  8760. #   You can now open a stream (say, "instream") and pass this as
  8761. #   an argument to the procedure awk(). If the stream is at EOF,
  8762. #   the function awk() fails, so the following form is useful:
  8763. #
  8764. #       while awk(instream) do {
  8765. #           ...
  8766. #       }
  8767. #
  8768. #   Every time awk(stream) is called, it reads a line from stream, and
  8769. #   sets the global variables FLD, NR, and NF. awk() returns the whole line
  8770. #   that was read from the stream (cf. $0 in AWK).
  8771. #
  8772. #   FLD is a list, where FLD[n] corresponds to the nth column in the input
  8773. #   line, separated by characters from FS. Note that you can therefore use
  8774. #   FLD as a generator, or with the pop() function, or what have you.
  8775. #
  8776. #   NR is the number of records read from the input stream.
  8777. #   NF is the number of fields read. 
  8778. #
  8779. #   The global var FS is a cset, specifying the whitespace characters. If you
  8780. #   do not set FS, awk() uses the space and tab character as default. If you
  8781. #   want another set of separator-chars, you can set FS to the desired
  8782. #   cset before calling awk(). It is also possible to change FS 
  8783. #   between successive calls to awk() with the same stream. (see example)
  8784. #
  8785. #   If you call awk() with another stream argument than the one you used in
  8786. #   the previous call to awk(), it resets the value of NR to 0.
  8787. #
  8788. #   The caller (your icon program) is responsible for opening and closing
  8789. #   the streams.
  8790. #
  8791. #
  8792. #   An example program to print out all words in an ascii text on a separate
  8793. #   line. It changes the value of FS from ' ;' to ' ,.;:?!' if the string
  8794. #   "TEXT" is processed, and it sets the value of FS to ' ;' again if the
  8795. #   string "PROGRAM" is encountered. It then opens a new file, and does the
  8796. #   same thing with the default character set, without changing FS. It shows
  8797. #   some of nice awk*icon mixtures that can be used.
  8798. #
  8799. #   # example and test program for AWEKA lib
  8800. #   link aweka
  8801. #   procedure main()
  8802. #       instream := open("awktest.dat")
  8803. #       FS := ' ;'
  8804. #
  8805. #       while(awk(instream)) do {
  8806. #           every(i := 1 to NF) do {
  8807. #               case FLD[i] of {
  8808. #                "TEXT"    : FS := ' ,.;:?!'
  8809. #                "PROGRAM" : FS := ' ;'
  8810. #               }
  8811. #               write(FLD[i])
  8812. #           }
  8813. #       }
  8814. #
  8815. #       secondstream := open("awktest2.dat")
  8816. #       FS := &null   # in order to restore the default charset
  8817. #       while awk(secondstream) do every(write(!FLD))
  8818. #
  8819. #       close(instream)
  8820. #       close(secondstream)
  8821. #   end
  8822. #
  8823. #
  8824. #
  8825. global NF, NR, FLD, FS
  8826. procedure awk(file)
  8827.     static oldfile
  8828.     initial { oldfile := &null }
  8829.  
  8830.     if (oldfile ~=== file) then {
  8831.         NR := 0
  8832.         oldfile := file
  8833.     }
  8834.  
  8835.     if (/FS) then FS := ' \t'
  8836.     charset := &cset -- cset(FS)
  8837.     NF := 0
  8838.     FLD := list()
  8839.  
  8840.     if(LSTR := !file) then NR +:= 1 else fail
  8841.     LSTR ? while(tab(upto(charset))) do put(FLD,tab(many(charset)))
  8842.     NF := *FLD
  8843.     suspend LSTR
  8844. end
  8845.  
  8846. From MATH0022@rmc.ca  Tue Apr 21 10:52:09 1992
  8847. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Tue, 21 Apr 92 10:52:09 MST
  8848. Received: from Arizona.edu (Osprey.Telcom.Arizona.EDU) by optima.cs.arizona.edu (4.1/15)
  8849.     id AA09366; Tue, 21 Apr 92 10:51:30 MST
  8850. Received: from RMC.CA (MAILER@RMC) by Arizona.edu (PMDF #12663) id
  8851.  <01GJ3UGERAVWA9OUD2@Arizona.edu>; Tue, 21 Apr 1992 10:51 MST
  8852. Received: by RMC (Mailer) id 45140317390; Tue, 21 Apr 92 13:47:10 EST
  8853. Date: Tue, 21 Apr 92 13:22:16 EST
  8854. From: MATH0022@rmc.ca
  8855. Subject: References please ....
  8856. To: icon-group@cs.arizona.edu
  8857. Reply-To: LINDSAY_JH@rmc.ca
  8858. Message-Id: <920421.13460935.081750@RMC.CP6>
  8859. X-Envelope-To: icon-group@cs.Arizona.edu
  8860.  
  8861.         One would not expect the current PERL-AWK-NAWK-&c controversy on THIS
  8862. board.  However, since it's there, would someone please post a list of
  8863. references to PERL, AWK, NAWK, &c., preferrably including any sort of definitive
  8864. documents or standards documents and some introductory material.  The "perl"
  8865. that I have references to is plainly not the PERL being discussed here, and my
  8866. AWK material must be very out of date.  It would be a good place to list any
  8867. sort of comparative document too.
  8868.  
  8869.                                         Thanks.
  8870.  
  8871. --------------------------------------------------------------------------------
  8872.  
  8873.             John H. Lindsay,
  8874.             Department of Mathematics and Computer Science,
  8875.             Royal Military College of Canada,
  8876.             Kingston, Ontario, Canada, K7K 5L0.
  8877.  
  8878.             Phones: Office,                          (613) 541-6419
  8879.                     Messages,                              541-6343 or 541-6458
  8880.                     Home,                                  546-6988
  8881.             E-Mail: From Bitnet, NetNorth, ONet:     LINDSAY_JH@RMC.CA
  8882.                     From Canadian Military Colleges: LINDSAY JH@RMC
  8883.             Fax:                                     (613) 542-8129
  8884.  
  8885. From MATH0022@rmc.ca  Tue Apr 21 13:24:56 1992
  8886. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Tue, 21 Apr 92 13:24:56 MST
  8887. Received: from Arizona.edu (Merlin.Telcom.Arizona.EDU) by optima.cs.arizona.edu (4.1/15)
  8888.     id AA17503; Tue, 21 Apr 92 13:24:46 MST
  8889. Received: from RMC.CA (MAILER@RMC) by Arizona.edu (PMDF #12663) id
  8890.  <01GJ3ZSCQO9OA9UI81@Arizona.edu>; Tue, 21 Apr 1992 13:24 MST
  8891. Received: by RMC (Mailer) id 45141254084; Tue, 21 Apr 92 16:23:12 EST
  8892. Date: Tue, 21 Apr 92 16:22:17 EST
  8893. From: MATH0022@rmc.ca
  8894. Subject: Algol 60 Call-by-Name & SNOBOL4 & ICON .... ?
  8895. To: icon-group@cs.arizona.edu
  8896. Reply-To: LINDSAY_JH@rmc.ca
  8897. Message-Id: <920421.16221752.081750@RMC.CP6>
  8898. X-Envelope-To: icon-group@cs.Arizona.edu
  8899.  
  8900.         The ideas of passing a SNOBOL4 (delayed) expression or an ICON
  8901. co-expression as an argument to a procedure present the thought that these are
  8902. "almost" like the Algol 60 Call-by-Name facility, painfully so if one wants to
  8903. use a facility of that sort, but can't because these are not quite like it, and
  8904. enragingly so if one finds such a facility too mind-boggling to be a part of a
  8905. readable reliable program.
  8906.  
  8907.         For the Johnny-and-Suzie-come-latelies, in Algol 60 and some related
  8908. languages, an actual parameter (= argument) of a procedure call which does not
  8909. correspond to a formal VALUE parameter is reevaluated every time it's referenced
  8910. in the called procedure, but in the context of the block containing the call.
  8911. This means that even as simple an argument as an array element can change its
  8912. meaning or value from reference to reference in the called routine because the
  8913. subscripting is redone, and reflects any changes in the value of the subscript.
  8914. The situation shows up well in Algol W (an "Algol 67" -- a step looking forward
  8915. to Algol 68, and done by Nick Wirth, associates and students at Stanford); that
  8916. Algol also allowed <statement>s to be actual parameters, but the corresponding
  8917. formal parameters were then declared as parameterless procedures, and one might
  8918. infer that other types of formal parameters corresponding to a <Type> expression
  8919. as an actual parameter were thought of, if not declared, in that way.
  8920.  
  8921.         The notable "deficiencies" (useful roadblocks ?) that inhibit or prevent
  8922. the use of delayed expressions and co-expressions in SNOBOL4 and ICON as actual
  8923. Call-by-Name parameters, as I see it, are:
  8924.     The inability of a SNOBOL4 expression to NRETURN like a function so that
  8925.         such a parameter can't be used as the target of an assignment without
  8926.         doing an indirect,
  8927.     The semantics of the SNOBOL4 save-and-replace formal parameter handling
  8928.         mechanism for function calls which may inhibit anything like evaluation
  8929.         in a context,
  8930.     The one-level procedure nesting of ICON and the semantics of co-expression
  8931.         creation which limit useful contexts to global variables and COPIES of
  8932.         contexts of procedures (without the possibility of sharing local
  8933.         procedure variables between the copies), and
  8934.     The lack of an indirect reference mechanism in ICON.
  8935.  
  8936.         I'd like to swap notes with anyone who has tried anything like this sort
  8937. of thing:  Could you use it?  What roadblocks did you find?  Could you get
  8938. around them?  How painfully?  Would you try it again?
  8939.  
  8940. --------------------------------------------------------------------------------
  8941.  
  8942.             John H. Lindsay,
  8943.             Department of Mathematics and Computer Science,
  8944.             Royal Military College of Canada,
  8945.             Kingston, Ontario, Canada, K7K 5L0.
  8946.  
  8947.             Phones: Office,                          (613) 541-6419
  8948.                     Messages,                              541-6343 or 541-6458
  8949.                     Home,                                  546-6988
  8950.             E-Mail: From Bitnet, NetNorth, ONet:     LINDSAY_JH@RMC.CA
  8951.                     From Canadian Military Colleges: LINDSAY JH@RMC
  8952.             Fax:                                     (613) 542-8129
  8953.  
  8954. From janpeter@mpi.kun.nl  Wed Apr 22 09:12:38 1992
  8955. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Wed, 22 Apr 92 09:12:38 MST
  8956. Received: from wn1.sci.kun.nl by optima.cs.arizona.edu (4.1/15)
  8957.     id AA04244; Wed, 22 Apr 92 09:12:33 MST
  8958. Received: by wn1.sci.kun.nl (5.57/2.1) on NUNET
  8959.      id AA05231; Wed, 22 Apr 92 17:21:18 +0200
  8960. Received: by mpix10.mpi.kun.nl (5.57/2.0) on NUNET
  8961.      id AA08390; Wed, 22 Apr 92 17:19:01 +0200
  8962. Date: Wed, 22 Apr 92 17:19:01 +0200
  8963. From: Jan Peter de Ruiter <janpeter@mpi.kun.nl>
  8964. Message-Id: <9204221519.AA08390@mpix10.mpi.kun.nl>
  8965. To: icon-group@cs.arizona.edu
  8966. Subject: ICON/AWK disclaimer
  8967.  
  8968. I keep getting email from people asking if I can send my ICON/AWK lib
  8969. to them, and if there are any charges involved. I think that there must
  8970. be some misunderstanding, for I have *already* sent the lib to the ICON 
  8971. group, and charges are of course out of the question. Perhaps I've used
  8972. too big a word for it ("library") for which I hereby apologise.
  8973.  
  8974. Perhaps it would be a good idea to spell things out quite clearly:
  8975.  
  8976. The lib i've written is a modest 20 line ICON procedure (and some
  8977. global variables) that enables one to do AWKish processing (using $,
  8978. NF, NR and FS) on a specified stream. I've already sent the lib to 
  8979. the icon-group, but anyone who's accidentally deleted it and is still 
  8980. interested can mail me to ask for a (free) copy.
  8981.  
  8982. I use this library extensively (being an ex awk-user), and consider it
  8983. quite handy. That's why I wanted to mention it in the ICON group.
  8984.  
  8985. Charges are (of course) out of the question for an almost
  8986. trivial procedure like the one I've written. Maybe some of you would
  8987. have liked a "real" icon-to-awk interface, but alas, that's not what
  8988. I meant.  For me it is enough to have the $n-style functionality of 
  8989. AWK in an otherwise ICONic environment.
  8990.  
  8991. Jan Peter de Ruiter
  8992. Max Planck Institute for Psycholinguistics
  8993. Nijmegen
  8994. The Netherlands
  8995. EMAIL: janpeter@mpi.kun.nl
  8996.  
  8997. From janpeter@mpi.kun.nl  Thu Apr 23 05:33:15 1992
  8998. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Thu, 23 Apr 92 05:33:15 MST
  8999. Received: from wn1.sci.kun.nl by optima.cs.arizona.edu (4.1/15)
  9000.     id AA01033; Thu, 23 Apr 92 05:33:10 MST
  9001. Received: by wn1.sci.kun.nl (5.57/2.1) on NUNET
  9002.      id AA22294; Thu, 23 Apr 92 14:34:23 +0200
  9003. Received: by mpix10.mpi.kun.nl (5.57/2.0) on NUNET
  9004.      id AA09955; Thu, 23 Apr 92 14:32:15 +0200
  9005. Date: Thu, 23 Apr 92 14:32:15 +0200
  9006. From: Jan Peter de Ruiter <janpeter@mpi.kun.nl>
  9007. Message-Id: <9204231232.AA09955@mpix10.mpi.kun.nl>
  9008. To: icon-group@cs.arizona.edu
  9009. Subject: $ as identifyer
  9010.  
  9011. In ICON one can use only identifyers that consist of underscores, digits,
  9012. and letters. Why is this? The '$' character is not an ICON operator 
  9013. (to my surprise, I must add), and it would be nice to be able to use
  9014. all non-operator ascii-characters. 
  9015.  
  9016. Another point is that someone has recently suggested to me that is would
  9017. be possible to circumvent this problem; unfortunately he only thought 
  9018. *that* it was possible, but didn't know to do it.
  9019.  
  9020. Any tips, hints, or comments?
  9021.  
  9022. Jan Peter de Ruiter
  9023. Max Planck Institute for Psycholinguistics, Nijmegen, Netherlands
  9024. EMAIL: janpeter@mpi.kun.nl
  9025.  
  9026. From ralph  Thu Apr 23 05:41:11 1992
  9027. Date: Thu, 23 Apr 92 05:41:11 MST
  9028. From: "Ralph Griswold" <ralph>
  9029. Message-Id: <9204231241.AA08471@cheltenham.cs.arizona.edu>
  9030. Received: by cheltenham.cs.arizona.edu; Thu, 23 Apr 92 05:41:11 MST
  9031. To: icon-group@cs.arizona.edu, janpeter@mpi.kun.nl
  9032. Subject: Re:  $ as identifyer
  9033.  
  9034. The character $ is not an operator in Icon, but it is used in digraphs
  9035. for alternative representations for a few characters that are not
  9036. available on some EBCDIC terminals.  For example, $< and [ are
  9037. equivalent in Icon.  (See page 293 of the second edition of the Icon
  9038. language book.)
  9039.     
  9040.     Ralph Griswold / Department of Computer Science 
  9041.     The University of Arizona / Tucson, AZ 85721
  9042.     
  9043.     ralph@cs.arizona.edu / uunet!arizona!ralph
  9044.     
  9045.     voice: 602-621-6609 / fax: 602-621-9618
  9046.  
  9047. From ms@informatik.uni-hannover.dbp.de  Thu Apr 23 08:49:42 1992
  9048. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Thu, 23 Apr 92 08:49:42 MST
  9049. Received: from ixgate.gmd.de by optima.cs.arizona.edu (4.1/15)
  9050.     id AA07163; Thu, 23 Apr 92 08:49:38 MST
  9051. Received: by ixgate.gmd.de id AA19527; Thu, 23 Apr 92 17:49:50 +0200
  9052. Date: 23 Apr 92 15:45 
  9053. From: "(Michael Sperber)" <ms@informatik.uni-hannover.dbp.de>
  9054. Message-Id: <RFC-822:>
  9055. Subject: $ in identifiers
  9056. Apparently-To: icon-group@cs.arizona.edu
  9057.  
  9058. RFC-822-HEADERS:
  9059. Return-Path: <@CDC2.RRZN.UNI-HANNOVER.DE:ms@informatik.uni-hannover.de>
  9060. To: @CDC2:icon-group@cs.arizona.edu
  9061.  
  9062. ==================
  9063. It's even nicer to have an at least on character left over
  9064. for potential language extensions.  One of those is Idol from
  9065. the IPL.
  9066.  
  9067. :-> Chipsy
  9068.  
  9069. From TENAGLIA@mis.mcw.edu  Thu Apr 23 12:48:16 1992
  9070. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Thu, 23 Apr 92 12:48:16 MST
  9071. Received: from ADM.MIS.MCW.EDU by optima.cs.arizona.edu (4.1/15)
  9072.     id AA18730; Thu, 23 Apr 92 12:48:11 MST
  9073. Received: from mis.mcw.edu by mis.mcw.edu (PMDF #12865) id
  9074.  <01GJ6VC0XW2OBXIO3P@mis.mcw.edu>; Thu, 23 Apr 1992 14:48 CST
  9075. Date: Thu, 23 Apr 1992 14:48 CST
  9076. From: Chris Tenaglia - 257-8765 <TENAGLIA@mis.mcw.edu>
  9077. Subject: Re: $ as identifyer
  9078. To: janpeter@mpi.kun.nl
  9079. Cc: icon-group@cs.arizona.edu
  9080. Message-Id: <01GJ6VC0XW2OBXIO3P@mis.mcw.edu>
  9081. X-Organization: Medical College of Wisconsin (Milwaukee, WI)
  9082. X-Vms-To: IN%"janpeter@mpi.kun.nl"
  9083. X-Vms-Cc: in%"icon-group@cs.arizona.edu"
  9084.  
  9085.  
  9086. > In ICON one can use only identifyers that consist of underscores, digits,
  9087. > and letters. Why is this? The '$' character is not an ICON operator 
  9088. > (to my surprise, I must add), and it would be nice to be able to use
  9089. > all non-operator ascii-characters.
  9090.  
  9091. > Another point is that someone has recently suggested to me that is would
  9092. > be possible to circumvent this problem; unfortunately he only thought 
  9093. > *that* it was possible, but didn't know to do it.
  9094.  
  9095. > Any tips, hints, or comments?
  9096.  
  9097. > Jan Peter de Ruiter
  9098. > Max Planck Institute for Psycholinguistics, Nijmegen, Netherlands
  9099. > EMAIL: janpeter@mpi.kun.nl
  9100.  
  9101. I also noticed that lonely $ character. I started a flame war sometime
  9102. back suggesting it be used as a user defined operator and I proposed a
  9103. syntax for defining it.
  9104.  
  9105. operator {
  9106.          &operand[1] : bits
  9107.          &operand[2] : test_bits
  9108.          &operand[3] : etc,...
  9109.          }
  9110.  
  9111.   val := 192                           |  procedure bits(n)
  9112.   mask:= 160                           |    binary := radcon(n,10,2)
  9113.   tmp := $ val                         |    count  := 0
  9114.   write(tmp)         2                 |    every bit := !binary do
  9115.   tmp := mask $ val                    |      count +:= 1
  9116.   write(tmp)         "partial match"   |    return count
  9117.                                        |    end
  9118.                                        etc,...
  9119.  
  9120. The argument for this is that certain kinds of operations can be made
  9121. clearer to understand using this notation rather than procedural. It
  9122. can be argued that the procedural notation is sufficiently powerful
  9123. to handle currently known contingencies. I thought about defining
  9124. compound operators like $+ which would be a conceptual analog to an
  9125. addition operation.
  9126.  
  9127. However the whole thing seemed to be shot down from the OOPs camp
  9128. since apparently IDOL uses the character. I also think IBM mainframe
  9129. ICON uses $( and $) for curly braces, and quoting other non-ibm
  9130. characters. The thought was fun to toy with for a while.
  9131.  
  9132. Chris Tenaglia (System Manager) |  "The past explained,     
  9133. Medical College of Wisconsin    |   the future fortold, 
  9134. 8701 W. Watertown Plank Rd.     |   the present largely appologized for."
  9135. Milwaukee, WI 53226             |   Organon to The Doctor
  9136. (414)257-8765                   |     
  9137. tenaglia@mis.mcw.edu
  9138.  
  9139.  
  9140. From keil@apollo.hp.com  Thu Apr 23 15:00:15 1992
  9141. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Thu, 23 Apr 92 15:00:15 MST
  9142. Received: from amway.ch.apollo.hp.com by optima.cs.arizona.edu (4.1/15)
  9143.     id AA24886; Thu, 23 Apr 92 15:00:06 MST
  9144. Received: from xuucp.ch.apollo.hp.com by amway.ch.apollo.hp.com id <AA19850@amway.ch.apollo.hp.com> Thu, 23 Apr 92 17:57:57 EDT    
  9145. Received: by xuucp.ch.apollo.hp.com id <AA13723@xuucp.ch.apollo.hp.com>; Thu, 23 Apr 92 17:45:37 EDT
  9146. Message-Id: <9204232145.AA13723@xuucp.ch.apollo.hp.com>
  9147. Received: by daphne.ch.apollo.hp.com  id AA04182; Thu, 23 Apr 92 17:50:48 EDT    
  9148. From: keil@apollo.hp.com
  9149. Date: Thu, 23 Apr 92 17:16:10 EDT 
  9150. Subject: How tu use $ as identifyer
  9151. To: icon-group@cs.arizona.edu
  9152. Cc: janpeter@mpi.kun.nl
  9153.  
  9154. Folks:
  9155.  
  9156.   I suppose I started this by mentioning this to Jan...
  9157.  
  9158.   SO, here is how I did it.
  9159.  
  9160.   I added the define:
  9161.  
  9162. #define DollarIdent                     /* allow $ character as an identifier */
  9163.  
  9164.   to define.h
  9165.  
  9166.   And then I made the following changes to tlex.c (see below)
  9167.  
  9168.   I had no problems with this change. I used it for procedure names
  9169.   of the form name1_$name2. (I did this because I wanted to make
  9170.   system call visible to the icon program through the external interface,
  9171.   and the system call had the form name1_$nane2)
  9172.  
  9173.   Since I didn't use digraphs, I don't know if it affects their use.
  9174.   Since there is a define to control it, the change can be made invisable
  9175.   to those that don't want it.
  9176.  
  9177.   You can add this to standard ICON if you want to Ralph.
  9178.  
  9179. -Mark
  9180.  
  9181.  
  9182. The following comprares were off a august 1990 snapshot of version 8
  9183. It should not differ much from the present version 8   (I think...)
  9184.  
  9185. The Apollo compare (cmf) shows the change in context
  9186.  
  9187. $ cmf /keil/icon/v8.x6/src/icont/tlex.c.orig /keil/icon/v8.x6/src/icont/tlex.c
  9188.  
  9189. A254         if (isalpha(c) || (c == '_')) {   /* gather ident or reserved word */
  9190. changed to
  9191. B254      #ifdef DollarIdent
  9192. B255         if (isalpha(c) || (c == '_') || (c == '$')) {   /* gather ident or reserved word */
  9193. B256      #else
  9194. B257         if (isalpha(c) || (c == '_')) {   /* gather ident or reserved word */
  9195. B258      #endif                    /* VarTran */
  9196.  
  9197.  
  9198. A330            } while (isalnum(c) || (c == '_'));
  9199. changed to
  9200. B334      #ifdef DollarIdent
  9201. B335            } while (isalnum(c) || (c == '_') || (c == '$'));
  9202. B336      #else
  9203. B337            } while (isalnum(c) || (c == '_'));
  9204. B338      #endif
  9205.  
  9206.  
  9207.  
  9208. The diff version for those that like and grok diff ;-)
  9209.  
  9210. $ diff /keil/icon/v8.x6/src/icont/tlex.c.orig /keil/icon/v8.x6/src/icont/tlex.c
  9211. 253a254,256
  9212. > #ifdef DollarIdent
  9213. >    if (isalpha(c) || (c == '_') || (c == '$')) {   /* gather ident or reserved word */
  9214. > #else
  9215. 254a258
  9216. > #endif                    /* VarTran */
  9217. 329a334,336
  9218. > #ifdef DollarIdent
  9219. >       } while (isalnum(c) || (c == '_') || (c == '$'));
  9220. > #else
  9221. 330a338
  9222. > #endif
  9223.  
  9224.  
  9225.  
  9226. From cjeffery  Thu Apr 23 16:56:10 1992
  9227. Received: from chuckwalla.cs.arizona.edu by cheltenham.cs.arizona.edu; Thu, 23 Apr 92 16:56:10 MST
  9228. Date: Thu, 23 Apr 92 16:56:08 MST
  9229. From: "Clinton Jeffery" <cjeffery>
  9230. Message-Id: <9204232356.AA12522@chuckwalla.cs.arizona.edu>
  9231. Received: by chuckwalla.cs.arizona.edu; Thu, 23 Apr 92 16:56:08 MST
  9232. To: TENAGLIA@mis.mcw.edu
  9233. Cc: icon-group@cs.arizona.edu
  9234. In-Reply-To: Chris Tenaglia - 257-8765's message of Thu, 23 Apr 1992 14:48 CST <01GJ6VC0XW2OBXIO3P@mis.mcw.edu>
  9235. Subject: $ as identifyer
  9236.  
  9237. Chris Tenaglia writes about his proposed $ for a user-defined operator:
  9238.     > However the whole thing seemed to be shot down from the OOPs camp
  9239.     > since apparently IDOL uses the character.
  9240.  
  9241. It is true that the first implementation of Idol uses the $ operator.
  9242. I don't think you can blame the OOP camp for shooting down your idea
  9243. though; you can use $ to do whatever you want, if you don't use Idol.
  9244.  
  9245. The two best ways to try out extensions to Icon that are too complex to
  9246. code in C, are (a) use a variant translator if your system supports it,
  9247. or (b) write an Icon program that translates your extended language
  9248. into Icon and then calls icont.  Idol proves that the latter approach
  9249. is viable, and can be very portable (it even runs on MS-DOS :-).
  9250.  
  9251. I should warn you, though, that language design is *very hard*, so don't
  9252. take it personally if people aren't interested in your extension.  You
  9253. might discover its the best thing since sliced bread, but if other
  9254. people can't immediately grasp its usefulness, it will get ignored.
  9255. And if its a good idea, but the design is not general enough, or the
  9256. syntax is clumsy, it will still get ignored.  And lastly, you may learn
  9257. how to do it right, if you do it wrong, and gain experience with it.
  9258. Good luck.
  9259.  
  9260. Clint Jeffery
  9261.  
  9262. From icon-group-request  Fri Apr 24 09:54:50 1992
  9263. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Fri, 24 Apr 92 09:54:50 MST
  9264. Received: from ucbvax.Berkeley.EDU by optima.cs.arizona.edu (4.1/15)
  9265.     id AA09730; Fri, 24 Apr 92 09:54:48 MST
  9266. Received: by ucbvax.Berkeley.EDU (5.63/1.43)
  9267.     id AA08944; Fri, 24 Apr 92 09:48:47 -0700
  9268. Received: from USENET by ucbvax.Berkeley.EDU with netnews
  9269.     for icon-group@cs.arizona.edu (icon-group@cs.arizona.edu)
  9270.     (contact usenet@ucbvax.Berkeley.EDU if you have questions)
  9271. Date: 24 Apr 92 16:20:06 GMT
  9272. From: wupost!dsuvax.dsu.edu!ghelmer@decwrl.dec.com  (Guy Helmer)
  9273. Organization: Dakota State University, Madison, SD
  9274. Subject: Computer Programming for the Humanities Course Offering
  9275. Message-Id: <1992Apr24.162006.6210@dsuvax.dsu.edu>
  9276. Sender: icon-group-request@cs.arizona.edu
  9277. To: icon-group@cs.arizona.edu
  9278.  
  9279.  
  9280.       [ The following is a description of an offering of a course via
  9281.     electronic mail by Dakota State University's College of Liberal
  9282.     Arts.  Reply-To: is set to ERIC%SDNET.BITNET@vm1.nodak.edu, which
  9283.     is where queries regarding the course should be sent.
  9284.  
  9285.     Flames regarding this massive cross-post should be directed to
  9286.     ghelmer@dsuvax.dsu.edu :-) ]
  9287.  
  9288.      Following is information about a three-credit graduate course
  9289. in programming for the humanities offered by Dakota State
  9290. University via BITNET (and other interconnected networks).
  9291. Students in the course can be anywhere in the world if they can
  9292. send and receive electronic mail.
  9293.  
  9294.      CHUM 650, COMPUTER PROGRAMMING FOR THE HUMANITIES, is an
  9295. introduction to programming using SNOBOL4 for applications in the
  9296. humanities such as analysis of texts, arranging data from research,
  9297. and formatting for printing and desktop publishing.  The primary
  9298. emphasis in the course will be on computer applications with texts.
  9299.  
  9300.      The course is designed for humanists who want to learn to
  9301. write useful computer programs for research and teaching.  The
  9302. language of choice for this course is SNOBOL4 because it is a
  9303. powerful language designed for non-numeric computing; students can
  9304. write useful programs in SNOBOL4 almost from the start.  The course
  9305. will begin with an introduction to programming, then cover
  9306. techniques of structuring SNOBOL4 programs, and it will finish with
  9307. students completing individual projects of their own creation.
  9308.  
  9309.      Students in the course can work at their own pace; they can
  9310. begin immediately.  Students should plan to finish all course
  9311. requirements by August 1.
  9312.  
  9313.      Programming assignments for the course will be designed for
  9314. MS-DOS microcomputers.  Although most assignments can be modified
  9315. for Macintosh users, students using a Macintosh would have to
  9316. purchase MaxSPITBOL, and they would need an understanding of
  9317. Macintosh file structures.
  9318.  
  9319.      It is a prerequisite for the course that students have a sound
  9320. understanding of how to upload and download files from the
  9321. mainframe that runs electronic mail to the DOS microcomputer used
  9322. for the programming assignments.  In addition, students must be
  9323. familiar with DOS commands.
  9324.  
  9325.      The total cost of the course is $239.82.  No textbook is
  9326. required.  Students will be sent a disk containing a public-domain
  9327. SNOBOL4 compiler and a text editor.  Lectures and data files will
  9328. be sent electronically.
  9329.  
  9330.      Students may audit the course or enroll for credit and receive
  9331. a grade of Pass or Fail.  The cost to audit the course is the same
  9332. as enrolling for credit.
  9333.  
  9334.      Those who want an electronic registration form or who have
  9335. questions about the course should send a message to
  9336.  
  9337.              Eric Johnson
  9338.              ERIC@SDNET.BITNET
  9339. -- 
  9340. Guy Helmer, Dakota State University Computing Services - ghelmer@dsuvax.dsu.edu
  9341. "Often you fix the wrong thing first." - Karl Auerbach, Interop 91
  9342.  
  9343. From icon-group-request  Sat Apr 25 07:57:29 1992
  9344. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Sat, 25 Apr 92 07:57:29 MST
  9345. Received: from ucbvax.Berkeley.EDU by optima.cs.arizona.edu (4.1/15)
  9346.     id AA00354; Sat, 25 Apr 92 07:57:27 MST
  9347. Received: by ucbvax.Berkeley.EDU (5.63/1.43)
  9348.     id AA28185; Sat, 25 Apr 92 07:41:27 -0700
  9349. Received: from USENET by ucbvax.Berkeley.EDU with netnews
  9350.     for icon-group@cs.arizona.edu (icon-group@cs.arizona.edu)
  9351.     (contact usenet@ucbvax.Berkeley.EDU if you have questions)
  9352. Date: 25 Apr 92 05:53:27 GMT
  9353. From: cs.utexas.edu!qt.cs.utexas.edu!yale.edu!cs.yale.edu!horne-scott@rutgers.edu  (Scott Horne)
  9354. Organization: Computer "Science" Dept, Yale University
  9355. Subject: Re: Computer Programming for the Humanities Course Offering
  9356. Message-Id: <1992Apr25.055327.19926@cs.yale.edu>
  9357. References: <1992Apr24.162006.6210@dsuvax.dsu.edu>, <ARA.92Apr24204136@camelot.ai.mit.edu>
  9358. Sender: icon-group-request@cs.arizona.edu
  9359. To: icon-group@cs.arizona.edu
  9360.  
  9361. In article <ARA.92Apr24204136@camelot.ai.mit.edu>, ara@zurich.ai.mit.edu (Allan Adler) writes:
  9362. <In article <1992Apr24.162006.6210@dsuvax.dsu.edu> ghelmer@dsuvax.dsu.edu (Guy Helmer) writes:
  9363. <
  9364. <   Students will be sent a disk containing a public-domain
  9365. <   SNOBOL4 compiler and a text editor.
  9366.  
  9367. HA!  Why not send them vacuum tubes and copper wire?
  9368.  
  9369. <I think this counts as commercial advertising.  <...>
  9370.  
  9371. Yes.
  9372.  
  9373. <Aren't there rules about this sort of thing?
  9374.  
  9375. Yes, and it's specifically disallowed.  Complain to
  9376. `postmaster@dsuvax.dsu.edu'.
  9377.  
  9378.                     --Scott
  9379.  
  9380. -- 
  9381. Scott Horne                               ...!{harvard,cmcl2,decvax}!yale!horne
  9382. horne@cs.Yale.edu      SnailMail:  Box 7196 Yale Station, New Haven, CT   06520
  9383. 203 436-1848                Residence:  Rm 1848 Silliman College, New Haven, CT
  9384. Shao2shan1 sheng1-qi3 de tai4yang2 yong3 bu2 luo4!
  9385.  
  9386. From icon-group-request  Sat Apr 25 12:28:31 1992
  9387. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Sat, 25 Apr 92 12:28:31 MST
  9388. Received: from ucbvax.Berkeley.EDU by optima.cs.arizona.edu (4.1/15)
  9389.     id AA06577; Sat, 25 Apr 92 12:28:27 MST
  9390. Received: by ucbvax.Berkeley.EDU (5.63/1.43)
  9391.     id AA17709; Sat, 25 Apr 92 12:14:17 -0700
  9392. Received: from USENET by ucbvax.Berkeley.EDU with netnews
  9393.     for icon-group@cs.arizona.edu (icon-group@cs.arizona.edu)
  9394.     (contact usenet@ucbvax.Berkeley.EDU if you have questions)
  9395. Date: 25 Apr 92 18:58:54 GMT
  9396. From: jar@cu-arpa.cs.cornell.edu  (Jonathan Rees)
  9397. Organization: Cornell Univ. CS Dept, Ithaca NY 14853
  9398. Subject: Re: features from Icon Language in lisp
  9399. Message-Id: <1992Apr25.185854.1374@cs.cornell.edu>
  9400. References: <1992Apr14.173407.28762@adobe.com>, <LGM.92Apr25121643@cbnewsc.ATT.COM>
  9401. Sender: icon-group-request@cs.arizona.edu
  9402. To: icon-group@cs.arizona.edu
  9403.  
  9404.  
  9405. In this discussion of Icon features in Lisp, I'm surprised that no one
  9406. has mentioned the obvious embedding of Icon-like control in Scheme.
  9407. (If someone did, I missed it.)
  9408.  
  9409.  
  9410. ; For Icon's alternation operator a | b | c, write (either a b c).
  9411.  
  9412. (define-syntax either
  9413.   (syntax-rules ()
  9414.     ((either x) x)
  9415.     ((either x y ...)
  9416.      (%either (lambda () x) (lambda () (either y ...))))))
  9417.  
  9418. (define (%either thunk1 thunk2)        ;Macro axuiliary
  9419.   (let ((save *fail*))
  9420.     ((call-with-current-continuation
  9421.        (lambda (k)
  9422.      (set! *fail*
  9423.            (lambda ()
  9424.          (set! *fail* save)
  9425.          (k thunk2)))
  9426.      thunk1)))))
  9427.  
  9428. ; (accumulate a) returns a list of all the possible values of the
  9429. ; expression a.  Prolog calls this "bagof"; I forget what Icon calls it.
  9430.  
  9431. (define-syntax accumulate
  9432.   (syntax-rules ()
  9433.     ((accumulate x) (%accumulate (lambda () x)))))
  9434.  
  9435. (define (%accumulate thunk)
  9436.   (let ((results '()))
  9437.     (either (begin (set! results (cons (thunk) results))
  9438.            (fail))
  9439.         (reverse results))))
  9440.  
  9441.  
  9442. ; Generate all the members of list l.  E.g.
  9443. ;   (accumulate (+ (member-of '(10 20 30)) (member-of '(1 2 3))))
  9444. ;     => '(11 12 13 21 22 23 31 32 33)
  9445.  
  9446. (define (member-of l)
  9447.   (if (null? l)
  9448.       (fail)
  9449.       (either (car l) (member-of (cdr l)))))
  9450.  
  9451.  
  9452. ; Internal variable representing the failure stack.
  9453.  
  9454. (define (fail) (*fail*))
  9455.  
  9456. (define *fail* (lambda () (error "You didn't do (init).")))
  9457.  
  9458.  
  9459. ; Crufty initialization hack that allows you to type failing
  9460. ; expressions at the R-E-P loop (if there is an R-E-P loop).  E.g. try
  9461. ; evaluating the sequence
  9462. ;  (either 1 2)
  9463. ;  (fail)
  9464. ;  (+ (fail) 10)
  9465.  
  9466. (define (init)
  9467.   (call-with-current-continuation
  9468.     (lambda (k)
  9469.       (set! *fail* (lambda () (k 'failed)))
  9470.       'initialized)))
  9471.  
  9472. (display "Type (init) at the read-eval-print loop.")
  9473. (newline)
  9474.  
  9475.  
  9476. -- 
  9477. -- Jonathan Rees  jar@cs.cornell.edu
  9478. member, Cambridge Entomological Club / member, League for Programming Freedom
  9479.  
  9480. From icon-group-request  Sat Apr 25 19:30:16 1992
  9481. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Sat, 25 Apr 92 19:30:16 MST
  9482. Received: from ucbvax.Berkeley.EDU by optima.cs.arizona.edu (4.1/15)
  9483.     id AA17509; Sat, 25 Apr 92 19:30:09 MST
  9484. Received: by ucbvax.Berkeley.EDU (5.63/1.43)
  9485.     id AA16070; Sat, 25 Apr 92 19:22:03 -0700
  9486. Received: from USENET by ucbvax.Berkeley.EDU with netnews
  9487.     for icon-group@cs.arizona.edu (icon-group@cs.arizona.edu)
  9488.     (contact usenet@ucbvax.Berkeley.EDU if you have questions)
  9489. Date: 24 Apr 92 21:27:53 GMT
  9490. From: cis.ohio-state.edu!zaphod.mps.ohio-state.edu!sdd.hp.com!spool.mu.edu!hri.com!noc.near.net!chaos!random.ccs.northeastern.edu!news@ucbvax.berkeley.edu  (mitchell wand)
  9491. Organization: College of Computer Science, Northeastern University
  9492. Subject: Re: Computer Programming for the Humanities Course Offering
  9493. Message-Id: <WAND.92Apr24162753@dec5120z.ccs.northeastern.edu>
  9494. References: <1992Apr24.162006.6210@dsuvax.dsu.edu>
  9495. Sender: icon-group-request@cs.arizona.edu
  9496. To: icon-group@cs.arizona.edu
  9497.  
  9498. I didn't think there were any living SNOBOL programmers left!
  9499.  
  9500. But seriously, I can't imagine doing 
  9501.  
  9502.   applications in the
  9503.   humanities such as analysis of texts, arranging data from research,
  9504.   and formatting for printing and desktop publishing.  
  9505.  
  9506. in SNOBOL, which is hardly an industrial-strength language with widespread
  9507. support! 
  9508.  
  9509. If you want to teach humanists about programming, use Friedman and Felleisen's
  9510. {Little Lisper}, which converts everything to the kind of game even humanists
  9511. can understand (:-).
  9512.  
  9513. If you want to do quick-and-dirty text processing, you can either use Scheme
  9514. or awk or Icon (or even C!), all of which are widely supported.
  9515.  
  9516. If you want to do formatting and desktop publishing, you'd be far better off
  9517. using all the good tools that are available for that, rather than struggling
  9518. to do it in SNOBOL.
  9519.  
  9520. [OK, my flameproof suit is on now.]
  9521.  
  9522. --Mitch 
  9523.  
  9524.  
  9525.  
  9526. --
  9527. Mitchell Wand
  9528. College of Computer Science, Northeastern University
  9529. 360 Huntington Avenue #161CN, Boston, MA 02115     Phone: (617) 437 2072
  9530. Internet: wand@{corwin|flora}.ccs.northeastern.edu   Fax: (617) 437 5121
  9531.  
  9532. From @um.cc.umich.edu:Paul_Abrahams@MTS.cc.Wayne.edu  Sun Apr 26 11:11:55 1992
  9533. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Sun, 26 Apr 92 11:11:55 MST
  9534. Received: from mailrus.cc.umich.edu by optima.cs.arizona.edu (4.1/15)
  9535.     id AA10847; Sun, 26 Apr 92 11:11:52 MST
  9536. Received: from um.cc.umich.edu by mailrus.cc.umich.edu (5.61/1123-1.0)
  9537.     id AA26427; Sun, 26 Apr 92 14:07:50 -0400
  9538. Received: from MTS.cc.Wayne.edu by um.cc.umich.edu via MTS-Net; Sun, 26 Apr 92 14:09:23 EDT
  9539. Date: Sun, 26 Apr 92 14:08:36 EDT
  9540. From: Paul_Abrahams@mts.cc.wayne.edu
  9541. To: icon-group@cs.arizona.edu
  9542. Message-Id: <448138@MTS.cc.Wayne.edu>
  9543. Subject: Icon versus Snobol for the humanities
  9544.  
  9545. I agree with Mitch Wand's statement that Icon is far superior to Snobol
  9546. for the kinds of stuff that people do in the humanities (or for nearly
  9547. anything else, for that matter).  (I wouldn't inflict Lisp on anyone
  9548. with no ambitions to be a professional programmer, however.)  But I think
  9549. Mitch overlooks one important consideration: if you're used to using
  9550. Language A, there's a considerable cost in switching to Language B even
  9551. if Language B is better.  If programming is not your main ambition in
  9552. life, you may be far better off sticking with the devil you know than
  9553. the one you don't.  The arguments for switching from Snobol to Icon are
  9554. much like the arguments for replacing your old clunker with a new car.
  9555. If the clunker gets you where you want to go and the repair bills aren't
  9556. too high, sticking with it is probably your most rational choice.
  9557. On the other hand, if you know you're going to have to switch eventually,
  9558. it's better to do it sooner than later.
  9559.  
  9560. Paul Abrahams
  9561. abrahams@mts.cc.wayne.edu
  9562.  
  9563. From janpeter@mpi.kun.nl  Mon Apr 27 01:22:36 1992
  9564. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Mon, 27 Apr 92 01:22:36 MST
  9565. Received: from wn1.sci.kun.nl by optima.cs.arizona.edu (4.1/15)
  9566.     id AA06758; Mon, 27 Apr 92 01:22:30 MST
  9567. Received: by wn1.sci.kun.nl (5.57/2.1) on NUNET
  9568.      id AA29188; Mon, 27 Apr 92 10:23:26 +0200
  9569. Received: by mpix10.mpi.kun.nl (5.57/2.0) on NUNET
  9570.      id AA04874; Mon, 27 Apr 92 10:22:58 +0200
  9571. Date: Mon, 27 Apr 92 10:22:58 +0200
  9572. From: Jan Peter de Ruiter <janpeter@mpi.kun.nl>
  9573. Message-Id: <9204270822.AA04874@mpix10.mpi.kun.nl>
  9574. To: icon-group@cs.arizona.edu
  9575. Subject: snoboldtimer
  9576.  
  9577. I do entirely agree with what Mitch wrote about Snobol, although there is
  9578. a certain "oldtimer" feeling connected to SNOBOL programming. Like people
  9579. driving around in old cars, just because they are old. Besides, SNOBOL is
  9580. to my knowledge the only computer language that combines the speed of
  9581. LISP with the elegance of assembly language.
  9582.  
  9583. Jan.
  9584.  
  9585. Jan Peter de Ruiter
  9586. Max Planck Institute for Psycholinguistics
  9587. The Netherlands
  9588. janpeter@mpi.kun.nl
  9589.  
  9590.  
  9591. From icon-group-request  Mon Apr 27 08:47:11 1992
  9592. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Mon, 27 Apr 92 08:47:11 MST
  9593. Received: from ucbvax.Berkeley.EDU by optima.cs.arizona.edu (4.1/15)
  9594.     id AA22083; Mon, 27 Apr 92 08:47:09 MST
  9595. Received: by ucbvax.Berkeley.EDU (5.63/1.43)
  9596.     id AA27876; Mon, 27 Apr 92 08:33:55 -0700
  9597. Received: from USENET by ucbvax.Berkeley.EDU with netnews
  9598.     for icon-group@cs.arizona.edu (icon-group@cs.arizona.edu)
  9599.     (contact usenet@ucbvax.Berkeley.EDU if you have questions)
  9600. Date: 27 Apr 92 14:50:08 GMT
  9601. From: sdd.hp.com!wupost!dsuvax.dsu.edu!ghelmer@hplabs.hpl.hp.com  (Guy Helmer)
  9602. Organization: Dakota State University
  9603. Subject: Re: Computer Programming for the Humanities Course Offering
  9604. Message-Id: <1992Apr27.145008.22240@dsuvax.dsu.edu>
  9605. References: <1992Apr24.162006.6210@dsuvax.dsu.edu>, <ARA.92Apr24204136@camelot.ai.mit.edu>
  9606. Sender: icon-group-request@cs.arizona.edu
  9607. To: icon-group@cs.arizona.edu
  9608.  
  9609. In <ARA.92Apr24204136@camelot.ai.mit.edu> ara@zurich.ai.mit.edu (Allan Adler) writes:
  9610.  
  9611. >In article <1992Apr24.162006.6210@dsuvax.dsu.edu> ghelmer@dsuvax.dsu.edu
  9612. > (Guy Helmer) posted:
  9613.  
  9614. >>    Following is information about a three-credit graduate course
  9615. >>   in programming for the humanities offered by Dakota State
  9616. >>   University via BITNET (and other interconnected networks).
  9617. >>     [ details of the course deleted]
  9618. >>    The total cost of the course is $xxx.xx.  No textbook is
  9619.                                          ^^^^^^
  9620. Actual cost deleted to avoid affending even more readers. :-)
  9621.  
  9622. >>   required.  Students will be sent a disk containing a public-domain
  9623. >>   SNOBOL4 compiler and a text editor.  Lectures and data files will
  9624. >>   be sent electronically.
  9625.  
  9626. >I think this counts as commercial advertising. If someone wants to make the
  9627. >course materials available to people via anonymous ftp, that is one thing.
  9628. >If someone wants to organize a network of volunteers to help people in the
  9629. >humanities learn computers, that is still ok. But this is pure commerce.
  9630.  
  9631. OK, this may be considered "commercial" advertising by some, but I submit it
  9632. it not "pure commerce", because:
  9633.  
  9634.     1) This is an experimental program offering, where the experiment
  9635.     is to offer an unusual course worldwide to users of the net, who,
  9636.     without benefit of the Internet, would not be able to take advantage
  9637.     of the offering.
  9638.  
  9639.     2) In the spirit of the course (using Internet as the delivery
  9640.     medium), the best method to contact potential "virtual attendees"
  9641.     is Usenet.  A very large share of the Internet is funded this
  9642.     moment to promote communication between research and educational
  9643.     institutions, which is what this course is based on.
  9644.  
  9645.     3) Given tight budgets, lack of support, and funding of time,
  9646.     the academic community must develop "free courses" so that we
  9647.     may post announcements of innovative, experimental, 
  9648.     one-of-a-kind opportunities to Usenet?
  9649.  
  9650. >Aren't there rules about this sort of thing?
  9651.  
  9652. :-)  Rules on Usenet?
  9653.  
  9654. Seriously, I will grant that perhaps it would have been "more proper"
  9655. and "less offending" to have posted summary information.  However, I
  9656. have a very hard time finding differences between my posting and the
  9657. postings you will find in news.announce.conferences, and I don't see
  9658. y'all flaming each post in n.a.c that lists course costs and materials
  9659. provided.
  9660.  
  9661. Followups to misc.misc, since this thread probably doesn't interest everyone.
  9662.  
  9663. >Allan Adler
  9664. >ara@altdorf.ai.mit.edu
  9665. -- 
  9666. Guy Helmer, Dakota State University Computing Services - ghelmer@dsuvax.dsu.edu
  9667. "Often you fix the wrong thing first." - Karl Auerbach, Interop 91
  9668.  
  9669. From icon-group-request  Mon Apr 27 10:01:06 1992
  9670. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Mon, 27 Apr 92 10:01:06 MST
  9671. Received: from ucbvax.Berkeley.EDU by optima.cs.arizona.edu (4.1/15)
  9672.     id AA25521; Mon, 27 Apr 92 10:01:02 MST
  9673. Received: by ucbvax.Berkeley.EDU (5.63/1.43)
  9674.     id AA01341; Mon, 27 Apr 92 09:55:48 -0700
  9675. Received: from USENET by ucbvax.Berkeley.EDU with netnews
  9676.     for icon-group@cs.arizona.edu (icon-group@cs.arizona.edu)
  9677.     (contact usenet@ucbvax.Berkeley.EDU if you have questions)
  9678. Date: 24 Apr 92 21:25:52 GMT
  9679. From: cis.ohio-state.edu!zaphod.mps.ohio-state.edu!uwm.edu!linac!uchinews!ellis!goer@ucbvax.berkeley.edu  (Richard L. Goerwitz)
  9680. Organization: University of Chicago Computing Organizations
  9681. Subject: Re: Computer Programming for the Humanities Course Offering
  9682. Message-Id: <1992Apr24.212552.9948@midway.uchicago.edu>
  9683. References: <1992Apr24.162006.6210@dsuvax.dsu.edu>
  9684. Sender: icon-group-request@cs.arizona.edu
  9685. To: icon-group@cs.arizona.edu
  9686.  
  9687. While we're at it, I'd like to advertize a course in COBOL and FORTRAN
  9688. programming for computer science students.  An advanced course in BASIC
  9689. will be offered as well.
  9690.  
  9691. -- 
  9692.  
  9693.    -Richard L. Goerwitz              goer%ellis@uchicago.bitnet
  9694.    goer@ellis.uchicago.edu           rutgers!oddjob!ellis!goer
  9695.  
  9696. From icon-group-request  Mon Apr 27 14:32:41 1992
  9697. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Mon, 27 Apr 92 14:32:41 MST
  9698. Received: from ucbvax.Berkeley.EDU by optima.cs.arizona.edu (4.1/15)
  9699.     id AA09622; Mon, 27 Apr 92 14:32:38 MST
  9700. Received: by ucbvax.Berkeley.EDU (5.63/1.43)
  9701.     id AA12719; Mon, 27 Apr 92 14:15:42 -0700
  9702. Received: from USENET by ucbvax.Berkeley.EDU with netnews
  9703.     for icon-group@cs.arizona.edu (icon-group@cs.arizona.edu)
  9704.     (contact usenet@ucbvax.Berkeley.EDU if you have questions)
  9705. Date: 25 Apr 92 01:41:36 GMT
  9706. From: mintaka.lcs.mit.edu!zurich.ai.mit.edu!ara@yale-bulldog.arpa  (Allan Adler)
  9707. Organization: M.I.T. Artificial Intelligence Lab.
  9708. Subject: Re: Computer Programming for the Humanities Course Offering
  9709. Message-Id: <ARA.92Apr24204136@camelot.ai.mit.edu>
  9710. References: <1992Apr24.162006.6210@dsuvax.dsu.edu>
  9711. Sender: icon-group-request@cs.arizona.edu
  9712. To: icon-group@cs.arizona.edu
  9713.  
  9714. In article <1992Apr24.162006.6210@dsuvax.dsu.edu> ghelmer@dsuvax.dsu.edu (Guy Helmer) writes:
  9715.  
  9716.  
  9717.     Following is information about a three-credit graduate course
  9718.    in programming for the humanities offered by Dakota State
  9719.    University via BITNET (and other interconnected networks).
  9720.    Students in the course can be anywhere in the world if they can
  9721.    send and receive electronic mail.
  9722.      [ details of the course deleted]
  9723.     The total cost of the course is $239.82.  No textbook is
  9724.    required.  Students will be sent a disk containing a public-domain
  9725.    SNOBOL4 compiler and a text editor.  Lectures and data files will
  9726.    be sent electronically.
  9727.  
  9728.     Students may audit the course or enroll for credit and receive
  9729.    a grade of Pass or Fail.  The cost to audit the course is the same
  9730.    as enrolling for credit.
  9731.  
  9732.     Those who want an electronic registration form or who have
  9733.    questions about the course should send a message to
  9734.  
  9735.  
  9736.  
  9737. I think this counts as commercial advertising. If someone wants to make the
  9738. course materials available to people via anonymous ftp, that is one thing.
  9739. If someone wants to organize a network of volunteers to help people in the
  9740. humanities learn computers, that is still ok. But this is pure commerce.
  9741.  
  9742. Aren't there rules about this sort of thing?
  9743.  
  9744. Allan Adler
  9745. ara@altdorf.ai.mit.edu
  9746.  
  9747. From icon-group-request  Mon Apr 27 15:16:23 1992
  9748. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Mon, 27 Apr 92 15:16:23 MST
  9749. Received: from ucbvax.Berkeley.EDU by optima.cs.arizona.edu (4.1/15)
  9750.     id AA11850; Mon, 27 Apr 92 15:16:22 MST
  9751. Received: by ucbvax.Berkeley.EDU (5.63/1.43)
  9752.     id AA15775; Mon, 27 Apr 92 15:12:45 -0700
  9753. Received: from USENET by ucbvax.Berkeley.EDU with netnews
  9754.     for icon-group@cs.arizona.edu (icon-group@cs.arizona.edu)
  9755.     (contact usenet@ucbvax.Berkeley.EDU if you have questions)
  9756. Date: 25 Apr 92 01:37:07 GMT
  9757. From: s5!sethb@uunet.uu.net  (Seth Breidbart)
  9758. Organization: Morgan Stanley & Co., New York, NY
  9759. Subject: Re: Computer Programming for the Humanities Course Offering
  9760. Message-Id: <1992Apr25.013707.17137@fid.morgan.com>
  9761. References: <1992Apr24.162006.6210@dsuvax.dsu.edu>, <WAND.92Apr24162753@dec5120z.ccs.northeastern.edu>
  9762. Sender: icon-group-request@cs.arizona.edu
  9763. To: icon-group@cs.arizona.edu
  9764.  
  9765. In article <WAND.92Apr24162753@dec5120z.ccs.northeastern.edu>
  9766. wand@corwin.ccs.northeastern.edu writes:
  9767. >I didn't think there were any living SNOBOL programmers left!
  9768.  
  9769. Well, I was once paid for programming in SNOBOL.  Does that count?
  9770. (But I remember how surprised I was the only time I saw a "help
  9771. wanted" ad for a SNOBOL programmer!)
  9772.  
  9773. >in SNOBOL, which is hardly an industrial-strength language with widespread
  9774. >support! 
  9775.  
  9776. No, but it's a lot of fun!
  9777.  
  9778. Seth        sethb@fid.morgan.com
  9779.  
  9780. From shafto@eos.arc.nasa.gov  Tue Apr 28 13:43:08 1992
  9781. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Tue, 28 Apr 92 13:43:08 MST
  9782. Received: from eos.arc.nasa.gov by optima.cs.arizona.edu (4.1/15)
  9783.     id AA03700; Tue, 28 Apr 92 13:43:06 MST
  9784. Received: Tue, 28 Apr 92 13:42:28 -0700 by eos.arc.nasa.gov (5.57/1.2)
  9785. Date: Tue, 28 Apr 92 13:42:28 -0700
  9786. From: Michael Shafto <shafto@eos.arc.nasa.gov>
  9787. Message-Id: <9204282042.AA26038@eos.arc.nasa.gov>
  9788. To: icon-group@cs.arizona.edu, s5!sethb@uunet.uu.net
  9789. Subject: Re: Computer Programming for the Humanities Course Offering
  9790. Cc: shafto@eos.arc.nasa.gov
  9791.  
  9792. s5!sethb@uunet.uu.net  (Seth Breidbart):
  9793. "wand@corwin.ccs.northeastern.edu writes:
  9794.  ' ... SNOBOL, which is hardly an industrial-strength language ... '"
  9795.  
  9796. It's sure no PL/I or Ada!
  9797.  
  9798. To paraphrase a phrase, "To really mess things up, you
  9799. need an international standards committee!"
  9800.  
  9801. Mike
  9802.  
  9803. From icon-group-request  Tue Apr 28 19:33:46 1992
  9804. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Tue, 28 Apr 92 19:33:46 MST
  9805. Received: from ucbvax.Berkeley.EDU by optima.cs.arizona.edu (4.1/15)
  9806.     id AA16798; Tue, 28 Apr 92 19:33:44 MST
  9807. Received: by ucbvax.Berkeley.EDU (5.63/1.43)
  9808.     id AA28705; Tue, 28 Apr 92 19:24:29 -0700
  9809. Received: from USENET by ucbvax.Berkeley.EDU with netnews
  9810.     for icon-group@cs.arizona.edu (icon-group@cs.arizona.edu)
  9811.     (contact usenet@ucbvax.Berkeley.EDU if you have questions)
  9812. Date: 27 Apr 92 04:41:35 GMT
  9813. From: mips!munnari.oz.au!goanna!ok@decwrl.dec.com  (Richard A. O'Keefe)
  9814. Organization: Comp Sci, RMIT, Melbourne, Australia
  9815. Subject: Re: features from Icon Language in lisp
  9816. Message-Id: <10400@goanna.cs.rmit.oz.au>
  9817. References: <1992Apr14.173407.28762@adobe.com>, <LGM.92Apr25121643@cbnewsc.ATT.COM>, <1992Apr25.185854.1374@cs.cornell.edu>
  9818. Sender: icon-group-request@cs.arizona.edu
  9819. To: icon-group@cs.arizona.edu
  9820.  
  9821. In article <1992Apr25.185854.1374@cs.cornell.edu>, jar@cs.cornell.edu (Jonathan Rees) writes:
  9822. > In this discussion of Icon features in Lisp, I'm surprised that no one
  9823. > has mentioned the obvious embedding of Icon-like control in Scheme.
  9824. Thanks for posting it.
  9825.  
  9826. > ; (accumulate a) returns a list of all the possible values of the
  9827. > ; expression a.  Prolog calls this "bagof"; I forget what Icon calls it.
  9828.  
  9829. Wrong.
  9830.  
  9831. Prolog calls it findall/3.  There is a *MAJOR* difference between findall/3
  9832. and bagof/3, which is not relevant to Scheme.
  9833.  
  9834. For what it's worth, some functional languages call this "list comprehension".
  9835. A stream-based version can be found in SICP, of course.
  9836. -- 
  9837. I am writing a book on debugging aimed at 1st & 2nd year CS students using
  9838. C/Modula/Pascal-like languages.  Please send suggestions (other than "you
  9839. _must_ cite "C Traps and Pitfalls") to ok@goanna.cs.rmit.oz.au
  9840.  
  9841. From TENAGLIA@mis.mcw.edu  Wed Apr 29 04:23:53 1992
  9842. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Wed, 29 Apr 92 04:23:53 MST
  9843. Received: from ADM.MIS.MCW.EDU by optima.cs.arizona.edu (4.1/15)
  9844.     id AA08177; Wed, 29 Apr 92 04:23:49 MST
  9845. Received: from mis.mcw.edu by mis.mcw.edu (PMDF #12865) id
  9846.  <01GJERGZM7PCBXIVW3@mis.mcw.edu>; Wed, 29 Apr 1992 06:24 CST
  9847. Date: Wed, 29 Apr 1992 06:24 CST
  9848. From: Chris Tenaglia - 257-8765 <TENAGLIA@mis.mcw.edu>
  9849. Subject: Icon Performance Tuning
  9850. To: icon-group@cs.arizona.edu
  9851. Message-Id: <01GJERGZM7PCBXIVW3@mis.mcw.edu>
  9852. X-Organization: Medical College of Wisconsin (Milwaukee, WI)
  9853. X-Vms-To: IN%"icon-group@cs.arizona.edu"
  9854.  
  9855.  
  9856. I've enjoyed the Icon Newsletter and Icon Analyst and their mentioning
  9857. of tuning and profiling iconware from algorythmic, and implementation
  9858. viewpoints. But I'm wondering if there has been much done from the host
  9859. OS point of view to make things run more smoothly.
  9860.  
  9861. ------------------------------------------------------------------------
  9862. VMS : Has several hundred parameters that control memory and disk use.
  9863.       You change a parameter by editing a file, run a utility, and then
  9864.       rebooting.
  9865.       
  9866. Unix: I think has a similar operation. You edit a parameter file (actually
  9867.       part of a C program) and then 'rebuild' the kernel.
  9868.  
  9869. DOS : Has CONFIG.SYS with things like FILES, BUFFERS, and other possible
  9870.       memory management doodads.
  9871.  
  9872. MAC and others : I haven't the foggiest idea
  9873. ------------------------------------------------------------------------
  9874.  
  9875. I'm most interested in DOS at the moment. I'm wondering if anyone has
  9876. tinkered with FILES, BUFFERS, or running Icon in a LAN (PathWorks mostly,
  9877. but Novell and Banyan comments are also welcome). Perhaps one has had
  9878. to actually be in the guts of Icon to know what to do? I have some IO
  9879. intensive programs, and they actually run slower than interpreted BASICA.
  9880. (and it's not just inefficient icon code). Any pointers or hints would be
  9881. greatly appreciated. I use Icon 5.9 (mostly) & 8.0 (sometimes) on DOS 3.3,
  9882. but I don't think IO methods have changed that much.
  9883.  
  9884. Chris Tenaglia (System Manager) |  "The past explained,     
  9885. Medical College of Wisconsin    |   the future fortold, 
  9886. 8701 W. Watertown Plank Rd.     |   the present largely appologized for."
  9887. Milwaukee, WI 53226             |   Organon to The Doctor
  9888. (414)257-8765                   |     
  9889. tenaglia@mis.mcw.edu
  9890.  
  9891.  
  9892. From icon-group-request  Fri May  1 10:46:31 1992
  9893. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Fri, 1 May 92 10:46:31 MST
  9894. Received: from ucbvax.Berkeley.EDU by optima.cs.arizona.edu (4.1/15)
  9895.     id AA20861; Fri, 1 May 92 10:46:28 MST
  9896. Received: by ucbvax.Berkeley.EDU (5.63/1.43)
  9897.     id AA01504; Fri, 1 May 92 10:33:13 -0700
  9898. Received: from USENET by ucbvax.Berkeley.EDU with netnews
  9899.     for icon-group@cs.arizona.edu (icon-group@cs.arizona.edu)
  9900.     (contact usenet@ucbvax.Berkeley.EDU if you have questions)
  9901. Date: 29 Apr 92 15:22:35 GMT
  9902. From: ogicse!mintaka.lcs.mit.edu!zurich.ai.mit.edu!ara@decwrl.dec.com  (Allan Adler)
  9903. Organization: M.I.T. Artificial Intelligence Lab.
  9904. Subject: Re: Computer Programming for the Humanities Course Offering
  9905. Message-Id: <ARA.92Apr29102235@camelot.ai.mit.edu>
  9906. References: <1992Apr27.145008.22240@dsuvax.dsu.edu>
  9907. Sender: icon-group-request@cs.arizona.edu
  9908. To: icon-group@cs.arizona.edu
  9909.  
  9910. In article <1992Apr29.123915.3952@jlc.mv.com> john@jlc.mv.com (John Leslie) writes:
  9911.  
  9912.  
  9913.    In article <STEPHEN.92Apr27235345@estragon.uchicago.edu> stephen@estragon.uchicago.edu (Stephen P Spackman) writes:
  9914.    >
  9915.    >A society that makes charging for sex illegal and considers charging
  9916.    >for information only proper is *very seriously twisted*.
  9917.    >
  9918.       As it turns out, there's a very good reason for governments to prohibit
  9919.    free market sex -- the extreme costs of AIDS treatment make it entirely
  9920.    impractical to regulate such a market and allocate the true costs.  Surely
  9921.    today's Internetters don't _still_ believe that *information* is as
  9922.    harmful? :)
  9923.  
  9924.    John Leslie <john@jlc.mv.com>
  9925.  
  9926.  
  9927. The cost of ignorance is also quite high. That is a good argument for free
  9928. information.
  9929.  
  9930. Allan Adler
  9931. ara@altdorf.ai.mit.edu
  9932.  
  9933. From icon-group-request  Fri May  1 18:32:50 1992
  9934. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Fri, 1 May 92 18:32:50 MST
  9935. Received: from ucbvax.Berkeley.EDU by optima.cs.arizona.edu (4.1/15)
  9936.     id AA07779; Fri, 1 May 92 18:32:46 MST
  9937. Received: by ucbvax.Berkeley.EDU (5.63/1.43)
  9938.     id AA00208; Fri, 1 May 92 18:20:23 -0700
  9939. Received: from USENET by ucbvax.Berkeley.EDU with netnews
  9940.     for icon-group@cs.arizona.edu (icon-group@cs.arizona.edu)
  9941.     (contact usenet@ucbvax.Berkeley.EDU if you have questions)
  9942. Date: 28 Apr 92 04:38:48 GMT
  9943. From: cis.ohio-state.edu!zaphod.mps.ohio-state.edu!uakari.primate.wisc.edu!usenet.coe.montana.edu!news.u.washington.edu!hardy.u.washington.edu!ericfw@ucbvax.berkeley.edu  (Eric F.)
  9944. Organization: University of Washington, Seattle
  9945. Subject: Re: Computer Programming for the Humanities Course Offering
  9946. Message-Id: <1992Apr28.043848.17093@u.washington.edu>
  9947. References: <ARA.92Apr24204136@camelot.ai.mit.edu>, <1992Apr27.145008.22240@dsuvax.dsu.edu>, <1992Apr28.013928.873@coyote.datalog.com>
  9948. Sender: icon-group-request@cs.arizona.edu
  9949. To: icon-group@cs.arizona.edu
  9950.  
  9951. In article <1992Apr28.013928.873@coyote.datalog.com> jmh@coyote.datalog.com (John Hughes) writes:
  9952. >In article <1992Apr27.145008.22240@dsuvax.dsu.edu> ghelmer@dsuvax.dsu.edu (Guy Helmer) writes:
  9953. >>In <ARA.92Apr24204136@camelot.ai.mit.edu> ara@zurich.ai.mit.edu (Allan Adler) writes:
  9954. >>
  9955. >>>In article <1992Apr24.162006.6210@dsuvax.dsu.edu> ghelmer@dsuvax.dsu.edu
  9956. >>> (Guy Helmer) posted:
  9957. >>
  9958. >>>>    Following is information about a three-credit graduate course
  9959. >>>>   in programming for the humanities offered by Dakota State
  9960. >>>>   University via BITNET (and other interconnected networks).
  9961. >>>>     [ details of the course deleted]
  9962. >>>>    The total cost of the course is $xxx.xx.  No textbook is
  9963. >>                                         ^^^^^^
  9964. >>Actual cost deleted to avoid affending even more readers. :-)
  9965.  
  9966. [arguments concerning whether this is or is not commercial advertising]
  9967.  
  9968. >>>Aren't there rules about this sort of thing?
  9969. >>
  9970. >>:-)  Rules on Usenet?
  9971. >>
  9972.  
  9973. [more deletia]
  9974.  
  9975. >
  9976. >I've been watching the various reactions to the original posting with some
  9977. >mixed feelings. It is a source of puzzlement to me as to why there aren't
  9978. >more readily accessible venues for this type of "alternative" education
  9979. >(please spare me the comments about the comp. sci. degrees by mail in the
  9980. >Popular Mechanics ads). I, for one, would welcome the opportunity to acquire
  9981. >additional education in a form that wouldn't tax my already overloaded
  9982. >school and work schedules. Also, since this is a course offered for credit
  9983. >by a (presumably) accredited, non-profit academic institution, I don't
  9984. >really see where it fits into the same category as, say, IBM or DEC trying
  9985. >to use the Internet to sell their latest workstations. And, as Guy points
  9986. >out, there really isn't much difference between the posting for the course
  9987. >offering and those seen regularly for various and sundry conferences.
  9988. >Perhaps there should be a move to ban conference notices which go into
  9989. >long and gory detail (including costs).
  9990. >
  9991. >But seriously, the technolgy and resources now exist to allow this type of
  9992. >"electronic classroom" to exist in a way never before possible. I would
  9993. >suggest that the collective minds of the Internet consider the possibilities
  9994. >and weigh the benefits before hastily brandishing the "non-commercial"
  9995. >club and beating such postings senseless.
  9996.  
  9997. I can make a suggestion: Advertising 'products' that are in whole or in 
  9998. major part information is OK, advertising tangible goods is out. For example,
  9999. the following could be sold through the net:
  10000. Software, counseling, on-line magazines and periodicals, training, legal 
  10001. advice, etc. 
  10002.  
  10003. The following would not be OK:
  10004. Computers, cars, food, booze, condominiums, condoms....etc. 
  10005.  
  10006. The usual classified ad type stuff would still be OK(by the way, I have a 
  10007. used AT for sale ;->). 
  10008.  
  10009. Just a suggestion from off the top of my head. Flame away; I am interested in 
  10010. comments. Especially interested in counter-suggestions. 
  10011. =Eric
  10012.