home *** CD-ROM | disk | FTP | other *** search
/ ftp.cs.arizona.edu / ftp.cs.arizona.edu.tar / ftp.cs.arizona.edu / icon / newsgrp / group92b.txt < prev    next >
Text File  |  1992-09-13  |  445KB  |  12,823 lines

  1.  
  2. From icon-group-request  Fri May  1 20:18:36 1992
  3. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Fri, 1 May 92 20:18:36 MST
  4. Received: from ucbvax.Berkeley.EDU by optima.cs.arizona.edu (4.1/15)
  5.     id AA16097; Fri, 1 May 92 20:18:33 MST
  6. Received: by ucbvax.Berkeley.EDU (5.63/1.43)
  7.     id AA06324; Fri, 1 May 92 20:08:49 -0700
  8. Received: from USENET by ucbvax.Berkeley.EDU with netnews
  9.     for icon-group@cs.arizona.edu (icon-group@cs.arizona.edu)
  10.     (contact usenet@ucbvax.Berkeley.EDU if you have questions)
  11. Date: 28 Apr 92 04:53:38 GMT
  12. From: cis.ohio-state.edu!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!linac!uchinews!tira!stephen@ucbvax.berkeley.edu  (Stephen P Spackman)
  13. Organization: University of Chicago CILS
  14. Subject: Re: Computer Programming for the Humanities Course Offering
  15. Message-Id: <STEPHEN.92Apr27235345@estragon.uchicago.edu>
  16. References: <1992Apr24.162006.6210@dsuvax.dsu.edu>
  17. Sender: icon-group-request@cs.arizona.edu
  18. To: icon-group@cs.arizona.edu
  19.  
  20. In article <1992Apr28.013928.873@coyote.datalog.com> jmh@coyote.datalog.com (John Hughes) writes:
  21. |But seriously, the technolgy and resources now exist to allow this type of
  22. |"electronic classroom" to exist in a way never before possible. I would
  23. |suggest that the collective minds of the Internet consider the possibilities
  24. |and weigh the benefits before hastily brandishing the "non-commercial"
  25. |club and beating such postings senseless.
  26.  
  27. *Many* people here believe that all software should be free. There is
  28. a case to be made for this position, and you will note that the
  29. correlate attitude - that announcements of free software are far more
  30. welcome than those of commercial products - extend to this domain as
  31. well.
  32.  
  33. Now I realise that this is a political position (and probably an
  34. unpopular one in this country) but while it might be a good thing for
  35. software to be free, it is VITAL that education be so.  Education is
  36. not only one of the cornerstones of personal development, but it is
  37. essential to all sectors of public life as well. Denying it to people
  38. because of accidents of birth (that is, after all, what determines
  39. whether you have money - and hence health, education, and a hope in
  40. hell of putting what God gave you to some practical use - in this
  41. country, myths of classlessness be damned) is not merely morally
  42. suspect, it is socioeconomic suicide.
  43.  
  44. You want the BEST minds in your company, and you want the BEST
  45. musicians on your radio. You get that by not garbaging them because
  46. they can't raise your student fees, and by not forcing them to do work
  47. that they don't believe in by putting them in hock for the rest of
  48. their lives. (And if the price for this is that a lot of people get
  49. paid to WASTE their time, you're STILL better off than having that
  50. same deadwood drawing a salary in position that could be filled by
  51. someone with the enthusiasm and dedication that would draw them to it
  52. in spite of a lower marginal return).
  53.  
  54. A society that makes charging for sex illegal and considers charging
  55. for information only proper is *very seriously twisted*.
  56.  
  57. This ends the party political broadcast ;-).
  58. ----------------------------------------------------------------------
  59. stephen p spackman         Center for Information and Language Studies
  60. stephen@estragon.uchicago.edu                    University of Chicago
  61. ----------------------------------------------------------------------
  62. Note: the Univeristy of Chicago *without a doubt* disagrees with every
  63. single word of the above. Jack Mandora, me no choose NONE.
  64.  
  65. From icon-group-request  Sat May  2 12:21:27 1992
  66. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Sat, 2 May 92 12:21:27 MST
  67. Received: from ucbvax.Berkeley.EDU by optima.cs.arizona.edu (4.1/15)
  68.     id AA10815; Sat, 2 May 92 12:21:24 MST
  69. Received: by ucbvax.Berkeley.EDU (5.63/1.43)
  70.     id AA06461; Sat, 2 May 92 12:19:21 -0700
  71. Received: from USENET by ucbvax.Berkeley.EDU with netnews
  72.     for icon-group@cs.arizona.edu (icon-group@cs.arizona.edu)
  73.     (contact usenet@ucbvax.Berkeley.EDU if you have questions)
  74. Date: 28 Apr 92 07:10:39 GMT
  75. From: ryptyde!rjgrace@nosc.mil  (Jeff Grace)
  76. Organization: NetLink Online Communications, San Diego CA
  77. Subject: Re: Computer Programming for the Humanities Course Offering
  78. Message-Id: <g5iXJB1w164w@netlink.cts.com>
  79. References: <1992Apr27.145008.22240@dsuvax.dsu.edu>
  80. Sender: icon-group-request@cs.arizona.edu
  81. To: icon-group@cs.arizona.edu
  82.  
  83. ghelmer@dsuvax.dsu.edu (Guy Helmer) writes:
  84.  
  85. > In <ARA.92Apr24204136@camelot.ai.mit.edu> ara@zurich.ai.mit.edu (Allan Adler)
  86. > >In article <1992Apr24.162006.6210@dsuvax.dsu.edu> ghelmer@dsuvax.dsu.edu
  87. > > (Guy Helmer) posted:
  88. > >>    Following is information about a three-credit graduate course
  89. > >>   in programming for the humanities offered by Dakota State
  90. > >>   University via BITNET (and other interconnected networks).
  91. > >>     [ details of the course deleted]
  92. > >>    The total cost of the course is $xxx.xx.  No textbook is
  93. >                                          ^^^^^^
  94. > Actual cost deleted to avoid affending even more readers. :-)
  95. > >>   required.  Students will be sent a disk containing a public-domain
  96. > >>   SNOBOL4 compiler and a text editor.  Lectures and data files will
  97. > >>   be sent electronically.
  98. > >I think this counts as commercial advertising. If someone wants to make the
  99. > >course materials available to people via anonymous ftp, that is one thing.
  100. > >If someone wants to organize a network of volunteers to help people in the
  101. > >humanities learn computers, that is still ok. But this is pure commerce.
  102. > OK, this may be considered "commercial" advertising by some, but I submit it
  103. > it not "pure commerce", because:
  104. >     1) This is an experimental program offering, where the experiment
  105. >     is to offer an unusual course worldwide to users of the net, who,
  106. >     without benefit of the Internet, would not be able to take advantage
  107. >     of the offering.
  108. >     2) In the spirit of the course (using Internet as the delivery
  109. >     medium), the best method to contact potential "virtual attendees"
  110. >     is Usenet.  A very large share of the Internet is funded this
  111. >     moment to promote communication between research and educational
  112. >     institutions, which is what this course is based on.
  113. >     3) Given tight budgets, lack of support, and funding of time,
  114. >     the academic community must develop "free courses" so that we
  115. >     may post announcements of innovative, experimental, 
  116. >     one-of-a-kind opportunities to Usenet?
  117. > >Aren't there rules about this sort of thing?
  118. > :-)  Rules on Usenet?
  119. > Seriously, I will grant that perhaps it would have been "more proper"
  120. > and "less offending" to have posted summary information.  However, I
  121. > have a very hard time finding differences between my posting and the
  122. > postings you will find in news.announce.conferences, and I don't see
  123. > y'all flaming each post in n.a.c that lists course costs and materials
  124. > provided.
  125. > Followups to misc.misc, since this thread probably doesn't interest everyone.
  126. > >Allan Adler
  127. > >ara@altdorf.ai.mit.edu
  128. > -- 
  129. > Guy Helmer, Dakota State University Computing Services - ghelmer@dsuvax.dsu.e
  130. > "Often you fix the wrong thing first." - Karl Auerbach, Interop 91
  131.  
  132. Computer Science Majors! Language taught is SNOTLIK 2000! The advatages of
  133. learning programming from a Humanities Expert are so mind-boggling that
  134. etiquette prevents me from elaborating! Suffice it to say that Computer 
  135. Science Students will discover unknown horizons! New Territory! They might
  136. even forget that they aren't REAL SCIENTISTS!!
  137.  
  138. --                    
  139. INTERNET:  rjgrace@netlink.cts.com (Jeff Grace) |  This is a man...proud man,
  140. UUCP:   ...!nosc!ryptyde!netlink!rjgrace        |  most ingnorant of what 
  141. NetLink Online Communications                   |  he's most assured, his 
  142. Public access in San Diego, CA (619) 435-6181   |  glassy essence. (CS Pierce)
  143.  
  144. From icon-group-request  Sat May  2 16:07:05 1992
  145. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Sat, 2 May 92 16:07:05 MST
  146. Received: from ucbvax.Berkeley.EDU by optima.cs.arizona.edu (4.1/15)
  147.     id AA16895; Sat, 2 May 92 16:07:01 MST
  148. Received: by ucbvax.Berkeley.EDU (5.63/1.43)
  149.     id AA19860; Sat, 2 May 92 15:53:22 -0700
  150. Received: from USENET by ucbvax.Berkeley.EDU with netnews
  151.     for icon-group@cs.arizona.edu (icon-group@cs.arizona.edu)
  152.     (contact usenet@ucbvax.Berkeley.EDU if you have questions)
  153. Date: 28 Apr 92 15:54:56 GMT
  154. From: jar@cu-arpa.cs.cornell.edu  (Jonathan Rees)
  155. Organization: Cornell Univ. CS Dept, Ithaca NY 14853
  156. Subject: Re: features from Icon Language in lisp
  157. Message-Id: <1992Apr28.155456.15893@cs.cornell.edu>
  158. References: <1992Apr14.173407.28762@adobe.com>, <LGM.92Apr25121643@cbnewsc.ATT.COM>, <1992Apr25.185854.1374@cs.cornell.edu>
  159. Sender: icon-group-request@cs.arizona.edu
  160. To: icon-group@cs.arizona.edu
  161.  
  162. Oops!  I screwed up.
  163.  
  164.    To: jar@cs.cornell.edu
  165.    Subject: Re: features from Icon Language in lisp
  166.    Date: Tue, 28 Apr 92 11:10:19 -0400
  167.    From: Mark Saaltink <mark@ora.on.ca>
  168.  
  169.    I enjoyed your posting of "either" and "accumulate".  Sadly,
  170.    accumulate is not guaranteed to work properly in all Schemes
  171.    (and in fact does not work properly in the scheme I use).
  172.  
  173.    Here's the problem.  In the code
  174.  
  175.    (define (%accumulate thunk)
  176.      (let ((results '()))
  177.        (either (begin (set! results (cons (thunk) results))
  178.               (fail))
  179.            (reverse results))))
  180.  
  181.    the continuation for (thunk) may have already evaluated "results" (and got
  182.    '()).  The standard, of course, allows cons to evaluate its arguments in
  183.    either order.  In this case, accumulate returns a list containing only the
  184.    last result generated.
  185.  
  186.    The fix is really quite simple:
  187.  
  188.    (define (%accumulate thunk)
  189.      (let ((results '()))
  190.        (either (let ((x (thunk)))            ;[minor edit of MS's fix --JAR]
  191.          (set! results (cons x results))
  192.          (fail))
  193.            (reverse results))))
  194.  
  195.    Programming with continuations is amazing (and subtle)!
  196.  
  197.    Mark Saaltink
  198.  
  199. -- 
  200. Jonathan Rees  jar@cs.cornell.edu
  201. member, Cambridge Entomological Club / member, League for Programming Freedom
  202.  
  203. From icon-group-request  Sun May  3 19:44:09 1992
  204. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Sun, 3 May 92 19:44:09 MST
  205. Received: from ucbvax.Berkeley.EDU by optima.cs.arizona.edu (4.1/15)
  206.     id AA04714; Sun, 3 May 92 19:44:06 MST
  207. Received: by ucbvax.Berkeley.EDU (5.63/1.43)
  208.     id AA00551; Sun, 3 May 92 19:28:25 -0700
  209. Received: from USENET by ucbvax.Berkeley.EDU with netnews
  210.     for icon-group@cs.arizona.edu (icon-group@cs.arizona.edu)
  211.     (contact usenet@ucbvax.Berkeley.EDU if you have questions)
  212. Date: 28 Apr 92 17:18:36 GMT
  213. From: amethyst!organpipe.uug.arizona.edu!news@noao.edu  (Dave Schaumann)
  214. Organization: University of Arizona
  215. Subject: Re: Computer Programming for the Humanities Course Offering
  216. Message-Id: <1992Apr28.171836.12400@organpipe.uug.arizona.edu>
  217. References: <1992Apr27.145008.22240@dsuvax.dsu.edu>, <1992Apr28.013928.873@coyote.datalog.com>, <STEPHEN.92Apr27235345@estragon.uchicago.edu>
  218. Sender: icon-group-request@cs.arizona.edu
  219. To: icon-group@cs.arizona.edu
  220.  
  221. [Oh, boy.  Are we having a flame war yet?]
  222.  
  223. In article <STEPHEN.92Apr27235345@estragon.uchicago.edu>, stephen@estragon (Stephen P Spackman) writes:
  224. >Now I realise that this is a political position (and probably an
  225. >unpopular one in this country) but while it might be a good thing for
  226. >software to be free, it is VITAL that education be so.
  227.  
  228. Perhaps so.  But until and unless we have a *major* restructuring of our
  229. economy, it never will be.  Instructors, equipment, classrooms, material,
  230. etc, etc, etc. all cost money.  Unless that changes, education will never
  231. be free.  I suppose what you meant was "eductaion should be free for
  232. students" (in which case, I suppose, education would be funded by the
  233. state (==taxes) and private donations). 
  234.  
  235. >Denying [education] to people because of accidents of birth (that is,
  236. >after all, what determines whether you have money - and hence health,
  237. >education, and a hope in hell of putting what God gave you to some
  238. >practical use
  239.  
  240. I disagree.  "Accidents of birth" determines whether you /start out/
  241. with money.  Too many people have managed to climb their way out of
  242. shit-holes of poverty to make me believe that where you start out is
  243. the only (or even the most important) determining factor about where
  244. you end up.
  245.  
  246. And frankly, it seems to me that unless you are /very/ careful, increasing
  247. government hand outs doesn't teach anyone anything except how to depend
  248. on government hand outs.  I think we'd be far better off teaching people
  249. how to make their own prosperity rather than trying to provide it for them.
  250.  
  251. >A society that makes charging for sex illegal and considers charging
  252. >for information only proper is *very seriously twisted*.
  253.  
  254. Anything that I might ever do with a computer is surely nothing more than
  255. creating information.  And if information should not be charged for, how
  256. can I hope to make a living with computers?
  257.  
  258. [Just in case its not completely obvious: ALL IMHO!]
  259.  
  260. >This ends the party political broadcast ;-).
  261.  
  262. -- 
  263. Dave Schaumann            dave@cs.arizona.edu
  264.  
  265. From icon-group-request  Mon May  4 09:46:48 1992
  266. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Mon, 4 May 92 09:46:48 MST
  267. Received: from ucbvax.Berkeley.EDU by optima.cs.arizona.edu (4.1/15)
  268.     id AA05648; Mon, 4 May 92 09:46:45 MST
  269. Received: by ucbvax.Berkeley.EDU (5.63/1.43)
  270.     id AA17758; Mon, 4 May 92 05:10:26 -0700
  271. Received: from USENET by ucbvax.Berkeley.EDU with netnews
  272.     for icon-group@cs.arizona.edu (icon-group@cs.arizona.edu)
  273.     (contact usenet@ucbvax.Berkeley.EDU if you have questions)
  274. Date: 28 Apr 92 16:32:16 GMT
  275. From: cis.ohio-state.edu!zaphod.mps.ohio-state.edu!menudo.uh.edu!sugar!ficc!peter@ucbvax.berkeley.edu  (Peter da Silva)
  276. Organization: Xenix Support, FICC
  277. Subject: Re: Computer Programming for the Humanities Course Offering
  278. Message-Id: <id.A2AP.DSC@ferranti.com>
  279. References: <1992Apr27.145008.22240@dsuvax.dsu.edu>, <1992Apr28.013928.873@coyote.datalog.com>, <STEPHEN.92Apr27235345@estragon.uchicago.edu>
  280. Sender: icon-group-request@cs.arizona.edu
  281. To: icon-group@cs.arizona.edu
  282.  
  283. In article <STEPHEN.92Apr27235345@estragon.uchicago.edu> stephen@estragon.uchicago.edu (Stephen P Spackman) writes:
  284. > Now I realise that this is a political position (and probably an
  285. > unpopular one in this country) but while it might be a good thing for
  286. > software to be free, it is VITAL that education be so.
  287.  
  288. It is possible to consider making software free, because the cost of duplication
  289. is negligable. This is NOT true for education, at least if you plan on having
  290. some sort of grading and accredition. Someone has to pay for the costs of
  291. training each student.
  292.  
  293. I happen to agree that the cost of education should be shared by the general
  294. public, since the benefits outweigh the costs by orders of magnitude, but how
  295. much education to you give away? This is simply a matter of management of
  296. resources. And in this society resource management is handled by distributing
  297. tokens that represent resources to individuals, and letting individuals make
  298. their own decisions on how their share of their resources will be used.
  299.  
  300. This has disadvantages, since people may use their share of resources unwisely.
  301. Or their parents may have, or other people may cheat. So we have a common
  302. pool of resources that are managed on people's behalf. This pool, however, is
  303. limited... so at some point you have to let people do their own resource
  304. allocation, and have people pay for continuing education with their own
  305. money.
  306.  
  307. You may have problems with *where* the dividing line is... but I can't see
  308. any way you can seriously argue that this dividing line not exist.
  309.  
  310. > (And if the price for this is that a lot of people get
  311. > paid to WASTE their time, you're STILL better off than having that
  312. > same deadwood drawing a salary in position that could be filled by
  313. > someone with the enthusiasm and dedication that would draw them to it
  314. > in spite of a lower marginal return).
  315.  
  316. I think eastern europe demonstrates quite well that this is not true.
  317.  
  318. > A society that makes charging for sex illegal and considers charging
  319. > for information only proper is *very seriously twisted*.
  320.  
  321. Now that I can't argue with. But that's a different matter... this society
  322. was founded by seriously twisted people who couldn't make it in Europe.
  323. -- 
  324. Peter da Silva                                                      `-_-'
  325. Programmer, network firefighter, thrillseeker                        'U` 
  326. Ferranti International Controls Corporation                    Have you hugged
  327. Sugar Land, TX  77487-5012    +1 713 274 5180                  your wolf today?
  328.  
  329. From lrw!leichter@lrw.com  Mon May  4 11:49:12 1992
  330. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Mon, 4 May 92 11:49:12 MST
  331. Received: from uu.psi.com by optima.cs.arizona.edu (4.1/15)
  332.     id AA11474; Mon, 4 May 92 11:49:01 MST
  333. Received: from lrw.UUCP by uu.psi.com (5.65b/4.1.031792-PSI/PSINet)
  334.     id AA24943; Mon, 4 May 92 14:22:50 -0400
  335. Message-Id: <9205041822.AA24943@uu.psi.com>
  336. Received: by lrw.UUCP (DECUS UUCP w/Smail);
  337.           Mon,  4 May 92 13:52:44 EDT
  338. Date: Mon,  4 May 92 13:52:44 EDT
  339. From: Jerry Leichter <leichter@lrw.com>
  340. To: ICON-GROUP@cs.arizona.edu
  341. Subject: Re: Computer Programming for Humanities ... [Political Flammage]
  342. X-Vms-Mail-To: ICON-GROUP@CS.ARIZONA.EDU
  343.  
  344. Will all of you please just SHUT UP.  This is the ICON mailing list.  It's for
  345. the discussion of the ICON programming language and related issues.  We don't
  346. need your naive, uninformed political ravings.  We wouldn't need your them
  347. even if they WERE informed.
  348.  
  349. Announcements of seminars and classes related to academic pursuits have long
  350. been considered fair game on the Internet, even when there was a charge for
  351. them.  (Try and find an announcement of a truly free meeting, ACM, IEEE, AAAI,
  352. or otherwise.)  The seminar that started all this extraordinary raving (by too
  353. many people for me to write to them individually, the best response to idiocy
  354. that won't go away when simply ignored) was clearly a legitimate academic
  355. effort.
  356.  
  357. You don't like it?  You think you know better what should be allowed on the
  358. net, or on this group?  I don't give a damn.  It's not your decision.  Never
  359. was.  Let's all hope it never will be.  Go back to your little sandboxes and
  360. play nicely with your toys, children.
  361.                             -- Jerry
  362.  
  363. From alex@laguna.metaphor.com  Mon May  4 16:20:02 1992
  364. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Mon, 4 May 92 16:20:02 MST
  365. Received: from relay.metaphor.com by optima.cs.arizona.edu (4.1/15)
  366.     id AA27463; Mon, 4 May 92 16:19:53 MST
  367. Received: from laguna.Metaphor.COM by relay.metaphor.com (4.1/SMI-4.1)
  368.     id AA00252; Mon, 4 May 92 16:03:16 PDT
  369. Received: by laguna.Metaphor.COM (4.1/SMI-4.0)
  370.     id AA01672; Mon, 4 May 92 15:28:51 PDT
  371. Date: Mon, 4 May 92 15:28:51 PDT
  372. From: alex@laguna.metaphor.com (Bob Alexander)
  373. Message-Id: <9205042228.AA01672@laguna.Metaphor.COM>
  374. To: icon-group@cs.arizona.edu
  375. Subject: Encryption in Icon?
  376.  
  377. Can anyone point me to an encryption/decryption algorithm in Icon?
  378.  
  379.  
  380. -- Bob Alexander
  381.  
  382. Metaphor Computer Systems   (415) 961-3600 x751   alex@metaphor.com
  383. ====^=== Mountain View, CA  ...{uunet}!{decwrl,apple}!metaphor!alex
  384.  
  385. From icon-group-request  Mon May  4 19:35:08 1992
  386. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Mon, 4 May 92 19:35:08 MST
  387. Received: from ucbvax.Berkeley.EDU by optima.cs.arizona.edu (4.1/15)
  388.     id AA05370; Mon, 4 May 92 19:35:05 MST
  389. Received: by ucbvax.Berkeley.EDU (5.63/1.43)
  390.     id AA16922; Mon, 4 May 92 19:28:55 -0700
  391. Received: from USENET by ucbvax.Berkeley.EDU with netnews
  392.     for icon-group@cs.arizona.edu (icon-group@cs.arizona.edu)
  393.     (contact usenet@ucbvax.Berkeley.EDU if you have questions)
  394. Date: 29 Apr 92 12:39:15 GMT
  395. From: cis.ohio-state.edu!zaphod.mps.ohio-state.edu!mips!spool.mu.edu!hri.com!noc.near.net!mv!jlc!john@ucbvax.berkeley.edu  (John Leslie)
  396. Organization: John Leslie Consulting, Milford NH
  397. Subject: Re: Computer Programming for the Humanities Course Offering
  398. Message-Id: <1992Apr29.123915.3952@jlc.mv.com>
  399. References: <1992Apr27.145008.22240@dsuvax.dsu.edu>, <1992Apr28.013928.873@coyote.datalog.com>, <STEPHEN.92Apr27235345@estragon.uchicago.edu>
  400. Sender: icon-group-request@cs.arizona.edu
  401. To: icon-group@cs.arizona.edu
  402.  
  403. In article <STEPHEN.92Apr27235345@estragon.uchicago.edu> stephen@estragon.uchicago.edu (Stephen P Spackman) writes:
  404. >
  405. >A society that makes charging for sex illegal and considers charging
  406. >for information only proper is *very seriously twisted*.
  407. >
  408.    As it turns out, there's a very good reason for governments to prohibit
  409. free market sex -- the extreme costs of AIDS treatment make it entirely
  410. impractical to regulate such a market and allocate the true costs.  Surely
  411. today's Internetters don't _still_ believe that *information* is as
  412. harmful? :)
  413.  
  414. John Leslie <john@jlc.mv.com>
  415.  
  416. From pbewig@netcom.com  Mon May  4 20:50:13 1992
  417. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Mon, 4 May 92 20:50:13 MST
  418. Received: from netcom.netcom.com by optima.cs.arizona.edu (4.1/15)
  419.     id AA07469; Mon, 4 May 92 20:50:11 MST
  420. Received: by netcom.netcom.com (4.1/SMI-4.1)
  421.     id AA22471; Mon, 4 May 92 20:44:39 PDT
  422. Date: Mon, 4 May 92 20:44:39 PDT
  423. From: pbewig@netcom.com (Phil Bewig)
  424. Message-Id: <9205050344.AA22471@netcom.netcom.com>
  425. Apparently-To: icon-group@cs.arizona.edu
  426.  
  427. Here is a short encryption program which I use occasionally.
  428. Do *not* use this in the face of competent cryptanalysis.
  429.  
  430.  
  431. # icrypt.icn - encrypt and decrypt
  432. # usage:  [iconx] icrypt [key] <infile >outfile
  433.  
  434. procedure main(args)
  435.     local i, k, ky, l
  436.     if *args = 1 then
  437.         ky := get(args)
  438.     else {
  439.         con := open("/dev/tty", "b")
  440.         writes(con, "Enter password:  ")
  441.         # NOTE:  displays password!
  442.         ky := read(con)
  443.         close(con) }
  444.     i := 1
  445.     l := 0
  446.     k := []
  447.     every put(k, ord(!ky)) do
  448.         l +:= 1
  449.     while writes(char(ixor(ord(reads()), k[i]))) do
  450.         i %:= l + 1
  451. end
  452.  
  453. From icon-group-request  Mon May  4 23:47:12 1992
  454. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Mon, 4 May 92 23:47:12 MST
  455. Received: from ucbvax.Berkeley.EDU by optima.cs.arizona.edu (4.1/15)
  456.     id AA12587; Mon, 4 May 92 23:47:09 MST
  457. Received: by ucbvax.Berkeley.EDU (5.63/1.43)
  458.     id AA05980; Mon, 4 May 92 23:31:56 -0700
  459. Received: from USENET by ucbvax.Berkeley.EDU with netnews
  460.     for icon-group@cs.arizona.edu (icon-group@cs.arizona.edu)
  461.     (contact usenet@ucbvax.Berkeley.EDU if you have questions)
  462. Date: 29 Apr 92 15:18:28 GMT
  463. From: mcsun!uknet!edcastle!dcs.ed.ac.uk!nick@uunet.uu.net  (Nick Rothwell)
  464. Organization: Friends of the Salter Duck
  465. Subject: Re: Computer Programming for the Humanities Course Offering
  466. Message-Id: <NICK.92Apr29161828@vaila.ed.ac.uk>
  467. References: <1992Apr27.145008.22240@dsuvax.dsu.edu>
  468. Sender: icon-group-request@cs.arizona.edu
  469. To: icon-group@cs.arizona.edu
  470.  
  471. In article <1992Apr29.123915.3952@jlc.mv.com> john@jlc.mv.com (John Leslie) writes:
  472.       As it turns out, there's a very good reason for governments to prohibit
  473.    free market sex -- the extreme costs of AIDS treatment make it entirely
  474.    impractical to regulate such a market and allocate the true costs.  Surely
  475.    today's Internetters don't _still_ believe that *information* is as
  476.    harmful? :)
  477.  
  478. Computer viruses?
  479.  
  480. Nick.
  481. --
  482. Nick Rothwell, LFCS, Edinburgh |
  483.              nick@dcs.ed.ac.uk | Julia Roberts as Tinkerbell ...
  484. Mentation Consultancy Services | ... hey, that's *my* kind of fantasy ...
  485.    cassiel@cix.compulink.co.uk |
  486.  
  487. From icon-group-request  Tue May  5 08:02:48 1992
  488. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Tue, 5 May 92 08:02:48 MST
  489. Received: from ucbvax.Berkeley.EDU by optima.cs.arizona.edu (4.1/15)
  490.     id AA03570; Tue, 5 May 92 08:02:45 MST
  491. Received: by ucbvax.Berkeley.EDU (5.63/1.43)
  492.     id AA05539; Tue, 5 May 92 07:55:18 -0700
  493. Received: from USENET by ucbvax.Berkeley.EDU with netnews
  494.     for icon-group@cs.arizona.edu (icon-group@cs.arizona.edu)
  495.     (contact usenet@ucbvax.Berkeley.EDU if you have questions)
  496. Date: 29 Apr 92 16:51:23 GMT
  497. From: cis.ohio-state.edu!zaphod.mps.ohio-state.edu!news.acns.nwu.edu!uicvm.uic.edu!u47041@ucbvax.berkeley.edu
  498. Organization: University of Illinois at Chicago
  499. Subject: cms problem
  500. Message-Id: <92120.115123U47041@uicvm.uic.edu>
  501. Sender: icon-group-request@cs.arizona.edu
  502. To: icon-group@cs.arizona.edu
  503.  
  504. hi there i 'm trying to use icon in cms 5.0
  505. when i enter ICONT HELLO -X
  506. to test the program from the distribution tape
  507. i get the foll. messg. from the machine
  508.  
  509.  
  510. dms116s  loader table overflow
  511. invalid cms command
  512.  
  513.  
  514. (end of messg.)
  515. any sugestions?
  516. thanx
  517. u47041@uicvm.bitnet
  518. kapoulas@lac.math.uic.edu
  519.  
  520. From icon-group-request  Tue May  5 09:18:17 1992
  521. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Tue, 5 May 92 09:18:17 MST
  522. Received: from ucbvax.Berkeley.EDU by optima.cs.arizona.edu (4.1/15)
  523.     id AA06676; Tue, 5 May 92 09:18:14 MST
  524. Received: by ucbvax.Berkeley.EDU (5.63/1.43)
  525.     id AA11024; Tue, 5 May 92 09:05:20 -0700
  526. Received: from USENET by ucbvax.Berkeley.EDU with netnews
  527.     for icon-group@cs.arizona.edu (icon-group@cs.arizona.edu)
  528.     (contact usenet@ucbvax.Berkeley.EDU if you have questions)
  529. Date: 29 Apr 92 20:05:36 GMT
  530. From: cis.ohio-state.edu!zaphod.mps.ohio-state.edu!menudo.uh.edu!lobster!sugar!ficc!peter@ucbvax.berkeley.edu  (Peter da Silva)
  531. Organization: Xenix Support, FICC
  532. Subject: Re: Computer Programming for the Humanities Course Offering
  533. Message-Id: <id.Z9BP.RH5@ferranti.com>
  534. References: <1992Apr28.013928.873@coyote.datalog.com>, <STEPHEN.92Apr27235345@estragon.uchicago.edu>, <1992Apr29.123915.3952@jlc.mv.com>
  535. Sender: icon-group-request@cs.arizona.edu
  536. To: icon-group@cs.arizona.edu
  537.  
  538. In article <1992Apr29.123915.3952@jlc.mv.com> john@jlc.mv.com (John Leslie) writes:
  539. > In article <STEPHEN.92Apr27235345@estragon.uchicago.edu> stephen@estragon.uchicago.edu (Stephen P Spackman) writes:
  540. > >A society that makes charging for sex illegal and considers charging
  541. > >for information only proper is *very seriously twisted*.
  542.  
  543. >    As it turns out, there's a very good reason for governments to prohibit
  544. > free market sex -- the extreme costs of AIDS treatment make it entirely
  545. > impractical to regulate such a market and allocate the true costs.
  546.  
  547. I see. So rather than trying to regulate the market and minimise the
  548. dangers, you ensure that it's going to be unregulated and maximise the
  549. dangers.
  550.  
  551. Swift.
  552. -- 
  553. Peter da Silva                                                      `-_-'
  554. Programmer, network firefighter, thrillseeker                        'U` 
  555. Ferranti International Controls Corporation                    Have you hugged
  556. Sugar Land, TX  77487-5012    +1 713 274 5180                  your wolf today?
  557.  
  558. From icon-group-request  Tue May  5 09:19:14 1992
  559. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Tue, 5 May 92 09:19:14 MST
  560. Received: from ucbvax.Berkeley.EDU by optima.cs.arizona.edu (4.1/15)
  561.     id AA06708; Tue, 5 May 92 09:19:11 MST
  562. Received: by ucbvax.Berkeley.EDU (5.63/1.43)
  563.     id AA11657; Tue, 5 May 92 09:13:08 -0700
  564. Received: from USENET by ucbvax.Berkeley.EDU with netnews
  565.     for icon-group@cs.arizona.edu (icon-group@cs.arizona.edu)
  566.     (contact usenet@ucbvax.Berkeley.EDU if you have questions)
  567. Date: 5 May 92 15:39:40 GMT
  568. From: gln@arizona.edu  (Gary L. Newell)
  569. Organization: U of Arizona CS Dept, Tucson
  570. Subject: Re: Icon for CS-1
  571. Message-Id: <16147@optima.cs.arizona.edu>
  572. References: <1992Apr25.171211.6548@midway.uchicago.edu>, <15797@optima.cs.arizona.edu>
  573. Sender: icon-group-request@cs.arizona.edu
  574. To: icon-group@cs.arizona.edu
  575.  
  576. In article <15797@optima.cs.arizona.edu>, cjeffery@optima.UUCP (Clinton Jeffery) writes:
  577. > > Is Icon suitable as an introductory language?
  578. > Yes, if Lisp is then Icon is.  Some curriculums call for low-level
  579. > programming in the first course, but there is no consensus.  I'd
  580. > rather teach algorithms and program design than syntax, but a first
  581. > programming course necessarily spends much of its time teaching
  582. > language syntax ("special forms" for you Lisp protesters) so ideally
  583. > one would have a very high level language whose syntax suggests
  584. > design principles.  Not Lisp (not enough syntactic reinforcement
  585. > for good design, except in the huge variants that are too complex)
  586. > and not Modula-2 or Ada (syntax for modules, but way too much syntax
  587. > for the boring stuff).  Hmmm.
  588.  
  589.  
  590.  As someone who has taught a number of courses here at Arizona, I thought
  591. I might throw my 1.5 cents worht in. I've often thought about the
  592. possibility of teaching Icon at the CS-1 level and have come to the
  593. following conclusions:
  594.  
  595. 1) It would be superb in allowing students to focus more on the design
  596. of a solution to a problem in general terms, rather than the usual "design
  597. of a solution with a very specific syntax with little rhyme or reason to
  598. the new programmer". 
  599.  
  600. 2) Icon's use of failure as a natural occurance would also allow for
  601.    easier programming and thus give more time to students for learning
  602.    the more important tasks.
  603.  
  604. 3) The string and list capabilities would allow the types of problems
  605.    examined in such a course to far out-reach those commonly taught with
  606.    languages such as Pascal.
  607.  
  608.  However, as I see it there are at least two major problems:
  609.  
  610. 1) At some point you need to get the students into the grunge (so to speak)
  611. and more or less force them to hack out Pascal-like or C-like code. Their
  612. ability to compete in the market (both business and grad school) is likely
  613. to depend upon their exposure to "traditional" languages. It *could* be
  614. more difficult to move them into a language like C after exposure to
  615. a language with as high a level as Icon than it would be from Pascal.
  616.  
  617. 2) I don't know about other folks out there, but I find myself
  618. frequently wishing that I could program a certain piece of software
  619. using Icon rather than say C++, as it simply saves so much design time.
  620. It has definately been a bad influence on me (in a very good way of course)
  621. and tends to color my thinking about programming in general - thankfully
  622. I hope to enter academia upon receipt of my PhD (knock on wood) and
  623. intend to take X-Icon anywhere I go so as to never have to look at
  624. another C++ program again for the rest of my life....
  625.  
  626. From icon-group-request  Tue May  5 13:03:58 1992
  627. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Tue, 5 May 92 13:03:58 MST
  628. Received: from ucbvax.Berkeley.EDU by optima.cs.arizona.edu (4.1/15)
  629.     id AA16752; Tue, 5 May 92 13:03:56 MST
  630. Received: by ucbvax.Berkeley.EDU (5.63/1.43)
  631.     id AA28920; Tue, 5 May 92 12:57:09 -0700
  632. Received: from USENET by ucbvax.Berkeley.EDU with netnews
  633.     for icon-group@cs.arizona.edu (icon-group@cs.arizona.edu)
  634.     (contact usenet@ucbvax.Berkeley.EDU if you have questions)
  635. Date: 24 Apr 92 00:41:43 GMT
  636. From: wmichgw!561sleda@gumby.wisc.edu
  637. Organization: Western Michigan University
  638. Subject: TEST: Which lang. needs least lines?
  639. Message-Id: <1992Apr23.194143.3970@gw.wmich.edu>
  640. Sender: icon-group-request@cs.arizona.edu
  641. To: icon-group@cs.arizona.edu
  642.  
  643. Hello fellow programmers,
  644.  
  645. A professor here at Western Michigan University recently put the question
  646. shown below (or one very similar) on the final exam for an introductory
  647. computer course.  Besides the fact that usage of only the BASIC 
  648. language was discussed to any degree of depth, what is your opinion to, and
  649. what do you think the answer is to the question?  Please expound.  Send
  650. E-Mail to:  561sleda@gw.wmich.edu.  Thanks in advance for the input!!
  651.  
  652. Question:
  653.  
  654. If you were writing a program, which of the following languages would
  655. require to most lines?
  656.  
  657.          A)  COBOL
  658.          B)  BASIC
  659.          C)  FORTRAN
  660.          D)  PASCAL
  661.  
  662. _____________________________
  663.  
  664. From callas@eris.enet.dec.com  Tue May  5 14:09:06 1992
  665. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Tue, 5 May 92 14:09:06 MST
  666. Received: from enet-gw.pa.dec.com by optima.cs.arizona.edu (4.1/15)
  667.     id AA20429; Tue, 5 May 92 14:08:58 MST
  668. Received: by enet-gw.pa.dec.com; id AA25539; Tue, 5 May 92 14:08:40 -0700
  669. Message-Id: <9205052108.AA25539@enet-gw.pa.dec.com>
  670. Received: from eris.enet; by decwrl.enet; Tue, 5 May 92 14:08:48 PDT
  671. Date: Tue, 5 May 92 14:08:48 PDT
  672. From: What good is rain that falls up?  05-May-1992 1704 <callas@eris.enet.dec.com>
  673. To: 561sleda@gw.wmich.edu
  674. Cc: icon-group@cs.arizona.edu, callas@eris.enet.dec.com
  675. Apparently-To: icon-group@cs.arizona.edu, 561sleda@gw.wmich.edu
  676. Subject: Re: TEST: Which lang. needs least lines?
  677.  
  678. There's one small problem with your missive. Your subject line asks what
  679. program needs the *least* lines to code in, yet the question you give in the
  680. body asks for the *most* lines. They are two different questions.
  681.  
  682. If your question is the latter (most lines), then here are some possible
  683. answers:
  684.  
  685. An answer to your question is "mu." It should properly be accompanied by a
  686. sharp blow with a cane to the asker's occipital lobe in an attempt to bring the
  687. asker to true enlightenment. I believe that this is the best answer, as it
  688. indicates that the person who asked it does not understand a few very
  689. fundamental things about programming, like that "lines" are irrelevant in most
  690. cases. That this misunderstanding comes from a professor is alarming, but not
  691. surprising. One can only hope that it is an untenured position or that in
  692. spite of being a teacher, this professor is capable of learning.
  693.  
  694. Another answer to your question would be, "What does the program do?" All
  695. programs do some things better than others, and if allowed, a properly
  696. jesuitical or rabbinical person could construct a case for any of those
  697. languages.
  698.  
  699. Another answer would be to say (A) -- COBOL. COBOL is a very verbose language,
  700. and a betting person would bet on COBOL being longest on a non-rigged case. I
  701. might even go so far as to say that if Cobol is *not* the longest, then the
  702. case is rigged.
  703.  
  704. Now then, the other question -- which language would give you the least lines.
  705.  
  706. The best answer for this question, in my opinion, is also the best answer for
  707. the other one, for the same reasons.
  708.  
  709. The next best answer is to unequovably state that Pascal wins. (Note  that it
  710. is *not* PASCAL -- Pascal is a proper name, not an acronym; if your professor
  711. put it in upper case, then they not only lose points on content, but on style
  712. as well.) Pascal is the *only* language of those four that allows you to put
  713. your whole program on one arbitrarily long line (if it's a good Pascal,
  714. anyway). Meditate on this for a moment, and see if you can see why this tells
  715. me that "mu" (and the blow on the head) is a better answer.
  716.  
  717.         Jon.
  718.  
  719. From icon-group-request  Tue May  5 14:48:29 1992
  720. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Tue, 5 May 92 14:48:29 MST
  721. Received: from ucbvax.Berkeley.EDU by optima.cs.arizona.edu (4.1/15)
  722.     id AA22306; Tue, 5 May 92 14:48:26 MST
  723. Received: by ucbvax.Berkeley.EDU (5.63/1.43)
  724.     id AA04905; Tue, 5 May 92 14:18:38 -0700
  725. Received: from USENET by ucbvax.Berkeley.EDU with netnews
  726.     for icon-group@cs.arizona.edu (icon-group@cs.arizona.edu)
  727.     (contact usenet@ucbvax.Berkeley.EDU if you have questions)
  728. Date: 30 Apr 92 07:52:36 GMT
  729. From: mcsun!sunic2!dkuug!diku!klaus@uunet.uu.net  (Klaus Ole Kristiansen)
  730. Organization: Department of Computer Science, U of Copenhagen
  731. Subject: Re: Computer Programming for the Humanities Course Offering
  732. Message-Id: <1992Apr30.075236.5667@odin.diku.dk>
  733. References: <STEPHEN.92Apr27235345@estragon.uchicago.edu>, <1992Apr29.123915.3952@jlc.mv.com>, <ARA.92Apr29102235@camelot.ai.mit.edu>
  734. Sender: icon-group-request@cs.arizona.edu
  735. To: icon-group@cs.arizona.edu
  736.  
  737. ara@zurich.ai.mit.edu (Allan Adler) writes:
  738.  
  739. >The cost of ignorance is also quite high. That is a good argument for free
  740. >information.
  741.  
  742. Huh? "Having this thing will save me a lot, therefore it is not fair that
  743. I should have to pay for it."
  744.  
  745. I am all for free information, but this argument is absurd.
  746.  
  747. Klaus O K
  748.  
  749. From icon-group-request  Tue May  5 15:19:00 1992
  750. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Tue, 5 May 92 15:19:00 MST
  751. Received: from ucbvax.Berkeley.EDU by optima.cs.arizona.edu (4.1/15)
  752.     id AA24385; Tue, 5 May 92 15:18:58 MST
  753. Received: by ucbvax.Berkeley.EDU (5.63/1.43)
  754.     id AA09076; Tue, 5 May 92 15:08:53 -0700
  755. Received: from USENET by ucbvax.Berkeley.EDU with netnews
  756.     for icon-group@cs.arizona.edu (icon-group@cs.arizona.edu)
  757.     (contact usenet@ucbvax.Berkeley.EDU if you have questions)
  758. Date: 30 Apr 92 10:49:49 GMT
  759. 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)
  760. Organization: User Helpdesk Comp. Cent. (RUS) U of Stuttgart, FRG
  761. Subject: Re: cms problem
  762. Message-Id: <1992Apr30.104949.24461@news.uni-stuttgart.de>
  763. References: <92120.115123U47041@uicvm.uic.edu>
  764. Sender: icon-group-request@cs.arizona.edu
  765. To: icon-group@cs.arizona.edu
  766.  
  767. In article <92120.115123U47041@uicvm.uic.edu> <U47041@uicvm.uic.edu> writes:
  768. >hi there i 'm trying to use icon in cms 5.0
  769. >when i enter ICONT HELLO -X
  770. >i get the foll. messg. from the machine
  771. >
  772. >dms116s  loader table overflow
  773. >invalid cms command
  774. >
  775.  
  776. Don't now what's going on, but try to extent the loadertable:
  777.  
  778. Query the actuell numbers of loadertables with
  779.  
  780. query ldrtbls
  781.  
  782. and set a higher number with 
  783.  
  784. set ldrtbls number 
  785.  
  786. (the default number is 3)
  787.  
  788. so long
  789. MUFTI
  790.  
  791. From icon-group-request  Wed May  6 00:49:27 1992
  792. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Wed, 6 May 92 00:49:27 MST
  793. Received: from ucbvax.Berkeley.EDU by optima.cs.arizona.edu (4.1/15)
  794.     id AA19006; Wed, 6 May 92 00:49:23 MST
  795. Received: by ucbvax.Berkeley.EDU (5.63/1.43)
  796.     id AA25167; Wed, 6 May 92 00:36:59 -0700
  797. Received: from USENET by ucbvax.Berkeley.EDU with netnews
  798.     for icon-group@cs.arizona.edu (icon-group@cs.arizona.edu)
  799.     (contact usenet@ucbvax.Berkeley.EDU if you have questions)
  800. Date: 30 Apr 92 10:49:49 GMT
  801. 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)
  802. Organization: User Helpdesk Comp. Cent. (RUS) U of Stuttgart, FRG
  803. Subject: Re: cms problem
  804. Message-Id: <1992Apr30.104949.24461@news.uni-stuttgart.de>
  805. References: <92120.115123U47041@uicvm.uic.edu>
  806. Sender: icon-group-request@cs.arizona.edu
  807. To: icon-group@cs.arizona.edu
  808.  
  809. In article <92120.115123U47041@uicvm.uic.edu> <U47041@uicvm.uic.edu> writes:
  810. >hi there i 'm trying to use icon in cms 5.0
  811. >when i enter ICONT HELLO -X
  812. >i get the foll. messg. from the machine
  813. >
  814. >dms116s  loader table overflow
  815. >invalid cms command
  816. >
  817.  
  818. Don't now what's going on, but try to extent the loadertable:
  819.  
  820. Query the actuell numbers of loadertables with
  821.  
  822. query ldrtbls
  823.  
  824. and set a higher number with 
  825.  
  826. set ldrtbls number 
  827.  
  828. (the default number is 3)
  829.  
  830. so long
  831. MUFTI
  832.  
  833. From icon-group-request  Wed May  6 05:51:20 1992
  834. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Wed, 6 May 92 05:51:20 MST
  835. Received: from ucbvax.Berkeley.EDU by optima.cs.arizona.edu (4.1/15)
  836.     id AA01498; Wed, 6 May 92 05:51:17 MST
  837. Received: by ucbvax.Berkeley.EDU (5.63/1.43)
  838.     id AA23083; Wed, 6 May 92 05:49:12 -0700
  839. Received: from USENET by ucbvax.Berkeley.EDU with netnews
  840.     for icon-group@cs.arizona.edu (icon-group@cs.arizona.edu)
  841.     (contact usenet@ucbvax.Berkeley.EDU if you have questions)
  842. Date: 1 May 92 00:54:45 GMT
  843. From: cis.ohio-state.edu!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!linac!uchinews!tira!stephen@ucbvax.berkeley.edu  (Stephen P Spackman)
  844. Organization: University of Chicago CILS
  845. Subject: Re: Computer Programming for the Humanities Course Offering
  846. Message-Id: <STEPHEN.92Apr30195455@estragon.uchicago.edu>
  847. References: <1992Apr27.145008.22240@dsuvax.dsu.edu>
  848. Sender: icon-group-request@cs.arizona.edu
  849. To: icon-group@cs.arizona.edu
  850.  
  851. In article <1992Apr30.075236.5667@odin.diku.dk> klaus@diku.dk (Klaus Ole Kristiansen) writes:
  852. |ara@zurich.ai.mit.edu (Allan Adler) writes:
  853. |>The cost of ignorance is also quite high. That is a good argument for free
  854. |>information.
  855. |Huh? "Having this thing will save me a lot, therefore it is not fair that
  856. |I should have to pay for it."
  857. |
  858. |I am all for free information, but this argument is absurd.
  859.  
  860. I think the idea here is that the cost to OTHERS of ignorance is high.
  861. Which has always been my experience: I suffer as much from other
  862. people's mistakes as from my own, and sometimes a lot more.
  863.  
  864. stephen
  865.  
  866. From KARCZMA@FRCAEN51.BITNET  Wed May  6 06:33:45 1992
  867. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Wed, 6 May 92 06:33:45 MST
  868. Received: from SKYBLU.CCIT.ARIZONA.EDU by optima.cs.arizona.edu (4.1/15)
  869.     id AA03000; Wed, 6 May 92 06:33:44 MST
  870. Received: from FRCAEN51.BITNET (KARCZMA@FRCAEN51) by CCIT.ARIZONA.EDU (PMDF
  871.  #12663) id <01GJOJUPYA748WZ50B@CCIT.ARIZONA.EDU>; Wed, 6 May 1992 06:34 MST
  872. Date: 6 MAY 92 15:35:20.10-GMT
  873. From: KARCZMA@FRCAEN51.BITNET
  874. Subject: This time NOTHING about Humanities, etc.
  875. To: ICON-GROUP@cs.arizona.edu
  876. Message-Id: <01GJOJUPYA748WZ50B@CCIT.ARIZONA.EDU>
  877. X-Envelope-To: ICON-GROUP@CS.ARIZONA.EDU
  878.  
  879.  
  880. OK, gentlemen.
  881. I agree that the problem of free software is extremely interesting, and
  882. that this discussion will never end,
  883.  
  884. but let me ask something different.
  885.  
  886. Did anybody try to implement the co-expressions in Icon-V8 on a Sun 4 (Sparc)?
  887. In "C"? In assembly code?
  888.  
  889. Could you share your experiences?
  890.    Jerzy Karczmarczuk      karczma@frcaen51.bitnet
  891.    Lab. d'Informatique, University of Caen, France
  892.  
  893. From ralph  Wed May  6 06:45:50 1992
  894. Date: Wed, 6 May 92 06:45:50 MST
  895. From: "Ralph Griswold" <ralph>
  896. Message-Id: <9205061345.AA08807@cheltenham.cs.arizona.edu>
  897. Received: by cheltenham.cs.arizona.edu; Wed, 6 May 92 06:45:50 MST
  898. To: ICON-GROUP@cs.arizona.edu, KARCZMA@FRCAEN51.BITNET
  899. Subject: Re:  This time NOTHING about Humanities, etc.
  900. Cc: q
  901.  
  902. Co-expressions were implemented for Version 8 of Icon on the Sparc
  903. some time ago.  They are included in the recent Version 8.6 release
  904. as announced on this newsgroup.
  905.     
  906. Ralph E. Griswold            ralph@cs.arizona.edu
  907. Department of Computer Science          uunet!arizona!ralph
  908. The University of Arizona        602-621-6609 (voice)
  909. Tucson, AZ 85721            602-621-9618   (fax)
  910.  
  911. From icon-group-request  Wed May  6 07:54:05 1992
  912. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Wed, 6 May 92 07:54:05 MST
  913. Received: from ucbvax.Berkeley.EDU by optima.cs.arizona.edu (4.1/15)
  914.     id AA05647; Wed, 6 May 92 07:54:01 MST
  915. Received: by ucbvax.Berkeley.EDU (5.63/1.43)
  916.     id AA02916; Wed, 6 May 92 07:36:17 -0700
  917. Received: from USENET by ucbvax.Berkeley.EDU with netnews
  918.     for icon-group@cs.arizona.edu (icon-group@cs.arizona.edu)
  919.     (contact usenet@ucbvax.Berkeley.EDU if you have questions)
  920. Date: 6 May 92 15:08:36 GMT
  921. From: eru.mt.luth.se!lunic!sunic2!sics.se!eua.ericsson.se!euas20!konhks@bloom-beacon.mit.edu  (Hakan.Soderstrom)
  922. Organization: Ellemtel Telecom Systems Labs, Stockholm, Sweden
  923. Subject: Re: features from Icon Language in lisp
  924. Message-Id: <KONHKS.92May6160836@euas20.ericsson.se>
  925. References: <1992Apr14.173407.28762@adobe.com>
  926. Sender: icon-group-request@cs.arizona.edu
  927. To: icon-group@cs.arizona.edu
  928.  
  929. The original post on this subject seems to be
  930. In article <1992Apr14.173407.28762@adobe.com> yost@adobe.COM (David
  931. Yost) writes:
  932. >  Has anyone implemented any other of our favorite iconish things
  933. >  in Common Lisp or Scheme?  Like goal-directed evaluation,
  934. >  string scanning, ... ?
  935.  
  936. As one who has coded a lot in Icon, but is a newcomer to Scheme, the
  937. following observations might be of interest. The reason I turned to
  938. Scheme was mainly its interactive nature plus the Elk implementation.
  939. Scheme has several very significant strenghts. What I needed was an
  940. extension language. Here are a few things which I think could make
  941. their way into Scheme without disrupting its general flavour.
  942.  
  943. -- Equal opportunity for the various datatypes. There is an
  944. uneven-ness in Scheme. There are terribly general and well exploited
  945. concepts like lists, procedures and continuations. But strings and
  946. vectors are treated on a quite low level of abstraction.
  947.  
  948. Among the first things that amazed me was that for-each only worked on
  949. lists. Why? In Icon the '!' operator works on strings, lists, sets,
  950. tables, and files.
  951.  
  952. Scheme procedures working on lists usually refer (recursively) to
  953. "this guy" (car) and "the next guy" (cdr) in a relative way. With
  954. strings and vectors one has to use "absolute addressing" like
  955. vector-ref. You also have to explicitly find the length of what you
  956. are working on in order to know when to stop.
  957.  
  958. There is append, string-append, but not vector-append.
  959.  
  960. A simple, but very useful concept is the way you specify string
  961. positions in Icon. Positions are located *between* characters. The
  962. first position has number 1; numbering increases to the right. But
  963. there is also a second numbering. The last position has number 0
  964. (zero); numbering decreases towards the left. So, there are two ways
  965. to define every position, and you can use whichever is most
  966. convenient. This means that taking the last few characters of a string
  967. is as easy as taking the first few.  You don't have to find the length
  968. explicitly.
  969.  
  970. Of course the same thing works with lists; why not?
  971.  
  972. Then there is a host of string scanning functions that elevate strings
  973. to a productive level of abstraction.
  974.  
  975. -- The table datatype in Icon is extremely useful. I can hardly think
  976. of an application where I did not use a table. I have made
  977. applications work well with a megabyte of data in tables. I think this
  978. is a reasonable level of abstraction for a language in the 90's.
  979.  
  980. -- Icon is expression oriented; i.e. a statement is also an
  981. expression. This is true in many cases in Scheme, but not in set!.
  982. This is strange to me, but there may be some theory behind. I think it
  983. is very useful to see mutation as pure side-effect. I.e.
  984.  
  985.     (set! a x)
  986.  
  987. would evaluate to x, but with a side-effect. (Same with append! etc.)
  988.  
  989. -- Dare I mention syntax? A (load 'foo.scm) results in "File ended
  990. prematurely". In my 2000 line program a parenthesis is missing, and,
  991. by virtue of the underlying theory, the 'compiler' can't give me a
  992. clue. But there is Emacs.
  993.  
  994. Oh well, I shouldn't have mentioned the last one. And, yes, you are
  995. absolutely right, this is only my $ 0.02 worth. Of course I would like
  996. goal-directed evaluation (including failure and generators) that
  997. pervades Icon, but I think it would rock the foundations of Scheme.
  998.  
  999.     Hakan
  1000.  
  1001. (for-each standard-disclaimer (string->list message))
  1002. --
  1003. -----------------------------------------------
  1004. Hakan.Soderstrom@eua.ericsson.se  08 - 727 4235
  1005.  
  1006. From MATH0022@rmc.ca  Wed May  6 11:03:54 1992
  1007. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Wed, 6 May 92 11:03:54 MST
  1008. Received: from Arizona.edu (Hopey.Telcom.Arizona.EDU) by optima.cs.arizona.edu (4.1/15)
  1009.     id AA15855; Wed, 6 May 92 11:03:49 MST
  1010. Received: from RMC.CA (MAILER@RMC) by Arizona.edu (PMDF #12663) id
  1011.  <01GJOT8XFOSKAKTUH0@Arizona.edu>; Wed, 6 May 1992 11:03 MST
  1012. Received: by RMC (Mailer) id 45270000416; Wed, 06 May 92 14:00:33 EST
  1013. Date: Wed, 06 May 92 14:00:01 EST
  1014. From: MATH0022@rmc.ca
  1015. Subject: Data structures text with ICON, SNOBOL?
  1016. To: icon-group@cs.arizona.edu
  1017. Reply-To: LINDSAY_JH@rmc.ca
  1018. Message-Id: <920506.14000144.004394@RMC.CP6>
  1019. X-Envelope-To: icon-group@cs.Arizona.edu
  1020.  
  1021. I'm looking for a text for a course on Data Structures and Algorithm Analysis,
  1022. and I'd very much like to find one that uses (ICON | SNOBOL) & (Pascal | Modula
  1023. | C | Ada | .... ) ... any suggestions ?  (I know of Gimpel's Algorithms in
  1024. SNOBOL4 and Griswold's String and List Processing (is the latter still available
  1025. ?), both useful references.)
  1026.  
  1027. --------------------------------------------------------------------------------
  1028.  
  1029.             John H. Lindsay,
  1030.             Department of Mathematics and Computer Science,
  1031.             Royal Military College of Canada,
  1032.             Kingston, Ontario, Canada, K7K 5L0.
  1033.  
  1034.             Phones: Office,                          (613) 541-6419
  1035.                     Messages,                              541-6343 or 541-6458
  1036.                     Home,                                  546-6988
  1037.             E-Mail: From Bitnet, NetNorth, ONet:     LINDSAY_JH@RMC.CA
  1038.                     From Canadian Military Colleges: LINDSAY JH@RMC
  1039.             Fax:                                     (613) 542-8129
  1040.  
  1041. From icon-group-request  Thu May  7 06:10:58 1992
  1042. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Thu, 7 May 92 06:10:58 MST
  1043. Received: from ucbvax.Berkeley.EDU by optima.cs.arizona.edu (4.1/15)
  1044.     id AA03458; Thu, 7 May 92 06:10:54 MST
  1045. Received: by ucbvax.Berkeley.EDU (5.63/1.43)
  1046.     id AA01127; Thu, 7 May 92 06:01:07 -0700
  1047. Received: from USENET by ucbvax.Berkeley.EDU with netnews
  1048.     for icon-group@cs.arizona.edu (icon-group@cs.arizona.edu)
  1049.     (contact usenet@ucbvax.Berkeley.EDU if you have questions)
  1050. Date: 24 Apr 92 16:20:06 GMT
  1051. From: dog.ee.lbl.gov!overload.lbl.gov!agate!spool.mu.edu!mips!darwin.sura.net!wupost!dsuvax.dsu.edu!ghelmer@ucbvax.berkeley.edu  (Guy Helmer)
  1052. Organization: Dakota State University, Madison, SD
  1053. Subject: Computer Programming for the Humanities Course Offering
  1054. Message-Id: <1992Apr24.162006.6210@dsuvax.dsu.edu>
  1055. Sender: icon-group-request@cs.arizona.edu
  1056. To: icon-group@cs.arizona.edu
  1057.  
  1058.  
  1059.       [ The following is a description of an offering of a course via
  1060.     electronic mail by Dakota State University's College of Liberal
  1061.     Arts.  Reply-To: is set to ERIC%SDNET.BITNET@vm1.nodak.edu, which
  1062.     is where queries regarding the course should be sent.
  1063.  
  1064.     Flames regarding this massive cross-post should be directed to
  1065.     ghelmer@dsuvax.dsu.edu :-) ]
  1066.  
  1067.      Following is information about a three-credit graduate course
  1068. in programming for the humanities offered by Dakota State
  1069. University via BITNET (and other interconnected networks).
  1070. Students in the course can be anywhere in the world if they can
  1071. send and receive electronic mail.
  1072.  
  1073.      CHUM 650, COMPUTER PROGRAMMING FOR THE HUMANITIES, is an
  1074. introduction to programming using SNOBOL4 for applications in the
  1075. humanities such as analysis of texts, arranging data from research,
  1076. and formatting for printing and desktop publishing.  The primary
  1077. emphasis in the course will be on computer applications with texts.
  1078.  
  1079.      The course is designed for humanists who want to learn to
  1080. write useful computer programs for research and teaching.  The
  1081. language of choice for this course is SNOBOL4 because it is a
  1082. powerful language designed for non-numeric computing; students can
  1083. write useful programs in SNOBOL4 almost from the start.  The course
  1084. will begin with an introduction to programming, then cover
  1085. techniques of structuring SNOBOL4 programs, and it will finish with
  1086. students completing individual projects of their own creation.
  1087.  
  1088.      Students in the course can work at their own pace; they can
  1089. begin immediately.  Students should plan to finish all course
  1090. requirements by August 1.
  1091.  
  1092.      Programming assignments for the course will be designed for
  1093. MS-DOS microcomputers.  Although most assignments can be modified
  1094. for Macintosh users, students using a Macintosh would have to
  1095. purchase MaxSPITBOL, and they would need an understanding of
  1096. Macintosh file structures.
  1097.  
  1098.      It is a prerequisite for the course that students have a sound
  1099. understanding of how to upload and download files from the
  1100. mainframe that runs electronic mail to the DOS microcomputer used
  1101. for the programming assignments.  In addition, students must be
  1102. familiar with DOS commands.
  1103.  
  1104.      The total cost of the course is $239.82.  No textbook is
  1105. required.  Students will be sent a disk containing a public-domain
  1106. SNOBOL4 compiler and a text editor.  Lectures and data files will
  1107. be sent electronically.
  1108.  
  1109.      Students may audit the course or enroll for credit and receive
  1110. a grade of Pass or Fail.  The cost to audit the course is the same
  1111. as enrolling for credit.
  1112.  
  1113.      Those who want an electronic registration form or who have
  1114. questions about the course should send a message to
  1115.  
  1116.              Eric Johnson
  1117.              ERIC@SDNET.BITNET
  1118. -- 
  1119. Guy Helmer, Dakota State University Computing Services - ghelmer@dsuvax.dsu.edu
  1120. "Often you fix the wrong thing first." - Karl Auerbach, Interop 91
  1121.  
  1122. From janpeter@mpi.kun.nl  Thu May  7 09:00:01 1992
  1123. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Thu, 7 May 92 09:00:01 MST
  1124. Received: from wn1.sci.kun.nl by optima.cs.arizona.edu (4.1/15)
  1125.     id AA09268; Thu, 7 May 92 08:59:56 MST
  1126. Received: by wn1.sci.kun.nl (5.57/2.1) on NUNET
  1127.      id AA29058; Thu, 7 May 92 18:00:47 +0200
  1128. Received: by mpix10.mpi.kun.nl (5.57/2.0) on NUNET
  1129.      id AA00364; Thu, 7 May 92 18:00:54 +0200
  1130. Date: Thu, 7 May 92 18:00:54 +0200
  1131. From: Jan Peter de Ruiter <janpeter@mpi.kun.nl>
  1132. Message-Id: <9205071600.AA00364@mpix10.mpi.kun.nl>
  1133. To: icon-group@cs.arizona.edu
  1134. Subject: NAGBOL
  1135.  
  1136. Why the hell do we get the SNOBOL course message /again/? Is this a 
  1137. provocation? Is there some SNOBOL masochist out there that lives on 
  1138. Flames from ICON users? 
  1139.  
  1140. Anyhow, let's be constructive. I'd like to know if there is a specific
  1141. class of programming problems / algorithms for which SNOBOL is a more
  1142. natural language than Icon. I am aware of the more esoteric capabilities
  1143. of SNOBOL, but I'd like to know in what situations these functions are
  1144. actually /useful/. Many years ago someone told me enthusiastically that
  1145. one could write a LISP program that could modify itself! Since that day
  1146. I've never seen one useful LISP program that used this capability. Is 
  1147. that the case with SNOBOL too, or are there many SNOBOL programmers who 
  1148. use those (e.g. CODE, or "variable labels") capacities daily?
  1149.  
  1150. Comments welcome, especially from SNOBOL freaks.
  1151.  
  1152. Jan P.A. de Ruiter
  1153. janpeter@mpi.kun.nl
  1154.  
  1155. "Often you marry the wrong person first", Swami Brahparthivishnibraphutha.
  1156.  
  1157. From icon-group-request  Thu May  7 11:37:38 1992
  1158. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Thu, 7 May 92 11:37:38 MST
  1159. Received: from ucbvax.Berkeley.EDU by optima.cs.arizona.edu (4.1/15)
  1160.     id AA27991; Thu, 7 May 92 11:37:35 MST
  1161. Received: by ucbvax.Berkeley.EDU (5.63/1.43)
  1162.     id AA00990; Thu, 7 May 92 11:29:52 -0700
  1163. Received: from USENET by ucbvax.Berkeley.EDU with netnews
  1164.     for icon-group@cs.arizona.edu (icon-group@cs.arizona.edu)
  1165.     (contact usenet@ucbvax.Berkeley.EDU if you have questions)
  1166. Date: 24 Apr 92 21:27:53 GMT
  1167. From: dog.ee.lbl.gov!overload.lbl.gov!agate!spool.mu.edu!hri.com!noc.near.net!chaos!random.ccs.northeastern.edu!news@ucbvax.berkeley.edu  (mitchell wand)
  1168. Organization: College of Computer Science, Northeastern University
  1169. Subject: Re: Computer Programming for the Humanities Course Offering
  1170. Message-Id: <WAND.92Apr24162753@dec5120z.ccs.northeastern.edu>
  1171. References: <1992Apr24.162006.6210@dsuvax.dsu.edu>
  1172. Sender: icon-group-request@cs.arizona.edu
  1173. To: icon-group@cs.arizona.edu
  1174.  
  1175. I didn't think there were any living SNOBOL programmers left!
  1176.  
  1177. But seriously, I can't imagine doing 
  1178.  
  1179.   applications in the
  1180.   humanities such as analysis of texts, arranging data from research,
  1181.   and formatting for printing and desktop publishing.  
  1182.  
  1183. in SNOBOL, which is hardly an industrial-strength language with widespread
  1184. support! 
  1185.  
  1186. If you want to teach humanists about programming, use Friedman and Felleisen's
  1187. {Little Lisper}, which converts everything to the kind of game even humanists
  1188. can understand (:-).
  1189.  
  1190. If you want to do quick-and-dirty text processing, you can either use Scheme
  1191. or awk or Icon (or even C!), all of which are widely supported.
  1192.  
  1193. If you want to do formatting and desktop publishing, you'd be far better off
  1194. using all the good tools that are available for that, rather than struggling
  1195. to do it in SNOBOL.
  1196.  
  1197. [OK, my flameproof suit is on now.]
  1198.  
  1199. --Mitch 
  1200.  
  1201.  
  1202.  
  1203. --
  1204. Mitchell Wand
  1205. College of Computer Science, Northeastern University
  1206. 360 Huntington Avenue #161CN, Boston, MA 02115     Phone: (617) 437 2072
  1207. Internet: wand@{corwin|flora}.ccs.northeastern.edu   Fax: (617) 437 5121
  1208.  
  1209. From berstis@watson.ibm.com  Thu May  7 11:50:37 1992
  1210. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Thu, 7 May 92 11:50:37 MST
  1211. Message-Id: <9205071850.AA28706@optima.cs.arizona.edu>
  1212. Received: from watson.ibm.com by optima.cs.arizona.edu (4.1/15)
  1213.     id AA28706; Thu, 7 May 92 11:50:33 MST
  1214. Received: from YKTVMV by watson.ibm.com (IBM VM SMTP V2R2) with BSMTP id 1454;
  1215.    Thu, 07 May 92 14:50:32 EDT
  1216. Date: Thu, 7 May 92 14:16:36 EDT
  1217. From: "Viktors Berstis" <berstis@watson.ibm.com>
  1218. To: icon-group@cs.arizona.edu
  1219. Subject:  "NAGBOL"
  1220.  
  1221. >Is that the case with SNOBOL too, or are there many SNOBOL programmers who
  1222. >use those (e.g. CODE, or "variable labels") capacities daily?
  1223.  
  1224. >Comments welcome, especially from SNOBOL freaks.
  1225.  
  1226. I must admit that I still use SNOBOL quite a bit, including CODE and other
  1227. such facilities.  Even building a pattern at run time is like compiling
  1228. code and this is quite useful in many situations.  One program I wrote,
  1229. that sticks out in my mind as most dependent on these facilities, was one
  1230. which solved an unusually constrained scheduling problem.  Another was a
  1231. prototype for an interpreter of another computer language.  I would not
  1232. have attempted these in another language, given the time I had to write them.
  1233.  
  1234. And for lines-of-code counters, I have yet to see a program which solves
  1235. the N - queens problem, where N is specified at run time, and prints the
  1236. solution boards, with fewer tokens than SNOBOL (although I admit it
  1237. probably looks as cryptic as APL to the uninitiated):
  1238.  
  1239.  
  1240. * N-Queens solving program written in SNOBOL4
  1241.  
  1242.         N = INPUT
  1243.  
  1244.         NM1 = N - 1; NP1 = N + 1; NSZ = N * NP1; &ANCHOR = 1
  1245.         DEFINE('SOLVE(B)I')
  1246.  
  1247.         TEST = BREAK('Q') 'Q' (ARBNO(LEN(N) '-') LEN(N) 'Q'
  1248. +             | ARBNO(LEN(NP1) '-') LEN(NP1) 'Q'
  1249. +             | ARBNO(LEN(NM1) '-') LEN(NM1) 'Q')
  1250.         P = LEN(NM1) . X LEN(1); L = 'Q' DUPL('-',NM1) ' '
  1251.  
  1252.         SOLVE()                                 :(END)
  1253.  
  1254. SOLVE   SOLUTION = EQ(SIZE(B),NSZ) SOLUTION + 1 :S(PRINT)
  1255.         B = L B
  1256. LOOP    I = LT(I,N) I + 1                       :F(RETURN)
  1257.         B TEST                                  :S(NEXT)
  1258.         SOLVE(B)
  1259. NEXT    B P = '-' X                             :(LOOP)
  1260.  
  1261. PRINT   OUTPUT = 'Solution number ' SOLUTION ' is:'
  1262. PRTLOOP B LEN(NP1) . OUTPUT =                   :S(PRTLOOP)F(RETURN)
  1263. END
  1264. 8
  1265.  
  1266.  
  1267. -V Berstis
  1268.  
  1269. From icon-group-request  Thu May  7 13:24:59 1992
  1270. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Thu, 7 May 92 13:24:59 MST
  1271. Received: from ucbvax.Berkeley.EDU by optima.cs.arizona.edu (4.1/15)
  1272.     id AA04046; Thu, 7 May 92 13:24:52 MST
  1273. Received: by ucbvax.Berkeley.EDU (5.63/1.43)
  1274.     id AA09832; Thu, 7 May 92 13:15:16 -0700
  1275. Received: from USENET by ucbvax.Berkeley.EDU with netnews
  1276.     for icon-group@cs.arizona.edu (icon-group@cs.arizona.edu)
  1277.     (contact usenet@ucbvax.Berkeley.EDU if you have questions)
  1278. Date: 7 May 92 00:35:34 GMT
  1279. From: hsi!mlfarm!rosie!ron@uunet.uu.net  (Ronald Florence)
  1280. Organization: Maple Lawn Farm, Stonington, CT
  1281. Subject: Menu (searches, maintains, displays, & prints recipes)
  1282. Message-Id: <1992May7.003534.22272@mlfarm.com>
  1283. Sender: icon-group-request@cs.arizona.edu
  1284. To: icon-group@cs.arizona.edu
  1285.  
  1286. Every computer has menues.  This menu is for food.  Menu and the
  1287. companion program nr (mnemonic for new recipe) maintain and search an
  1288. index and database of recipes -- from the rec.food newsgroups, email,
  1289. cookbooks, or notebooks.  No special recipe format is required.  Menu
  1290. displays and/or prints on-line recipes, and gives page references for
  1291. recipes in cookbooks or notebooks.  Nr adds new recipes to the
  1292. database with a few keystrokes.  We use the programs on a Sun
  1293. workstation in our kitchen; a version for Unix systems without
  1294. X-windows, or ms-dos computers, is also included.  
  1295.  
  1296. Enjoy.
  1297.  
  1298.                 Ronald Florence
  1299.                 ron@mlfarm.com
  1300.  
  1301.  
  1302.  
  1303. #! /bin/sh
  1304. # This is a shell archive, meaning:
  1305. # 1. Remove everything above the #! /bin/sh line.
  1306. # 2. Save the resulting text in a file.
  1307. # 3. Execute the file with /bin/sh (not csh) to create:
  1308. #    Readme
  1309. #    Makefile
  1310. #    menu.man
  1311. #    xmenu.S
  1312. #    menu.S
  1313. #    nr.S
  1314. #    xdefault.icn
  1315. #    1
  1316. #    2
  1317. #    3
  1318. # This archive created: Wed May  6 20:34:57 1992
  1319. # By:    Ronald Florence (Maple Lawn Farm, Stonington, CT )
  1320. export PATH; PATH=/bin:/usr/bin:$PATH
  1321. echo shar: "extracting 'Readme'" '(6220 characters)'
  1322. if test -f 'Readme'
  1323. then
  1324.     echo shar: "will not over-write existing file 'Readme'"
  1325. else
  1326. sed 's/^X//' << \SHAR_EOF > 'Readme'
  1327. XMENU
  1328. XCopyright 1992 Ronald Florence
  1329. X
  1330. XEvery computer has menues.  This menu is for food.  Menu and the
  1331. Xcompanion program nr (mnemonic for new recipe) maintain and search an
  1332. Xindex and database of recipes -- from the rec.food newsgroups, email,
  1333. Xcookbooks, or notebooks.  No special recipe format is required.  Menu
  1334. Xdisplays and/or prints on-line recipes, and gives page references for
  1335. Xrecipes in cookbooks or notebooks.  Searches can use multiple keywords
  1336. Xor regular expressions; case and word order are not significant.
  1337. X
  1338. X    menu chicken 'garlic|lemon' --> recipes with chicken AND
  1339. X                    either garlic or lemon
  1340. X
  1341. X    menu venison chili        --> recipes for venison chili
  1342. X
  1343. X    menu 'blond|brown'        --> brownies or blondies
  1344. X
  1345. X    menu '^comp' prune        --> on-line recipes with prunes  
  1346. X
  1347. X    menu '^Julia'            --> Julia [Child] recipes
  1348. X
  1349. XThere are two versions of menu.  The X-windows version uses the mouse
  1350. Xto select on-line recipes for display in separate windows.  The
  1351. Xtermcap-based version, for Unix or ms-dos systems, displays one
  1352. Xon-line recipe at a time.  Both versions include commands for printing
  1353. Xa recipe.
  1354. X
  1355. XSOURCE CODE
  1356. X
  1357. XThe source code for menu and nr is in Icon.  If your system does not
  1358. Xhave the Icon programming language, it is available for Unix, ms-dos,
  1359. Xand many other operating systems from the icon-project@cs.arizona.edu.
  1360. XThe code for menu uses procedures from the IPL (Icon Program Library)
  1361. Xdistributed with Icon: the termcap version uses iolib.icn, and the
  1362. Xms-dos version also uses either regexp.icn or findre.icn.  The
  1363. XX-windows version of menu requires evmux.icn and button.icn, which are
  1364. Xdistributed with the Icon source code.
  1365. X
  1366. XCONFIGURATION
  1367. X
  1368. XFor Unix systems, all configuration can be done by setting the
  1369. Xfollowing variables at the top of the Makefile:
  1370. X
  1371. X    Indexfile =  the full path of the recipe index
  1372. X    Datadir =    the full path of the recipe directory, 
  1373. X             terminated with `/'.
  1374. X    Printcmd =   a command to pretty-print and/or spool an ascii 
  1375. X             file.  The name of the recipe will be substituted
  1376. X             for a %s in the string.  Not used for ms-dos.
  1377. X    Compress =   Optional, to store the recipes compressed.
  1378. X             Not used for ms-dos.
  1379. X    Mansuffix =  the suffix for local man pages on your system.
  1380. X
  1381. X   For X-windows sites, set the following:
  1382. X
  1383. X    Maxwin =     maximum number of lines on the windows.
  1384. X    Font =         display font.
  1385. X
  1386. X   For non-X-Windows Unix, you can optionally set:
  1387. X
  1388. X    Pager =         an optional external pager such as more or less,
  1389. X             used instead of the built-in pager.
  1390. X
  1391. XFor ms-dos systems, the files have to be configured manually:
  1392. X
  1393. X    Rename menu.S to menu.icn and nr.S to nr.icn.
  1394. X    Use an editor to substitute the full path of your recipe
  1395. X            index for %INDEXFILE% and the full path of your recipe 
  1396. X        directory for %DATADIR% in menu.icn, nr.icn, and menu.man.
  1397. X        Use `\\' as the path separator and the terminator of the
  1398. X        recipe directory path.
  1399. X        Change the link list in menu.icn and the menu.icx entry of the
  1400. X            Makefile to include regexp <or> findre.
  1401. X    If you use regexp, edit menu.icn so regexparser := ReFind; 
  1402. X            with findre, regexparser := findre.
  1403. X        Create the recipe directory.
  1404. X    Make sure you have a dos termcap file in place and the TERM
  1405. X        and TERMCAP environment variables set (if you are not 
  1406. X            familiar with termcap, see the comments to iolib.icn).
  1407. X
  1408. XMany of the configuration parameters can be overridden in the
  1409. XXresource files for X-Windows, or with environment variables.  See the
  1410. Xman page for details.
  1411. X
  1412. XINSTALLATION
  1413. X
  1414. XAfter configuring the Makefile, do `make X' for the X-Windows version
  1415. Xor `make unix' for the termcap version.  For ms-dos, you can do `make
  1416. Xdos' or
  1417. X
  1418. X    icont menu iolib regexp [or findre]
  1419. X    icont nr
  1420. X
  1421. XInstall menu by copying the executables (menu and nr for unix,
  1422. Xmenu.icx and nr.icx for ms-dos) to the appropriate local binary
  1423. Xdirectory, and the man page to the appropriate man directory.  See
  1424. Xbelow for adding recipes.
  1425. X
  1426. XTo try the program, do `make test.'
  1427. X
  1428. XADDING RECIPES
  1429. X
  1430. XNr is a simple filter which saves and automatically indexes recipes
  1431. Xfrom newsgroups, electronic mail, or a scanner.  From a mail- or
  1432. Xnews-reader use the pipe command on the current article:
  1433. X
  1434. X    | nr "recipe name" "ingredients"
  1435. X
  1436. XWith a typed-in or scanned recipe:
  1437. X
  1438. X    nr "recipe-name" "ingredients" < recipe-file
  1439. X
  1440. XYou can customize nr to eliminate additional headers by editing the
  1441. Xignore list in the code.
  1442. X
  1443. XTo add recipes from cookbooks, or recipes pasted into notebooks, use
  1444. Xan editor to append an entry like one of the following to your recipe
  1445. Xindex.  The first field is the name of the book and a page-number.
  1446. XThe second field is the name of the recipe.  The third field is
  1447. Xkeywords or ingredients.  Use tabs to separate the three fields:
  1448. X
  1449. X   Julia I-496     Red Cabbage & Sauerkraut        bacon, apples
  1450. X   Julia I-300     Bifteck Hache   ground venison, wine, thyme, hamburger
  1451. X   Julia Way-340   Hominy Grits    butter, milk, cheese, eggs, cream
  1452. X   Julia Way-70    Timbales        corn, ham, asparagus, broccoli, eggs
  1453. X   Red-1    Skillet Corn Bread    cornmeal
  1454. X   Red-1    Viennese Crescents    Gisa, Christmas, almonds
  1455. X   Red-1    Indian Pudding    corn meal, molasses, ginger
  1456. X   Red-1    Hickory Nut Cake    hickory nuts, egg whites
  1457. X   Red-2    Norwegian Pancakes    buttermilk, berries
  1458. X
  1459. XYou can use commas in the third field; they are not necessary.  The
  1460. Xfirst field for on-line recipes is Comp-#, where # is the file name of
  1461. Xthe recipe.  These recipes are entered automatically by nr, which
  1462. Xkeeps track of the file numbers.  The recipe index does not need to be
  1463. Xsorted.
  1464. X
  1465. XPERFORMANCE
  1466. X
  1467. XThe Unix versions of menu use egrep.  Searches with complex regular
  1468. Xexpressions take less than one second with a 2000-item index on a
  1469. XSun3.  The ms-dos version is slower because it relies on regular
  1470. Xexpression parsers written in Icon.  Putting any regular expression
  1471. Xlast in the search command may speed things up somewhat.
  1472. X
  1473. XDISCLAIMER
  1474. X
  1475. XPermission is hereby granted for unlimited non-commercial use of these
  1476. Xprograms, on condition that the copyright notices are left intact and
  1477. Xany modifications to the source code are noted as such.  No warranty
  1478. Xof any kind is implied or granted for this material.
  1479. X
  1480. XRonald Florence
  1481. Xron@mlfarm.com
  1482. X
  1483. X@(#) version 1.0 (ron@mlfarm.com, 5 May 1992)
  1484. SHAR_EOF
  1485. if test 6220 -ne "`wc -c < 'Readme'`"
  1486. then
  1487.     echo shar: "error transmitting 'Readme'" '(should have been 6220 characters)'
  1488. fi
  1489. fi
  1490. echo shar: "extracting 'Makefile'" '(3035 characters)'
  1491. if test -f 'Makefile'
  1492. then
  1493.     echo shar: "will not over-write existing file 'Makefile'"
  1494. else
  1495. sed 's/^X//' << \SHAR_EOF > 'Makefile'
  1496. X# Makefile for menu.icn
  1497. X# copyright 1992 Ronald Florence
  1498. X# @(#) version 1.0 (ron@mlfarm.com, 5 May 1992)
  1499. X
  1500. X# --- Change the following as needed. ---
  1501. X
  1502. X# Indexfile = full path of index
  1503. X# Datadir = directory for recipes, with final path separator
  1504. X# Printcmd = command to pretty-print and spool printed recipes;
  1505. X#         the name of the recipe will be substituted for %s.
  1506. X# Compress = (Optional) path of compress command if you want 
  1507. X#         recipes stored compressed.
  1508. X# Mansuffix = system-dependent suffix for man pages
  1509. X
  1510. XIndexfile = /home/heather/lib/recipe.index
  1511. XDatadir = /home/heather/recipes/
  1512. XPrintcmd = mp -o -s '%s' | lpr
  1513. XCompress =
  1514. XMansuffix = l
  1515. X
  1516. X# X-Windows only.
  1517. X# Font = display font
  1518. X# Maxwin = maximum lines in a window
  1519. X
  1520. XFont = lucidasans-typewriter-12
  1521. XMaxwin = 50
  1522. X
  1523. X# Non-X-Windows only.
  1524. X# Pager = (Optional) name of an external pager (e.g., more, less)
  1525. X#         to use instead of the built-in pager; the print command
  1526. X#      does not work if you use an external pager.
  1527. X
  1528. XPager =
  1529. X
  1530. X# --- You shouldn't need to make changes below here. ---
  1531. X
  1532. XSHELL = /bin/sh
  1533. XICONT = icont
  1534. XSRC = xmenu.S menu.S nr.S xdefault.icn
  1535. X
  1536. X.SUFFIXES: .icn .u1 .S
  1537. X
  1538. X.icn.u1:
  1539. X    icont -c $<
  1540. X
  1541. X.icn:
  1542. X    $(ICONT) $@
  1543. X
  1544. X.S.icn:    Makefile
  1545. X    rm -f $@
  1546. X    sed -e 's|%INDEXFILE%|$(Indexfile)|g' \
  1547. X        -e 's|%DATADIR%|$(Datadir)|g' \
  1548. X        -e 's/%PRINTCMD%/$(Printcmd)/g'   \
  1549. X        -e 's|%COMPRESS%|$(Compress)|g'   \
  1550. X        -e 's|%MAXWIN%|$(Maxwin)|g'   \
  1551. X        -e 's|%FONT%|$(Font)|g'   \
  1552. X        -e 's|%PAGER%|$(Pager)|g' $< > $@
  1553. X    chmod 444 $@
  1554. X
  1555. Xdefault: 
  1556. X    @echo "make what?"
  1557. X
  1558. Xx X:    xmenu nr recipedir manpage
  1559. X    ln xmenu menu
  1560. X
  1561. Xunix Unix:    menu nr recipedir manpage
  1562. X
  1563. Xdos ms-dos:    menu.icx nr
  1564. X
  1565. Xrecipedir:    
  1566. X    [ -d $(Datadir) ] || mkdir `dirname $(Datadir)BOGUS`
  1567. X
  1568. X# xmenu:    xmenu.icn
  1569. Xxmenu:    xdefault.u1 xmenu.icn evmux.u1 button.u1
  1570. X    $(ICONT) -u $@
  1571. X
  1572. X# menu:    menu.icn
  1573. Xmenu:    menu.icn iolib.u1
  1574. X    $(ICONT) -u $@
  1575. X
  1576. Xnr:    nr.icn
  1577. X    $(ICONT) -u $@
  1578. X
  1579. Xmanpage:    menu.man Makefile
  1580. X    sed -e 's|%INDEXFILE%|$(Indexfile)|g' \
  1581. X        -e 's|%DATADIR%|$(Datadir)|g' menu.man > menu.$(Mansuffix)
  1582. X
  1583. X# if you use findre.icn instead of regexp.icn, the dependency list
  1584. X# for menu.icx should be: menu.icn iolib.u1 findre.u1
  1585. X
  1586. Xmenu.icx:    menu.icn iolib.u1 regexp.u1
  1587. X    icont -u menu
  1588. X
  1589. Xshar:    $(SRC) Readme Makefile menu.man 1 2 3
  1590. X    shar -a Readme Makefile menu.man $(SRC) 1 2 3 > menu.shar
  1591. X
  1592. Xtest:    nr 1 2 3
  1593. X    nr "Best Brownies" "chocolate" < 1
  1594. X    nr "Blondie Brownies" "chips chocolate" < 2
  1595. X    nr "Blondies" "butterscotch brownies" < 3
  1596. X    @echo
  1597. X    @echo "Now try a menu command, like"
  1598. X    @echo "   menu 'brown|blond' <or>"
  1599. X    @echo "   menu chocolate"
  1600. X    @echo
  1601. X    @echo "If you haven't read the man page (shame!), for X-Windows"
  1602. X    @echo "use the left mouse button to select a recipe, the buttons,"
  1603. X    @echo "<space>, m, or b, to page the recipes, or p in a"
  1604. X    @echo "recipe window to print the recipe."
  1605. X    @echo 
  1606. X    @echo "For character displays, enter the number of the recipe
  1607. X    @echo "to display, <return> to page, or q to quit.  To"
  1608. X    @echo "print a recipe, enter p before the recipe number."
  1609. X    @echo
  1610. X    @echo "Enjoy."
  1611. X
  1612. Xclean:
  1613. X    rm -f *.u[12] xmenu menu nr *menu.icn nr.icn
  1614. X
  1615. SHAR_EOF
  1616. if test 3035 -ne "`wc -c < 'Makefile'`"
  1617. then
  1618.     echo shar: "error transmitting 'Makefile'" '(should have been 3035 characters)'
  1619. fi
  1620. fi
  1621. echo shar: "extracting 'menu.man'" '(2213 characters)'
  1622. if test -f 'menu.man'
  1623. then
  1624.     echo shar: "will not over-write existing file 'menu.man'"
  1625. else
  1626. sed 's/^X//' << \SHAR_EOF > 'menu.man'
  1627. X.\" menu.man
  1628. X.\" copyright 1992 Ronald Florence
  1629. X.\" @(#) version 1.0 (ron@mlfarm.com, 5 May 1992)
  1630. X.\"
  1631. X.TH menu LOCAL "4 May 1992"
  1632. X.SH NAME
  1633. Xmenu \- recipe database searcher
  1634. X.br
  1635. Xnr \- adds recipes to the database
  1636. X.SH SYNOPSIS
  1637. X.B menu
  1638. Xkeyword
  1639. X[ keyword, ... ]
  1640. X.PP
  1641. X.B "| nr"
  1642. X"recipe name" "ingredients-or-keywords"
  1643. X.PP
  1644. X.B nr
  1645. X"recipe name" "ingredients-or-keywords" < recipe-file
  1646. X.SH DESCRIPTION
  1647. X.I Menu
  1648. Xlooks up on-line and indexed recipes from keywords in the name of the
  1649. Xrecipe, the list of ingredients, or other information in the index
  1650. Xentry.  Regular expressions can be used in the search:
  1651. X
  1652. X   menu 'chick.*' 'garlic|coriander' lemon
  1653. X
  1654. Xwould find all recipes with chicken 
  1655. X.I or
  1656. Xchickpeas
  1657. X.I and 
  1658. Xlemon
  1659. X.I and
  1660. Xgarlic or coriander.  On most systems regular expressions must be quoted.
  1661. X
  1662. XOn-line recipes found in a search can be paged in a window or printed.
  1663. X.PP
  1664. X.I Nr
  1665. Xis used with a pipe command from the newsreader or mailer, or with
  1666. Xredirction from the command line, to add recipes to the database and
  1667. Xthe index.  Both arguments to
  1668. X.I nr
  1669. Xare required; use quotation
  1670. Xmarks for multi-word arguments.
  1671. X.SH COMMANDS (X-Windows Version)
  1672. X.IP "Main Window"
  1673. X.I Left
  1674. Xbutton to select a recipe.
  1675. X.br
  1676. X.IR Q ", " ^C " or " ^D 
  1677. Xto quit.
  1678. X.IP "Recipe Windows"
  1679. X.IR M ", <" space "> or the " left 
  1680. Xbutton to page down 
  1681. X.RI ( more ).
  1682. X.br
  1683. X.IR B " or the " middle
  1684. Xbutton to page up
  1685. X.RI ( less ).
  1686. X.br
  1687. X.IR Q " or the " right
  1688. Xbutton to return to the main menu.
  1689. X.br
  1690. X.I P
  1691. Xto print the recipe.
  1692. X.SH COMMANDS (Termcap Version)
  1693. XEnter the number of an on-line recipe to display the recipe.  Precede
  1694. Xthe number with `p' to print the recipe.  The print command works only
  1695. Xwith the built-in pager.
  1696. X.SH CONFIGURATION
  1697. XFor the X-Windows version, the following program defaults can be set
  1698. Xin $HOME/.Xdefaults or $XAPPLRESDIR/Xmenu:
  1699. X.nf
  1700. X.RS
  1701. XXmenu.font
  1702. XXmenu.maxwin
  1703. XXmenu.index
  1704. XXmenu.datadir
  1705. X.RE
  1706. X.fi
  1707. XFor the Termcap version, an external pager such as
  1708. X.IR more " or " less
  1709. Xcan be substituted for the built-in pager, and the program defaults
  1710. Xfor the index and data directory can be reset with the environment
  1711. Xvariables
  1712. X.SM PAGER,
  1713. X.SM INDEXFILE,
  1714. Xand
  1715. X.SM DATADIR.
  1716. X.fi
  1717. X.SH FILES
  1718. X%INDEXFILE%
  1719. X.br
  1720. X%DATADIR%*
  1721. X.SH AUTHOR
  1722. XRonald Florence (ron\s-2@\s0mlfarm.com).
  1723. X
  1724. SHAR_EOF
  1725. if test 2213 -ne "`wc -c < 'menu.man'`"
  1726. then
  1727.     echo shar: "error transmitting 'menu.man'" '(should have been 2213 characters)'
  1728. fi
  1729. fi
  1730. echo shar: "extracting 'xmenu.S'" '(5016 characters)'
  1731. if test -f 'xmenu.S'
  1732. then
  1733.     echo shar: "will not over-write existing file 'xmenu.S'"
  1734. else
  1735. sed 's/^X//' << \SHAR_EOF > 'xmenu.S'
  1736. X#
  1737. X# xmenu.icn
  1738. X# copyright 1992 Ronald Florence
  1739. X# @(#) version 1.0 (ron@mlfarm.com, 5 May 1992)
  1740. X#
  1741. X# main window:  
  1742. X#    left button to select recipe
  1743. X#    q, ^c, ^d to quit
  1744. X# recipe windows:
  1745. X#    <space>, m, or left button for more
  1746. X#    b or middle button for less
  1747. X#    p to print
  1748. X#    q or right button to return to main screen
  1749. X# .Xdefaults options:
  1750. X#    Xmenu.maxwin
  1751. X#    Xmenu.index
  1752. X#    Xmenu.datadir
  1753. X#    Xmenu.font
  1754. X# Configuration:
  1755. X#    Maxwin :    maximum # of lines in the windows
  1756. X#    indexfile:    full path of the indexfile
  1757. X#    Data_dir:    full path of directory with recipe files
  1758. X#    Font:        X-Windows display font
  1759. X#    Print_cmd:    pretty-printer and/or spooler; the name of
  1760. X#            the recipe will be substituted for %s
  1761. X#
  1762. X
  1763. Xlink evmux, button, xdefault
  1764. Xrecord rec_record (win, title, recipe, proc, but)
  1765. Xglobal Data_dir, Maxwin, Font, Print_cmd, Zcat, R, W
  1766. X
  1767. Xprocedure main(arg)
  1768. X  local indexfile, pchar, hits, online, meta_keys, keys, xres,
  1769. X        egrep_cmd, k, m, found, r, index, winsize, title, but
  1770. X
  1771. X  "X Windows" == &features | stop("Sorry, requires X-Windows.")
  1772. X  xres := xdefault("Xmenu")
  1773. X  Maxwin := \xres["maxwin"] | %MAXWIN%
  1774. X  indexfile := \xres["index"] | "%INDEXFILE%"
  1775. X  Data_dir := \xres["datadir"] | "%DATADIR%"
  1776. X  Font := \xres["font"] | "%FONT%"
  1777. X  Print_cmd := "%PRINTCMD%"
  1778. X
  1779. X  (*arg > 0) | stop("usage: menu keyword [keyword,...]")
  1780. X  close(open(indexfile)) | stop("can't read indexfile")
  1781. X  pchar := &ascii[32:127]
  1782. X  hits := []
  1783. X  online := []
  1784. X  meta_keys := []
  1785. X  keys := []
  1786. X  egrep_cmd := "cat " || indexfile 
  1787. X  every k := !arg do put(if metas(k) then meta_keys else keys, map(k))
  1788. X  \meta_keys[1] | put(meta_keys, pop(keys))
  1789. X  every k := !meta_keys do egrep_cmd ||:= " | egrep -i '" || k || "'"
  1790. X  index := open(egrep_cmd || " 2>&1", "rp") 
  1791. X  every !index ? {
  1792. X    find("error"|"grep") & stop("search expression error")
  1793. X    m := map(&subject)
  1794. X    found := 1
  1795. X    every k := !keys do { find(k, m) | break found := &null }
  1796. X    \found & {
  1797. X      put(if match("Comp-", &subject) then online else hits, 
  1798. X      left(tab(many(pchar)), 20) || (tab(upto(pchar)), tab(many(pchar))))
  1799. X      tab(0)
  1800. X    }
  1801. X  }
  1802. X  *hits + *online = 0 & stop("No matching recipes.")
  1803. X  (winsize := *online * 2 + *hits + 2) <= Maxwin | {
  1804. X    hits |||:= online
  1805. X    online := []
  1806. X    winsize := *hits + 1
  1807. X  }
  1808. X  winsize >=:= Maxwin
  1809. X  W := open("menu", "x", "font=" || Font, "cursor=off", "lines=" || winsize,
  1810. X        "columns=80") | stop("no window")
  1811. X  quitsensor(W)
  1812. X  if (*hits + 1) >= winsize then page(W, hits, "menu")
  1813. X  else every write(W, !hits)
  1814. X  R := table()
  1815. X
  1816. X  every !online ? {
  1817. X    ="Comp-"
  1818. X    r := tab(many(&digits))
  1819. X    title := (tab(many(' \t')), tab(0))
  1820. X    but := button(W, r, setup, r, XAttrib(W, "x"), XAttrib(W, "y"), 70, 20)
  1821. X    XGotoRC(W, XAttrib(W, "row"), 21)
  1822. X    write(W, title)
  1823. X    R[r] := rec_record (&null, title, [], &null, but)
  1824. X  }
  1825. X  if *online > 0 then evmux(W)
  1826. Xend 
  1827. X
  1828. X
  1829. Xprocedure setup(win, r)
  1830. X  local rpath, rf, heading
  1831. X
  1832. X  if *R[r].recipe = 0 then {
  1833. X    rpath := Data_dir || r
  1834. X    rf := open(rpath) | open("zcat " || rpath || ".Z", "rp") | 
  1835. X    return writes("\^g")
  1836. X    every put(R[r].recipe, !rf)
  1837. X    close(rf)
  1838. X  }
  1839. X  if /R[r].win then {
  1840. X    heading := R[r].title || " [" || r || "]"
  1841. X    R[r].win := open(heading, "x", "font=" || Font, "cursor=off",
  1842. X         "lines=" || (Maxwin > (*R[r].recipe + 2) | Maxwin), 
  1843. X         "columns=80") | stop("no page window")
  1844. X    shadebutton(R[r].but)
  1845. X    R[r].proc := create page(R[r].win, R[r].recipe, R[r].title)
  1846. X  }
  1847. X  @R[r].proc | (R[r].win := &null)
  1848. Xend
  1849. X  
  1850. X
  1851. Xprocedure page(win, rec, title)
  1852. X  local base, x, k, i, e, lines
  1853. X
  1854. X  lines := XAttrib(win, "lines")
  1855. X  base := 0
  1856. X  repeat {
  1857. X    XClearArea(win)
  1858. X    XGotoRC(win,1,1)
  1859. X    every i := 0 to lines - 2 do {
  1860. X      if i + base < *rec then writes(win, rec[i+base+1])
  1861. X      write(win)
  1862. X    }
  1863. X    if lines = Maxwin then {
  1864. X      XAttrib(win, "reverse=on")
  1865. X      writes(win, "--More--(", ((100 > (base+lines-2) * 100/*rec) | 100), "%)")
  1866. X      XAttrib(win, "reverse=off")
  1867. X    }
  1868. X    case (x := XActive()) of {
  1869. X      win : &null
  1870. X      W : @&main
  1871. X      default: every k := key(R) do if (x === R[k].win) then break @R[k].proc
  1872. X    }
  1873. X    if type(e := XEvent(win)) == "integer" then XEvent(win)
  1874. X    else e := map(e)
  1875. X    case e of {
  1876. X      " "|"m"|&lpress: base := *rec > (base+lines-2)
  1877. X      "b"|&mpress: base := (0 < (base-lines+2) | 0)
  1878. X      "q"|&rpress: close(win) & fail
  1879. X      "p": print(rec, title)
  1880. X    }
  1881. X  }
  1882. Xend
  1883. X        
  1884. X
  1885. Xprocedure print(recipe, head)
  1886. X  local prn, rp
  1887. X
  1888. X  Print_cmd ? {
  1889. X    prn := (/tab(find("%s")) || head) | tab(0)
  1890. X    move(2) & prn ||:= tab(0)
  1891. X  }
  1892. X  rp := open(prn, "wp")
  1893. X  every write(rp, !recipe)
  1894. X  return close(rp)
  1895. Xend
  1896. X
  1897. X
  1898. Xprocedure metas(str)
  1899. X
  1900. X  str ? {
  1901. X    tab(many('*+?|'))        # initials don't count
  1902. X    while tab(upto('\\*+()|?.$^[')) do {
  1903. X                # a naked backslash is NG
  1904. X      if ="\\" then move(1) | stop("badly-formed search string")
  1905. X      else return .&pos
  1906. X    }
  1907. X  }
  1908. X  fail
  1909. Xend
  1910. X
  1911. X
  1912. Xprocedure shadebutton(b)
  1913. X
  1914. X  XAttrib(W, "fillstyle=opaquestippled")
  1915. X  XSetStipple(W, 4, 10, 7, 5, 15)
  1916. X  XFillRectangle(b.win, b.x+1, b.y+1, b.w-1, b.h-1)
  1917. X  XGotoXY(b.win, b.lx, b.ly)
  1918. X  writes(b.win, b.label)
  1919. Xend
  1920. X
  1921. X
  1922. SHAR_EOF
  1923. if test 5016 -ne "`wc -c < 'xmenu.S'`"
  1924. then
  1925.     echo shar: "error transmitting 'xmenu.S'" '(should have been 5016 characters)'
  1926. fi
  1927. fi
  1928. echo shar: "extracting 'menu.S'" '(5268 characters)'
  1929. if test -f 'menu.S'
  1930. then
  1931.     echo shar: "will not over-write existing file 'menu.S'"
  1932. else
  1933. sed 's/^X//' << \SHAR_EOF > 'menu.S'
  1934. X#
  1935. X# menu.icn
  1936. X# copyright 1992 Ronald Florence
  1937. X# @(#) version 1.0 (ron@mlfarm.com, 5 May 1992)
  1938. X#
  1939. X# See xmenu.icn for the X-Windows/X-Icon version.
  1940. X#
  1941. X# configuration:
  1942. X#    indexfile := full path of index file
  1943. X#    data_dir := recipe directory
  1944. X#    pager := optional external pager (instead of built-in pager)
  1945. X#    Print_cmd := pretty-printer and/or spooler (for OS with pipes)
  1946. X#    regexparser := (ms-dos only) findre <or> ReFind
  1947. X
  1948. X# for ms-dos, use:   link iolib, findre <or> link iolib, regexp
  1949. X
  1950. Xlink iolib
  1951. Xglobal    Pipes, Print_cmd
  1952. X
  1953. Xprocedure main(arg)
  1954. X  local indexfile, data_dir, pager, zcat, hits, online, keys, pchar,
  1955. X      egrep, meta_keys, egrep_cmd, k, index, m, found, search, putout, 
  1956. X      out, recipe, rpath, rf, regexparser
  1957. X
  1958. X                # configuration
  1959. X  indexfile := getenv("INDEXFILE") | "%INDEXFILE%"
  1960. X  data_dir := getenv("RECIPEDIR") | "%DATADIR%"
  1961. X  pager := getenv("PAGER") | "%PAGER%"
  1962. X  Print_cmd := "%PRINTCMD%"
  1963. X  regexparser := 
  1964. X                # end of configuration
  1965. X
  1966. X  (*arg > 0) | stop("usage: menu keyword [regexp,...]")
  1967. X  close(open(indexfile)) | stop("can't read index")
  1968. X  hits := []
  1969. X  online := []
  1970. X  keys := []
  1971. X  pchar := &ascii[32:127]
  1972. X  Pipes := "pipes" == &features
  1973. X                # If we have pipes and egrep (Unix),
  1974. X                # separate the keywords into those with
  1975. X                # metacharacters and those without.  If
  1976. X                # there are none with metacharacters, pop
  1977. X                # one off the non-meta list to use with
  1978. X                # an egrep search.  
  1979. X  if \Pipes & close(open("/bin/" | "/usr/bin/" | "/usr/ucb/bin" || "egrep"))
  1980. X    then {
  1981. X      meta_keys := []
  1982. X      egrep_cmd := "cat " || indexfile 
  1983. X      regexparser := find
  1984. X      every k := !arg do put(if metas(k) then meta_keys else keys, map(k))
  1985. X      \meta_keys[1] | put(meta_keys, pop(keys))
  1986. X      every k := !meta_keys do egrep_cmd ||:= " | egrep -i '" || k || "'"
  1987. X      index := open(egrep_cmd || " 2>&1", "rp") 
  1988. X  }
  1989. X                # Without pipes and egrep use findre
  1990. X                # or ReFind for the regular expression
  1991. X                # search.  S-l-o-w.
  1992. X  else {
  1993. X    index := open(indexfile)
  1994. X    every put(keys, map(!arg))
  1995. X  }
  1996. X                # The search is a generator, breaking
  1997. X                # when the find or regexparser fails.  We
  1998. X                # then put online recipes in one list
  1999. X                # and the reference recipes in another.
  2000. X  every !index ? {
  2001. X    \egrep_cmd & find("error"|"grep") & stop("search expression error")
  2002. X    m := map(&subject)
  2003. X    found := 1
  2004. X    every k := !keys do { 
  2005. X      search := if /egrep & metas(k) then regexparser else find
  2006. X      search(k, m) | break found := &null 
  2007. X    }
  2008. X    \found & {
  2009. X      put(if ="Comp-" then online else hits, 
  2010. X      left(tab(many(pchar)), 20) || (tab(upto(pchar)), tab(many(pchar))))
  2011. X      tab(0)
  2012. X    }
  2013. X  }
  2014. X
  2015. X  *hits + *online = 0 & stop("No matching recipes.")
  2016. X  \hits[1] & more("RECIPES", hits)
  2017. X  \online[1] & repeat {
  2018. X    more("ON-LINE RECIPES", online)
  2019. X    writes("\nEnter recipe numbers(s): ")
  2020. X    read() ? {
  2021. X      (*&subject = 0) | upto('qQ') & exit(1)
  2022. X                # Print code for the built-in pager.
  2023. X      putout := if upto('pP') then print else more
  2024. X      while tab(upto(&digits)) do {
  2025. X    out := []
  2026. X    recipe := tab(many(&digits))
  2027. X     rpath := data_dir || recipe
  2028. X    if close(open(rpath)) then {
  2029. X      if *pager > 0 then system(pager || " " || rpath)
  2030. X                # Put the recipe in a list, so more
  2031. X                # will know how big it is. 
  2032. X      else rf := open(rpath) & every put(out, !rf)
  2033. X    }
  2034. X    else if \Pipes then {
  2035. X      rpath ||:= ".Z"
  2036. X      if *pager > 0 then system("zcat " || rpath || " | " || pager)
  2037. X      else {
  2038. X        rf := open("zcat " || rpath, "rp")
  2039. X        every put(out, !rf)
  2040. X        close(rf)
  2041. X      } | write("Can't find " || rpath)    
  2042. X    }
  2043. X    \out[1] & putout("RECIPE " || recipe, out, "End of Recipe " || recipe)
  2044. X      }
  2045. X    }
  2046. X  }
  2047. Xend 
  2048. X
  2049. X
  2050. Xprocedure print(recipe, head)
  2051. X  local prn, rp, mode
  2052. X
  2053. X  if \Print_cmd & \Pipes then {
  2054. X    Print_cmd ? {
  2055. X      prn := (/tab(find("%s")) || head) | tab(0)
  2056. X      move(2) & prn ||:= tab(0)
  2057. X    }
  2058. X    mode := "wp"
  2059. X  }
  2060. X  else if not "MS-DOS" == &features then 
  2061. X      return write("Sorry, not configured to print.")
  2062. X  else {
  2063. X    mode := "w"
  2064. X    prn := "PRN"
  2065. X  }
  2066. X  rp := open(prn, "wp")
  2067. X  every write(rp, !recipe)
  2068. X  return close(rp)
  2069. Xend
  2070. X
  2071. X                # Procedured modified from R.Goerwitz
  2072. X                # to detect whether a keyword contains
  2073. X                # meta-characters, e.g., whether we
  2074. X                # need a regular expression search.
  2075. Xprocedure metas(str)
  2076. X
  2077. X  str ? {
  2078. X    tab(many('*+?|'))    
  2079. X    while tab(upto('\\*+()|?.$^[')) do {
  2080. X      if ="\\" then move(1) | stop("badly-formed search string")
  2081. X      else return .&pos
  2082. X    }
  2083. X  }
  2084. X  fail
  2085. Xend
  2086. X
  2087. X                # This is kluged to not clear the
  2088. X                # screen or show the percentage
  2089. X                # after -MORE- for the lists of recipes.
  2090. Xprocedure more(header, what, footer)
  2091. X  static lines
  2092. X  local ans
  2093. X
  2094. X  initial {
  2095. X    writes(getval("cl"))
  2096. X    lines := 0
  2097. X  }
  2098. X  /footer | {
  2099. X    writes(getval("cl"))
  2100. X    lines := 0
  2101. X  }
  2102. X  \header & {
  2103. X    write(getval("md"|"so") || header || ":" || getval("me"|"se"))
  2104. X    lines +:= 1
  2105. X  }
  2106. X  every !what ? {
  2107. X    write(tab(0))
  2108. X    ((lines +:= 1 + *&subject/getval("co")) % (getval("li") - 1) = 0) & {
  2109. X      writes(getval("so") || "-MORE-")
  2110. X      \footer & writes("(", (100 > (lines - 2)*100/*what) | 100, "%)")
  2111. X      writes(getval("se"))
  2112. X      ans := read() & writes(getval("up") || getval("ce"))
  2113. X      upto('nNqQ', ans) & fail
  2114. X    }
  2115. X  }
  2116. X  \footer & {
  2117. X    writes(getval("so") || footer || getval("se")) 
  2118. X    read() & writes(getval("up") || getval("ce"))
  2119. X  }
  2120. Xend
  2121. X
  2122. SHAR_EOF
  2123. if test 5268 -ne "`wc -c < 'menu.S'`"
  2124. then
  2125.     echo shar: "error transmitting 'menu.S'" '(should have been 5268 characters)'
  2126. fi
  2127. fi
  2128. echo shar: "extracting 'nr.S'" '(1535 characters)'
  2129. if test -f 'nr.S'
  2130. then
  2131.     echo shar: "will not over-write existing file 'nr.S'"
  2132. else
  2133. sed 's/^X//' << \SHAR_EOF > 'nr.S'
  2134. X#
  2135. X# nr.icn
  2136. X# copyright 1992 Ronald Florence
  2137. X# @(#) version 1.0 (ron@mlfarm.com, 5 May 1992)
  2138. X#
  2139. X# usage (from news- or mail-reader):
  2140. X#    | nr "recipe name" "keywords"
  2141. X#
  2142. X
  2143. Xprocedure main(arg)
  2144. X  local indexfile, data_dir, noshow, compress, index, num,
  2145. X        seqfile, recipefile, eoh
  2146. X
  2147. X  indexfile := getenv("INDEXFILE") | "%INDEXFILE%"
  2148. X  data_dir := getenv("RECIPEDIR") | "%DATADIR%"
  2149. X  noshow := ["From ", "Message-Id: ", "Received: ", "Return-path: ",
  2150. X         "Path: ", "Xref: ", "References: ", "Lines: ", "Expires: ",
  2151. X         "Approved: ", "Newsgroups: ", "Subject: ", "Summary: ",
  2152. X         "Keywords: ", "Followup-To: ", "Date: ", "Nf-", "From: ",
  2153. X         "Distribution: ", "In-Reply-to: ", "Reply-To: ", "NNTP-",
  2154. X         "Article-I.D.: ", "Organization: "]
  2155. X  compress := "%COMPRESS%"
  2156. X
  2157. X  (*arg < 2) & stop("usage: nr \"recipe-name\" \"keywords\" < posted-recipe")
  2158. X  index := open(indexfile, "a") | stop("Can't append to recipe index")
  2159. X  num := 1
  2160. X  if seqfile := open(data_dir || "seq") then num +:= read(seqfile) 
  2161. X  { if (*compress > 0) & "pipes" == &features then
  2162. X      recipefile := open(compress || " -c > " || data_dir || num || ".Z", "wp")
  2163. X  else recipefile := open(data_dir || num, "w") } |
  2164. X      stop("Can't write recipe file")
  2165. X  every !&input ? {
  2166. X    /eoh := *&subject = 0
  2167. X    if \eoh | not match(map(!noshow), map(&subject)) then 
  2168. X    write(recipefile, tab(0))
  2169. X  }
  2170. X  write(index, "Comp-", num, "\t", arg[1], "\t", arg[2])
  2171. X  close(\seqfile)
  2172. X  seqfile := open(data_dir || "seq", "w") | stop("Can't update seq file")
  2173. X  write(seqfile, num)
  2174. Xend
  2175. X
  2176. X
  2177. SHAR_EOF
  2178. if test 1535 -ne "`wc -c < 'nr.S'`"
  2179. then
  2180.     echo shar: "error transmitting 'nr.S'" '(should have been 1535 characters)'
  2181. fi
  2182. fi
  2183. echo shar: "extracting 'xdefault.icn'" '(513 characters)'
  2184. if test -f 'xdefault.icn'
  2185. then
  2186.     echo shar: "will not over-write existing file 'xdefault.icn'"
  2187. else
  2188. sed 's/^X//' << \SHAR_EOF > 'xdefault.icn'
  2189. X#
  2190. X# xdefault.icn
  2191. X# copyright 1992 Ronald Florence
  2192. X# @(#) version 1.0 (ron@mlfarm.com, 5 May 1992)
  2193. X#
  2194. X
  2195. Xprocedure xdefault(prog)
  2196. X  local res, sys_r, user_r, r
  2197. X
  2198. X  sys_r := open(\getenv("XAPPLRESDIR") || "/" || prog) | []
  2199. X  user_r := open(getenv("HOME") || "/.Xdefaults") | []
  2200. X  res := table()
  2201. X  every !sys_r | !user_r ? if =prog then {
  2202. X    move(1)
  2203. X    r := tab(upto(':'))
  2204. X    tab(many(': \t'))
  2205. X    res[r] := tab(0)
  2206. X  }
  2207. X  type(sys_r) == "file" & close(sys_r)
  2208. X  type(user_r) == "file" & close(user_r)
  2209. X  return res
  2210. Xend
  2211. X
  2212. SHAR_EOF
  2213. if test 513 -ne "`wc -c < 'xdefault.icn'`"
  2214. then
  2215.     echo shar: "error transmitting 'xdefault.icn'" '(should have been 513 characters)'
  2216. fi
  2217. fi
  2218. echo shar: "extracting '1'" '(918 characters)'
  2219. if test -f '1'
  2220. then
  2221.     echo shar: "will not over-write existing file '1'"
  2222. else
  2223. sed 's/^X//' << \SHAR_EOF > '1'
  2224. XDeirdre's Chocolate Lovers Brownies
  2225. X
  2226. XI have tried dozens of brownie recipes over the years and I finally got
  2227. Xone that has the right flavor and the right consistency.  Many thanks to
  2228. XDeirdre Christman for this fool-proof (it worked for me!) and easy one..
  2229. X
  2230. XIngredients:
  2231. X
  2232. X2 sticks of unsalted butter
  2233. X4 squares of unsweetened chocolate
  2234. X2 cups sugar (I like a tad less)
  2235. X4 eggs (if they are jumbo use only 3)
  2236. X1 cup flour
  2237. Xpinch salt
  2238. X1/2 teaspoon vanilla
  2239. X1 cup chocolate chips
  2240. X1 cup walnuts (optional)
  2241. X
  2242. XTechnique:
  2243. X
  2244. XMelt butter and chocolate slowly in a pot large enough to hold all of
  2245. Xthe ingredients.  Cool slightly then add sugar and then beat in one egg
  2246. Xat a time.  Then add vanilla and all of the rest of the ingredients,
  2247. Xmixing enough just to blend the flour.
  2248. X
  2249. XSpread evenly into a greased 9 X 13 pan and bake in a pre-heated 350 degree
  2250. Xoven for 25 minutes.
  2251. X
  2252. XCool several hours before trying to cut or remove from pan.
  2253. X
  2254. SHAR_EOF
  2255. if test 918 -ne "`wc -c < '1'`"
  2256. then
  2257.     echo shar: "error transmitting '1'" '(should have been 918 characters)'
  2258. fi
  2259. fi
  2260. echo shar: "extracting '2'" '(1423 characters)'
  2261. if test -f '2'
  2262. then
  2263.     echo shar: "will not over-write existing file '2'"
  2264. else
  2265. sed 's/^X//' << \SHAR_EOF > '2'
  2266. XBLOND BROWNIES
  2267. X
  2268. XThe ingredients are the same as toll house cookies, but the mix is different.
  2269. XThe beauty of the followin recipie is you can make with few measurements
  2270. Xwith a minimum of dishes!
  2271. X
  2272. X2/3 c.    butter or oleo     (just chop two sticks at the 1/3 line)
  2273. X1 lb.    brown sugar    (just by by the 1lb box and no measuring!)
  2274. X            or 2 1/4 cups
  2275. X1 t.    vanilla        (I don't meausre because I love the stuff)
  2276. X3         eggs
  2277. X2 1/4    flour        (when I'm lazy, I just stir it in until it looks
  2278. X             like enough!)
  2279. X1/2 bag    morsels         any flavor, whole bag if you like, nuts too
  2280. X
  2281. X
  2282. XMELT    the butter in a 4 qt. sauce pan on low heat
  2283. XSTIR    in brown sugar
  2284. XSTIR    in vanilla
  2285. XCOOL    or the morsles will melt later
  2286. X
  2287. XSTIR    in eggs
  2288. X    (so far, one pan and one spoon dirty!)
  2289. XSTIR    in flour, a rounded 2 cup liquid measure is about right
  2290. X    as much as 3 cups if you like them dry and cake like
  2291. XSTIR    in morsles
  2292. X
  2293. XGREASE    a 12x8 pan, better yet a 13x9 baking pan
  2294. XSPREAD  batter in pan
  2295. X
  2296. XBAKE    350 oF for 20-25 minutes, use toothpick test.
  2297. X    even if you use less flour and they are gooey like they
  2298. X    should be, they won't stick to the toothpick when done
  2299. X    If you are using a smaller pan (say 11x7) and you brownies
  2300. X    are taller, bake a little longer but don't burn the bottom
  2301. X-- 
  2302. X   <=========================><===================================>
  2303. X   || Christopher Landers    || Stamp out Silly Long Signatures! ||
  2304. X   <================ landers@zeus.mgmt.purdue.edu ================>
  2305. SHAR_EOF
  2306. if test 1423 -ne "`wc -c < '2'`"
  2307. then
  2308.     echo shar: "error transmitting '2'" '(should have been 1423 characters)'
  2309. fi
  2310. fi
  2311. echo shar: "extracting '3'" '(596 characters)'
  2312. if test -f '3'
  2313. then
  2314.     echo shar: "will not over-write existing file '3'"
  2315. else
  2316. sed 's/^X//' << \SHAR_EOF > '3'
  2317. XArchive-Name: recipes/ovo-lacto/butterscotch-brownies
  2318. X
  2319. X
  2320. XButterscotch Brownies
  2321. X
  2322. X1/4 c. butter            1 tsp. baking powder
  2323. X1 c. brown sugar (dark)        1/2 tsp. vanilla
  2324. X1 egg                1/2 c. chopped nuts
  2325. X3/4 c. flour
  2326. X
  2327. XMelt butter, add other ingredients.  Spread in greased 8" x 8"
  2328. Xpan.  Bake 25 minutes at 350.
  2329. X
  2330. XNote:  I haven't had these in a long, long time, but i seem to
  2331. Xremember my mom adding butterscotch chips.  You could substitute
  2332. Xchocolate chips if you want.
  2333. X
  2334. XI would also sift the baking powder and flour together first
  2335. Xthen add it to the mixed wet ingredients.
  2336. X
  2337. Xpauline
  2338. Xpmmuggli@uokmax.ecn.uoknor.edu
  2339. SHAR_EOF
  2340. if test 596 -ne "`wc -c < '3'`"
  2341. then
  2342.     echo shar: "error transmitting '3'" '(should have been 596 characters)'
  2343. fi
  2344. fi
  2345. exit 0
  2346. #    End of shell archive
  2347. -- 
  2348.  
  2349.                 Ronald Florence
  2350.                 ron@mlfarm.com
  2351.  
  2352. From icon-group-request  Thu May  7 14:23:00 1992
  2353. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Thu, 7 May 92 14:23:00 MST
  2354. Received: from ucbvax.Berkeley.EDU by optima.cs.arizona.edu (4.1/15)
  2355.     id AA07925; Thu, 7 May 92 14:22:57 MST
  2356. Received: by ucbvax.Berkeley.EDU (5.63/1.43)
  2357.     id AA15301; Thu, 7 May 92 14:20:23 -0700
  2358. Received: from USENET by ucbvax.Berkeley.EDU with netnews
  2359.     for icon-group@cs.arizona.edu (icon-group@cs.arizona.edu)
  2360.     (contact usenet@ucbvax.Berkeley.EDU if you have questions)
  2361. Date: 24 Apr 92 21:25:52 GMT
  2362. From: dog.ee.lbl.gov!overload.lbl.gov!agate!spool.mu.edu!sol.ctr.columbia.edu!zaphod.mps.ohio-state.edu!uwm.edu!linac!uchinews!ellis!goer@ucbvax.berkeley.edu  (Richard L. Goerwitz)
  2363. Organization: University of Chicago Computing Organizations
  2364. Subject: Re: Computer Programming for the Humanities Course Offering
  2365. Message-Id: <1992Apr24.212552.9948@midway.uchicago.edu>
  2366. References: <1992Apr24.162006.6210@dsuvax.dsu.edu>
  2367. Sender: icon-group-request@cs.arizona.edu
  2368. To: icon-group@cs.arizona.edu
  2369.  
  2370. While we're at it, I'd like to advertize a course in COBOL and FORTRAN
  2371. programming for computer science students.  An advanced course in BASIC
  2372. will be offered as well.
  2373.  
  2374. -- 
  2375.  
  2376.    -Richard L. Goerwitz              goer%ellis@uchicago.bitnet
  2377.    goer@ellis.uchicago.edu           rutgers!oddjob!ellis!goer
  2378.  
  2379. From icon-group-request  Thu May  7 16:39:58 1992
  2380. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Thu, 7 May 92 16:39:58 MST
  2381. Received: from ucbvax.Berkeley.EDU by optima.cs.arizona.edu (4.1/15)
  2382.     id AA13909; Thu, 7 May 92 16:39:55 MST
  2383. Received: by ucbvax.Berkeley.EDU (5.63/1.43)
  2384.     id AA25871; Thu, 7 May 92 16:36:32 -0700
  2385. Received: from USENET by ucbvax.Berkeley.EDU with netnews
  2386.     for icon-group@cs.arizona.edu (icon-group@cs.arizona.edu)
  2387.     (contact usenet@ucbvax.Berkeley.EDU if you have questions)
  2388. Date: 25 Apr 92 01:41:36 GMT
  2389. From: mintaka.lcs.mit.edu!zurich.ai.mit.edu!ara@yale-bulldog.arpa  (Allan Adler)
  2390. Organization: M.I.T. Artificial Intelligence Lab.
  2391. Subject: Re: Computer Programming for the Humanities Course Offering
  2392. Message-Id: <ARA.92Apr24204136@camelot.ai.mit.edu>
  2393. References: <1992Apr24.162006.6210@dsuvax.dsu.edu>
  2394. Sender: icon-group-request@cs.arizona.edu
  2395. To: icon-group@cs.arizona.edu
  2396.  
  2397. In article <1992Apr24.162006.6210@dsuvax.dsu.edu> ghelmer@dsuvax.dsu.edu (Guy Helmer) writes:
  2398.  
  2399.  
  2400.     Following is information about a three-credit graduate course
  2401.    in programming for the humanities offered by Dakota State
  2402.    University via BITNET (and other interconnected networks).
  2403.    Students in the course can be anywhere in the world if they can
  2404.    send and receive electronic mail.
  2405.      [ details of the course deleted]
  2406.     The total cost of the course is $239.82.  No textbook is
  2407.    required.  Students will be sent a disk containing a public-domain
  2408.    SNOBOL4 compiler and a text editor.  Lectures and data files will
  2409.    be sent electronically.
  2410.  
  2411.     Students may audit the course or enroll for credit and receive
  2412.    a grade of Pass or Fail.  The cost to audit the course is the same
  2413.    as enrolling for credit.
  2414.  
  2415.     Those who want an electronic registration form or who have
  2416.    questions about the course should send a message to
  2417.  
  2418.  
  2419.  
  2420. I think this counts as commercial advertising. If someone wants to make the
  2421. course materials available to people via anonymous ftp, that is one thing.
  2422. If someone wants to organize a network of volunteers to help people in the
  2423. humanities learn computers, that is still ok. But this is pure commerce.
  2424.  
  2425. Aren't there rules about this sort of thing?
  2426.  
  2427. Allan Adler
  2428. ara@altdorf.ai.mit.edu
  2429.  
  2430. From icon-group-request  Thu May  7 17:38:18 1992
  2431. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Thu, 7 May 92 17:38:18 MST
  2432. Received: from ucbvax.Berkeley.EDU by optima.cs.arizona.edu (4.1/15)
  2433.     id AA16984; Thu, 7 May 92 17:38:15 MST
  2434. Received: by ucbvax.Berkeley.EDU (5.63/1.43)
  2435.     id AA29808; Thu, 7 May 92 17:31:16 -0700
  2436. Received: from USENET by ucbvax.Berkeley.EDU with netnews
  2437.     for icon-group@cs.arizona.edu (icon-group@cs.arizona.edu)
  2438.     (contact usenet@ucbvax.Berkeley.EDU if you have questions)
  2439. Date: 25 Apr 92 01:37:07 GMT
  2440. From: s5!sethb@uunet.uu.net  (Seth Breidbart)
  2441. Organization: Morgan Stanley & Co., New York, NY
  2442. Subject: Re: Computer Programming for the Humanities Course Offering
  2443. Message-Id: <1992Apr25.013707.17137@fid.morgan.com>
  2444. References: <1992Apr24.162006.6210@dsuvax.dsu.edu>, <WAND.92Apr24162753@dec5120z.ccs.northeastern.edu>
  2445. Sender: icon-group-request@cs.arizona.edu
  2446. To: icon-group@cs.arizona.edu
  2447.  
  2448. In article <WAND.92Apr24162753@dec5120z.ccs.northeastern.edu>
  2449. wand@corwin.ccs.northeastern.edu writes:
  2450. >I didn't think there were any living SNOBOL programmers left!
  2451.  
  2452. Well, I was once paid for programming in SNOBOL.  Does that count?
  2453. (But I remember how surprised I was the only time I saw a "help
  2454. wanted" ad for a SNOBOL programmer!)
  2455.  
  2456. >in SNOBOL, which is hardly an industrial-strength language with widespread
  2457. >support! 
  2458.  
  2459. No, but it's a lot of fun!
  2460.  
  2461. Seth        sethb@fid.morgan.com
  2462.  
  2463. From lrw!leichter@lrw.com  Thu May  7 18:25:46 1992
  2464. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Thu, 7 May 92 18:25:46 MST
  2465. Received: from uu.psi.com by optima.cs.arizona.edu (4.1/15)
  2466.     id AA18365; Thu, 7 May 92 18:25:42 MST
  2467. Received: from lrw.UUCP by uu.psi.com (5.65b/4.1.031792-PSI/PSINet)
  2468.     id AA14042; Thu, 7 May 92 21:00:09 -0400
  2469. Message-Id: <9205080100.AA14042@uu.psi.com>
  2470. Received: by lrw.UUCP (DECUS UUCP w/Smail);
  2471.           Thu,  7 May 92 20:48:09 EDT
  2472. Date: Thu,  7 May 92 20:48:09 EDT
  2473. From: Jerry Leichter <leichter@lrw.com>
  2474. To: ICON-GROUP@cs.arizona.edu
  2475. Subject: RE: NAGBOL
  2476. X-Vms-Mail-To: UUCP%"janpeter@mpi.kun.nl"
  2477.  
  2478.     Why the hell do we get the SNOBOL course message /again/? Is this a
  2479.     provocation? Is there some SNOBOL masochist out there that lives on
  2480.     Flames from ICON users? 
  2481.  
  2482. I've saved up my flame for reposting.  :-)  (Just kidding.)
  2483.  
  2484.     Anyhow, let's be constructive.
  2485.  
  2486. Yes, lets.
  2487.  
  2488.                        I'd like to know if there is a specific
  2489.     class of programming problems / algorithms for which SNOBOL is a more
  2490.     natural language than Icon.
  2491.  
  2492. It's hard to beat SNOBOL for specifying patterns and string operations, PURELY
  2493. ON A SYNTACTIC LEVEL.  Yes, Icon can do all of that - but you have to add
  2494. various syntactic elements that are, in a way, extraneous to the problem.
  2495. A grammer in traditional form pretty much IS a SNOBOL pattern definition.
  2496. If what you are doing is easily and naturally describable as matching a
  2497. pattern defined by a grammer against a string, SNOBOL will give you a very
  2498. concise and transparent program for it.
  2499.  
  2500.                     I am aware of the more esoteric
  2501.     capabilities of SNOBOL, but I'd like to know in what situations these
  2502.     functions are actually /useful/. Many years ago someone told me
  2503.     enthusiastically that one could write a LISP program that could modify
  2504.     itself! Since that day I've never seen one useful LISP program that
  2505.     used this capability. Is  that the case with SNOBOL too, or are there
  2506.     many SNOBOL programmers who  use those (e.g. CODE, or "variable
  2507.     labels") capacities daily?
  2508.  
  2509. Absolutely!  LISP users commonly use packages that read in code only when it
  2510. is actually needed - one package I recall was named SLURP.  Similar things
  2511. have been done in SNOBOL - Gimpel's Algorithms in SNOBOL4 has a nice example.
  2512. It's also possible to write debuggers which allow you to type in SNOBOL code
  2513. on the fly and evaluate it.  I've seen a number of tools of this general sort.
  2514. I took it to its logical extreme in a system I wrote years ago called APLBOL.
  2515. APLBOL, which was built on SITBOL on PDP-10's and -20's, had the same user
  2516. interface as APL, although the language was (of course) SNOBOL.  The only
  2517. "fixed" code in the system was the APLBOL implementation; every line of code
  2518. a user wrote was actually "established" by CODE().  Worked quite nicely, and
  2519. it was great for quick and easy development.  (Had some amazing hacks in it
  2520. to make it work, though.  Unfortunately, some of the central hacks were
  2521. based on SITBOL-specific extensions, so it won't work on any other SNOBOL.)
  2522.  
  2523. Now, you could argue that APLBOL wasn't SELF-modifying - the APLBOL code
  2524. modified the user code, not itself, and the user code did NOT modify itself.
  2525. But that's just the point:  Self-modification if uncontrolled is a disaster;
  2526. but self-modification fit into a rational scheme is extremely useful. (Actu-
  2527. ally, it WAS possible to modify the APLBOL code, if you knew how and ignored
  2528. the "don't do this or you may be screwed" rules, which basically reserved
  2529. a certain name space to internal routines.  This could be VERY handy for
  2530. debugging, but was otherwise not recommended.  However, there were a couple
  2531. of "documented" hooks so that, for example, you could insert a pre-processor
  2532. that would muck with code before it was handed to CODE().)
  2533.  
  2534.                             -- Jerry
  2535.  
  2536. From dnehme@ccwf.cc.utexas.edu  Fri May  8 06:31:30 1992
  2537. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Fri, 8 May 92 06:31:30 MST
  2538. Received: from dopey.cc.utexas.edu by optima.cs.arizona.edu (4.1/15)
  2539.     id AA17389; Fri, 8 May 92 06:31:26 MST
  2540. Received: by dopey.cc.utexas.edu (5.61/1.34/CCWF 1.18)
  2541.     id AA11767; Fri, 8 May 92 08:31:22 -0500
  2542. Date: Fri, 8 May 92 08:31:22 -0500
  2543. From: dnehme@ccwf.cc.utexas.edu (David Nehme)
  2544. Message-Id: <9205081331.AA11767@dopey.cc.utexas.edu>
  2545. To: icon-group@cs.arizona.edu
  2546. Subject: unsubscribe me
  2547.  
  2548. Please Unsubscribe me from this list.  Thank you.
  2549.  
  2550. David Nehme
  2551. dnehme@ccwf.cc.utexas.edu
  2552. (512) 343-6975
  2553.  
  2554. From MATH0022@rmc.ca  Fri May  8 10:08:34 1992
  2555. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Fri, 8 May 92 10:08:34 MST
  2556. Received: from Arizona.edu (Merlin.Telcom.Arizona.EDU) by optima.cs.arizona.edu (4.1/15)
  2557.     id AA03206; Fri, 8 May 92 10:08:30 MST
  2558. Received: from RMC.CA (MAILER@RMC) by Arizona.edu (PMDF #12663) id
  2559.  <01GJRJVZRYI8AKTJ91@Arizona.edu>; Fri, 8 May 1992 10:08 MST
  2560. Received: by RMC (Mailer) id 45286592920; Fri, 08 May 92 12:06:11 EST
  2561. Date: Fri, 08 May 92 12:05:24 EST
  2562. From: MATH0022@rmc.ca
  2563. Subject: SNOBOL 4 "far-out" features.
  2564. To: icon-group@cs.arizona.edu
  2565. Reply-To: LINDSAY_JH@rmc.ca
  2566. Message-Id: <920508.12052540.004982@RMC.CP6>
  2567. X-Envelope-To: icon-group@cs.Arizona.edu
  2568.  
  2569.         As a SNOBOL enthusiast ever since I ran into Mr. Poage (of the famous
  2570. "green book" by Griswold, Poage and Polonsky) at a SHARE meeting in the sixties,
  2571. perhaps I can add a few notes about some of the uses of CODE() and other
  2572. SNOBOLish things that I'll probably miss in ICON as I start using it.
  2573.  
  2574.         As with other experienced programmers, experienced SNOBOL programmers
  2575. don't pull rabbits out of hats unless (1) a rabbit is definitely called for,
  2576. and (2) a hat is the most reasonable place to get the particular type of rabbit
  2577. needed.  The thing about SNOBOL is (1) that it has a few very nice hats complete
  2578. with top-quality rabbits, and (2) any such infrequently used and hence less
  2579. understood features, whether hats or programming language facilities, may be
  2580. poorly used, misused, or abused.  In our attempt to improve the quality of many
  2581. programming languages, we have dropped some features with low frequency of use
  2582. or which were subject to poor use and misuse, in spite of consequent loss of
  2583. facilities in some cases.
  2584.  
  2585.         There are ways to code around almost any lack of features.  I'm not
  2586. speaking here of things which can't be done any other way, but of things that I
  2587. have to do every once in a while, and then want to do in a simple, elegant,
  2588. readable, understandable way at least to me, the one who has to construct and
  2589. maintain the code for project, often a short-lived research-oriented one.  Now,
  2590. I have to concede that some aspects of SNOBOL, like Mathematical notation, are
  2591. pretty dense to the uninitiated, but I'll add that the language and its customs
  2592. and idioms grow on the user very quickly, and it becomes expressive and quite
  2593. powerful.  I've put away some of the things I find less desirable about SNOBOL
  2594. with a bit of a preprocessor (PREP0); I'm pleased to note that I shouldn't need
  2595. it with ICON, but then there are the other things like CODE() and the unary  *
  2596. operator (procedures and expressions as dynamically constructable, manipulable
  2597. data), EVAL(), explicit names of variables (via the  .  operator) and indirects,
  2598. and NRETURN, ....
  2599.  
  2600.         I coded an assembler of sorts a long time ago.  It was a typical two-
  2601. pass assembler with some macro capabilities.  The easiest way to switch from
  2602. pass 1 to pass 2 was to reDEFINE() a number of procedures.  The ICON equivalent
  2603. is just an assignment.  But macro definitions were converted into executable
  2604. code on the fly; the bodies of macro code were CONSTRUCTED out of the macro
  2605. definitions as the definitions were read during assembly.  In ICON, it appears
  2606. that this sort of thing would be done in two ICON invocations, and then with
  2607. the loss of a REdefinition capability.
  2608.  
  2609.         I've done several programs which involved complex ways of disposing of
  2610. some values (other than just assigning them to a variable, or storing them in
  2611. table or array elements, say with both constructing hash headers and making
  2612. multiple connections to or from the data being stored), but where the
  2613. complexities of the action hid the attempt to dispose of the data so that the
  2614. overall handling of the data was hidden.  I cooked up a SNOBOL4 way to write
  2615. such disposition of data as the assignment to a pseudovariable -- if you like,
  2616. a way to overload the assignment operator with a parameterized routine.
  2617.  
  2618.         Now don't think that such syntactical and symantic nicities don't have
  2619. their very significant uses.  There's a "war story" about a service bureau in
  2620. Ottawa in the days before PC's with word processors.  They offered a text entry
  2621. and retrieval service based on a then-old I.B.M. mainframe system called ATS
  2622. (Administrative Terminal System).  About the 3rd. or 4th. release of ATS, there
  2623. was a change in the internal format of the archive tapes of ATS, and users
  2624. going to the next version of ATS would have lost access to their archived
  2625. material.  First, the service bureau did a utility to convert old format archive
  2626. tapes to new format ones in a system language called PL360 -- a language which
  2627. gave access to most of the mainframe machine instructions and data types with
  2628. a syntax that was based on ALGOL 60.  It took about 10 minutes of C.P.U. time on
  2629. an I.B.M. model 65 to convert a full 2400 foot archive tape reel.  But there
  2630. were a few glitches, the complexity of which made it unreasonable to do a
  2631. thorough job in PL360 or any other available 'normal' language.  Enter SPITBOL
  2632. 360, a very fast implementation of SNOBOL4.  It was reasonable and simple to
  2633. write a SNOBOL4 routine which recognized and processed the old format archive
  2634. tapes into new format ones.  Running speed ?  About 30 minutes per full tape on
  2635. the same machine, and most importantly, because of the expressiveness of
  2636. SNOBOL4, the reformatting was without error.  Not industrial strength ?
  2637.  
  2638.         Of course, I don't know if that application used any of my list of
  2639. far-out features, but we can see the rather large number of prototypes and first
  2640. versions of compilers and preprocessors that have been done in SNOBOL4, many of
  2641. which did use one or perhaps two of them.  I consulted with a colleague who did
  2642. simulation of learning processes in SNOBOL4 (my suggestion for the language).
  2643. The thing that gave him a plus in SNOBOL4 was the ability to determine and
  2644. compute a learning process during processing, CODE() it, and use it.  Later on,
  2645. he switched to a Lisp, initially with the loss of some of the facilities he had
  2646. been making good use of.  Mostly, that was because he found that the rest of the
  2647. community he was working and communicating with were also using Lisp, and it
  2648. wasn't until later versions of Interlisp became available that he recovered the
  2649. features he had been using, and could persue some of his own thoughts.
  2650.  
  2651.         Yes, I say some of the far-out features, features which in other
  2652. languages would be thought of as giving rise to uncontroled, unstructured
  2653. programming are important, even if used only once in a while and by a few.
  2654.  
  2655. --------------------------------------------------------------------------------
  2656.  
  2657.             John H. Lindsay,
  2658.             Department of Mathematics and Computer Science,
  2659.             Royal Military College of Canada,
  2660.             Kingston, Ontario, Canada, K7K 5L0.
  2661.  
  2662.             Phones: Office,                          (613) 541-6419
  2663.                     Messages,                              541-6343 or 541-6458
  2664.                     Home,                                  546-6988
  2665.             E-Mail: From Bitnet, NetNorth, ONet:     LINDSAY_JH@RMC.CA
  2666.                     From Canadian Military Colleges: LINDSAY JH@RMC
  2667.             Fax:                                     (613) 542-8129
  2668.  
  2669. John H. Lindsay, Dept. of Math. & C. S., Royal Military College of Canada
  2670.  
  2671. From cliff  Fri May  8 16:05:42 1992
  2672. Received: from javelina.cs.arizona.edu by cheltenham.cs.arizona.edu; Fri, 8 May 92 16:05:42 MST
  2673. Date: Fri, 8 May 92 16:05:42 MST
  2674. From: "Cliff Hathaway" <cliff>
  2675. Message-Id: <9205082305.AA12509@javelina.cs.arizona.edu>
  2676. Received: by javelina.cs.arizona.edu; Fri, 8 May 92 16:05:42 MST
  2677. To: icon-group-file
  2678. Subject: Icon-group mailing list
  2679.  
  2680. You have been added to the Icon-Group list. 
  2681.  
  2682. This mailing list is meant to be a common meeting area for persons
  2683. interested in the Icon programming language.  Topics for discussion
  2684. include (but are not limited to):
  2685.  
  2686.     Programming Techniques
  2687.       - Style
  2688.       - Efficiency
  2689.       - Idioms
  2690.       - Pros and Cons of certain constructs
  2691.       - Clever ways to accomplish a certain task
  2692.     Theoretical Aspects
  2693.     Icon in relation to other languages
  2694.     Applications of Icon
  2695.     Implementation Issues
  2696.     Porting Icon to other machines
  2697.     History/Origins
  2698.     Idea/Wish Lists
  2699.     Announcement/Exchange of programs and procedures
  2700.     Bugs
  2701.     
  2702. Items of interest should be mailed to icon-group@cs.arizona.edu.  Mail is
  2703. immediately redistributed to all persons on the list.  It's good practice
  2704. to include a signature giving your name and email address, because not all
  2705. mailers preserve these.
  2706.  
  2707. Requests for addition or removal from the list should be sent to
  2708. icon-group-request@cs.arizona.edu.
  2709.  
  2710. This mailing list does not subsume the function of the icon-project
  2711. mailbox that we currently maintain.  Rather, the mailing list
  2712. supplements it.  Icon questions that may not be appropriate for
  2713. icon-group can be sent to icon-project.  If you are in doubt,
  2714. send to icon-project, note your uncertainty, and we'll see it
  2715. ends up in the correct place.
  2716.  
  2717. If you submit an item to Icon-group and get back failure notifications for
  2718. individuals, you can help eliminate this problem by mailing such messages
  2719. to icon-group-REQUEST.  (Our software tries to arrange for failure
  2720. notifications to be sent to us, but it's a moving target type problem.)
  2721.  
  2722. From icon-group-sender  Tue May 12 22:20:31 1992
  2723. Received: by cheltenham.cs.arizona.edu; Wed, 13 May 92 05:58:29 MST
  2724. Date: 13 May 92 01:21:45 GMT
  2725. From: hsi!mlfarm!rosie!ron@uunet.uu.net  (Ronald Florence)
  2726. Organization: Maple Lawn Farm, Stonington, CT
  2727. Subject: menu (recipe database parser) - patch 1
  2728. Message-Id: <1992May13.012145.2360@mlfarm.com>
  2729. Sender: icon-group-request@cs.arizona.edu
  2730. To: icon-group@cs.arizona.edu
  2731. Status: R
  2732. Errors-To: icon-group-errors@cs.arizona.edu
  2733.  
  2734. Last week I posted menu, a set of programs which search and maintain a
  2735. recipe database.  The following patch covers some minor `oops' in the
  2736. termcap and X-windows versions.  To apply, cut on the dotted lines,
  2737. run through `patch' and rebuild.
  2738.  
  2739.  
  2740. ----------------------[menu patch]---------------------
  2741. *** Makefile.orig    Fri May  8 13:05:25 1992
  2742. --- Makefile    Tue May 12 21:12:24 1992
  2743. ***************
  2744. *** 1,6 ****
  2745.   # Makefile for menu.icn
  2746.   # copyright 1992 Ronald Florence
  2747. ! # @(#) version 1.0 (ron@mlfarm.com, 5 May 1992)
  2748.   
  2749.   # --- Change the following as needed. ---
  2750.   
  2751. --- 1,6 ----
  2752.   # Makefile for menu.icn
  2753.   # copyright 1992 Ronald Florence
  2754. ! # @(#) version 1.1 (ron@mlfarm.com, 12 May 1992)
  2755.   
  2756.   # --- Change the following as needed. ---
  2757.   
  2758. ***************
  2759. *** 50,56 ****
  2760.       rm -f $@
  2761.       sed -e 's|%INDEXFILE%|$(Indexfile)|g' \
  2762.           -e 's|%DATADIR%|$(Datadir)|g' \
  2763. !         -e 's/%PRINTCMD%/$(Printcmd)/g'   \
  2764.           -e 's|%COMPRESS%|$(Compress)|g'   \
  2765.           -e 's|%MAXWIN%|$(Maxwin)|g'   \
  2766.           -e 's|%FONT%|$(Font)|g'   \
  2767. --- 50,56 ----
  2768.       rm -f $@
  2769.       sed -e 's|%INDEXFILE%|$(Indexfile)|g' \
  2770.           -e 's|%DATADIR%|$(Datadir)|g' \
  2771. !         -e "s/%PRINTCMD%/$(Printcmd)/g"   \
  2772.           -e 's|%COMPRESS%|$(Compress)|g'   \
  2773.           -e 's|%MAXWIN%|$(Maxwin)|g'   \
  2774.           -e 's|%FONT%|$(Font)|g'   \
  2775. *** menu.S.orig    Fri May  8 13:10:34 1992
  2776. --- menu.S    Tue May 12 21:12:43 1992
  2777. ***************
  2778. *** 1,7 ****
  2779.   #
  2780.   # menu.icn
  2781.   # copyright 1992 Ronald Florence
  2782. ! # @(#) version 1.0 (ron@mlfarm.com, 5 May 1992)
  2783.   #
  2784.   # See xmenu.icn for the X-Windows/X-Icon version.
  2785.   #
  2786. --- 1,7 ----
  2787.   #
  2788.   # menu.icn
  2789.   # copyright 1992 Ronald Florence
  2790. ! # @(#) version 1.1 (ron@mlfarm.com, 12 May 1992)
  2791.   #
  2792.   # See xmenu.icn for the X-Windows/X-Icon version.
  2793.   #
  2794. ***************
  2795. *** 119,125 ****
  2796.   
  2797.     if \Print_cmd & \Pipes then {
  2798.       Print_cmd ? {
  2799. !       prn := (/tab(find("%s")) || head) | tab(0)
  2800.         move(2) & prn ||:= tab(0)
  2801.       }
  2802.       mode := "wp"
  2803. --- 119,125 ----
  2804.   
  2805.     if \Print_cmd & \Pipes then {
  2806.       Print_cmd ? {
  2807. !       prn := (\tab(find("%s")) || head) | tab(0)
  2808.         move(2) & prn ||:= tab(0)
  2809.       }
  2810.       mode := "wp"
  2811. *** xmenu.S.orig    Fri May  8 13:10:00 1992
  2812. --- xmenu.S    Tue May 12 21:13:00 1992
  2813. ***************
  2814. *** 1,7 ****
  2815.   #
  2816.   # xmenu.icn
  2817.   # copyright 1992 Ronald Florence
  2818. ! # @(#) version 1.0 (ron@mlfarm.com, 5 May 1992)
  2819.   #
  2820.   # main window:  
  2821.   #    left button to select recipe
  2822. --- 1,7 ----
  2823.   #
  2824.   # xmenu.icn
  2825.   # copyright 1992 Ronald Florence
  2826. ! # @(#) version 1.1 (ron@mlfarm.com, 12 May 1992)
  2827.   #
  2828.   # main window:  
  2829.   #    left button to select recipe
  2830. ***************
  2831. *** 65,81 ****
  2832.       }
  2833.     }
  2834.     *hits + *online = 0 & stop("No matching recipes.")
  2835. !   (winsize := *online * 2 + *hits + 2) <= Maxwin | {
  2836.       hits |||:= online
  2837.       online := []
  2838. !     winsize := *hits + 1
  2839.     }
  2840.     winsize >=:= Maxwin
  2841.     W := open("menu", "x", "font=" || Font, "cursor=off", "lines=" || winsize,
  2842.           "columns=80") | stop("no window")
  2843.     quitsensor(W)
  2844. !   if (*hits + 1) >= winsize then page(W, hits, "menu")
  2845. !   else every write(W, !hits)
  2846.     R := table()
  2847.   
  2848.     every !online ? {
  2849. --- 65,84 ----
  2850.       }
  2851.     }
  2852.     *hits + *online = 0 & stop("No matching recipes.")
  2853. !   (winsize := *online * 2 + *hits + 1) <= Maxwin | {
  2854.       hits |||:= online
  2855.       online := []
  2856. !     winsize := *hits 
  2857.     }
  2858.     winsize >=:= Maxwin
  2859.     W := open("menu", "x", "font=" || Font, "cursor=off", "lines=" || winsize,
  2860.           "columns=80") | stop("no window")
  2861.     quitsensor(W)
  2862. !   if *hits > winsize then page(W, hits, "menu")
  2863. !   else {
  2864. !     every write(W, !hits)
  2865. !    (*online > 0) | evhandle(W)
  2866. !   }
  2867.     R := table()
  2868.   
  2869.     every !online ? {
  2870. ***************
  2871. *** 151,157 ****
  2872.     local prn, rp
  2873.   
  2874.     Print_cmd ? {
  2875. !     prn := (/tab(find("%s")) || head) | tab(0)
  2876.       move(2) & prn ||:= tab(0)
  2877.     }
  2878.     rp := open(prn, "wp")
  2879. --- 154,160 ----
  2880.     local prn, rp
  2881.   
  2882.     Print_cmd ? {
  2883. !     prn := (\tab(find("%s")) || head) | tab(0)
  2884.       move(2) & prn ||:= tab(0)
  2885.     }
  2886.     rp := open(prn, "wp")
  2887. --------------------------[eof]------------------------
  2888. -- 
  2889.  
  2890.                 Ronald Florence
  2891.                 ron@mlfarm.com
  2892.  
  2893.  
  2894. From icon-group-sender  Sat May 16 00:41:37 1992
  2895. Received: by cheltenham.cs.arizona.edu; Sat, 16 May 92 11:34:42 MST
  2896. Date: 14 May 92 16:31:16 GMT
  2897. From: emory!gwinnett!yngbld!zeta@gatech.edu  (SYSTEM OPERATOR)
  2898. Organization: TCS Constulting Services, Peachtree City, GA
  2899. Subject: Latest icon version...what is it?
  2900. Message-Id: <Ta2RkB1w164w@yngbld.gwinnett.com>
  2901. Sender: icon-group-request@cs.arizona.edu
  2902. To: icon-group@cs.arizona.edu
  2903. Errors-To: icon-group-errors@cs.arizona.edu
  2904.  
  2905. I've been out of the mainstream for a while..  what is the latest version if 
  2906. Icon?  both for DOS and OS/2?  Is the os/2 version for 2.0?  Is one planned? 
  2907. When will it be out if it isn't now?  I'm also interested in getting a 
  2908. compiler and not just interpreter...how much does it cost?  [Note-I have 
  2909. 386-33, 8 megs ram, dos 5, and soon os/2 2.0]  thanx
  2910. Gre
  2911.  
  2912.  
  2913. From icon-group-sender  Tue May 19 18:55:54 1992
  2914. Received: by cheltenham.cs.arizona.edu; Wed, 20 May 92 04:35:50 MST
  2915. Date: 1 May 92 09:17:56 GMT
  2916. From: eru.mt.luth.se!lunic!sunic2!mcsun!uknet!ox-prg!onions.natcorp!dominic@bloom-beacon.mit.edu  (Dominic Dunlop)
  2917. Organization: British National Corpus, Oxford University, GB
  2918. Subject: Icon documentation in info format anywhere?
  2919. Message-Id: <3397@inca.comlab.ox.ac.uk>
  2920. Sender: icon-group-request@cs.arizona.edu
  2921. To: icon-group@cs.arizona.edu
  2922. Status: R
  2923. Errors-To: icon-group-errors@cs.arizona.edu
  2924.  
  2925. Has anybody out there taken the time and trouble to cast the Icon
  2926. documentation into info format so that it can be accessed on-line from
  2927. inside emacs?  A search by the nearest Archie server reveals nothing
  2928. hopeful, so I'm asking in this forum on the off-chance.  (And because
  2929. I'm too lazy to do the work myself...)
  2930.  
  2931. Thanks...
  2932.  
  2933. -- 
  2934. Dominic Dunlop
  2935.  
  2936.  
  2937. From icon-group-sender  Wed May 20 00:11:39 1992
  2938. Received: by cheltenham.cs.arizona.edu; Wed, 20 May 92 04:36:22 MST
  2939. Date: 1 May 92 14:35:36 GMT
  2940. From: dog.ee.lbl.gov!overload.lbl.gov!agate!spool.mu.edu!sol.ctr.columbia.edu!zaphod.mps.ohio-state.edu!magnus.acs.ohio-state.edu!csn!stortek!LSTC2VM.stortek.com!WILLS@ucbvax.berkeley.edu  (Cheyenne Wills)
  2941. Organization: StorageTek SW Engineering
  2942. Subject: Re: cms problem
  2943. Message-Id: <167DA78DC.WILLS@LSTC2VM.stortek.com>
  2944. References: <92120.115123U47041@uicvm.uic.edu>
  2945. Sender: icon-group-request@cs.arizona.edu
  2946. To: icon-group@cs.arizona.edu
  2947. Status: R
  2948. Errors-To: icon-group-errors@cs.arizona.edu
  2949.  
  2950. In article <92120.115123U47041@uicvm.uic.edu>
  2951. <U47041@uicvm.uic.edu> writes:
  2952.  
  2953. >
  2954. >hi there i 'm trying to use icon in cms 5.0
  2955. >when i enter ICONT HELLO -X
  2956. >to test the program from the distribution tape
  2957. >i get the foll. messg. from the machine
  2958. >
  2959. >
  2960. >dms116s  loader table overflow
  2961. >invalid cms command
  2962. >
  2963. >
  2964. >(end of messg.)
  2965. >any sugestions?
  2966. >thanx
  2967. >u47041@uicvm.bitnet
  2968. >kapoulas@lac.math.uic.edu
  2969.  
  2970.  
  2971. You want to issue "SET LDRTBLS 12" from the cms command line
  2972. (or place the statement into your "PROFILE EXEC").
  2973.  
  2974. Cheyenne Wills
  2975.  
  2976.  
  2977. From icon-group-sender  Wed May 20 10:14:11 1992
  2978. Received: by cheltenham.cs.arizona.edu; Wed, 20 May 92 14:10:29 MST
  2979. Date: 19 May 92 11:30:14 GMT
  2980. From: hsi!mlfarm!rosie!ron@uunet.uu.net  (Ronald Florence)
  2981. Organization: Maple Lawn Farm, Stonington, CT
  2982. Subject: menu (recipe database parser & maintainer)
  2983. Message-Id: <1992May19.113014.8093@mlfarm.com>
  2984. Sender: icon-group-request@cs.arizona.edu
  2985. To: icon-group@cs.arizona.edu
  2986. Status: R
  2987. Errors-To: icon-group-errors@cs.arizona.edu
  2988.  
  2989. The source code for the menu and nr programs are now available via
  2990. anonymous ftp from cs.arizona.edu, in directory /icon/contrib/menu.
  2991. The distribution includes the source for X-windows, Unix, and ms-dos
  2992. implementations, auxiliary files, and files from the Icon Program
  2993. Library which are used in building menu.
  2994.  
  2995. Menu and nr parse, display, and maintain a database of recipes.  The
  2996. programs are written in Icon.  If you do not have Icon for your
  2997. system, it is available via ftp from cs.arizona.edu, or on various
  2998. media from icon-project@cs.arizona.edu.
  2999. -- 
  3000.  
  3001.                 Ronald Florence
  3002.                 ron@mlfarm.com
  3003.  
  3004.  
  3005. From icon-group-sender  Wed May 20 11:18:20 1992
  3006. Received: by cheltenham.cs.arizona.edu; Wed, 20 May 92 14:10:42 MST
  3007. Date: Wed, 20 May 92 11:18:20 MST
  3008. From: "Ralph Griswold" <ralph>
  3009. Message-Id: <9205201818.AA26342@cheltenham.cs.arizona.edu>
  3010. To: icon-group
  3011. Subject: UNIX Executables for Version 8.6 of Icon
  3012. Status: R
  3013. Errors-To: icon-group-errors@cs.arizona.edu
  3014.  
  3015. Precompiled packages containing the Version 8.6 Icon interpreter and compiler
  3016. are now available via FTP for the following UNIX platforms:
  3017.  
  3018.     Convex C240
  3019.     DEC MIPS
  3020.     HP 9000/800
  3021.     Intel 386, System V, Release 4
  3022.     SGI Iris
  3023.     NeXT
  3024.     Sun 3
  3025.     Sun 4 (Sparc)
  3026.     Sequent Symmetry
  3027.  
  3028. In addition to the executable files, the libraries and other files needed
  3029. by the Icon compiler are included in the packages.
  3030.  
  3031. X facilities are enabled for most platforms.
  3032.  
  3033. To get a package, do an anonymous FTP to cs.arizona.edu and
  3034.  
  3035.     cd /icon/binaries/unix
  3036.  
  3037. The READ.ME there contains instructions for installing packages.  The
  3038. subdirectories identify the platforms for which packages are available. 
  3039.     
  3040.  
  3041. Ralph E. Griswold            ralph@cs.arizona.edu
  3042. Department of Computer Science          uunet!arizona!ralph
  3043. The University of Arizona        602-621-6609 (voice)
  3044. Tucson, AZ 85721            602-621-9618   (fax)
  3045.  
  3046.  
  3047. From icon-group-sender  Sat May 23 07:18:58 1992
  3048. Received: by cheltenham.cs.arizona.edu; Sat, 23 May 92 14:29:13 MST
  3049. Date: 21 May 92 16:10:12 GMT
  3050. From: wupost!cs.utexas.edu!utgpu!cunews!nrcnet0!furlong@gumby.wisc.edu
  3051. Organization: National Research Council of Canada
  3052. Subject: Icon for reading 16-bit bytes
  3053. Message-Id: <1992May21.161012.24026@nrcnet0.nrc.ca>
  3054. Sender: icon-group-request@cs.arizona.edu
  3055. To: icon-group@cs.arizona.edu
  3056. Status: R
  3057. Errors-To: icon-group-errors@cs.arizona.edu
  3058.  
  3059.  
  3060.  
  3061.    Does anyone know if it is possible to modify Icon so that byte size (when
  3062.    reading data is 16 bits, and not 8?  We are working on a project in which 
  3063.    we need to readinput files which may have various formatting done to them
  3064.    (i.e different fonts, type size, underlining, etc.) and it would be useful
  3065.    to be able to read this as part of a single character (i.e. one 16-bit byte)
  3066.    instead of an on/off "flag",as in "underlining starts here" <blah blah blah>
  3067.    "underlining ends here".
  3068.  
  3069.    If anyone has heard/done anything involving this kind of modification, 
  3070.    please respond by e-mail to the either of the following addresses:
  3071.  
  3072.     furlong@selaix.iit.nrc.ca
  3073.     furlong@iit.nrc.ca
  3074.  
  3075.    Thanks in advance, 
  3076.  
  3077.       Andrew Furlong
  3078.  
  3079.  
  3080.  
  3081.  
  3082. -- 
  3083. Andrew Furlong                   | The views expressed herein are mine alone,
  3084. Summer Research Assistant        | and may not reflect those of the National
  3085. furlong@selaix.iit.nrc.ca        | Research Council of Canada or the Government
  3086. National Research Council (NRCC) | of Canada.
  3087.  
  3088.  
  3089. From icon-group-sender  Sat May 23 19:50:42 1992
  3090. Received: by cheltenham.cs.arizona.edu; Sun, 24 May 92 06:06:03 MST
  3091. Date: 21 May 92 18:21:16 GMT
  3092. From: cis.ohio-state.edu!pacific.mps.ohio-state.edu!linac!uchinews!ellis!goer@ucbvax.berkeley.edu  (Richard L. Goerwitz)
  3093. Organization: University of Chicago Computing Organizations
  3094. Subject: Re: Icon for reading 16-bit bytes
  3095. Message-Id: <1992May21.182116.16103@midway.uchicago.edu>
  3096. References: <1992May21.161012.24026@nrcnet0.nrc.ca>
  3097. Sender: icon-group-request@cs.arizona.edu
  3098. To: icon-group@cs.arizona.edu
  3099. Status: R
  3100. Errors-To: icon-group-errors@cs.arizona.edu
  3101.  
  3102. furlong@selaix.iit.nrc.ca writes:
  3103. >
  3104. >   Does anyone know if it is possible to modify Icon so that byte size (when
  3105. >   reading data is 16 bits, and not 8?  We are working on a project in which 
  3106. >   we need to readinput files which may have various formatting done to them
  3107. >   (i.e different fonts, type size, underlining, etc.) and it would be useful
  3108. >   to be able to read this as part of a single character (i.e. one 16-bit byte)
  3109. >   instead of an on/off "flag",as in "underlining starts here" <blah blah blah>
  3110. >   "underlining ends here".
  3111.  
  3112. (BTW:  Isn't this how the standard curses libraries work?)
  3113.  
  3114. This is surely of general interest.  If anyone has modified Icon to support
  3115. long characters, please *post* as well.  The ANSI specs actually include a lot
  3116. of library functions for "long" characters, and 10646 and Unicode specify
  3117. 32 and 16-bit specs for international character assortments.  People have been
  3118. talking about long characters for a long time, and nothing so far has material-
  3119. ized.  Ken, Ralph, Clint, etc.:  How easy would it be to modify Icon to accept
  3120. alternate character sizes?
  3121.  
  3122. -- 
  3123.  
  3124.    -Richard L. Goerwitz              goer%ellis@uchicago.bitnet
  3125.    goer@ellis.uchicago.edu           rutgers!oddjob!ellis!goer
  3126.  
  3127.  
  3128. From icon-group-sender  Sun May 24 07:28:52 1992
  3129. Received: by cheltenham.cs.arizona.edu; Sun, 24 May 92 07:29:06 MST
  3130. Date: Sun, 24 May 92 07:28:52 MST
  3131. From: "Ralph Griswold" <ralph>
  3132. Message-Id: <9205241428.AA29946@cheltenham.cs.arizona.edu>
  3133. To: goer@midway.uchicago.EDU, icon-group
  3134. Subject: "large" characters
  3135. Status: R
  3136. Errors-To: icon-group-errors@cs.arizona.edu
  3137.  
  3138.  
  3139. We've thought off and on about extended character sets -- it's a "natural"
  3140. for a language like Icon.
  3141.  
  3142. There are design problems, but the real problems are in the implementation.
  3143. Since Icon has so many operations on strings, any changes to the handling
  3144. of characters would require massive changes in the implementation.
  3145.  
  3146. The plain fact is that we're unlikely to do anything along these lines.
  3147.     
  3148. Ralph E. Griswold            ralph@cs.arizona.edu
  3149. Department of Computer Science          uunet!arizona!ralph
  3150. The University of Arizona        602-621-6609 (voice)
  3151. Tucson, AZ 85721            602-621-9618   (fax)
  3152.  
  3153.  
  3154. From icon-group-sender  Sun May 24 11:47:55 1992
  3155. Received: by cheltenham.cs.arizona.edu; Sun, 24 May 92 15:47:49 MST
  3156. Date: Sun, 24 May 92 11:47:47 PDT
  3157. From: wgg@cs.ucsd.edu (William Griswold)
  3158. Message-Id: <9205241847.AA25923@gremlin.ucsd.edu>
  3159. To: icon-group@cs.arizona.edu
  3160. Subject: Re:  "large" characters
  3161. Status: R
  3162. Errors-To: icon-group-errors@cs.arizona.edu
  3163.  
  3164. Another approach to handling this problem is for the programmer to create
  3165. his/her own abstractions for long characters, defining long-character
  3166. operations that are analogous to the existing operations.  This would surely
  3167. be tedious to get started, but once done could be very useful.  Because
  3168. Icon does not have extendable operations (e.g., being able to overload or
  3169. redefine "?"), this would not be syntically pretty.
  3170.  
  3171.                         bill
  3172.  
  3173.  
  3174. From icon-group-sender  Sun May 24 13:07:22 1992
  3175. Received: by cheltenham.cs.arizona.edu; Sun, 24 May 92 15:47:58 MST
  3176. Date: 24 May 92 18:42:56 GMT
  3177. From: att!linac!uchinews!ellis!goer@ucbvax.berkeley.edu  (Richard L. Goerwitz)
  3178. Organization: University of Chicago Computing Organizations
  3179. Subject: Re: "large" characters
  3180. Message-Id: <1992May24.184256.1039@midway.uchicago.edu>
  3181. References: <9205241428.AA29946@cheltenham.cs.arizona.edu>
  3182. Sender: icon-group-request@cs.arizona.edu
  3183. To: icon-group@cs.arizona.edu
  3184. Status: R
  3185. Errors-To: icon-group-errors@cs.arizona.edu
  3186.  
  3187. ralph@CS.ARIZONA.EDU ("Ralph Griswold") writes:
  3188. >
  3189. >The plain fact is that we're unlikely to do anything along [the lines
  3190. >of 16-bit or greater character widths].
  3191.  
  3192. I've heard the word "never" many, many times from you and your tireless
  3193. staff, and later seen things nobody imagined would happen come to realiz-
  3194. ation.  Not that wide characters should necessarily be on the list; just
  3195. that some day there might be sufficient demand and intrinsic C library/
  3196. OS support that wide characters might seem a more natural thing than they
  3197. might seem now.  Right now, I admit that there's not much point, since
  3198. nobody really does anything standard with the upper 8 bits anyway.  ISO
  3199. 10646 and Unicode are still under development, and none of the vendors
  3200. has done anything more than to express a commitment for the long haul.
  3201.  
  3202. Just how ingrained is the 8-bit character in Icon, anyway?  Isn't it
  3203. more the assumption character width = byte width = unit returned by the
  3204. sizeof operator in C?  I read the implementation book cover to cover a
  3205. year ago, but some of the details have escaped me.  Could somebody (not
  3206. necessarily Ralph) perhaps refresh our collective memories on where the
  3207. implementation, as it stands, really has to have a specific character
  3208. size?
  3209.  
  3210. -- 
  3211.  
  3212.    -Richard L. Goerwitz              goer%ellis@uchicago.bitnet
  3213.    goer@ellis.uchicago.edu           rutgers!oddjob!ellis!goer
  3214.  
  3215.  
  3216. From icon-group-sender  Mon May 25 05:25:26 1992
  3217. Received: by cheltenham.cs.arizona.edu; Mon, 25 May 92 05:41:08 MST
  3218. Date: Mon, 25 May 1992 07:26 CST
  3219. From: Chris Tenaglia - 257-8765 <TENAGLIA@mis.mcw.edu>
  3220. Subject: Re: Icon for reading 16-bit bytes
  3221. To: cis.ohio-state.edu!pacific.mps.ohio-state.edu!linac!uchinews!ellis!goer@ucbvax.berkeley.edu
  3222. Cc: icon-group@cs.arizona.edu
  3223. Message-Id: <01GKF57CGJIO984PUJ@mis.mcw.edu>
  3224. X-Organization: Medical College of Wisconsin (Milwaukee, WI)
  3225. X-Vms-To: 
  3226.  IN%"cis.ohio-state.edu!pacific.mps.ohio-state.edu!linac!uchinews!ellis!goer@ucbvax.berkeley.edu"
  3227. X-Vms-Cc: IN%"icon-group@cs.arizona.edu"
  3228. Status: R
  3229. Errors-To: icon-group-errors@cs.arizona.edu
  3230.  
  3231. From:    IN%"cis.ohio-state.edu!pacific.mps.ohio-state.edu!linac!uchinews!ellis!goer@ucbvax.berkeley.edu" 24-MAY-1992 08:11:56.52
  3232. To:    IN%"icon-group@cs.arizona.edu"
  3233. Subj:    RE: Icon for reading 16-bit bytes
  3234.  
  3235. furlong@selaix.iit.nrc.ca writes:
  3236. >
  3237. >   Does anyone know if it is possible to modify Icon so that byte size (when
  3238. >   reading data is 16 bits, and not 8?  We are working on a project in which 
  3239. >   we need to readinput files which may have various formatting done to them
  3240. >   (i.e different fonts, type size, underlining, etc.) and it would be useful
  3241. >   to be able to read this as part of a single character (i.e. one 16-bit byte)
  3242. >   instead of an on/off "flag",as in "underlining starts here" <blah blah blah>
  3243. >   "underlining ends here".
  3244.  
  3245. I think this particular application is best handled as a separate case. It is
  3246. best done coding with extant icon rather than trying to force it thru a
  3247. reimplementation of the language.
  3248.  
  3249. There  is  something  called UNICODE which is a 16bit character set designed to
  3250. include  all the characters of most languages. The concept of having 256 copies
  3251. of  ascii  to  handle every imaginable permutation of video attributes and font
  3252. selection  is  not what UNICODE is about. In the case of video attributes, they
  3253. are done usually at the hardware level usually as a bit mask, and the roms in a
  3254. terminal  map  these  via  escape  sequences.  Fonts are actually another issue
  3255. altogether.  If there was an easy work around, I'm sure postscript would not be
  3256. where  it  is today. When UNICODE is widespread, it will probably be built into
  3257. the  operating system (wel it better be) and little or no reeingineering should
  3258. be  required.  Perhaps  edit  a few #DEFINEs and mass compile, and poof! 16 bit
  3259. byte icon.
  3260.  
  3261. Chris Tenaglia (System Manager) |  "The past explained,     
  3262. Medical College of Wisconsin    |   the future fortold, 
  3263. 8701 W. Watertown Plank Rd.     |   the present largely appologized for."
  3264. Milwaukee, WI 53226             |   Organon to The Doctor
  3265. (414)257-8765                   |     
  3266. tenaglia@mis.mcw.edu
  3267.  
  3268.  
  3269.  
  3270. From icon-group-sender  Mon May 25 05:36:44 1992
  3271. Received: by cheltenham.cs.arizona.edu; Mon, 25 May 92 05:41:27 MST
  3272. Date: Mon, 25 May 1992 07:37 CST
  3273. From: Chris Tenaglia - 257-8765 <TENAGLIA@mis.mcw.edu>
  3274. Subject: Holiday Offering
  3275. To: icon-group@cs.arizona.edu
  3276. Message-Id: <01GKF5LBRLEE984PUJ@mis.mcw.edu>
  3277. X-Organization: Medical College of Wisconsin (Milwaukee, WI)
  3278. X-Vms-To: IN%"icon-group@cs.arizona.edu"
  3279. Status: R
  3280. Errors-To: icon-group-errors@cs.arizona.edu
  3281.  
  3282.  
  3283. Bizaare Verse Generator:
  3284.  
  3285. This is another holiday, and I have a splash of code. It's not real pretty.
  3286. But it's fun to watch. I don't remember if I posted this one, but I'm sure
  3287. there are new subscribers who might get a kick out of it. This verse maker
  3288. was initially published in an early 1980s Byte magazine in TRS80 Basic. In
  3289. 1985 I translated it to BASICA, and in 1987 I translated it icon. Recently,
  3290. I've polished it to fetch the vocabulary all from one file. This message
  3291. contains the program. A subsequent message will contain a sample vocabulary
  3292. file. You'll notice that ! beginning a line designate a comment, and %xxx
  3293. designates the parts of speech to be loaded. There are 19 sentense patterns,
  3294. 4 title patterns, and 2 concluding patterns. Usage: iconx verse [vocab]
  3295. If you don't specify a vocabulary file it looks for verse.dat by default.
  3296.  
  3297. ###################################################################
  3298. #                                                                 #
  3299. # VERSE.ICN              1/9/92               BY CHRIS TENAGLIA   #
  3300. #                                                                 #
  3301. #              NOW ICON CAN GENERATE WIERD POETRY !               #
  3302. #                                                                 #
  3303. ###################################################################
  3304.  
  3305. global nouns,nounp,adjt,advb,more,most,ivpre,ivpas,tvpre,tvpas,prep
  3306. global being,art,ques,cond,nompro,punc,noun1,noun2,tv,iv,adjv,prpo
  3307. global be,pun,pron,con,ar,tnnum,tadjno,ttvnum,tprnum,cls,name,watch
  3308.  
  3309. procedure main(param)
  3310.  
  3311.   &random := map(&clock,":","0")      #randomize
  3312.   nouns := []                         #singular nouns
  3313.   nounp := []                         #plural nouns
  3314.   adjt  := []                         #adjectives
  3315.   advb  := []                         #adverbized
  3316.   more  := []                         #more adjective
  3317.   most  := []                         #most adjective
  3318.   tvpas := []                         #transitive verb past
  3319.   tvpre := []                         #transitive verb present
  3320.   ivpas := []                         #intransitive verb past
  3321.   ivpre := []                         #intransitive verb present
  3322.   prep  := []                         #prepositions
  3323.   punc  := []                         #punctuations
  3324.   art   := []                         #articles of speech
  3325.   ques  := []                         #question words
  3326.   being := []                         #being verbs
  3327.   cls   := "\e[H\e[2J"                #clear screen string (or system("clear"))
  3328.  
  3329. ##############################################################
  3330. #                                                            #
  3331. #                 load the vocabulary arrays                 #
  3332. #                                                            #
  3333. ##############################################################
  3334.  
  3335.   name := param[1]    | "verse.dat"
  3336.   (in  := open(name)) | stop("Can't open vocabulary file (",name,")")
  3337.   part := "?" ; watch := "?"
  3338.   write(cls,"VERSE : AI Mysterious Poetry Generator\n\nInitializing\n\n")
  3339.   while line := read(in) do
  3340.     {
  3341.     if match("%",line) then
  3342.       {
  3343.       part := map(trim(line[2:0]))
  3344.       write("Loading words of type ",part)
  3345.       next
  3346.       }
  3347.     tmp := parse(line,'|@#')
  3348.     case part of   
  3349.       {
  3350.       "noun" : {
  3351.                put(nouns,tmp[1])
  3352.                put(nounp,tmp[2])
  3353.                }
  3354.       "adjt" : {
  3355.                put(adjt,tmp[1])
  3356.                put(advb,tmp[2])
  3357.                put(more,tmp[3])
  3358.                put(most,tmp[4])
  3359.                }
  3360.       "ivrb" : {
  3361.                put(ivpre,tmp[1])
  3362.                put(ivpas,tmp[2])
  3363.                }
  3364.       "tvrb" : {
  3365.                put(tvpre,tmp[1])
  3366.                put(tvpas,tmp[2])
  3367.                }
  3368.       "prep" : put(prep,line)
  3369.       "been" : put(being,line)
  3370.       default: write("Such Language!")
  3371.       }
  3372.     loadrest()
  3373.     }
  3374.   close(in)
  3375. reply := ""
  3376. while map(reply) ~== "q" do
  3377.   {
  3378. #
  3379. #                         output the title
  3380. #
  3381.   (Out := open("a.out","w")) | stop ("can't open a.out for some reason!")
  3382.  
  3383.   t := ?7
  3384.   tnnum := ?*(nouns)                   #title noun selector
  3385.   tadjno:= ?*(adjt)                    #title adjective selector
  3386.   ttvnum:= ?*(tvpre)                   #title transitive verb selector
  3387.   tprnum:= ?*(prep)                    #title preposition selector
  3388.   
  3389.   clrvdu()
  3390.   write(title(t))
  3391.   write(Out,title(t))
  3392.   write()
  3393.   write(Out)
  3394.  
  3395. #
  3396. #                        output the lines
  3397. #
  3398.     every 1 to (12+?6) do
  3399.       {
  3400.       noun1 := ?*(nouns)
  3401.       noun2 := ?*(nouns)
  3402.       tv    := ?*(tvpre)
  3403.       iv    := ?*(ivpre)
  3404.       adjv  := ?*(adjt)
  3405.       prpo  := ?*(prep)
  3406.       be    := ?*(being)
  3407.       pun   := ?*(punc)
  3408.       pron  := ?*(nompro)
  3409.       con   := ?*(cond)
  3410.       ar    := ?*(art)
  3411.        
  3412.       case ?19 of
  3413.         {
  3414.         1 : {write(form1()) ; write(Out,form1())}
  3415.         2 : {write(form2()) ; write(Out,form2())}
  3416.         3 : {write(form3()) ; write(Out,form3())}
  3417.         4 : {write(form4()) ; write(Out,form4())}
  3418.         5 : {write(form5()) ; write(Out,form5())}
  3419.         6 : {write(form6()) ; write(Out,form6())}
  3420.         7 : {write(form7()) ; write(Out,form7())}
  3421.         8 : {write(form8()) ; write(Out,form8())}
  3422.         9 : {write(form9()) ; write(Out,form9())}
  3423.        10 : {write(form10()) ; write(Out,form10())}
  3424.        11 : {write(form11()) ; write(Out,form11())}
  3425.        12 : {write(form12()) ; write(Out,form12())}
  3426.        13 : {write(form13()) ; write(Out,form13())}
  3427.        14 : {write(form14()) ; write(Out,form14())}
  3428.        15 : {write(form15()) ; write(Out,form15())}
  3429.        16 : {write(form16()) ; write(Out,form16())}
  3430.        17 : {write(form17()) ; write(Out,form17())}
  3431.        18 : {write(form18()) ; write(Out,form18())}
  3432.        19 : {write(form19()) ; write(Out,form19())}
  3433.         }   
  3434.     }
  3435. # last line
  3436.   case ?2 of
  3437.     {
  3438.     1 : {
  3439.         write(nounp[tnnum]," ",prep[prpo]," THE ",nouns[noun1],
  3440.         " ",being[be]," ",adjt[tadjno],".")
  3441.         write(Out,nounp[tnnum]," ",prep[prpo]," THE ",nouns[noun1],
  3442.         " ",being[be]," ",adjt[tadjno],".")
  3443.         }
  3444.     2 : {
  3445.         write("THE ",nounp[tnnum]," OR ",nouns[noun1]," ",
  3446.         adjt[adjv]," ",being[be],".")
  3447.         write(Out,"THE ",nounp[tnnum]," OR ",nouns[noun1]," ",
  3448.         adjt[adjv]," ",being[be],".")
  3449.         }
  3450.     }      
  3451.     close(Out)
  3452.  
  3453.     write()
  3454.     writes("Press <RET> for another, Q to quit, or a name to save it>")
  3455.     reply := read()
  3456.     if (reply ~== "Q") & (trim(reply) ~== "") then
  3457.       {
  3458.       (In := open("a.out")) | stop ("can't open a.out for some reason!")
  3459.       (Out := open(reply,"w")) | stop ("can't open ",reply)
  3460.       while write(Out,read(In))
  3461.       close(In) ; close(Out)
  3462.       }
  3463.   }
  3464.   end
  3465.  
  3466. #######################################################################
  3467.  
  3468. procedure aoran(word)
  3469.   vowels := 'AEIOU'
  3470.   if any(vowels,word) then return ("AN " || word)
  3471.                       else return ("A "  || word)
  3472. end
  3473.  
  3474. #######################################################################
  3475.  
  3476. procedure clrvdu()
  3477.   writes(cls)
  3478. end
  3479.  
  3480. #######################################################################
  3481.  
  3482. procedure gerund(word)
  3483.   static vowel
  3484.   initial vowel := 'AEIOU'
  3485.   if word[-1] == "E" then word[-1] := ""
  3486.   return(word || "ING")
  3487. end
  3488.  
  3489. ######################################################################
  3490.  
  3491. procedure title(a)
  3492.  
  3493.     local text
  3494.  
  3495.     case a of
  3496.       {               
  3497.       1 : text := aoran(adjt[tadjno]) || " " || nouns[tnnum]
  3498.       2 : text := "TO " || tvpre[ttvnum] || " SOME " || nouns[tnnum]
  3499.       3 : text := prep[tprnum] || " " || nounp[tnnum]
  3500.       4 : text := "THE " || nouns[tnnum]
  3501.       5 : text := prep[tprnum] || " " || aoran(nouns[tnnum]) || " " || advb[tadjno]
  3502.       6 : text := "THE " || more[tadjno] || " " || nouns[tnnum]
  3503.       7 : text := "THE " || most[tadjno] || " " || nouns[tnnum]
  3504.       }
  3505.     return(text)
  3506. end
  3507.  
  3508. #######################################################################
  3509.  
  3510. procedure form1()
  3511.   local text,n
  3512.   n := 1
  3513.   if watch=="true" then prefix := "(" || n || ") " else prefix := ""
  3514.   text := prefix || nounp[noun1] || " " || tvpre[tv] || " THE "
  3515.   text ||:= more[adjv] || " " || nouns[noun2] || punc[pun]
  3516.   return(text)
  3517. end
  3518.  
  3519. procedure form2()
  3520.   local text,n
  3521.   n := 2
  3522.   if watch=="true" then prefix := "(" || n || ") " else prefix := ""
  3523.   text := prefix || nounp[noun1] || " " || tvpre[tv] || " THE "
  3524.   text ||:= most[adjv] || " " || nouns[noun2] || punc[pun]
  3525.   return(text)
  3526. end
  3527.  
  3528. procedure form3()
  3529.   local text,n
  3530.   n := 3
  3531.   if watch=="true" then prefix := "(" || n || ") " else prefix := ""
  3532.   text := prefix || adjt[adjv] || " " || nounp[noun1] || " " || being[be]
  3533.   text ||:= " " || gerund(ivpre[iv]) || " " || punc[pun]
  3534.   return(text)
  3535. end  
  3536.  
  3537. procedure form4()
  3538.   local text,n
  3539.   n := 4
  3540.   if watch=="true" then prefix := "(" || n || ") " else prefix := ""
  3541.   text := prefix || adjt[adjv] || " " || nounp[noun1] || " " || ivpre[iv]
  3542.   text ||:= " " || punc[pun]
  3543.   return(text)
  3544. end
  3545.  
  3546. procedure form5()
  3547.   local text,n
  3548.   n := 5
  3549.   if watch=="true" then prefix := "(" || n || ") " else prefix := ""
  3550.   text := prefix || ques[?*ques] || " " || adjt[adjv] || " "
  3551.   text ||:= nounp[noun1] || " " || ivpre[iv] || "?"
  3552.   return(text)
  3553. end
  3554.  
  3555. procedure form6()
  3556.   local text,n
  3557.   n := 6
  3558.   if watch=="true" then prefix := "(" || n || ") " else prefix := ""
  3559.   text := prefix || art[ar] || " " || adjt[adjv] || " " || nouns[noun1]
  3560.   text ||:= " " || tvpas[tv] || " THE " || nouns[noun2] || punc[pun]
  3561.   return(text)
  3562. end
  3563.  
  3564. procedure form7()
  3565.   local text,n
  3566.   n := 7
  3567.   if watch=="true" then prefix := "(" || n || ") " else prefix := ""
  3568.   text := prefix || "THE " || nounp[tnnum] || " " || ivpas[iv]
  3569.   text ||:= " " || prep[prpo] || " THE " || more[tadjno] || " "
  3570.   text ||:= nounp[noun1] || " " || punc[pun]
  3571.   return(text)
  3572. end
  3573.  
  3574. procedure form8()
  3575.   local text,n
  3576.   n := 8
  3577.   if watch=="true" then prefix := "(" || n || ") " else prefix := ""
  3578.   text := prefix || "THE " || nounp[tnnum] || " " || ivpas[iv] || " " 
  3579.   text ||:= prep[prpo] || " THE " || most[tadjno] || " " || nounp[noun1]
  3580.   text ||:= " " || punc[pun]
  3581.   return(text)
  3582. end
  3583.  
  3584. procedure form9()
  3585.   local text,n
  3586.   n := 9
  3587.   if watch=="true" then prefix := "(" || n || ") " else prefix := ""
  3588.   text := prefix || ques[?*ques] || " " || nounp[tnnum] || " " || ivpre[iv]
  3589.   text ||:= " " || prep[prpo] || " " || aoran(adjt[adjv]) || " "
  3590.   text ||:= nouns[noun2] || "?"
  3591.   return(text)
  3592. end
  3593.  
  3594. procedure form10()
  3595.   local text,n
  3596.   n := 10
  3597.   if watch=="true" then prefix := "(" || n || ") " else prefix := ""
  3598.   text := prefix || nounp[noun1] || " " || ivpre[iv] || " " || advb[adjv]
  3599.   text ||:= " " || prep[prpo] || " " || nompro[pron] || punc[pun]
  3600.   return(text)
  3601. end
  3602.  
  3603. procedure form11()
  3604.   local text,n
  3605.   n := 11
  3606.   if watch=="true" then prefix := "(" || n || ") " else prefix := ""
  3607.   text := prefix || adjt[adjv] || " " || nounp[noun1] || " " || being[be]
  3608.   text ||:= " " || adjt[tadjno] || " " || cond[con]
  3609.   return(text)
  3610. end
  3611.  
  3612. procedure form12()
  3613.   local text,n
  3614.   n := 12
  3615.   if watch=="true" then prefix := "(" || n || ") " else prefix := ""
  3616.   text := prefix || art[ar] || " " || nouns[noun1] || " " || ivpas[iv]
  3617.   text ||:= " " || advb[adjv] || punc[pun]
  3618.   return(text)
  3619. end
  3620.  
  3621. procedure form13()
  3622.   local text,n
  3623.   n := 13
  3624.   if watch=="true" then prefix := "(" || n || ") " else prefix := ""
  3625.   text := prefix || cond[con] || " " || nounp[noun1] || " " || being[be]
  3626.   text ||:= " " || gerund(tvpre[ttvnum]) || " " || prep[prpo] || " "
  3627.   text ||:= gerund(ivpre[iv]) || " " || nounp[noun2] || punc[pun]
  3628.   return(text)
  3629. end
  3630.  
  3631. procedure form14()
  3632.   local text,n
  3633.   n := 14
  3634.   if watch=="true" then prefix := "(" || n || ") " else prefix := ""
  3635.   text := prefix || art[ar] || " " || adjt[adjv] || " " || gerund(tvpre[tv])
  3636.   text ||:= " OF THE " || nouns[tnnum] || " AND " || nouns[noun1] || punc[pun]
  3637.   return(text)
  3638. end
  3639.  
  3640. procedure form15()
  3641.   local text,n
  3642.   n := 15
  3643.   if watch=="true" then prefix := "(" || n || ") " else prefix := ""
  3644.   text := prefix || gerund(tvpre[ttvnum]) || " " || nouns[noun1]
  3645.   text ||:= " AND " || nouns[noun2]
  3646.   return(text)
  3647. end
  3648.  
  3649. procedure form16()
  3650.   local text,n
  3651.   n := 16
  3652.   if watch=="true" then prefix := "(" || n || ") " else prefix := ""
  3653.   text := prefix || "THE " || nounp[tnnum] || " " || ivpre[iv] || punc[pun]
  3654.   return(text)
  3655. end
  3656.  
  3657. procedure form17()
  3658.   local text,n
  3659.   n := 17
  3660.   if watch=="true" then prefix := "(" || n || ") " else prefix := ""
  3661.   text := prefix || nompro[pron] || " " || tvpas[ttvnum] || " THE "
  3662.   text ||:= adjt[adjv] || " " || nouns[noun1] || punc[pun]
  3663.   return(text)
  3664. end
  3665.  
  3666. procedure form18()
  3667.   local text,n
  3668.   n := 18
  3669.   if watch=="true" then prefix := "(" || n || ") " else prefix := ""
  3670.   text := prefix || adjt[adjv] || " " || nounp[noun2] || " " || being[be]
  3671.   text ||:= " " || nounp[noun1] || punc[pun]
  3672.   return(text)
  3673. end
  3674.  
  3675. procedure form19()
  3676.   local text,n
  3677.   n := 19
  3678.   if watch=="true" then prefix := "(" || n || ") " else prefix := ""
  3679.   text := prefix || "THE " || nounp[tnnum] || "'S " || nounp[noun1] || " "
  3680.   text ||:= adjt[adjv] || " " || being[be] || punc[pun]
  3681.   return(text)
  3682. end
  3683.  
  3684. ###################################################################
  3685.        
  3686. procedure parse(line,delims)  
  3687.   static chars
  3688.   chars  := &cset -- delims
  3689.   tokens := []
  3690.   line ? while tab(upto(chars)) do put(tokens,tab(many(chars)))
  3691.   return tokens
  3692.   end
  3693.  
  3694. procedure loadrest()
  3695.   art   := ["ITS" , "THIS" , "SOME", "ANY" , "ONE" , "THAT" ,
  3696.             "ITS" , "MY" , "YOUR" , "OUR"]
  3697.  
  3698.   ques  := ["WHY DO" , "WHEN DO" , "WHERE DO" , "HOW DO" , "CANNOT" ,
  3699.             "HOW COME" , "WHY DON'T"]
  3700.  
  3701.   nompro := ["SOMETHING" , "ANYTHING" , "IT" , "THAT" , "ONE" , "YOU" , "THIS"]
  3702.           
  3703.   cond  := ["SINCE" , "BECAUSE" , "UNTIL" , "IF" , "THEN" , "OR" ,
  3704.             "UNLESS" , "THEREFORE" , "AND THEN" , "OR ELSE" , "ELSE IF"]
  3705.  
  3706.   punc  := ["." , "," , "?" , "!" , "," , "-" , ";"]
  3707. end
  3708.  
  3709.  
  3710.  
  3711.  
  3712. From icon-group-sender  Mon May 25 05:40:09 1992
  3713. Received: by cheltenham.cs.arizona.edu; Mon, 25 May 92 05:41:38 MST
  3714. Date: Mon, 25 May 1992 07:41 CST
  3715. From: Chris Tenaglia - 257-8765 <TENAGLIA@mis.mcw.edu>
  3716. Subject: Holiday Offering
  3717. To: icon-group@cs.arizona.edu
  3718. Message-Id: <01GKF5PLTI6I984PUJ@mis.mcw.edu>
  3719. X-Organization: Medical College of Wisconsin (Milwaukee, WI)
  3720. X-Vms-To: IN%"icon-group@cs.arizona.edu"
  3721. Status: R
  3722. Errors-To: icon-group-errors@cs.arizona.edu
  3723.  
  3724. Here is a sample vocabulary file. I choose computer and science related stuff
  3725. which seems to fit together well. I've tried farming and agriculture, but it
  3726. got pretty gross. Great stuff for talk.bizaare! Happy holidays!
  3727.  
  3728. Chris Tenaglia (System Manager) |  "The past explained,     
  3729. Medical College of Wisconsin    |   the future fortold, 
  3730. 8701 W. Watertown Plank Rd.     |   the present largely appologized for."
  3731. Milwaukee, WI 53226             |   Organon to The Doctor
  3732. (414)257-8765                   |     
  3733. tenaglia@mis.mcw.edu
  3734.  
  3735. !
  3736. ! This is the vocabulary of the AI verse generator. Its filename is passed
  3737. ! as a parameter. This should run under VMS, Unix, and MS-DOS. Lines until
  3738. ! the %noun line are ignored and will generate 'Such Language!' messages
  3739. ! when the program is run.
  3740. !
  3741. %noun
  3742. ABEND|ABENDS
  3743. ABUSE|ABUSES
  3744. ACCEPTANCE|ACCEPTANCES
  3745. ACCOUNT|ACCOUNTS
  3746. ACTION|ACTIONS
  3747. ADDRESS|ADDRESSES
  3748. ALGORITHM|ALGORITHMS
  3749. AMAZEMENT|AMAZEMENTS
  3750. ANOMALY|ANOMALIES
  3751. ANSWER|ANSWERS
  3752. APPLICATION|APPLICATIONS
  3753. ARGUMENT|ARGUMENTS
  3754. ARITHMETIC|ARITHMETICS
  3755. ASSEMBLER|ASSEMBLERS
  3756. ASSEMBLY|ASSEMBLIES
  3757. BASE|BASES
  3758. BASIC|BASICS
  3759. BATCH|BATCHES
  3760. BAUD RATE|BAUD RATES
  3761. BENCHMARK|BENCHMARKS
  3762. BIT|BITS
  3763. BIT BUCKET|BIT BUCKETS
  3764. BLANK|BLANKS
  3765. BLOCK|BLOCKS
  3766. BOOK|BOOKS
  3767. BREAKPOINT|BREAKPOINTS
  3768. BUFFER|BUFFERS
  3769. BUG|BUGS
  3770. BYTE|BYTES
  3771. CALENDER|CALENDERS
  3772. CAPACITY|CAPACITIES
  3773. CATALOG|CATALOGS
  3774. CAUSE|CAUSES
  3775. CHAMBER|CHAMBERS
  3776. CHANGE|CHANGES
  3777. CHARACTER|CHARACTERS
  3778. CHECK|CHECKS
  3779. CLASS|CLASSES
  3780. CHIP|CHIPS
  3781. CIRCUIT|CIRCUITS
  3782. CIRCUIT CARD|CIRCUIT CARDS
  3783. CIRCUIT CHIP|CIRCUIT CHIPS
  3784. CLUSTER|CLUSTERS
  3785. CODE|CODES
  3786. COMMAND|COMMANDS
  3787. COMPILER|COMPILERS
  3788. COMPONENT|COMPONENTS
  3789. COMPUTER|COMPUTERS
  3790. CONCEPT|CONCEPTS
  3791. CONDITION|CONDITIONS
  3792. CONFUSION|CONFUSIONS
  3793. CONNECTION|CONNECTIONS
  3794. CONTROL|CONTROLS
  3795. CONVERSION|CONVERSIONS
  3796. COPROCESSOR|COPROCESSORS
  3797. COPY|COPIES
  3798. CRASH|CRASHES
  3799. CUBE|CUBES
  3800. CURSOR|CURSORS
  3801. CYCLE TIME|CYCLE TIMES
  3802. DATA|DATA
  3803. DATA|SET DATA SETS
  3804. DATABASE|DATABASES
  3805. DEFECT|DEFECTS
  3806. DEFINITION|DEFINITIONS
  3807. DELETION|DELETIONS
  3808. DERIVATIVE|DERIVATIVES
  3809. DESCRIPTION|DESCRIPTIONS
  3810. DESIGN|DESIGNS
  3811. DEVELOPEMENT|DEVELOPEMENTS
  3812. DEVICE|DEVICES
  3813. DIAGRAM|DIAGRAMS
  3814. DIGIT|DIGITS
  3815. DIRECTORY|DIRECTORIES
  3816. DISK|DISKS
  3817. DISPLAY|DISPLAYS
  3818. DIVISION|DIVISIONS
  3819. DOCUMENT|DOCUMENTS
  3820. DOCUMENTATION|DOCUMENTATIONS
  3821. DOMAIN|DOMAINS
  3822. DRAWING|DRAWINGS
  3823. DRIVER|DRIVERS
  3824. EFFECT|EFFECTS
  3825. ELEMENT|ELEMENTS
  3826. EMPTY SET|EMPTY SETS
  3827. ENGINE|ENGINES
  3828. ENGINEER|ENGINEERS
  3829. ENTROPY|ENTROPIES
  3830. ENTRY|ENTRIES
  3831. ENTRYPOINT|ENTRYPOINTS
  3832. ENVIRONMENT|ENVIRONMENTS
  3833. EQUATION|EQUATIONS
  3834. ERROR|ERRORS
  3835. ESCAPE|ESCAPES
  3836. EUPHEMISM|EUPHEMISMS
  3837. EXAMPLE|EXAMPLES
  3838. EXPONENT|EXPONENTS
  3839. FACT|FACTS
  3840. FAILURE|FAILURES
  3841. FANTASY|FANTASIES
  3842. FAX|FAXES
  3843. FEATURE|FEATURES
  3844. FIELD|FIELDS
  3845. FILE|FILES
  3846. FIRMWARE|FIRMWARES
  3847. FLAG|FLAGS
  3848. FLOPPY|FLOPPIES
  3849. FORM|FORMS
  3850. FORMAT|FORMATS
  3851. FROTH|FROTHS
  3852. FUNCTION|FUNCTIONS
  3853. GAME|GAMES
  3854. GENERATOR|GENERATORS
  3855. GLITSCH|GLITSCHES
  3856. GRAPH|GRAPHS
  3857. HACKER|HACKERS
  3858. HARDWARE|HARDWARES
  3859. HASH|HASHES
  3860. HEXIDECIMAL|HEXIDECIMALS
  3861. HOLLERITH CARD|HOLLERITH CARDS
  3862. HYPERCUBE|HYPERCUBES
  3863. IDIOT|IDIOTS
  3864. IMAGE|IMAGES
  3865. IMPLEMENTATION|IMPLEMENTATIONS
  3866. INDEX|INDICES
  3867. INDIVIDUAL|INDIVIDUALS
  3868. INFORMATION|INFORMATIONS
  3869. INITIALIZATION|INITIALIZATIONS
  3870. INHERITANCE|INHERITANCES
  3871. INPUT|INPUTS
  3872. INQUIRY|INQUIRIES
  3873. INSERTION|INSERTIONS
  3874. INSTALLATION|INSTALLATIONS
  3875. INSTRUCTION|INSTRUCTIONS
  3876. INTEGER|INTEGERS
  3877. INTEGRAL|INTEGRALS
  3878. INTEGRATED CIRCUIT|INTEGRATED CIRCUITS
  3879. INTELLECT|INTELLECTS
  3880. INTERFACE|INTERFACES
  3881. INTERPRETER|INTERPRETERS
  3882. INTERRUPT|INTERRUPTS
  3883. INTERVAL|INTERVALS
  3884. INTRODUCTION|INTRODUCTIONS
  3885. INVENTOR|INVENTORS
  3886. ITEM|ITEMS
  3887. ITERATION|ITERATIONS
  3888. JOB|JOBS
  3889. JOBSTREAM|JOBSTREAMS
  3890. JOYSTICK|JOYSTICKS
  3891. KEYPAD|KEYPADS
  3892. KEYWORD|KEYWORDS
  3893. KLOOJE|KLOOJES
  3894. KRUFT|KRUFTS
  3895. LABEL|LABELS
  3896. LABORATORY|LABORATORIES
  3897. LANGUAGE|LANGUAGES
  3898. LIBRARY|LIBRARIES
  3899. LINKAGE|LINKAGES
  3900. LINKER|LINKERS
  3901. LIQUID|LIQUIDS
  3902. LIST|LISTS
  3903. LOAD|LOADS
  3904. LOGIC|LOGICS
  3905. LOOP|LOOPS
  3906. MACHINE|MACHINES
  3907. MAINFRAME|MAINFRAMES
  3908. MANUAL|MANUALS
  3909. MEMBER|MEMBERS
  3910. MEMORY|MEMORIES
  3911. MENU|MENUS
  3912. MERGE|MERGES
  3913. MESSAGE|MESSAGES
  3914. METHOD|METHODS
  3915. MICROPROCESSOR|MICROPROCESSORS
  3916. MODE|MODES
  3917. MODEL|MODELS
  3918. MODEM|MODEMS
  3919. MODIFICATION|MODIFICATIONS
  3920. MODULE|MODULES
  3921. MONITOR|MONITORS
  3922. MOTHERBOARD|MOTHERBOARDS
  3923. MOVE|MOVES
  3924. MUTANT|MUTANTS
  3925. NAND|GATE NAND GATES
  3926. NETWORK|NETWORKS
  3927. NO-OP|NO-OPS
  3928. NODE|NODES
  3929. NONSENSE|NONSENSES
  3930. NULL DEVICE|NULL DEVICES
  3931. NUMBER|NUMBERS
  3932. NUMBER CRUNCHER|NUMBER CRUNCHERS
  3933. OBJECT|OBJECTS
  3934. OCCURENCE|OCCURENCES
  3935. OPERAND|OPERANDS
  3936. OPERATING SYSTEM|OPERATING SYSTEMS
  3937. OPERATION|OPERATIONS
  3938. OPTION|OPTIONS
  3939. ORDER|ORDERS
  3940. OUTPUT|OUTPUTS
  3941. PACKAGE|PACKAGES
  3942. PAGE|PAGES
  3943. PARADIGM|PARADIGMS
  3944. PARAMETER|PARAMETERS
  3945. PARITY BIT|PARITY BITS
  3946. PART NUMBER|PART NUMBERS
  3947. PARTITION|PARTITIONS
  3948. PARTNER|PARTNERS
  3949. PASSWORD|PASSWORDS
  3950. PATCH|PATCHES
  3951. PATH|PATHS
  3952. PERSON|PERSONS
  3953. POINT|POINTS
  3954. POINTER|POINTERS
  3955. PREFERENCE|PREFERENCES
  3956. PRICE|PRICES
  3957. PRINTER|PRINTERS
  3958. PRINTOUT|PRINTOUTS
  3959. PROCEDURE|PROCEDURES
  3960. PROCESS|PROCESSES
  3961. PRODUCT|PRODUCTS
  3962. PROFESSOR|PROFESSORS
  3963. PROGRAM|PROGRAMS
  3964. PROGRAMMER|PROGRAMMERS
  3965. PROJECT|PROJECTS
  3966. PURGE|PURGES
  3967. QUALITY|QUALITIES
  3968. QUANTITY|QUANTITIES
  3969. QUERY|QUERIES
  3970. QUESTION|QUESTIONS
  3971. QUOTE|QUOTES
  3972. RAM|DUMP RAM DUMPS
  3973. RANDOM NUMBER|RANDOM NUMBERS
  3974. RATIO|RATIOS
  3975. REALITY|REALITIES
  3976. REASON|REASONS
  3977. RECORD|RECORDS
  3978. REFERENCE|REFERENCES
  3979. REFLECTION|REFLECTIONS
  3980. REFUSAL|REFUSALS
  3981. REGION|REGIONS
  3982. REGISTER|REGISTERS
  3983. REPLENISHMENT|REPLENISHMENTS
  3984. REQUIREMENT|REQUIREMENTS
  3985. ROBOT|ROBOTS
  3986. ROUTINE|ROUTINES
  3987. SAMPLE|SAMPLES
  3988. SCHEMA|SCHEMAS
  3989. SCIENCE|SCIENCES
  3990. SEARCH|SEARCHES
  3991. SECTION|SECTIONS
  3992. SELECTION|SELECTIONS
  3993. SELF|SELFS
  3994. SEQUENCE|SEQUENCES
  3995. SHOW|SHOWS
  3996. SITUATION|SITUATIONS
  3997. SIZE|SIZES
  3998. SOCKET|SOCKETS
  3999. SOFTWARE|SOFTWARES
  4000. SOLUTION|SOLUTIONS
  4001. SORT|SORTS
  4002. SPACE|SPACES
  4003. SPARK|SPARKS
  4004. SPECTRUM|SPECTRUMS
  4005. SPHERE|SPHERES
  4006. SPREAD SHEET|SPREAD SHEETS
  4007. STANDARD|STANDARDS
  4008. STATUS|STATUSES
  4009. STEP|STEPS
  4010. STORAGE|STORAGES
  4011. STRUCTURE|STRUCTURES
  4012. SUBJECT|SUBJECTS
  4013. SUBSCHEMA|SUBSCHEMAS
  4014. SUBSECTION|SUBSECTIONS
  4015. SUBSTITUTE|SUBSTITUTES
  4016. SUPER COMPUTER|SUPER COMPUTERS
  4017. SURPRISE|SURPRISES
  4018. SWITCH|SWITCHES
  4019. SYMBOL|SYMBOLS
  4020. SYNTAX ERROR|SYNTAX ERRORS
  4021. SYSTEM|SYSTEMS
  4022. TABLE|TABLES
  4023. TECHNICIAN|TECHNICIANS
  4024. TESSARECT|TESSARECTS
  4025. TEST|TESTS
  4026. THOUGHT|THOUGHTS
  4027. TIME|TIMES
  4028. TOOL|TOOLS
  4029. TRACE|TRACES
  4030. TRANSACTION|TRANSACTIONS
  4031. TRANSFER|TRANSFERS
  4032. TREE|TREES
  4033. TRIANGLE|TRIANGLES
  4034. TWOS-COMPLEMENT|TWOS-COMPLEMENTS
  4035. UNIT|UNITS
  4036. UPDATE|UPDATES
  4037. USAGE|USAGES
  4038. USER|USERS
  4039. UTILITY|UTILITIES
  4040. VACUUM|VACUUMS
  4041. VALUE|VALUES
  4042. VARIABLE|VARIABLES
  4043. VECTOR|VECTORS
  4044. VERSION|VERSIONS
  4045. VIOLATION|VIOLATIONS
  4046. VOLUME|VOLUMES
  4047. WARRANTY|WARRANTIES
  4048. WORD|WORDS
  4049. WORD PROCESSOR|WORD PROCESSORS
  4050. WORK|WORKS
  4051. %adjt
  4052. ABRASIVE|ABRASIVELY@MORE ABRASIVE#MOST ABRASIVE
  4053. ABSURD|ABSURDLY@ABSURDER#ABSURDEST
  4054. ACTIVE|ACTIVELY@MORE ACTIVE#MOST ACTIVE
  4055. ALARMING|ALARMINGLY@MORE ALARMING#MOST ALARMING
  4056. ALERT|ALERTLY@MORE ALERT#MOST ALERT
  4057. AMORPHOUS|AMORPHOUSLY@MORE AMORPHOUS#MOST AMORPHOUS
  4058. APATHETIC|APATHETICALLY@MORE APATHETIC#MOST APATHETIC
  4059. ASTONISHING|ASTONISHINGLY@MORE ASTONISHING#MOST ASTONISHING
  4060. AUTOMATIC|AUTOMATICALLY@MORE AUTOMATIC#MOST AUTOMATIC
  4061. AVERAGE|AVERAGELY@MORE AVERAGE#MOST AVERAGE
  4062. BAD|BADLY@BADDER#BADDEST
  4063. BASIC|BASICALLY@MORE BASIC#MOST BASIC
  4064. BEAUTIFUL|BEAUTIFULLY@MORE BEAUTIFUL#MOST BEAUTIFUL
  4065. BERZERK|BERZERKLY@BERZERKER#BERZERKEST
  4066. BIZAAR|BIZAARLY@BIZAARER#BIZAAREST
  4067. BLETCHEROUS|BLETCHEROUSLY@MORE BLETCHEROUS#MOST BLETCHEROUS
  4068. BLIND|BLINDLY@BLINDER#BLINDEST
  4069. BLINKING|BLINKINGLY@MORE BLINKING#MOST BLINKING
  4070. BOGUS|BOGUSLY@MORE BOGUS#MOST BOGUS
  4071. BOLD|BOLDLY@BOLDER#BOLDEST
  4072. BORING|BORINGLY@MORE BORING#MOST BORING
  4073. BRAVE|BRAVELY@BRAVER#BRAVEST
  4074. CAUSTIC|CAUSTICALLY@MORE CAUSTIC#MOST CAUSTIC
  4075. CHEAP|CHEAPLY@CHEAPER#CHEAPEST
  4076. COLD|COLDLY@COLDER#COLDEST
  4077. COBOL|COBOL LIKE|MORE COBOL LIKE|MOSTLY COBOL
  4078. CONCISE|CONCISELY@CONCISER#CONCISEST
  4079. CONSIDERATE|CONSIDERATELY@MORE CONSIDERATE#MOST CONSIDERATE
  4080. CONVOLUTED|CONVOLUTEDLY@MORE CONVOLUTED#MOST CONVOLUTED
  4081. CORRECT|CORRECTLY@MORE CORRECT#MOST CORRECT
  4082. COURTEOUS|COURTEOUSLY@MORE COURTEOUS#MOST COURTEOUS
  4083. CREATIVE|CREATIVELY@MORE CREATIVE#MOST CREATIVE
  4084. DEAR|DEARLY@DEARER#DEAREST
  4085. DEEP|DEEPLY@DEEPER#DEEPEST
  4086. DEFECTIVE|DEFECTIVELY@MORE DEFECTIVE#MOST DEFECTIVE
  4087. DELIGHTFUL|DELIGHTFULLY@MORE DELIGHTFUL#MOST DELIGHTFUL
  4088. DEPLETED|DEPLETEDLY@MORE DEPLETED#MOST DEPLETED
  4089. DESTRUCTIVE|DESTRUCTIVELY@MORE DESTRUCTIVE#MOST DESTRUCTIVE
  4090. DETACHED|DETACHEDLY|MORE DETACHED|MOST DETACHED
  4091. DEVOUT|DEVOUTLY@DEVOUTER#DEVOUTEST
  4092. DIFFERENT|DIFFERENTLY@MORE DIFFERENT#MOST DIFFERENT
  4093. DIFFUSE|DIFFUSELY@MORE DIFFUSE#MOST DIFFUSE
  4094. DISPOSABLE|DISPOSABLY@MORE DISPOSABLE#MOST DISPOSABLE
  4095. DISTANT|DISTANTLY@MORE DISTANT#MOST DISTANT
  4096. DROWSY|DROWSILY@DROWSIER#DROWSIEST
  4097. DRY|DRYLY@DRIER#DRIEST
  4098. DUMB|DUMBLY@DUMBER#DUMBEST
  4099. DUSTY|DUSTILY@DUSTIER#DUSTIEST
  4100. EASY|EASILY@EASIER#EASIEST
  4101. EDUCATED|EDUCATEDLY@MORE EDUCATED#MOST EDUCATED
  4102. ELECTRIC|ELECTRICALLY@MORE ELECTRIC#MOST ELECTRIC
  4103. ENERGETIC|ENERGETICALLY@MORE ENERGETIC#MOST ENERGETIC
  4104. EVEN|EVENLY@MORE EVEN#MOST EVEN
  4105. EVIL|EVILY@MORE EVIL#MOST EVIL
  4106. EXCITABLE|EXCITABLY@MORE EXCITABLE#MOST EXCITABLE
  4107. EXUBERANT|EXUBERANTLY@MORE EXUBERANT#MOST EXUBERANT
  4108. FAIR|FAIRLY@FAIRER#FAIREST
  4109. FANTASTIC|FANTASTICALLY@MORE FANTASTIC#MOST FANTASTIC
  4110. FEARFUL|FEARFULLY@MORE FEARFUL#MOST FEARFUL
  4111. FLEXIBLE|FLEXIBLY@MORE FLEXIBLE#MOST FLEXIBLE
  4112. FLUID|FLUIDLY@MORE FLUID#MOST FLUID
  4113. FOAMING|FOAMINGLY@MORE FOAMING#MOST FOAMING
  4114. FOOLISH|FOOLISHLY@MORE FOOLISH#MOST FOOLISH
  4115. FORBIDDING|FORBIDDINGLY@MORE FORBIDDING#MOST FORBIDDING
  4116. FREEZING|FREEZINGLY@MORE FREEZING#MOST FREEZING
  4117. FRESH|FRESHLY@FRESHER#FRESHEST
  4118. FROTHING|FROTHINGLY@MORE FROTHING#MOST FROTHING
  4119. FUNNY|FUNNY@FUNNIER#FUNNIEST
  4120. FUZZY|FUZZILY@FUZZIER#FUZZIEST
  4121. GENERAL|GENERALLY@MORE GENERAL#MOST GENERAL
  4122. GLORIOUS|GLORIOUSLY@MORE GLORIOUS#MOST GLORIOUS
  4123. GLOWING|GLOWINGLY@MORE GLOWING#MOST GLOWING
  4124. GRAND|GRANDLY@GRANDER#GRANDEST
  4125. GREESY|GREESILY@GREESIER#GREESIEST
  4126. GRINDING|GRINDINGLY@MORE GRINDING#MOST GRINDING
  4127. GROSS|GROSSLY@GROSSER#GROSSEST
  4128. GULLIBLE|GULLIBLY@MORE GULLIBLE#MOST GULLIBLE
  4129. HAPPY|HAPPILY@HAPPIER#HAPPIEST
  4130. HARD|HARDLY@HARDER#HARDEST
  4131. HATEFUL|HATEFULLY@MORE HATEFUL#MOST HATEFUL
  4132. HEATED|HEATEDLY@MORE HEATED#MOST HEATED
  4133. HEAVY|HEAVILY@HEAVIER#HEAVIEST
  4134. HELPFUL|HELPFULLY@MORE HELPFUL#MOST HELPFUL
  4135. HIGH|HIGHLY@HIGHER#HIGHEST
  4136. HOPELESS|HOPELESSLY@MORE HOPELESS#MOST HOPELESS
  4137. HORRIBLE|HORRIBLY@MORE HORRIBLE#MOST HORRIBLE
  4138. HOT|HOTLY@HOTTER#HOTTEST
  4139. HUMOROUS|HUMOROUSLY@MORE HUMOROUS#MOST HUMOROUS
  4140. HUNGRY|HUNGRILY@HUNGRIER#HUNGRIEST
  4141. IDIOTIC|IDIOTICALLY@MORE IDIOTIC#MOST IDIOTIC
  4142. IGNORANT|IGNORANTLY@MORE IGNORANT#MOST IGNORANT
  4143. IMPORTANT|IMPORTANTLY@MORE IMPORTANT#MOST IMPORTANT
  4144. IMPRESSIVE|IMPRESSIVELY@MORE IMPRESSIVE#MOST IMPRESSIVE
  4145. INDEFINITE|INDEFINITELY@MORE INDEFINITE#MOST INDEFINITE 
  4146. INDESCRIBABLE|INDESCRIBABLY@MORE INDESCRIBABLE#MOST INDESCRIBABLE
  4147. INDIRECT|INDIRECTLY@MORE INDIRECT#MOST INDIRECT
  4148. INSTANT|INSTANTLY@MORE INSTANT#MOST INSTANT
  4149. INTERACTIVE|INTERACTIVELY|MORE INTERACTIVE|MOST INTERACTIVE
  4150. INTERMITANT|INTERMITANTLY@MORE INTERMITANT#MOST INTERMITANT
  4151. JOYOUS|JOYOUSLY@MORE JOYOUS#MOST JOYOUS
  4152. JUBILANT|JUBILANTLY@MORE JUBILANT#MOST JUBILANT
  4153. KIND|KINDLY@KINDER#KINDEST
  4154. KNOWING|KNOWINGLY@MORE KNOWING#MOST KNOWING
  4155. LAMENTABLE|LAMENTABLY@MORE LAMENTABLE#MOST LAMENTABLE
  4156. LATE|LATELY@LATER#LATEST
  4157. LAZY|LAZILY@LAZIER#LAZIEST
  4158. LOGICAL|LOGICALLY@MORE LOGICAL#MOST LOGICAL
  4159. LONG|LONGLY@LONGER#LONGEST
  4160. LOQUACIOUS|LOQUACIOUSLY@MORE LOQUACIOUS#MOST LOQUACIOUS
  4161. LOUSY|LOUSILY@LOUSIER#LOUSIEST
  4162. LOW|LOWLY@LOWER#LOWEST
  4163. LUSCIOUS|LUSCIOUSLY@MORE LUSCIOUS#MOST LUSCIOUS
  4164. MAGIC|MAGICALLY@MORE MAGIC#MOST MAGIC
  4165. MAGNIFICENT|MAGNIFICENTLY@MORE MAGNIFICENT#MOST MAGNIFICENT
  4166. MANIACAL|MANIACALLY@MORE MANIACAL#MOST MANIACAL
  4167. MASTERFUL|MASTERFULLY@MORE MASTERFUL#MOST MASTERFUL
  4168. MEANINGFUL|MEANINGFULLY@MORE MEANINGFUL#MOST MEANINGFUL
  4169. METALLIC|METALLICALLY@MORE METALLIC#MOST METALLIC
  4170. MISERABLE|MISERABLY@MORE MISERABLE#MOST MISERABLE
  4171. MONOLITHIC|MONOLITHICALLY@MORE MONOLITHIC#MOST MONOLITHIC
  4172. MONSTROUS|MONSTROUSLY@MORE MONSTROUS#MOST MONSTROUS
  4173. MUNDANE|MUNDANELY@MUNDANER#MUNDANEST
  4174. NATURAL|NATURALLY@MORE NATURAL#MOST NATURAL
  4175. NEAR|NEARLY@NEARER#NEAREST
  4176. NEAT|NEATLY@NEATER#NEATEST
  4177. NOISOME|NOISOMELY@MORE NOISOME#MOST NOISOME
  4178. NONEXISTANT|NONEXISTANTLY@MORE NONEXISTANT#MOST NONEXISTANT
  4179. NUCLEAR|NUCLEARLY@MORE NUCLEAR#MOST NUCLEAR
  4180. OBEDIENT|OBEDIENTLY@MORE OBEDIENT#MOST OBEDIENT
  4181. OBVIOUS|OBVIOUSLY@MORE OBVIOUS#MOST OBVIOUS
  4182. ODD|ODDLY@ODDER#ODDEST
  4183. ODIFEROUS|ODIFEROUSLY@MORE ODIFEROUS#MOST ODIFEROUS
  4184. OMNIVOROUS|OMNIVOROUSLY@MORE OMNIVOROUS#MOST OMNIVOROUS
  4185. OPEN|OPENLY@MORE OPEN#MOST OPEN
  4186. PAINLESS|PAINLESSLY@MORE PAINLESS#MOST PAINLESS
  4187. PATHETIC|PATHETICALLY@MORE PATHETIC#MOST PATHETIC
  4188. PECULIAR|PECULIARLY@MORE PECULIAR#MOST PECULIAR
  4189. PERCEPTIVE|PERCEPTIVELY@MORE PERCEPTIVE#MOST PERCEPTIVE
  4190. PERSISTANT|PERSISTANTLY@MORE PERSISTANT#MOST PERSISTANT
  4191. PLASTIC|PLASTICALLY@MORE PLASTIC#MOST PLASTIC
  4192. PLEASANT|PLEASANTLY@MORE PLEASANT#MOST PLEASANT
  4193. PONDEROUS|PONDEROUSLY@MORE PONDEROUS#MOST PONDEROUS
  4194. POWERFUL|POWERFULLY@MORE POWERFUL#MOST POWERFUL
  4195. PRECIOUS|PRECIOUSLY@MORE PRECIOUS#MOST PRECIOUS
  4196. PRECISE|PRECISELY@MORE PRECISE#MOST PRECISE
  4197. PRETTY|PRETTILY@PRETTIER#PRETTIEST
  4198. PROPER|PROPERLY@MORE PROPER#MOST PROPER
  4199. PROUD|PROUDLY@PROUDER#PROUDEST
  4200. QUEER|QUEERLY@QUEERER#QUEEREST
  4201. QUICK|QUICKLY@QUICKER#QUICKEST
  4202. READY|READILY@MORE READY#MOST READY
  4203. RELENTING|RELENTINGLY@MORE RELENTING#MOST RELENTING
  4204. RELUCTANT|RELUCTANTLY@MORE RELUCTANT#MOST RELUCTANT
  4205. REVERENT|REVERENTLY@MORE REVERENT#MOST REVERENT
  4206. ROUDY|ROUDILY@ROUDIER#ROUDIEST
  4207. ROUGH|ROUGHLY@ROUGHER#ROUGHEST
  4208. RUDE|RUDELY@RUDER#RUDEST
  4209. SAD|SADLY@SADDER#SADDEST
  4210. SALIENT|SALIENTLY@MORE SALIENT#MOST SALIENT
  4211. SAVAGE|SAVAGELY@MORE SAVAGE#MOST SAVAGE
  4212. SCRUFFY|SCRUFFILY@SCRUFFIER#SCRUFFIEST
  4213. SELF MODIFYING|SELF MODIFYINGLY@MORE SELF MODIFYING#MOST SELF MODIFYING
  4214. SHARP|SHARPLY@SHARPER#SHARPEST
  4215. SHORT|SHORTLY@SHORTER#SHORTEST
  4216. SKEWED|SKEWEDLY@MORE SKEWED#MOST SKEWED
  4217. SLOPPY|SLOPPILY@SLOPPIER#SLOPPIEST
  4218. SLOW|SLOWLY@SLOWER#SLOWEST
  4219. SMOOTH|SMOOTHLY@SMOOTHER#SMOOTHEST
  4220. SOFT|SOFTLY@SOFTER#SOFTEST
  4221. SOULFUL|SOULFULLY@MORE SOULFUL#MOST SOULFUL
  4222. SPACIOUS|SPACIOUSLY@MORE SPACIOUS#MOST SPACIOUS
  4223. SPASTIC|SPASTICALLY@MORE SPASTIC#MOST SPASTIC
  4224. SPECKLED|SPECKLEDLY@MORE SPECKLED#MOST SPECKLED
  4225. SPECTACULAR|SPECTACULARLY@MORE SPECTACULAR#MOST SPECTACULAR
  4226. SPIFFY|SPIFFILY@SPIFFIER#SPIFFIEST
  4227. SQUEEKING|SQUEEKINGLY@MORE SQUEEKING#MOST SQUEEKING
  4228. STATIC|STATICALLY@MORE STATIC#MOST STATIC
  4229. STRANGE|STRANGELY@STRANGER#STRANGEST
  4230. STRATEGIC|STRATEGICALLY@MORE STRATEGIC#MOST STRATEGIC
  4231. STUDIOUS|STUDIOUSLY@MORE STUDIOUS#MOST STUDIOUS
  4232. STUPID|STUPIDLY@MORE STUPID#MOST STUPID
  4233. SUBNORMAL|SUBNORMALLY@MORE SUBNORMAL#MOST SUBNORMAL
  4234. SUCCESSFUL|SUCCESSFULLY@MORE SUCCESSFUL#MOST SUCCESSFUL
  4235. SWIFT|SWIFTLY@SWIFTER#SWIFTEST
  4236. TANGIBLE|TANGIBLY@MORE TANGIBLE#MOST TANGIBLE
  4237. TEPID|TEPIDLY@MORE TEPID#MOST TEPID
  4238. TERSE|TERSELY@TERSER#TERSEST
  4239. THRASHING|THRASHINGLY@MORE THRASHING#MOST THRASHING
  4240. TIGHT|TIGHTLY@TIGHTER#TIGHTEST
  4241. TIRED|TIREDLY@TIREDER#TIREDEST
  4242. TRAGIC|TRAGICALLY@MORE TRAGIC#MOST TRAGIC
  4243. TWISTED|TWISTEDLY@MORE TWISTED#MOST TWISTED
  4244. TYPICAL|TYPICALLY@MORE TYPICAL#MOST TYPICAL
  4245. UNBELIEVABLE|UNBELIEVABLY@MORE UNBELIEVABLE#MOST UNBELIEVABLE
  4246. UNIFORM|UNIFORMLY@MORE UNIFORM#MOST UNIFORM
  4247. URBANE|URBANELY@URBANER#URBANEST
  4248. VACANT|VACANTLY@MORE VACANT#MOST VACANT
  4249. VAIN|VAINLY@VAINER#VAINEST
  4250. VENOMOUS|VENOMOUSLY@MORE VENOMOUS#MOST VENOMOUS
  4251. VERBOSE|VERBOSELY@VERBOSER#VERBOSEST
  4252. VIBRANT|VIBRANTLY@MORE VIBRANT#MOST VIBRANT
  4253. VIRTUOUS|VIRTUOUSLY@MORE VIRTUOUS#MOST VIRTUOUS
  4254. VITAL|VITALLY@MORE VITAL#MOST VITAL
  4255. WEAK|WEAKLY@WEAKER#WEAKEST
  4256. WET|WETLY@WETTER#WETTEST
  4257. WHOLESOME|WHOLESOMELY@MORE WHOLESOME#MOST WHOLESOME
  4258. WIDE|WIDELY@WIDER#WIDEST
  4259. WIERD|WIERDLY@WIERDER#WIERDEST
  4260. WILD|WILDLY@WILDER#WILDEST
  4261. WISE|WISELY@WISER#WISEST
  4262. WONDERFUL|WONDERFULLY@MORE WONDERFUL#MOST WONDERFUL
  4263. WRETCHED|WRETCHEDLY@MORE WRETCHED#MOST WRETCHED
  4264. WRITHING|WRITHINGLY@MORE WRITHING#MOST WRITHING
  4265. %been
  4266. AIN'T
  4267. BE
  4268. SHOULD BE
  4269. COULD BE
  4270. WOULD BE
  4271. CAN'T BE
  4272. MIGHT BE NOT
  4273. MAY BE
  4274. MIGHT BE
  4275. MAY BE NOT
  4276. COULD NOT BE
  4277. SHOULD NOT BE
  4278. WOULD NOT BE
  4279. MAY NOT BE
  4280. MIGHT NOT BE
  4281. WILL BE
  4282. WILL NOT BE
  4283. WON'T BE
  4284. COULD HAVE BEEN
  4285. SHOULD HAVE BEEN
  4286. WOULD HAVE BEEN
  4287. WILL HAVE BEEN
  4288. COULD BE NOT
  4289. SHOULD BE NOT
  4290. WOULD BE NOT
  4291. COULDN'T HAVE BEEN
  4292. SHOULDN'T HAVE BEEN
  4293. WOULDN'T HAVE BEEN
  4294. SHOULD BE
  4295. %ivrb
  4296. ADD|ADDED
  4297. ASSEMBLE|ASSEMBLED
  4298. ATTEMPT|ATTEMPTED
  4299. CALCULATE|CALCULATED
  4300. CLIMB|CLIMBED
  4301. CLOSE|CLOSED
  4302. CODE|CODED
  4303. COMBINE|COMBINED
  4304. COMPARE|COMPARED
  4305. COMPILE|COMPILED
  4306. COMPUTE|COMPUTED
  4307. CONCLUDE|CONCLUDED
  4308. CONTEND|CONTENDED
  4309. CONTINUE|CONTINUED
  4310. CONVERT|CONVERTED
  4311. CRASH|CRASHED
  4312. CRUNCH|CRUNCHED
  4313. DECREASE|DECREASED
  4314. DECREMENT|DECREMENTED
  4315. DIGEST|DIGESTED
  4316. DOUBLE|DOUBLED
  4317. DUMP|DUMPED
  4318. ENHANCE|ENHANCED
  4319. ENTER|ENTERED
  4320. EXIST|EXISTED
  4321. EXPLODE|EXPLODED
  4322. EXTEND|EXTENDED
  4323. FLASH|FLASHED
  4324. FLOAT|FLOATED
  4325. FRY|FRIED
  4326. HIT|HITTED
  4327. GENERATE|GENERATED
  4328. IMPLODE|IMPLODED
  4329. INCREASE|INCREASED
  4330. INCREMENT|INCREMENTED
  4331. JUGGLE|JUGGLED
  4332. JUMP|JUMPED
  4333. LINK|LINKED
  4334. LISTEN|LISTENED
  4335. MANIPULATE|MANIPULATED
  4336. MUNCH|MUNCHED
  4337. OPEN|OPENED
  4338. OPERATE|OPERATED
  4339. OVERFLOW|OVERFLOWED
  4340. PASS|PASSED
  4341. PERFORM|PERFORMED
  4342. PLAN|PLANNED
  4343. PREPARE|PREPARED
  4344. RAIN|RAINED
  4345. REJECT|REJECTED
  4346. REPEAT|REPEATED
  4347. SHOW|SHOWED
  4348. SPIT|SPITTED
  4349. SLIP|SLIPPED
  4350. SUMMARIZE|SUMMARIZED
  4351. TERMINATE|TERMINATED
  4352. TOGGLE|TOGGLED
  4353. TRIPLE|TRIPLED
  4354. TURN|TURNED
  4355. TWITCH|TWITCHED
  4356. WRIGGLE|WRIGGLED
  4357. %tvrb
  4358. ABSORB|ABSORBED
  4359. ACCESS|ACCESSED
  4360. ALLOCATE|ALLOCATED
  4361. ALLOW|ALLOWED
  4362. ASSEMBLE|ASSEMBLED
  4363. ASSIGN|ASSIGNED
  4364. BENEFIT|BENEFITTED
  4365. CALCULATE|CALCULATED
  4366. CLIMB|CLIMBED
  4367. CLOSE|CLOSED
  4368. CODE|CODED
  4369. COLLIDE|COLLIDED
  4370. COMBINE|COMBINED
  4371. COMMAND|COMMANDED
  4372. COMPARE|COMPARED
  4373. COMPILE|COMPILED
  4374. CONCLUDE|CONCLUDED
  4375. CONTAIN|CONTAINED
  4376. CONVERT|CONVERTED
  4377. COOK|COOKED
  4378. COPY|COPIED
  4379. CRASH|CRASHED
  4380. CRUNCH|CRUNCHED
  4381. DEBUG|DEBUGGED
  4382. DECREASE|DECREASED
  4383. DECREMENT|DECREMENTED
  4384. DELETE|DELETED
  4385. DELIVER|DELIVERED
  4386. DESCRIBE|DESCRIBED
  4387. DESTROY|DESTROYED
  4388. DETECT|DETECTED
  4389. DEVISE|DEVISED
  4390. DIGEST|DIGESTED
  4391. DIRECT|DIRECTED
  4392. DISPLAY|DISPLAYED
  4393. DIVIDE|DIVIDED
  4394. DOUBLE|DOUBLED
  4395. DUMP|DUMPED
  4396. EDIT|EDITED
  4397. EMPHASIZE|EMPHASIZED
  4398. EMULATE|EMULATED
  4399. ENCRYPT|ENCRYPTED
  4400. ENHANCE|ENHANCED
  4401. ERASE|ERASED
  4402. EVALUATE|EVALUATED
  4403. EXECUTE|EXECUTED
  4404. EXPLODE|EXPLODED
  4405. EXPRESS|EXPRESSED
  4406. EXTEND|EXTENDED
  4407. FACILITATE|FACILITATED
  4408. FLASH|FLASHED
  4409. FLIP|FLIPPED
  4410. FORMAT|FORMATTED
  4411. FRY|FRIED
  4412. GATHER|GATHERED
  4413. IDENTIFY|IDENTIFIED
  4414. IGNORE|IGNORED
  4415. IMPLEMENT|IMPLEMENTED
  4416. IMPLODE|IMPLODED
  4417. INCLUDE|INCLUDED
  4418. INCREASE|INCREASED
  4419. INCREMENT|INCREMENTED
  4420. INSTALL|INSTALLED
  4421. INDICATE|INDICATED
  4422. INSTRUCT|INSTRUCTED
  4423. INVOKE|INVOKED
  4424. JUGGLE|JUGGLED
  4425. KICK|KICKED
  4426. KLOOJE|KLOOJED
  4427. LIFT|LIFTED
  4428. LIGHT|LIGHTED
  4429. LIMIT|LIMITED
  4430. LINK|LINKED
  4431. LOAD|LOADED
  4432. LOCATE|LOCATED
  4433. MANIPULATE|MANIPULATED
  4434. MULTIPLY|MULTIPLIED
  4435. MUNCH|MUNCHED
  4436. NEGATE|NEGATED
  4437. NUMBER|NUMBERED
  4438. OPEN|OPENED
  4439. ORDER|ORDERED
  4440. OUTPUT|OUTPUTTED
  4441. OVERFLOW|OVERFLOWED
  4442. PAINT|PAINTED
  4443. PASS|PASSED
  4444. PERCEIVE|PERCEIVED
  4445. PERFORM|PERFORMED
  4446. PICK|PICKED
  4447. PLAN|PLANNED
  4448. POKE|POKED
  4449. PORT|PORTED
  4450. PREPARE|PREPARED
  4451. PROCESS|PROCESSED
  4452. PRODUCE|PRODUCED
  4453. PROGRAM|PROGRAMMED
  4454. PROTECT|PROTECTED
  4455. PROMPT|PROMPTED
  4456. PUNCH|PUNCHED
  4457. QUESTION|QUESTIONED
  4458. RANDOMIZE|RANDOMIZED
  4459. READ|READ
  4460. REJECT|REJECTED
  4461. RENAME|RENAMED
  4462. REPEAT|REPEATED
  4463. REPRESENT|REPRESENTED
  4464. SAVE|SAVED
  4465. SCRATCH|SCRATCHED
  4466. SCRAWL|SCRAWLED
  4467. SELECT|SELECTED
  4468. SHOW|SHOWED
  4469. SHREAD|SHREADED
  4470. SPECIFY|SPECIFIED
  4471. SPEW|SPEWED
  4472. SPOOL|SPOOLED
  4473. STIR|STIRRED
  4474. SUPPORT|SUPPORTED
  4475. TAG|TAGGED
  4476. TAX|TAXED
  4477. TERMINATE|TERMINATED
  4478. TIME|TIMED
  4479. TOAST|TOASTED
  4480. TOGGLE|TOGGLED
  4481. TOUCH|TOUCHED
  4482. TRIPLE|TRIPLED
  4483. TWEEK|TWEEKED
  4484. TWIST|TWISTED
  4485. TYPE|TYPED
  4486. UNDERMINE|UNDERMINED
  4487. UNLOAD|UNLOADED
  4488. USE|USED
  4489. WRIGGLE|WRIGGLED
  4490. WRINKLE|WRINKLED
  4491. ZAP|ZAPPED
  4492. %prep
  4493. ABOVE
  4494. ABOUT
  4495. AROUND
  4496. ALONGSIDE
  4497. ATOP
  4498. BESIDE
  4499. BETWEEN
  4500. THROUGH
  4501. AFTER
  4502. WITH
  4503. ON
  4504. OVER
  4505. UNDER
  4506. NEXT TO
  4507. OUTSIDE OF
  4508. INSIDE
  4509. BY
  4510. FROM
  4511. ACROSS FROM
  4512. BELOW
  4513. WITHOUT
  4514. BY
  4515. INSIDE
  4516. OUTSIDE
  4517. FROM
  4518. ABOVE
  4519. ABOUT
  4520. AROUND
  4521. BESIDE
  4522.  
  4523.  
  4524.  
  4525. From icon-group-sender  Wed May 27 09:17:27 1992
  4526. Received: by cheltenham.cs.arizona.edu; Wed, 27 May 92 09:47:19 MST
  4527. Date: Wed, 27 May 92 18:18:28 +0200
  4528. From: Jan Peter de Ruiter <janpeter@mpi.kun.nl>
  4529. Message-Id: <9205271618.AA07196@mpix10.mpi.kun.nl>
  4530. To: icon-group@cs.arizona.edu
  4531. Subject: save()
  4532. Status: R
  4533. Errors-To: icon-group-errors@cs.arizona.edu
  4534.  
  4535. A short question: is there (or will there be) a version of Icon for either
  4536. Ultrix or MSDOS that implements the save() function, i.e. executable
  4537. images? I'm working with version 8.5 on MSDOS and with 8.0 on Ultrix,
  4538. and I do not know for certain whether I'm using the latest available
  4539. version on Ultrix. If executable images are *not* supported on these
  4540. platforms, then my question amounts to "why not?".
  4541.  
  4542. Jan P.A. de Ruiter
  4543. Max Planck Institute for Psycholinguistics
  4544. janpeter@mpi.kun.nl
  4545.  
  4546.  
  4547.  
  4548. From icon-group-sender  Wed May 27 09:52:40 1992
  4549. Received: by cheltenham.cs.arizona.edu; Wed, 27 May 92 09:53:11 MST
  4550. Date: Wed, 27 May 92 09:52:40 MST
  4551. From: "Ralph Griswold" <ralph>
  4552. Message-Id: <9205271652.AA24941@cheltenham.cs.arizona.edu>
  4553. To: janpeter@mpi.kun.nl
  4554. Subject: Re:  save()
  4555. Cc: icon-group
  4556. Status: R
  4557. Errors-To: icon-group-errors@cs.arizona.edu
  4558.  
  4559. Our configuration files show that save() is supported for Ultrix on VAX
  4560. platforms for 8.0 and subsequent versions.
  4561.  
  4562. I can't speak to Ultrix on other platforms.
  4563.  
  4564. save() is not implemented for MS-DOS or most other platforms.
  4565.  
  4566. The reason save() is not widely supported is that its implementation is
  4567. difficult as well as system and architecture dependent.  Icon source
  4568. provides the hooks.  Local code would be needed where it's not already
  4569. provided.
  4570.     
  4571. Ralph E. Griswold            ralph@cs.arizona.edu
  4572. Department of Computer Science          uunet!arizona!ralph
  4573. The University of Arizona        602-621-6609 (voice)
  4574. Tucson, AZ 85721            602-621-9618   (fax)
  4575.  
  4576.  
  4577. From icon-group-sender  Wed May 27 10:29:52 1992
  4578. Received: by cheltenham.cs.arizona.edu; Wed, 27 May 92 12:04:55 MST
  4579. Date: Wed, 27 May 92 10:30:20 PDT
  4580. From: alex@laguna.metaphor.com (Bob Alexander)
  4581. Message-Id: <9205271730.AA00972@laguna.Metaphor.COM>
  4582. To: icon-group@cs.arizona.edu
  4583. Subject: Icon coding puzzle
  4584. Status: R
  4585. Errors-To: icon-group-errors@cs.arizona.edu
  4586.  
  4587. I came across a simple but intriguing situation in Icon coding, and I
  4588. wonder if anyone has a better solution than the hack I came up with.
  4589.  
  4590. I wrote a procedure that is supposed to work in a string scanning
  4591. context (a "matching" procedure) to match optional spaces:
  4592.  
  4593. procedure OptSpace()
  4594.   suspend (tab(many(' ')) | "")\1
  4595. end
  4596.  
  4597. The idea of the \1 is that I don't really want to match the empty
  4598. string if there are blanks there, so the alternation is only allowed to
  4599. produce one result.  But there is a problem with this:  if the suspend
  4600. expression is resumed after spaces have been matched, the limitation
  4601. operation prevents the first term of the alternation [ tab(many(' ')) ]
  4602. from being resumed, therefore &pos is not restored to its position
  4603. before the match (thus it's not a proper matching procedure).
  4604.  
  4605. Here's one solution, but it doesn't seem very pretty to me -- I'd
  4606. prefer a slicker one without auxiliary variables:
  4607.  
  4608. procedure OptSpace()
  4609.   local x
  4610.   suspend (x := Space()) | (/x,"")
  4611. end
  4612.  
  4613. The generalization of what I am trying to do is a "selection" control
  4614. structure that produces the result sequence of its first operand that
  4615. succeeds, and no more.  It is modelled by a PDCO, Cond(), that appears
  4616. in the IPL (ipl/procs/pdco.icn):
  4617.  
  4618. procedure Cond(L)
  4619.    local i, x
  4620.    every i := 1 to *L do
  4621.       if x := @L[i] then {
  4622.          suspend x
  4623.          suspend |@L[i]
  4624.          fail
  4625.          }   
  4626. end
  4627.  
  4628. But what I *really* want is just a clever way to achieve the same
  4629. effect with in-line code.
  4630.  
  4631. Ideas???
  4632.  
  4633. I think this type of situation occurs often in goal-seeking Icon
  4634. programming, where alternation might produce unnecessary results (e.g.
  4635. tab(many(' ')) | "").  Does anyone out there agree?  Could we use a new
  4636. Icon selection control structure:  <expr1, expr2, ..., exprN>?  ("<"
  4637. and ">" taken literally -- I'm not sure about syntactic non-ambiguity
  4638. here).
  4639.  
  4640. -- Bob Alexander
  4641.  
  4642. Metaphor Computer Systems   (415) 961-3600 x751   alex@metaphor.com
  4643. ====^=== Mountain View, CA  ...{uunet}!{decwrl,apple}!metaphor!alex
  4644.  
  4645.  
  4646. From icon-group-sender  Thu May 28 07:25:03 1992
  4647. Received: by cheltenham.cs.arizona.edu; Thu, 28 May 92 10:05:16 MST
  4648. Date: Thu, 28 May 92 16:26:01 +0200
  4649. From: Jan Peter de Ruiter <janpeter@mpi.kun.nl>
  4650. Message-Id: <9205281426.AA09288@mpix10.mpi.kun.nl>
  4651. To: icon-group@cs.arizona.edu
  4652. Status: R
  4653. Errors-To: icon-group-errors@cs.arizona.edu
  4654.  
  4655. ## Hi,
  4656.  
  4657. ## As a demonstration of the use of awk-like icon programming, I've
  4658. ## written a simple but surprisingly useful program, that's now 
  4659. ## heavily used in 'data laundry' jobs at our institute. The program
  4660. ## as it is *can* be written in AWK, by the way, but it can be very
  4661. ## easily modified to handly specific (and more complex) jobs. I've
  4662. ## adapted it once (using Icon sets) to check out all the cross-
  4663. ## references in a multifile C program, for instance. Perhaps you'd
  4664. ## find it useful.
  4665.  
  4666. ## Jan P.A. de Ruiter
  4667. ## janpeter@mpi.kun.nl
  4668.  
  4669.  
  4670. # program peanuts; (C) 1992 J.P.A. de Ruiter
  4671. # This program can be used to add information from some file to
  4672. # a target file, provided there is a common element in both files
  4673. # The program makes use of the awk-emulation library called 'aweka.icn'
  4674. # which is provided at the end of this file. For those who do not posess
  4675. # the awk-lib: uncomment and save it and link it in with the
  4676. # peanuts code.
  4677.  
  4678. link aweka
  4679. procedure main(argm)
  4680.  
  4681. # argument handling 
  4682.  
  4683.     if (*argm ~= 6) then usage()    
  4684.     (vic := open(argm[1]) | stop("victim file cannot be opened."))
  4685.     (tabelfile := open(argm[2]) | stop("table file cannot be opened."))
  4686.     ((vicpos := +argm[3]) > 0 | stop("vicpos should be > 0."))
  4687.     ((key := +argm[4]) > 0 | stop("key should be > 0."))
  4688.     ((value := +argm[5]) > 0 | stop("value should be > 0."))
  4689.     (outfile := open(argm[6],"w") | stop("outfile cannot be opened."))
  4690.  
  4691. # initialize table
  4692.     tabel := table()
  4693.  
  4694. # load mapping table
  4695.     while (awk(tabelfile)) do {
  4696.         tabel[FLD[key]] := FLD[value]
  4697.     }
  4698.  
  4699.     while (entire_line := awk(vic)) do {
  4700.         if (\tabel[FLD[vicpos]]) then write(outfile,entire_line," ",tabel[FLD[vicpos]])
  4701.         else stop("I\'m sorry, element \'",FLD[vicpos],"\' not present in table.")
  4702.     }
  4703.  
  4704. # close and exit
  4705.     close(vic)
  4706.     close(outfile)
  4707.     close(tabelfile)
  4708. end
  4709.  
  4710. procedure usage()
  4711. stop("usage: {icon} peanuts <vicfile> <tabfile> <victim> <key>",
  4712.       " <value> <outfile>.\n", 
  4713.       "where: vicfile = file you want to add a column to.\n",
  4714.       "       tabfile = file you want to look up the new column\n",
  4715.       "       victim  = position of index column in vicfile\n",
  4716.       "       key     = position of index column in tabfile\n",
  4717.       "       value   = position of value to be retrieved from tabfile\n",
  4718.       "       outfile = the output file\n");
  4719. end
  4720.  
  4721.  
  4722. # #
  4723. # # awk - emulation lib. (c) 1992 J.P.A. de Ruiter
  4724. # #
  4725. # global NF, NR, FLD, FS
  4726. # procedure awk(file)
  4727. #     static oldfile
  4728. #      initial { oldfile := &null }
  4729. #
  4730. #    if (oldfile ~=== file) then {
  4731. #        NR := 0
  4732. #        oldfile := file
  4733. #    }
  4734. #
  4735. #    if (/FS) then FS := ' \t'
  4736. #    charset := &cset -- cset(FS)
  4737. #    NF := 0
  4738. #    FLD := list()
  4739. #
  4740. #    if(LSTR := !file) then NR +:= 1 else fail
  4741. #    LSTR ? while(tab(upto(charset))) do put(FLD,tab(many(charset)))
  4742. #    NF := *FLD
  4743. #    suspend LSTR
  4744. # end
  4745.  
  4746.  
  4747. From icon-group-sender  Thu May 28 11:02:10 1992
  4748. Received: by cheltenham.cs.arizona.edu; Thu, 28 May 92 12:11:30 MST
  4749. Date: Thu, 28 May 92 13:56:19 EST
  4750. From: MATH0022@rmc.ca
  4751. Subject: comp.compilers ?
  4752. To: icon-group@cs.arizona.edu
  4753. Reply-To: LINDSAY_JH@rmc.ca
  4754. Message-Id: <920528.14003991.013486@RMC.CP6>
  4755. X-Envelope-To: icon-group@cs.Arizona.edu
  4756. Status: R
  4757. Errors-To: icon-group-errors@cs.arizona.edu
  4758.  
  4759.         I'd appreciate it if someone would fill me in on how to locate or use
  4760. the bulletin board called  comp.compilers (?)
  4761.  
  4762. --------------------------------------------------------------------------------
  4763.  
  4764.             John H. Lindsay,
  4765.             Department of Mathematics and Computer Science,
  4766.             Royal Military College of Canada,
  4767.             Kingston, Ontario, Canada, K7K 5L0.
  4768.  
  4769.             Phones: Office,                          (613) 541-6419
  4770.                     Messages,                              541-6343 or 541-6458
  4771.                     Home,                                  546-6988
  4772.             E-Mail: From Bitnet, NetNorth, ONet:     LINDSAY_JH@RMC.CA
  4773.                     From Canadian Military Colleges: LINDSAY JH@RMC
  4774.             Fax:                                     (613) 542-8129
  4775.  
  4776. John H. Lindsay, Dept. of Math. & C. S., Royal Military College of Canada
  4777.  
  4778.  
  4779. From icon-group-sender  Mon Jun  1 19:36:22 1992
  4780. Received: by cheltenham.cs.arizona.edu; Tue, 2 Jun 1992 05:41:38 -0700
  4781. Date: Mon, 1 Jun 92 23:36:22 EDT
  4782. From: Paul_Abrahams@MTS.cc.Wayne.edu
  4783. To: icon-group@cs.arizona.edu
  4784. Message-Id: <463262@MTS.cc.Wayne.edu>
  4785. Subject: Concordance program from Icon Analyst #11
  4786. Status: R
  4787. Errors-To: icon-group-errors@cs.arizona.edu
  4788.  
  4789. Here's another wrinkle on the concordance program presented in Issue 11
  4790. (April 1992) of the Icon Analyst.  We associate with each word a record
  4791. containing the most recent line number where the word was encountered (as
  4792. a number) and the list of previous line numbers (as a string).  This version
  4793. is possibly a little cleaner than the string version given in the Analyst
  4794. and probably just as fast.
  4795.  
  4796. Add the global declaration
  4797.  
  4798.   record word_data(prev, current)
  4799.  
  4800. Initialize "uses" with
  4801.  
  4802.   uses := table(word_data("", 0))
  4803.  
  4804. Replace the tabulate and output routines by
  4805.  
  4806. # Add line number to citations for a word
  4807.  
  4808. procedure tabulate(word)
  4809.   if uses[word].current < lineno then
  4810.     uses[word] := word_data(
  4811.       uses[word].prev || (0 ~= uses[word].current) || "," | "", lineno)
  4812.   return
  4813. end
  4814.  
  4815. # Generate words
  4816.  
  4817. procedure output()
  4818.   local word, lines
  4819.  
  4820.   write()
  4821.  
  4822.   uses := sort(uses, 3)
  4823.   while word := get(uses) do {
  4824.     lines := get(uses)
  4825.      write(left(word, width), lines.prev, lines.current)
  4826.     }
  4827. end
  4828.  
  4829.  
  4830. From icon-group-sender  Tue Jun  2 01:06:01 1992
  4831. Received: by cheltenham.cs.arizona.edu; Tue, 2 Jun 1992 05:42:14 -0700
  4832. Via: festival.edinburgh.ac.uk; Tue, 2 Jun 1992 09:05:23 +0100
  4833. Date: 02 Jun 92 09:06:10 BST
  4834. From: R J Hare <ercn72@festival.edinburgh.ac.uk>
  4835. Subject: Fast searching
  4836. To: icon-group@cs.arizona.edu
  4837. Message-Id: <9206020906.aa21959@uk.ac.ed.festival>
  4838. Status: R
  4839. Errors-To: icon-group-errors@cs.arizona.edu
  4840.  
  4841. I am in a position where I may soon have to implement a fast search on large
  4842. (Mbytes) files. The obvious way to do this is with a binary search on a
  4843. record-based basis. However, as far as I can see, Icons random access features
  4844. are character based. It would be easy to convert this to a record-based basis
  4845. *if* the records in my files were fixed length - they aren't.
  4846.  
  4847. Are there any elegant ways of implementing random access on a record based
  4848. basis? I can think of at least two ways to do it; one involving the use of the
  4849. length of the longest record, the other simply involving padding records to a
  4850. fixed length - neither approach is attractive.
  4851.  
  4852. Or, have I missed something vital in the manual?
  4853.  
  4854. Thanks.
  4855.  
  4856. Roger Hare.
  4857.  
  4858.  
  4859. From icon-group-sender  Tue May 29 12:41:17 1992
  4860. Received: by cheltenham.cs.arizona.edu; Thu, 4 Jun 1992 06:18:57 -0700
  4861. Date: 29 May 92 12:41:17 GMT
  4862. From: overload.lbl.gov!agate!spool.mu.edu!sdd.hp.com!uakari.primate.wisc.edu!zaphod.mps.ohio-state.edu!sol.ctr.columbia.edu!ira.uka.de!news.belwue.de!news.uni-stuttgart.de!@dog.ee.lbl.gov  (MUFTI)
  4863. Organization: User Help Desk, Comp. Cent. (RUS), U of Stuttgart, FRG
  4864. Subject: question about "iconx" and "u1" files
  4865. Message-Id: <1992May29.124117.15515@news.uni-stuttgart.de>
  4866. Sender: icon-group-request@cs.arizona.edu
  4867. To: icon-group@cs.arizona.edu
  4868. Status: R
  4869. Errors-To: icon-group-errors@cs.arizona.edu
  4870.  
  4871. Can "iconx" and "u1" files be reconverted into icon source code files ?
  4872.  
  4873. This question may be important, if someone want to keep his source secret ...
  4874.  
  4875. thanks
  4876. so long
  4877. MUFTI
  4878.  
  4879.  
  4880. From icon-group-sender  Wed Jun  3 23:24:33 1992
  4881. Received: by cheltenham.cs.arizona.edu; Thu, 4 Jun 1992 09:09:45 -0700
  4882. Date: Thu, 4 Jun 1992 06:24:33 -0700
  4883. From: "Ralph Griswold" <ralph>
  4884. Message-Id: <199206041324.AA25278@cheltenham.cs.arizona.edu>
  4885. To: icon-group@cs.arizona.edu,
  4886.         overload.lbl.gov!agate!spool.mu.edu!sdd.hp.com!uakari.primate.wisc.edu!zaphod.mps.ohio-state.edu!sol.ctr.columbia.edu!ira.uka.de!news.belwue.de!news.uni-stuttgart.de!@dog.ee.lbl.gov
  4887. Subject: Re:  question about "iconx" and "u1" files
  4888. Status: R
  4889. Errors-To: icon-group-errors@cs.arizona.edu
  4890.  
  4891. I suppose it's theoretically possible to reconstruct source code from
  4892. Icon ucode and icode files, but no tools that I know of presently exist
  4893. for doing this.
  4894.  
  4895. Also, any source reconstruction probably is not going to be very useful --
  4896. it probably would be pretty much of a mess.
  4897.  
  4898. It's worth noting that it's possible to "decompile" executables of most
  4899. programming languages into some sort of source.  Much more work usually
  4900. is required to recover information about, say, algorithms used -- if
  4901. it is, indeed, possible.
  4902.  
  4903. I suppose there are ways of writing Icon programs to conceal important
  4904. information about algorithms used, but I haven't given much thought to
  4905. that.
  4906.     
  4907. Ralph E. Griswold            ralph@cs.arizona.edu
  4908. Department of Computer Science          uunet!arizona!ralph
  4909. The University of Arizona        602-621-6609 (voice)
  4910. Tucson, AZ 85721            602-621-9618   (fax)
  4911.  
  4912.  
  4913. From icon-group-sender  Thu Jun  4 17:26:16 1992
  4914. Received: by cheltenham.cs.arizona.edu; Thu, 4 Jun 1992 09:09:58 -0700
  4915. Date: Thu, 4 Jun 92 15:26:16 +0200
  4916. From: Jan Peter de Ruiter <janpeter@mpi.kun.nl>
  4917. Message-Id: <9206041326.AA25716@mpix10.mpi.kun.nl>
  4918. To: icon-group@cs.arizona.edu
  4919. Subject: program
  4920. Status: R
  4921. Errors-To: icon-group-errors@cs.arizona.edu
  4922.  
  4923. ## As a demonstration of the use of awk-like icon programming, I've
  4924. ## written a simple but surprisingly useful program, that's now 
  4925. ## heavily used in 'data laundry' jobs at our institute. The program
  4926. ## as it is *can* be written in AWK, by the way, but it can be very
  4927. ## easily modified to handly specific (and more complex) jobs. I've
  4928. ## adapted it once (using Icon sets) to check out all the cross-
  4929. ## references in a multifile C program, for instance. Perhaps you'd
  4930. ## find it useful. One final tip: with this program it really pays
  4931. ## to use the icon compiler; the awk-processing tends to take up a lot
  4932. ## of processing time.
  4933.  
  4934. ## Jan P.A. de Ruiter
  4935. ## janpeter@mpi.kun.nl
  4936.  
  4937. #
  4938. # program peanuts; 
  4939. # by Jan P. A. de Ruiter
  4940. #
  4941. # This program can be used to add information from some file to
  4942. # a target file, provided there is a common element in both files
  4943. #
  4944. # For SPSSX users: 'peanuts' can be conceived of as an 'outboard'
  4945. # JOIN MATCH function.
  4946. # The program makes use of the awk-emulation library called 'aweka.icn'
  4947. # which is provided at the end of this file. For those who do not posess
  4948. # the awk-lib: uncomment and save it and link it in with the
  4949. # peanuts code.
  4950.  
  4951. link aweka
  4952. procedure main(argm)
  4953.  
  4954. # argument handling 
  4955.  
  4956.     if (*argm ~= 6) then usage()    
  4957.     (vic := open(argm[1]) | stop("victim file cannot be opened."))
  4958.     (tabelfile := open(argm[2]) | stop("table file cannot be opened."))
  4959.     ((vicpos := +argm[3]) > 0 | stop("vicpos should be > 0."))
  4960.     ((key := +argm[4]) > 0 | stop("key should be > 0."))
  4961.     ((value := +argm[5]) > 0 | stop("value should be > 0."))
  4962.     (outfile := open(argm[6],"w") | stop("outfile cannot be opened."))
  4963.  
  4964. # initialize table
  4965.     tabel := table()
  4966.  
  4967. # load mapping table
  4968.     while (awk(tabelfile)) do {
  4969.         tabel[FLD[key]] := FLD[value]
  4970.     }
  4971.  
  4972.     while (entire_line := awk(vic)) do {
  4973.         if (\tabel[FLD[vicpos]]) then write(outfile,entire_line," ",tabel[FLD[vicpos]])
  4974.         else stop("I\'m sorry, element \'",FLD[vicpos],"\' not present in table.")
  4975.     }
  4976.  
  4977. # close and exit
  4978.     close(vic)
  4979.     close(outfile)
  4980.     close(tabelfile)
  4981. end
  4982.  
  4983. procedure usage()
  4984. stop("usage: {icon} peanuts <vicfile> <tabfile> <victim> <key>",
  4985.       " <value> <outfile>.\n", 
  4986.       "where: vicfile = file you want to add a column to.\n",
  4987.       "       tabfile = file you want to look up the new column\n",
  4988.       "       victim  = position of index column in vicfile\n",
  4989.       "       key     = position of index column in tabfile\n",
  4990.       "       value   = position of value to be retrieved from tabfile\n",
  4991.       "       outfile = the output file\n");
  4992. end
  4993.  
  4994. # #
  4995. # # AWK emulation library.
  4996. # # by Jan P. A. de Ruiter.
  4997. # #
  4998. # global NF, NR, FLD, FS
  4999. # procedure awk(file)
  5000. #     static oldfile
  5001. #      initial { oldfile := &null }
  5002. #
  5003. #    if (oldfile ~=== file) then {
  5004. #        NR := 0
  5005. #        oldfile := file
  5006. #    }
  5007. #
  5008. #    if (/FS) then FS := ' \t'
  5009. #    charset := &cset -- cset(FS)
  5010. #    NF := 0
  5011. #    FLD := list()
  5012. #
  5013. #    if(LSTR := !file) then NR +:= 1 else fail
  5014. #    LSTR ? while(tab(upto(charset))) do put(FLD,tab(many(charset)))
  5015. #    NF := *FLD
  5016. #    suspend LSTR
  5017. # end
  5018.  
  5019.  
  5020. From icon-group-sender  Thu Jun  4 04:13:54 1992
  5021. Received: by cheltenham.cs.arizona.edu; Thu, 4 Jun 1992 12:46:45 -0700
  5022. Date: Thu, 4 Jun 1992 11:13:54 -0700
  5023. From: "Kenneth Walker" <kwalker>
  5024. Message-Id: <199206041813.AA10015@ponderosa.cs.arizona.edu>
  5025. To: ercn72@festival.edinburgh.ac.uk, icon-group
  5026. Subject: Re:  Fast searching
  5027. Status: R
  5028. Errors-To: icon-group-errors@cs.arizona.edu
  5029.  
  5030. > Date: 02 Jun 92 09:06:10 BST
  5031. > From: R J Hare <ercn72@festival.edinburgh.ac.uk>
  5032.  
  5033. > I am in a position where I may soon have to implement a fast search on large
  5034. > (Mbytes) files. 
  5035. >   ...
  5036. > Are there any elegant ways of implementing random access on a record based
  5037. > basis?
  5038. >   ...
  5039. > Or, have I missed something vital in the manual?
  5040.  
  5041. I assume you are talking about too much data to read into memory or 
  5042. a volume which is too slow to read every time the program is called.
  5043.  
  5044. Icon has no high-level facilities for structuring data on disk. On some
  5045. systems, you can open files read-write and use where(), seek(), read()
  5046. and write() to do random read, write, and update of data. These are
  5047. very low-level features, but allow you to construct a complex data
  5048. base system if you are willing to work at it. Note that you can
  5049. effectively have pointers in "records" of the file by storing the
  5050. seek() address of other records. I don't know enough about data base
  5051. management to give you advice on the best way to go about it organizing
  5052. the file.
  5053.  
  5054. If you already have a data base management system, you may be able to
  5055. store the data using it. If an Icon program only needs to work on a
  5056. subset of the data, it can invoke data base query programs using system()
  5057. to create a file containing the subset. The Icon program can then open
  5058. the file and read it.
  5059.  
  5060. I hope you find these ideas useful.
  5061.  
  5062.   Ken Walker / Computer Science Dept / Univ of Arizona / Tucson, AZ 85721
  5063.   +1 602 621-4252  kwalker@cs.arizona.edu   uunet!arizona!kwalker
  5064.  
  5065.  
  5066. From icon-group-sender  Sat Jun 16 17:08:20 1992
  5067. Received: by cheltenham.cs.arizona.edu; Tue, 16 Jun 1992 13:18:22 -0700
  5068. Date: 16 Jun 92 17:08:20 GMT
  5069. From: micro-heart-of-gold.mit.edu!wupost!spool.mu.edu!caen!kuhub.cc.ukans.edu!chris@bloom-beacon.mit.edu
  5070. Organization: University of Kansas Academic Computing Services
  5071. Subject: Context Free Grammar and Parsing Dictionary
  5072. Message-Id: <1992Jun16.120820.40826@kuhub.cc.ukans.edu>
  5073. Sender: icon-group-request@cs.arizona.edu
  5074. To: icon-group@cs.arizona.edu
  5075. Status: R
  5076. Errors-To: icon-group-errors@cs.arizona.edu
  5077.  
  5078. I am interested in writing a Context free grammar in snobol and icon. I am 
  5079. interested in any citations that people would have, as well as suggestions on
  5080. where to find a pd parsing dictionary.
  5081.  
  5082. Thank you.
  5083.  
  5084. Christopher Donald
  5085. University of Kansas
  5086.  
  5087.  
  5088. From icon-group-sender  Sun Jun 17 17:11:47 1992
  5089. Received: by cheltenham.cs.arizona.edu; Wed, 17 Jun 1992 11:45:50 -0700
  5090. Path: ucbvax!cis.ohio-state.edu!zaphod.mps.ohio-state.edu!cs.utexas.edu!utgpu!torn!cunews!nrcnet0!furlong
  5091. From: furlong@selaix.iit.nrc.ca
  5092. Newsgroups: comp.lang.icon
  5093. Subject: string scanning and procedure calls
  5094. Keywords: string, scan, procedure
  5095. Message-Id: <1992Jun17.171147.20948@nrcnet0.nrc.ca>
  5096. Date: 17 Jun 92 17:11:47 GMT
  5097. Sender: root@nrcnet0.nrc.ca (Operator)
  5098. Organization: National Research Council of Canada
  5099. Lines: 59
  5100. Nntp-Posting-Host: selaix.iit.nrc.ca
  5101. Apparently-To: icon-group@cs.arizona.edu
  5102. Status: R
  5103. Errors-To: icon-group-errors@cs.arizona.edu
  5104.  
  5105.  
  5106.    
  5107.    I am scanning a string (&subject) for one of a set of words.
  5108.    If a particular word is found, a subroutine is called to scan the
  5109.    remainder of the string for some other value.
  5110.  
  5111.    If I do not pass the string in as a parameter, the remainder of &subject
  5112.    from the calling procedure is used, and the subroutine executes correctly.
  5113.    For example:
  5114.  
  5115.  
  5116.       string := read()
  5117.       string ? {
  5118.               tab(many(' \t'))
  5119.               do_something()
  5120.       }
  5121.  
  5122.  
  5123.  
  5124.       procedure do_something()
  5125.  
  5126.       word := tab(many(&letters))
  5127.  
  5128.  
  5129.     word will be assigned the first string of letters after any preceding
  5130.     whitespace.
  5131.  
  5132.    However, if I pass &subject[&pos:0] to the subroutine as a parameter,
  5133.    and try to scan the parameter, an error occurs (the wrong value is assigned)
  5134.  
  5135.  
  5136.     string := read()
  5137.     string ? {
  5138.            word1 := tab(many(&letters))
  5139.            tab(many(space))
  5140.            do_something(&subject[&pos:0])
  5141.      }
  5142.  
  5143.  
  5144.     procedure do_something(str)
  5145.  
  5146.     word := tab(many(&letters,str))
  5147.  
  5148.     word here is assigned incorrectly (to some or all the letters in word1)
  5149.  
  5150.    This problem can be solved by reassigning &subject inside the called
  5151.    procedure via the ? operator, I'm just interested to know why it happens.
  5152.  
  5153.  
  5154.     Has anyone out there seen this before?
  5155.     Thanks,
  5156.  
  5157.        Andrew
  5158.  
  5159. -- 
  5160. Andrew Furlong                   | The views expressed herein are mine alone,
  5161. Summer Research Assistant        | and may not reflect those of the National
  5162. furlong@selaix.iit.nrc.ca        | Research Council of Canada or the Government
  5163. National Research Council (NRCC) | of Canada.
  5164.  
  5165.  
  5166. From icon-group-sender  Wed Jun 17 12:31:21 1992
  5167. Received: by cheltenham.cs.arizona.edu; Wed, 17 Jun 1992 14:08:15 -0700
  5168. Date: Wed, 17 Jun 92 16:31:21 -0400
  5169. From: isidev!nowlin@uunet.uu.net
  5170. Message-Id: <9206172031.AA09780@relay1.UU.NET>
  5171. To: uunet!cs.arizona.edu!icon-group@uunet.UU.NET
  5172. Subject: Re: scanning in procedures
  5173. Status: R
  5174. Errors-To: icon-group-errors@cs.arizona.edu
  5175.  
  5176.  > From: furlong@selaix.iit.nrc.ca
  5177.  > Subject: string scanning and procedure calls
  5178.  > Date: 17 Jun 92 17:11:47 GMT
  5179.  >    
  5180.  >    I am scanning a string (&subject) for one of a set of words.
  5181.  >    If a particular word is found, a subroutine is called to scan the
  5182.  >    remainder of the string for some other value.
  5183.  > 
  5184.  >    If I do not pass the string in as a parameter, the remainder of &subject
  5185.  >    from the calling procedure is used, and the subroutine executes correctly.
  5186.  >
  5187.  >    ... 
  5188.  >
  5189.  >    However, if I pass &subject[&pos:0] to the subroutine as a parameter,
  5190.  >    and try to scan the parameter, an error occurs (the wrong value is
  5191.  >    assigned)
  5192.  > 
  5193.  >        string := read()
  5194.  >        string ? {
  5195.  >            word1 := tab(many(&letters))
  5196.  >            tab(many(space))
  5197.  >            do_something(&subject[&pos:0])
  5198.  >        }
  5199.  >
  5200.  >        procedure do_something(str)
  5201.  > 
  5202.  >        word := tab(many(&letters,str))
  5203.  >
  5204.  >    word here is assigned incorrectly (to some or all the letters in word1)
  5205.  > 
  5206.  >    This problem can be solved by reassigning &subject inside the called
  5207.  >    procedure via the ? operator, I'm just interested to know why it happens.
  5208.  > 
  5209.  >    Has anyone out there seen this before?
  5210.  >    Thanks,
  5211.  > 
  5212.  >    Andrew
  5213.  
  5214. Andrew,
  5215.  
  5216.         I added additional code to the fragment below to make it into a
  5217. complete program.  It's much easier to think of this stuff if you can
  5218. really run it.
  5219.  
  5220.     procedure main()                # mine
  5221.         space := ' \t'                # mine
  5222.  
  5223.         string := read()
  5224.         string ?  {
  5225.             word1 := tab(many(&letters))
  5226.             tab(many(space))
  5227.             do_something(&subject[&pos:0])
  5228.         }
  5229.     end                        # mine
  5230.  
  5231.     procedure do_something(str)
  5232.         word := tab(many(&letters,str))
  5233.  
  5234.         write("'",word,"'")            # mine
  5235.     end                        # mine
  5236.  
  5237. This is a neat puzzler.  The real misconception seems to be associating the
  5238. tab() in the expression:
  5239.  
  5240.     word := tab(many(&letters,str))
  5241.  
  5242. with the subject of the many(), str.  Since you provided a second argument
  5243. to this many() it's going to return the position in str after as many
  5244. initial letters as it can find, but the &subject that tab() operates on is
  5245. still the &subject from the main procedure since you haven't initiated
  5246. another scanning expression.
  5247.  
  5248. The tab() function is only meaningful in the context of string scanning
  5249. since it potentially returns a portion of &subject and modifies &pos.  If
  5250. you try your routine with some careful input and an understanding of the
  5251. above you'll see that the identifier "word" is being assigned what tab is
  5252. supposed to return.  It's just not what you expected.
  5253.  
  5254. By the way, the use of "string" as a variable overrides it's definition as
  5255. a built-in function.  It's no problem here but can lead to very confusing
  5256. errors under other circumstances.
  5257.  
  5258. --- ---
  5259.  | S |  Iconic Software, Inc.  -  Jerry Nowlin  -  uunet!isidev!nowlin
  5260. --- ---
  5261.  
  5262.  
  5263.  
  5264. From icon-group-sender  Tue Jun 19 19:56:14 1992
  5265. Received: by cheltenham.cs.arizona.edu; Sat, 20 Jun 1992 05:39:08 -0700
  5266. Date: 19 Jun 92 19:56:14 GMT
  5267. From: agate!pasteur!cory.Berkeley.EDU!hughett@ucbvax.Berkeley.EDU  (Paul Hughett)
  5268. Organization: University of California, at Berkeley
  5269. Subject: Where to get icon?
  5270. Message-Id: <1992Jun19.195614.19191@pasteur.Berkeley.EDU>
  5271. Sender: icon-group-request@cs.arizona.edu
  5272. To: icon-group@cs.arizona.edu
  5273. Status: R
  5274. Errors-To: icon-group-errors@cs.arizona.edu
  5275.  
  5276.  
  5277.    I am interested in using Icon to do some text hacking on an MS-DOS
  5278. machine or Sparc station.  Where can I get the source code (in C) or
  5279. binary code to run Icon.  Please reply to hughett@cory.berkeley.edu
  5280. or post news for other interested parties.  Thanks.
  5281.  
  5282.  
  5283. *  Paul Hughett      hughett@cory.berkeley.edu
  5284. *  EECS Department, University of California at Berkeley
  5285.  
  5286.  
  5287. From icon-group-sender  Thu Jun 21 16:08:34 1992
  5288. Received: by cheltenham.cs.arizona.edu; Sun, 21 Jun 1992 12:02:44 -0700
  5289. Date: 21 Jun 92 16:08:34 GMT
  5290. From: eru.mt.luth.se!lunic!sunic2!mcsun!corton!irisa!irisa.fr!bekkers@bloom-beacon.mit.edu  (Yves Bekkers INRIA/IRISA)
  5291. Organization: Irisa, Rennes(FR)
  5292. Subject: IWMM Program
  5293. Message-Id: <1992Jun21.160834.21999@irisa.fr>
  5294. Sender: icon-group-request@cs.arizona.edu
  5295. To: icon-group@cs.arizona.edu
  5296. Status: R
  5297. Errors-To: icon-group-errors@cs.arizona.edu
  5298.  
  5299.  
  5300.               Advance Program and registration information
  5301.  
  5302.                                   IWMM
  5303.                International Worshop on Memory Management
  5304.  
  5305.                          September 16-18, 1992
  5306.                         Centre de la Briantais
  5307.                             St Malo, France
  5308.  
  5309.  
  5310. The International workshop on Memory Management covers
  5311. state-of-the-art research on memory management in programming
  5312. languages implementations. The program includes invited talks,
  5313. reviewed presentations and panel discussions. The sessions have
  5314. been scheduled around the areas of
  5315.  
  5316. distributed systems,
  5317. parallelism,
  5318. fuctional programming,
  5319. logic programming,
  5320. object oriented programming,
  5321. incremental garbage collection,
  5322. improving locality,
  5323. massively parallel architectures.
  5324.  
  5325.  
  5326.                       PROGRAMME COMMITTEE
  5327.  
  5328.                           Chairman
  5329. Jacques Cohen      Brandeis University, Waltham, MA, USA
  5330.  
  5331. Joel F. Bartlett   DEC, Palo Alto, CA, USA
  5332. Yves Bekkers       INRIA-IRISA, Rennes, France
  5333. Hans-Jurgen Boehm  Xerox Corporation, Palo Alto, CA, USA
  5334. Maurice Bruynooghe Katholieke Universiteil, Leuven, Belgium
  5335. Bernard Lang       INRIA, Le Chesnay, France
  5336. David A. Moon      Apple Computer, Cambridge, MA, USA
  5337. Christian Queinnec INRIA, Le Chesnay, France
  5338. Dan Sahlin         SICS, Kista, Sweden
  5339. Taiichi Yuasa      Toyohashi Univ. of tech., Toyohashi, Japan
  5340.  
  5341.  
  5342.                       Workshop Coordinator
  5343.  
  5344. Yves Bekkers                       Email : bekkers@irisa.fr
  5345. INRIA-IRISA                        Tel   : (+33) 99 84 73 24
  5346. Campus Universitaire de Beaulieu   Fax   : (+33) 99 38 38 32
  5347. 35042 Rennes Cedex - France        Telex : Unirisa 950 473 F
  5348.  
  5349.  
  5350.                      In Cooperation with
  5351.  
  5352. INRIA
  5353. ACM SIGPLAN
  5354. University of Rennes I
  5355. CNRS-GRECO Programmation
  5356.  
  5357.  
  5358.                       ADVANCE PROGRAM
  5359.  
  5360.                    Wednesday September 16th
  5361.  
  5362.                  09:00 -- OPENING SESSION --
  5363.  
  5364.             J. Cohen, Brandeis University, Waltham, MA, USA
  5365.  
  5366.                09:15 -- DISTRIBUTED SYSTEMS I --
  5367.  
  5368. Distributed Garbage collection,
  5369. G. Ringwood, E. Miranda, S. Abdullahi, Univ. of London, United Kingdom
  5370.  
  5371. Comprehensive and robust garbage collection in a distributed system,
  5372. N. C. Juul, E. Jul, DIKU, University of Copenhagen, Denmark
  5373.  
  5374.                10:30 -- DISTRIBUTED SYSTEMS II --
  5375.  
  5376. Experience with fault-tolerant garbage collection in a distributed 
  5377. Lisp system, D. Plainfosse, M. Shapiro, INRIA, France
  5378.  
  5379. Scalable distributed garbage collection for systems of active objects,
  5380. N. Venkatasubramanian, G. Agha, C. Talcott, HP Comp., USA
  5381.  
  5382. Distributed Garbage collection of active objects with no synchronisation,
  5383. I. Puaut, INRIA/IRISA, France
  5384.  
  5385.                    13:30 -- PARALLELISM I --
  5386.  
  5387. Memory management for parallel tasks in shared memory,
  5388. K. Langendoen, H. Muller, W.G. Vree, Univ. of Amsterdam, Netherland
  5389.  
  5390. Incremental multi-threaded garbage collection on virtually shared
  5391. memory architectures, T. Le Sergent, B. Bartholomieu, CNRS, France
  5392.  
  5393.                  14:45 -- FUNCTIONAL PROGRAMMING --
  5394.  
  5395. Generational garbage collection for lazy graph reduction,
  5396. J. Seward, Victoria Univ. of Manchester, United Kingdom
  5397.  
  5398. A conservative garbage collector with ambiguous roots, for static type
  5399. checking languages, E. Chailloux, LIENS-LITP, France
  5400.  
  5401. Efficient implementation for coroutines,
  5402. L. Mateu, Universidade de Chile, 
  5403.  
  5404. An implementation of an applicative file system.,
  5405. B.C. Heck, D.S. Wise, Indiana University, USA.
  5406.  
  5407.                   17:00 -- DISCUSSION SESSION--
  5408.  
  5409. Garbage collection and memory hierarchy,
  5410. P. Wilson, University of Texas, USA.
  5411.  
  5412.  
  5413.  
  5414.  
  5415.                       Thursday September 17th
  5416.  
  5417.                   09:00 -- LOGIC PROGRAMMING I
  5418.  
  5419. A survey on memory management for logic programming,
  5420. Y. Bekkers, O. Ridoux, L. Ungaro, INRIA/IRISA, France
  5421.  
  5422. A compile time memory-reuse scheme for concurrent logic programs,
  5423. E. Tick, S. Duvvuru, R. Sundararajan, University of Oregon, USA
  5424.  
  5425.                10:00 -- OBJECT ORIENTED PROGRAMMING --
  5426.  
  5427. Finalization of the collector interface,
  5428. B. Hayes, Stanford University, USA
  5429.  
  5430. Precompiling C++ for garbage collection,
  5431. D. R. Edelson, INRIA, France
  5432.  
  5433. Garbage collection-cooperative C++,
  5434. A. D. Samples, University of Cincinnati, USA
  5435.  
  5436.                  13:30 -- LOGIC PROGRAMMING II --
  5437.  
  5438. Dynamic revision of choice points during garbage collection in Prolog,
  5439. J. F. Pique, University of Aix-Marseille II, France
  5440.  
  5441. Ecological memory management in a continuation passing Prolog engine,
  5442. P. Tarau, Univ. de Moncton, Canada
  5443.  
  5444.                     15:00 -- INCREMENTAL --
  5445.  
  5446. Replication-based incremental copying collection,
  5447. S. Nedttles, J. O'Toole, D. Pierce, N. Haines, Carnegie Mellon Univ., USA
  5448.  
  5449. Atomic incremental garbage collection,
  5450. E. K. Kolodner, W. E. Weihl, IBM Science and Technology, Israel
  5451.  
  5452. Incremental garbage collection for mature objects,
  5453. J. B. Moss, R. L. Hudson, Univ. of Massachusetts, USA
  5454.  
  5455.                   17:00 -- DISCUSSION SESSION
  5456.  --
  5457.  
  5458. Copying garbage collection is harmful,
  5459. D. A. Moon, Apple Computer, Cambridge, USA
  5460.  
  5461.  
  5462.                      Friday September 18th 
  5463.  
  5464.  
  5465.                   09:00 -- INVITED SPEAKER --
  5466.  
  5467. Thermodynamics of Garbage collection,
  5468. H. G. Baker, Nimble computer Corporation, USA
  5469.  
  5470.                  09:30 -- IMPROVING LOCALITY --
  5471.  
  5472. Object type directed garbage collection to improve locality,
  5473. M. S. Lam, P.R. Wilson, T.G. Moher, University of Illinois, USA
  5474.  
  5475. Allocation regions and implementation contracts,
  5476. V. Delacour, Xerox Corporation, USA 
  5477.  
  5478.  
  5479.                    11:00 -- PARALLELISM II --
  5480.  
  5481. A concurrent generational garbage collector for a parallel graph
  5482. reducer, N. Rojemo, Chalmers University of technology, Sweden.
  5483.  
  5484. Garbage collection in Aurora : an overview,
  5485. P. Weemeeuw, K.U. Leuven, Belgium.
  5486.  
  5487.  
  5488.                   13:30 -- MASSIVELY PARALLEL ARCHITECTURES --
  5489.  
  5490. Collections and Garbage collection,
  5491. S. C. Merrall, J.A. Padget, University of Bath, United Kingdom.
  5492.  
  5493. Memory management and garbage collection of an extended Common Lisp
  5494. system for massively parallel SIMD architecture,
  5495. T. Yuasa, Toyohashi University of Technology, Japan.
  5496.  
  5497.  
  5498.                     REGISTRATION FEES-ATTENDANCE
  5499.  
  5500. The attendance is limited to 70 participants including the speakers.
  5501. The registration fees are:
  5502.  
  5503. - Participant    2 000 FF
  5504. - Student    1 200 FF
  5505.  
  5506. These fees include the right of access to the conference room, the
  5507. proceedings, six meals (including the cold buffet on tuesday evening
  5508. and the dinner cruise party on "La Rance"), coffee breaks, bus shuttles.
  5509.  
  5510. Participants are in charge of their accomodation. There are limited
  5511. rooms available in the workshop center. Hotels will otherwise be proposed. 
  5512.  
  5513. An optional night-tour is planned on Wednesday 16, to visit the "Mont Saint
  5514. Michel".
  5515.  
  5516. Registration starts on Tuesday the 15th at 17:00 at the workshop center: 
  5517.  
  5518.     Le Centre de La Briantais
  5519.     30 rue Maurice Nogues
  5520.     St MALO France
  5521.     Tel (33) 99 81 87 04
  5522.  
  5523. A cold buffet will be served at the center between 19:00 and 21:30.
  5524.  
  5525.  
  5526.                          HOW TO GET THERE
  5527.  
  5528. 1) By train from Paris
  5529.  
  5530. A bus will pick up participants taking the following TGV at their
  5531. arrival in Rennes and take them to the workshop center, a one hour drive:
  5532.  
  5533.                        TGV           BUS
  5534.    Paris/Montparnasse  --->  Rennes  --->  St Malo
  5535.    15:20                     17:25         18:30
  5536.  
  5537.  
  5538. For your return, a bus will take you to the following TGV in Rennes :
  5539.  
  5540.             BUS           TGV
  5541.    St MALO  --->  Rennes  --->  Paris/Montparnasse
  5542.    16:00          17:10         19:20
  5543.  
  5544. Important: reservations are required on French TGV which are usually
  5545. fully booked a few days in advance, we can help taking train tickets
  5546. and reservations on these two TGVs.
  5547.  
  5548. 2) By plane via Jersey, the largest of the British Channel Islands
  5549.  
  5550. There are no direct flight from Paris or London to Dinard/St Malo, you
  5551. must come via Jersey.
  5552.  
  5553. - from Jersey, there is a daily, one hour, flight to Dinard airport,
  5554. (5 km from St Malo) which arrives at 19:05 in Dinard. Crossing by boat is
  5555. also possible and very handy.
  5556.  
  5557. - from Paris to Jersey, you can take the 16:40 flight and make your
  5558. connection to the Dinard flight.
  5559.  
  5560. - from London (Gatwick) to Jersey, there are several daily flights.
  5561.  
  5562. 3) By plane and boat via Jersey
  5563.  
  5564. The Channel Islands are very close from St Malo and there are plenty
  5565. of daily large catamarans, almost one every hour, between Jersey and St
  5566. Malo, it is only a one hour cruise.
  5567.  
  5568.                            INFORMATIONS
  5569.  
  5570. Isabelle Mescam                    Email : mescam@irisa.fr
  5571. INRIA-IRISA                        Tel   : (+33) 99 84 71 00
  5572. Campus Universitaire de Beaulieu   Fax   : (+33) 99 38 38 32
  5573. 35042 Rennes Cedex - France        Telex : Unirisa 950 473 F
  5574.  
  5575. -- 
  5576. ====================================================================
  5577.  
  5578.  Yves Bekkers                              Phone     +33 99 84 73 24 
  5579.  IRISA/INRIA-Rennes                        FAX       +33 99 38 38 32 
  5580.  Campus Universitaire de Beaulieu          Telex    UNIRISA 950 473F 
  5581.  35042 Rennes CEDEX - FRANCE               e-mail   bekkers@irisa.fr 
  5582.  
  5583. ====================================================================
  5584.  
  5585.  
  5586. From icon-group-sender  Mon Jun 22 16:52:53 1992
  5587. Received: by cheltenham.cs.arizona.edu; Mon, 22 Jun 1992 07:15:57 -0700
  5588. Date: Mon, 22 Jun 92 14:52:53 +0200
  5589. From: Jan Peter de Ruiter <janpeter@mpi.kun.nl>
  5590. Message-Id: <9206221252.AA21855@mpix10.mpi.kun.nl>
  5591. To: icon-group@cs.arizona.edu
  5592. Subject: teaching Icon
  5593. Status: R
  5594. Errors-To: icon-group-errors@cs.arizona.edu
  5595.  
  5596. Hi,
  5597.  
  5598. Since I'm considering giving a short introductory course on Icon
  5599. programming to some interested people, I came across a sentence
  5600. in the Icon Bible (I don't remeber the exact phrasing now) that
  5601. expresses the opinion that in order to learn Icon, you have to
  5602. have had some experience in "standard" programming languages.
  5603.  
  5604. I tend to agree, but that could be a result of my own learning 
  5605. history in computer science. After getting sick and tired of all
  5606. those boring loops (in C or Pascal) to run through a sequential
  5607. data structure, or trying to find out if that file is really open
  5608. now by checking error-codes/return values, the concepts of success/
  5609. failure and the generator metaphor are a true relief.
  5610.  
  5611. Could it not be the case that for people without any programming 
  5612. experience at all, Icon is easier to learn than, say, Pascal? The
  5613. Icon metaphors are more intuitive, and the student can learn to
  5614. program algorithms without the need of low-level knowledge such as
  5615. "a string is actually a series of unsigned short integers in C", or
  5616. "every time you try to read from a file you should check for 
  5617.  end-of-file by looking at this or that value".
  5618.  
  5619. Perhaps students that learn Icon as their mother-tongue will be spoiled
  5620. in a way; they may not be willing to learn the lower level stuff if 
  5621. they can use Icon for almost every application they would like to write.
  5622. But I don't like that argument. It's too calvinistic. The first aim of
  5623. computer education is to get students hooked on the use of computers
  5624. without always having to rely on standard software, at least that is 
  5625. *my* aim. If Icon could get more people to *program* computers instead 
  5626. of doing absolutely everything in Lotus, SPSS, or WordPerfect (some people
  5627. I know do data-laundry with WordPerfect macro's, since that all they know)
  5628. that would be a great advance, in my opinion.
  5629.  
  5630. So to wrap up: what's against teaching Icon as a first language?
  5631.  
  5632. I'd like some thoughful comments, especially from people with didactic
  5633. experience in computer education.
  5634.  
  5635. Greetings,
  5636.  
  5637. Jan P. A. de Ruiter
  5638. janpeter@mpi.kun.nl
  5639.  
  5640.  
  5641.  
  5642. From icon-group-sender  Sat Jun 23 04:03:11 1992
  5643. Received: by cheltenham.cs.arizona.edu; Tue, 23 Jun 1992 05:23:41 -0700
  5644. Date: 23 Jun 92 04:03:11 GMT
  5645. From: cis.ohio-state.edu!zaphod.mps.ohio-state.edu!rpi!usc!snorkelwacker.mit.edu!world!ksr!tim@ucbvax.Berkeley.EDU  (Tim Peters)
  5646. Organization: Kendall Square Research Corp.
  5647. Subject: Re: teaching Icon
  5648. Message-Id: <13184@ksr.com>
  5649. References: <9206221252.AA21855@mpix10.mpi.kun.nl>
  5650. Sender: icon-group-request@cs.arizona.edu
  5651. To: icon-group@cs.arizona.edu
  5652. Status: R
  5653. Errors-To: icon-group-errors@cs.arizona.edu
  5654.  
  5655. In article <9206221252.AA21855@mpix10.mpi.kun.nl> janpeter@mpi.kun.nl (Jan Peter de Ruiter) writes:
  5656. >Since I'm considering giving a short introductory course on Icon
  5657. >programming to some interested people, I came across a sentence
  5658. >in the Icon Bible (I don't remeber the exact phrasing now) that
  5659. >expresses the opinion that in order to learn Icon, you have to
  5660. >have had some experience in "standard" programming languages.
  5661. >...
  5662.  
  5663.  
  5664. From icon-group-sender  Tue Jun 23 05:23:50 1992
  5665. Date: Tue, 23 Jun 1992 05:23:50 -0700
  5666. From: icon-group-sender
  5667. Message-Id: <199206231223.AA20651@cheltenham.cs.arizona.edu>
  5668. Received: by cheltenham.cs.arizona.edu; Tue, 23 Jun 1992 05:23:50 -0700
  5669. Status: R
  5670. Errors-To: icon-group-errors@cs.arizona.edu
  5671. Apparently-To: icon-group-addresses
  5672.  
  5673.     The reader of this book should have a general understanding of
  5674.     the concepts of computer programming languages and a
  5675.     familiarity with the current terminology in the field.
  5676.     Programming experience with other programming languages, such as
  5677.     Pascal or C, is desirable.
  5678.  
  5679. I take that to mean that the book intends to describe Icon, and does not
  5680. intend to teach computer science or programming.  I.e., that it's a
  5681. statement about this specific book, not about Icon itself.
  5682.  
  5683. >...
  5684. >Could it not be the case that for people without any programming 
  5685. >experience at all, Icon is easier to learn than, say, Pascal?
  5686.  
  5687. I would expect so, yes.  Beginning programmers are just plain mystified,
  5688. no matter what the language, and I expect that Icon as a first language
  5689. would help them not to get hung up on trivialities (signed vs unsigned,
  5690. packed vs unpacked, long vs short vs int vs char, etc etc).
  5691.  
  5692. although-i-learned-fortran-first-&-think-everyone-else-should-suffer-
  5693.    the-way-i-did<grin>-ly y'rs  - tim
  5694.  
  5695. Tim Peters   Kendall Square Research Corp
  5696. tim@ksr.com,         ksr!tim@uunet.uu.net
  5697.  
  5698.  
  5699. From icon-group-sender  Tue Jun 23 05:23:18 1992
  5700. Received: by cheltenham.cs.arizona.edu; Tue, 23 Jun 1992 07:44:22 -0700
  5701. Date: Tue, 23 Jun 92 09:23:18 -0400
  5702. From: isidev!nowlin@uunet.uu.net
  5703. Message-Id: <9206231323.AA16239@relay1.UU.NET>
  5704. To: uunet!cs.arizona.edu!icon-group@uunet.UU.NET
  5705. Subject: Re: teaching Icon
  5706. Status: RO
  5707. Errors-To: icon-group-errors@cs.arizona.edu
  5708.  
  5709.  > >Could it not be the case that for people without any programming 
  5710.  > >experience at all, Icon is easier to learn than, say, Pascal?
  5711.  > 
  5712.  > I would expect so, yes.  Beginning programmers are just plain mystified,
  5713.  > no matter what the language, and I expect that Icon as a first language
  5714.  > would help them not to get hung up on trivialities (signed vs unsigned,
  5715.  > packed vs unpacked, long vs short vs int vs char, etc etc).
  5716.  > 
  5717.  > although-i-learned-fortran-first-&-think-everyone-else-should-suffer-
  5718.  >    the-way-i-did<grin>-ly y'rs  - tim
  5719.  > 
  5720.  > Tim Peters   Kendall Square Research Corp
  5721.  
  5722. I too spoke fortran as a first language and it took years to overcome the
  5723. compulsion to stick in a goto here and there.
  5724.  
  5725. I number of years ago I mentored a summer intern between his freshman and
  5726. sophomore years at MIT and taught him Icon in order to prototype a tool
  5727. that would scan textual log files and display sections of the logs based on
  5728. user specified patterns.  Since he didn't have a lot of "conventional
  5729. language" crap to overcome he took to Icon like a pig to mud.  By the end
  5730. of the summer he was trying things I wouldn't have thought to try and Icon
  5731. made them simple.  Of course he was a very sharp guy but Icon let him
  5732. imagine how the program should work and then implement it without all the
  5733. baggage Tim referred to above.  I think Icon would be an excellent first
  5734. language.
  5735.  
  5736. I'm interested in what institutions are teaching Icon as a language, even
  5737. as part of a larger course.  For example, IIT teaches Icon in a "these are
  5738. some neat languages" course and still uses it in a compiler construction
  5739. course I believe.  I know U of A teaches it.  What other colleges are
  5740. including Icon in their course offerings?
  5741.  
  5742. --- ---
  5743.  | S |  Iconic Software, Inc.  -  Jerry Nowlin  -  uunet!isidev!nowlin
  5744. --- ---
  5745.  
  5746.  
  5747.  
  5748. From icon-group-sender  Tue Jun 23 04:54:53 1992
  5749. Received: by cheltenham.cs.arizona.edu; Tue, 23 Jun 1992 11:38:11 -0700
  5750. Date:    Tue, 23 Jun 1992 9:54:53 -0500 (CDT)
  5751. From: DJBAILEY@SKYLER.MAVD.HONEYWELL.COM
  5752. Message-Id: <920623095453.2f2050bc@SKYLER.MAVD.HONEYWELL.COM>
  5753. Subject: Re: teaching Icon
  5754. To: <icon-group@cs.arizona.edu>
  5755. X-Vmsmail-To: SMTP%"<icon-group@cs.arizona.edu>"
  5756. Status: R
  5757. Errors-To: icon-group-errors@cs.arizona.edu
  5758.  
  5759. I am a professional programmer who is self-taught at Icon. One of the 
  5760. advantages to learning to program in Icon is ease of output. I wrote
  5761. many small programs to test features of the language in order to learn
  5762. how Icon behaved. My earliest programs had a Fortran-like design 
  5763. structure so I could understand them. Easy input and output is very
  5764. important in a first computer language and Icon is one of the languages
  5765. that has it.
  5766.  
  5767. On the other hand, Icon has some unique and tricky concepts that could 
  5768. hurt a first time user. I still mix up "every" and "while." The success
  5769. and failure concepts work very well some places and surprize me in 
  5770. others. It might be better to start with a simpler language like Basic
  5771. or Pascal.
  5772.  
  5773. When teaching programming, the teacher is more important than the 
  5774. language. You have to teach basic concepts like iteration, recursion,
  5775. algorithm selection, and data organization. Icon might be a good choice
  5776. for students with a poor math background because of Icon's suitability 
  5777. to non-numeric problems.
  5778.  
  5779. Icon is a better first language than Fortran because of the easy I/O and
  5780. the ability to demonstrate recursion. I'm not sure it's as good as Basic
  5781. or Pascal.
  5782.  
  5783. -- Don J. Bailey
  5784.  
  5785.  
  5786. From icon-group-sender  Sat Jun 23 22:28:25 1992
  5787. Received: by cheltenham.cs.arizona.edu; Tue, 23 Jun 1992 18:56:59 -0700
  5788. Date: 23 Jun 92 22:28:25 GMT
  5789. From: att!linac!uchinews!ellis!goer@ucbvax.Berkeley.EDU  (Richard L. Goerwitz)
  5790. Organization: University of Chicago Computing Organizations
  5791. Subject: Re: teaching Icon
  5792. Message-Id: <1992Jun23.222825.6180@midway.uchicago.edu>
  5793. References: <9206221252.AA21855@mpix10.mpi.kun.nl>
  5794. Sender: icon-group-request@cs.arizona.edu
  5795. To: icon-group@cs.arizona.edu
  5796. Status: R
  5797. Errors-To: icon-group-errors@cs.arizona.edu
  5798.  
  5799. janpeter@mpi.kun.nl (Jan Peter de Ruiter) writes:
  5800. >
  5801. >Since I'm considering giving a short introductory course on Icon
  5802. >programming to some interested people, I came across a sentence
  5803. >in the Icon Bible (I don't remeber the exact phrasing now) that
  5804. >expresses the opinion that in order to learn Icon, you have to
  5805. >have had some experience in "standard" programming languages.
  5806.  
  5807. Icon was the first programming language I learned really well.  I do
  5808. recall getting hung up on some basic concepts, but everything came
  5809. together OK.  If I'd taken it as part of an introductory programming
  5810. course, and had an instructor to explain a couple of basic things, I'd
  5811. guess it would have been just fine.
  5812.  
  5813. In some ways, wouldn't Icon be harder to figure out after having had
  5814. something like Pascal?
  5815.  
  5816. (I'm not advocating Icon as a first language, by the way; just tos-
  5817. sing in some ideas.)
  5818.  
  5819. -- 
  5820.  
  5821.    -Richard L. Goerwitz              goer%midway@uchicago.bitnet
  5822.    goer@midway.uchicago.edu          rutgers!oddjob!ellis!goer
  5823.  
  5824.  
  5825. From icon-group-sender  Wed Jun 24 08:59:58 1992
  5826. Received: by cheltenham.cs.arizona.edu; Wed, 24 Jun 1992 11:14:20 -0700
  5827. Date: Wed, 24 Jun 92 12:59:58 EDT
  5828. From: Paul_Abrahams@MTS.cc.Wayne.edu
  5829. To: icon-group@cs.arizona.edu
  5830. Message-Id: <471789@MTS.cc.Wayne.edu>
  5831. Subject: Icon as a first language
  5832. Status: R
  5833. Errors-To: icon-group-errors@cs.arizona.edu
  5834.  
  5835. Icon would be a marvelous first language for computer science courses
  5836. because, unlike its competitors, it encourages a high-level view of
  5837. programming yet avoids the trap of appearing too abstract or
  5838. theoretical.  Were I teaching it, I'd downplay goal-directed evaluation
  5839. and emphasize Icon's data structures: lists, tables, sets, strings,
  5840. unbounded integers, etc.  Moreover, Icon's error trapping is humane and
  5841. reasonable; out-of-bounds array (list, that is) references can't clobber
  5842. some other data that just happens to be sitting in the wrong place. 
  5843. Simple programs are easy to write; the initial hurdles are not large.
  5844.  
  5845. Programming in a realistic setting often requires far more optimization
  5846. and efficiency than Icon has any hope of ever providing.  (When will we
  5847. ever see a red-hot Icon implementation written in Icon itself?)  But the
  5848. right way to view an optimized program is as a derivative of a
  5849. high-level program.  If we don't have sets, we make do with arrays and
  5850. pointer-based structures.  But when obliged to do that, we should always
  5851. keep in mind what those lower-level structures are really expressing. 
  5852. Realistic programming also often requires very specific communication
  5853. with your environment (special system calls, etc.); Icon isn't terribly
  5854. good at this, but it's not the kind of stuff that belongs in a first
  5855. course anyway.
  5856.  
  5857. I see two practical programs with using Icon as a first language,
  5858. however:
  5859.  
  5860. (1) There is no appropriate textbook.  The Icon bible is marvelously
  5861. written for its intended audience, but it isn't appropriate for
  5862. beginners.  To make it so would ruin it for the rest of us.
  5863.  
  5864. (2) Icon is not very well known, particularly among people who teach
  5865. beginning courses.
  5866.  
  5867. The main competitors of Icon as a first language are probably Basic,
  5868. Pascal, and Scheme.  I'm not up on the recent extensions to Basic, but
  5869. the original language showed its utter dependency on a very limited
  5870. programming environment.  It's hard to see how extending it could
  5871. compensate for its weaknesses without losing compatibility with older
  5872. versions.  Pascal is optimized for obsolete programming environments and
  5873. computers--there's a lot to be said for learning how to optimize for
  5874. your environment and communicate with it, but if that's what you're
  5875. after, you should be using C or even Ada.  As to Scheme, it may be good
  5876. for MIT students, but hardly for the multitudes---and even there, I
  5877. wonder if Scheme really promotes the right high-level constructs.
  5878.  
  5879.  
  5880.  
  5881. From icon-group-sender  Thu Jun 25 10:02:22 1992
  5882. Received: by cheltenham.cs.arizona.edu; Thu, 25 Jun 1992 18:23:28 -0700
  5883. Date: Thu, 25 Jun 92 17:02:22 PDT
  5884. From: alex@laguna.Metaphor.COM (Bob Alexander)
  5885. Message-Id: <9206260002.AA06121@laguna.Metaphor.COM>
  5886. To: icon-group@cs.arizona.edu
  5887. Subject: Two-way conversations in Icon
  5888. Status: R
  5889. Errors-To: icon-group-errors@cs.arizona.edu
  5890.  
  5891. I would like to write an Icon program that carries on a two-way
  5892. conversation with a remote service (in the UNIX world, mainly) -- a
  5893. textual interface such as to a terminal-oriented service (like, for
  5894. example, ftp).  I'm not quite sure how to go about this, or if it's
  5895. even possible -- any suggestions?
  5896.  
  5897. -- Bob Alexander
  5898.  
  5899. Metaphor Computer Systems   (415) 961-3600 x751   alex@metaphor.com
  5900. ====^=== Mountain View, CA  ...{uunet}!{decwrl,apple}!metaphor!alex
  5901.  
  5902.  
  5903. From icon-group-sender  Sat Jun 27 02:54:00 1992
  5904. Received: by cheltenham.cs.arizona.edu; Sat, 27 Jun 1992 07:34:33 -0700
  5905. Date: Sat, 27 Jun 1992 08:54 CST
  5906. From: Chris Tenaglia - 257-8765 <TENAGLIA@mis.mcw.edu>
  5907. Subject: Teaching Icon
  5908. To: icon-group@cs.arizona.edu
  5909. Message-Id: <01GLPBWGKX1W9FMHHL@mis.mcw.edu>
  5910. X-Organization: Medical College of Wisconsin (Milwaukee, WI)
  5911. X-Vms-To: IN%"icon-group@cs.arizona.edu"
  5912. Status: R
  5913. Errors-To: icon-group-errors@cs.arizona.edu
  5914.  
  5915.  
  5916. I first bought Icon 5.9 for MS-DOS in 1985. I still have it and use it because
  5917. it doesn't use much memory. I also have Icon 8.5 for MS-DOS because of the
  5918. added features.
  5919.  
  5920. Having programmed BASIC for 10 years, and assembler for 5 years, I found the
  5921. README files fascinating, but I couldn't write a single working program till
  5922. I bought the book. I read it over a weekend back around 1988 and suddenly it
  5923. all made sense. The knowledge of basic and assembler didn't seem to hurt.
  5924.  
  5925. Later when I needed to write stuff in Pascal or C, I think the Icon knowledge
  5926. helped. I found those languages a lot harder to grasp, and master. I always
  5927. find myself crashing into their typed variables (even to this day). ADA which
  5928. is the ultimate in typed variables, procedures, keywords, etc,... is so bad
  5929. I couldn't bring myself to write the program exercizes because they were so
  5930. much easier to do in icon. I ended up writing Icon in ADA style and the
  5931. instructor wasn't amused. In this case Icon inhibited the learning of another
  5932. language.
  5933.  
  5934. Now the tables are turning. I've signed up for the chance to teach a session
  5935. on Icon at the December 1992 DECUS symposium in Las Vegas this year. I'll be
  5936. talking to a mixed crowd of users of VMS, Unix, and DOS backgrounds. Any one
  5937. care to offer advice on an "Intro to Icon" 1 hour talk? If I remember, I'll
  5938. share the results.
  5939.  
  5940. Thanks,
  5941.  
  5942. Chris Tenaglia (System Manager) |  "The past explained,
  5943. Medical College of Wisconsin    |   the future fortold, 
  5944. 8701 W. Watertown Plank Rd.     |   the present largely appologized for."
  5945. Milwaukee, WI 53226             |   Organon to The Doctor
  5946. (414)257-8765                   |     
  5947. tenaglia@mis.mcw.edu
  5948.  
  5949.  
  5950.  
  5951. From icon-group-sender  Sat Jun 27 02:53:07 1992
  5952. Received: by cheltenham.cs.arizona.edu; Sat, 27 Jun 1992 13:56:01 -0700
  5953. Date: Sat, 27 Jun 92 09:53:07 -0700
  5954. From: Michael Shafto <shafto@eos.arc.nasa.gov>
  5955. Message-Id: <9206271653.AA07183@eos.arc.nasa.gov>
  5956. To: TENAGLIA@mis.mcw.edu, icon-group@cs.arizona.edu
  5957. Subject: Re:  Teaching Icon
  5958. Cc: shafto@eos.arc.nasa.gov
  5959. Status: R
  5960. Errors-To: icon-group-errors@cs.arizona.edu
  5961.  
  5962. I agree with Paul Abrahamson's recent note:  The neatest
  5963. thing about Icon is the range of datatypes and data
  5964. structures it supports.  I've been hacking away for 2-3
  5965. years on a distributed-processing simulation package
  5966. based on Communicating Sequential Processes (CSP) by
  5967. Tony Hoare.  The most natural approach in Icon was
  5968. to go directly to co-routines.  But this quickly proved
  5969. to be neat but impractical:  stack space was eaten up and
  5970. the system crasged fairly quickly for any but the smallest
  5971. toy problems.  So I went back to the drawing board and
  5972. figured out a way to do it using concventional procedure
  5973. call/routine protocols -- no co-routines, no user-defined
  5974. control structures, no any of that jazz.  But I still
  5975. depend critically on sets, records, tables, lists, and
  5976. -- of course -- on variable-length strings.
  5977.  
  5978. Another mundane feature of Icon which I find amazingly
  5979. helpful is the compile-link-run structure which
  5980. encourages the building of libraries.
  5981.  
  5982. On the negative side:  For introductory purposes, I
  5983. would stay away from string analysis.  As one who
  5984. has programmed for years in SNOBOL4, I still have
  5985. one heck of a time doing anything but the simplest
  5986. string-scanning in Icon.  My personal opinion is that
  5987. the *logical* structure of string scanning, from the
  5988. user's viewpoint, is extremely opaque and confusing
  5989. in Icon (as compared to SNOBOL4, which also has a few
  5990. curves to throw at you, of course).  It may be that
  5991. I'm brain-damaged from SNOBOL4, but it seems that it's
  5992. really hard to remember and envision just exactly
  5993. what's happening in Icon string-scanning; and you
  5994. have to do that in order not to be surprised by what
  5995. you get a lot of them time.
  5996.  
  5997. So, my advice is to stick to conventional control
  5998. structures and focus on the nice range of datatypes
  5999. at first.  I have found sets to be amazingly useful.
  6000.  
  6001. Good luck!
  6002.  
  6003. Mike
  6004.  
  6005.  
  6006. From icon-group-sender  Sun Jun 28 18:51:55 1992
  6007. Received: by cheltenham.cs.arizona.edu; Sun, 28 Jun 1992 11:12:45 -0700
  6008. Via: uk.ac.manchester.computer-science; Sun, 28 Jun 1992 18:18:07 +0100
  6009. From: Steve Holden <steve@dtc.co.uk>
  6010. Date: Sun, 28 Jun 92 17:51:55 +0100
  6011. Message-Id: <2579.9206281651@desktop.desktop.co.uk>
  6012. To: icon-group@cs.arizona.edu
  6013. Subject: Re: Teaching Icon
  6014. Status: R
  6015. Errors-To: icon-group-errors@cs.arizona.edu
  6016.  
  6017. A further remark relevant to the teaching of Icon as
  6018. a beginner's language.
  6019.  
  6020. When I learned programming I started out with Algol 60,
  6021. moved on to the assembly language for a now long-forgotten
  6022. range of ICL machines, and went on picking up languages
  6023. (PL/1, Fortran 2, Fortran 4, Snobol 4, etc.) as I needed
  6024. them.  Job mobility was much higher in those days.
  6025.  
  6026. Icon has many features which are desirable in a language for
  6027. beginners, but one thing which might stand in its way is the
  6028. relatively overloaded operator set.
  6029.  
  6030. For example, p!l (where p is a procedure and l is a list)
  6031. really does mean something in Icon, but it is unlikely to be
  6032. useful for beginners.  The problem, as I see it, is that many
  6033. sequences of symbols which a beginner might use incorrectly
  6034. would be syntactically acceptable, and only at run-time would the
  6035. errors become known.
  6036.  
  6037. This gives the teacher two problems:
  6038.  
  6039. 1.  S/he has to explain what should have been written instead of
  6040.     what was.
  6041.  
  6042. 2.  S/he then has to explain why the erroneous construct was
  6043.     accepted by the translator.
  6044.  
  6045. Perhaps we could discuss which operators were appropriate to a
  6046. "beginners" version of the language, and produce a standard
  6047. system with a trimmed-down lexical analyser to obviate this problem?
  6048.  
  6049. regards
  6050.  Steve
  6051.  
  6052. +-----------------------------------+-----------------------------------+
  6053. | Steve Holden, Managing Director   | Desktop Connection Limited        |
  6054. |             steve@desktop.co.uk   | Manchester Science Park           |
  6055. |-----------------------------------+ Lloyd Street North                |
  6056. | Electronic Publishing Specialists | Manchester England M15 4EN        |
  6057. |     Communication is Sharing      | Tel: +44 61 227 9055 Fax: 226 4922|
  6058. +-----------------------------------^-----------------------------------+
  6059. | Commercial Director: UK Internet Consortium Limited: 061 256 3955     |
  6060. +-----------------------------------------------------------------------+
  6061.  
  6062.  
  6063. From icon-group-sender  Sun Jun 28 11:26:21 1992
  6064. Received: by cheltenham.cs.arizona.edu; Sun, 28 Jun 1992 20:44:12 -0700
  6065. Date: Sun, 28 Jun 92 18:26:21 PDT
  6066. From: rdm@cfcl.com (Rich Morin)
  6067. Message-Id: <9206290126.AA00349@cfcl.com>
  6068. To: icon-group@cs.arizona.edu, rdm@cfcl.com
  6069. Subject: Re:  Two-way conversations in Icon
  6070. Status: R
  6071. Errors-To: icon-group-errors@cs.arizona.edu
  6072.  
  6073. I hacked up something to do this, a few years back.  I wanted icon to talk to
  6074. NeWS interpreter, as I recall.  I added a command to Icon to open I/O to a
  6075. specified file.  Using this, I had it open a pair of named pipes.  I then
  6076. invoked another program that set up named pipes to a NeWS shell (psh).  All
  6077. of this is pretty hacky, and some of the interfaces may have changed, but here
  6078. is some sample code I dug up:
  6079.  
  6080. #
  6081. # foo.icn - check out ne3
  6082. #
  6083.  
  6084. procedure main()
  6085.   if not (ne0 := open("/usr/local/ne0","w")) then
  6086.     stop("foo: Cannot open ne0")
  6087.  
  6088.   write("ready")
  6089.  
  6090.   while line := read() do
  6091.     write(ne0,line)
  6092. end
  6093. rdm@cfcl 617: cd ne3
  6094. rdm@cfcl 618: l
  6095. foo*    ne3*    ne3.c   ne3.o
  6096. rdm@cfcl 619: more ne3.c
  6097. /*
  6098. || ne3.c - NeWS Environment, take 3
  6099. ||
  6100. || depends on the existence of named pipes /usr/local/ne[01]
  6101. */
  6102.  
  6103. #include <stdio.h>
  6104. #include <sys/file.h>
  6105.  
  6106. main()
  6107. {
  6108.  
  6109.   int
  6110.     ne0,
  6111.     ne1;
  6112.  
  6113.   if ((ne0 = open("/usr/local/ne0",O_RDONLY)) < 0)
  6114.     syserr("open (ne0)");
  6115.   if ((ne1 = open("/usr/local/ne1",O_WRONLY)) < 0)
  6116.     syserr("open (ne1)");
  6117.  
  6118.   switch (fork()) {             /* set up psh process */
  6119.   case -1:
  6120.     syserr("fork (psh)");
  6121.   case 0:                       /* child process (will be psh) */
  6122.     if (close(0) == -1)         /* set up ne0 as input stream */
  6123.       syserr("close (psh 0)");
  6124.     if (dup(ne0) != 0)
  6125.       syserr("dup (psh ne0)");
  6126.  
  6127.     if (close(1) == -1)         /* set up ne1 as output stream */
  6128.       syserr("close (psh 1)");
  6129.     if (dup(ne1) != 1)
  6130.       syserr("dup (psh ne1)");
  6131.  
  6132. /*    execlp("psh","psh",NULL); */
  6133.     execl("./psh","psh",NULL);
  6134.       syserr("execlp (psh)");
  6135.   }
  6136.  
  6137.   switch (fork()) {             /* set up "foo" process */
  6138.   case -1:
  6139.     syserr("fork (foo)");
  6140.   case 0:                       /* child process (will be "foo") */
  6141.     execlp("foo","foo",NULL);
  6142.       syserr("execlp (foo)");
  6143.   }
  6144.  
  6145.   while (wait(NULL) != -1)
  6146.     ;
  6147.   syserr("wait");
  6148. }
  6149.  
  6150.  
  6151.  
  6152. Yours, Rich Morin
  6153. rdm@cfcl.com
  6154.  
  6155.  
  6156. From icon-group-sender  Sun Jul  1 03:57:15 1992
  6157. Received: by cheltenham.cs.arizona.edu; Wed, 1 Jul 1992 05:45:27 -0700
  6158. Date: 1 Jul 92 03:57:15 GMT
  6159. From: uxa.ecn.bgu.edu!mudrc@psuvax1.cs.psu.edu  (Daniel R. Crowson)
  6160. Organization: Educational Computing Network
  6161. Subject: Icon help...
  6162. Message-Id: <1992Jul1.035715.21311@uxa.ecn.bgu.edu>
  6163. Sender: icon-group-request@cs.arizona.edu
  6164. To: icon-group@cs.arizona.edu
  6165. Status: R
  6166. Errors-To: icon-group-errors@cs.arizona.edu
  6167.  
  6168.  
  6169.   Here's my problem:
  6170.  
  6171.   I want to use ICON to go through a Pascal file.  The program can just
  6172. type in sum and product notation into the program and then icon will go
  6173. through and find these and convert them to the actual code,
  6174.  
  6175. Example:
  6176.  
  6177. temp1:=sum(i=1, n, (prod (j=1, 2*i, (i*(j+1)))+z) +z1
  6178.  
  6179. might convert to:
  6180.  
  6181. i:=1
  6182. sumtem,p:=0;
  6183. while (i<=n) do begin
  6184.   prodtemp:=1;
  6185.   j:=1;
  6186.   while (j<=2*i) do begin
  6187.     prodtemp:=prodtemp+(i*(j+1)):
  6188.     j:=j+1;
  6189.   end;
  6190.   sumtemp:=sumtemp+prodtemp+z1;
  6191.   i:=i+1;
  6192. end;
  6193. temp:=sumtemp+z1;
  6194.  
  6195. There can be more than on sum statement in a given express:
  6196.  
  6197. temp:=sum(i=1,n,i)+sum(i=1,n,i*i);
  6198.  
  6199. Any help is greatly appreciated!!!
  6200.  
  6201. Dan  <-  mudrc@uxa.ecn.bgu.edu
  6202.  
  6203.  
  6204. From icon-group-sender  Sun Jul  1 16:34:01 1992
  6205. Received: by cheltenham.cs.arizona.edu; Wed, 1 Jul 1992 11:33:23 -0700
  6206. Date: 1 Jul 92 16:34:01 GMT
  6207. From: sun-barr!cs.utexas.edu!wupost!kuhub.cc.ukans.edu!spssig.spss.com!uchinews!ellis!goer@ames.arc.nasa.gov  (Richard L. Goerwitz)
  6208. Organization: University of Chicago Computing Organizations
  6209. Subject: Re: Icon help...
  6210. Message-Id: <1992Jul1.163401.8947@midway.uchicago.edu>
  6211. References: <1992Jul1.035715.21311@uxa.ecn.bgu.edu>
  6212. Sender: icon-group-request@cs.arizona.edu
  6213. To: icon-group@cs.arizona.edu
  6214. Status: R
  6215. Errors-To: icon-group-errors@cs.arizona.edu
  6216.  
  6217. mudrc@uxa.ecn.bgu.edu (Daniel R. Crowson) writes:
  6218.  
  6219. >  Here's my problem:
  6220. >
  6221. >  I want to use ICON to go through a Pascal file.  The program can just
  6222. >type in sum and product notation into the program and then icon will go
  6223. >through and find these and convert them to the actual code,
  6224. >
  6225. >a)  temp1:=sum(i=1, n, (prod (j=1, 2*i, (i*(j+1)))+z) +z1
  6226. >
  6227. >b)  i:=1
  6228. >    sumtem,p:=0;
  6229. >    while (i<=n) do begin
  6230. >    etc...
  6231.  
  6232. I'd guess that the solution depended on whether the grammar of (a) above
  6233. is parsable using recursive descent backtracking system.  It's not, of
  6234. course, because (a) may include left recursive elements.  This renders
  6235. Icon's natural control mechanisms ineffective.  You have to do something
  6236. fancier to reduce (a) to a tree or graph structure, and convert it to (b).
  6237.  
  6238. I keep grumbling about how I ought to write a YACC-like tool for Icon,
  6239. or at least try to rewrite a YACC version to output Icon code.  I don't
  6240. see how I'll get to this in the near future, though.  If somebody wants
  6241. to make us all jump with glee, they oughta write a Tomita-style parallel
  6242. parser.  Such parsers are almost as fast on simple grammars as traditional
  6243. LALR(1) parser generators, and handle a much fuller range of context free
  6244. grammars.
  6245.  
  6246. If you want, I can send you a chart parser I wrote, which can be used to
  6247. parse anything describable by a context-free grammar.  It's set up, by
  6248. default, to output a tree structure, which can then be converted into
  6249. legal Pascal notation.  Pascal has a very simple grammar.  As I recall,
  6250. it can be parsed using a simple top-down recursive system.  You tech-
  6251. nical guys:  Is this right?  If so, it should be *very* easy to convert
  6252. a tree structure into good PASCAL code!
  6253.  
  6254. -- 
  6255.  
  6256.    -Richard L. Goerwitz              goer%midway@uchicago.bitnet
  6257.    goer@midway.uchicago.edu          rutgers!oddjob!ellis!goer
  6258.  
  6259.  
  6260. From icon-group-sender  Wed Jul  4 07:44:28 1992
  6261. Received: by cheltenham.cs.arizona.edu; Sat, 4 Jul 1992 06:07:02 -0700
  6262. Date: 4 Jul 92 07:44:28 GMT
  6263. From: csus.edu!netcomsv!mork!ivan@decwrl.dec.com  (Ivan Kissiov)
  6264. Organization: Netcom - Online Communication Services  (408 241-9760 guest)
  6265. Subject: Where do I find the source code for Icon ?
  6266. Message-Id: <kl3lmqc.ivan@netcom.com>
  6267. Sender: icon-group-request@cs.arizona.edu
  6268. To: icon-group@cs.arizona.edu
  6269. Status: R
  6270. Errors-To: icon-group-errors@cs.arizona.edu
  6271.  
  6272.  
  6273.     I just got the book "The Implementation of the Icon
  6274.     Programming Language" and it says that the source is
  6275.     in the public domain. ftp`ing into "cs.arizona.edu"
  6276.     left me with no source. Where do I go from here ?
  6277.  
  6278.     Please HELP? I am a language implementation junkie and
  6279.     I need a fix.
  6280.  
  6281.         Regards:
  6282.  
  6283.     - ivan
  6284.  
  6285.  
  6286. From icon-group-sender  Wed Jul  4 07:44:28 1992
  6287. Received: by cheltenham.cs.arizona.edu; Sat, 4 Jul 1992 06:15:07 -0700
  6288. Date: 4 Jul 92 07:44:28 GMT
  6289. From: csus.edu!netcomsv!mork!ivan@decwrl.dec.com  (Ivan Kissiov)
  6290. Organization: Netcom - Online Communication Services  (408 241-9760 guest)
  6291. Subject: Where do I find the source code for Icon ?
  6292. Message-Id: <kl3lmqc.ivan@netcom.com>
  6293. Sender: icon-group-request@cs.arizona.edu
  6294. To: icon-group@cs.arizona.edu
  6295. Status: RO
  6296. Errors-To: icon-group-errors@cs.arizona.edu
  6297.  
  6298.  
  6299.     I just got the book "The Implementation of the Icon
  6300.     Programming Language" and it says that the source is
  6301.     in the public domain. ftp`ing into "cs.arizona.edu"
  6302.     left me with no source. Where do I go from here ?
  6303.  
  6304.     Please HELP? I am a language implementation junkie and
  6305.     I need a fix.
  6306.  
  6307.         Regards:
  6308.  
  6309.     - ivan
  6310.  
  6311.  
  6312. From icon-group-sender  Mon Jul  9 04:34:41 1992
  6313. Received: by cheltenham.cs.arizona.edu; Thu, 9 Jul 1992 07:01:09 -0700
  6314. Date: 9 Jul 92 04:34:41 GMT
  6315. From: cis.ohio-state.edu!pacific.mps.ohio-state.edu!linac!uchinews!quads!goer@ucbvax.Berkeley.EDU  (Richard L. Goerwitz)
  6316. Organization: University of Chicago Computing Organizations
  6317. Subject: chart parser
  6318. Message-Id: <1992Jul9.043441.8063@midway.uchicago.edu>
  6319. Sender: icon-group-request@cs.arizona.edu
  6320. To: icon-group@cs.arizona.edu
  6321. Status: R
  6322. Errors-To: icon-group-errors@cs.arizona.edu
  6323.  
  6324. I received a request for this, and since I've augmented it slightly
  6325. (adding sample BNFs to the front matter, for example), it seemed worth
  6326. a re-post.
  6327.  
  6328. -Richard
  6329.  
  6330.  
  6331. ############################################################################
  6332. #
  6333. #    Name:     ichartp.icn
  6334. #
  6335. #    Title:     Iconish implementation of a simple chart parser
  6336. #
  6337. #    Author:     Richard L. Goerwitz
  6338. #
  6339. #    Version: 1.5
  6340. #
  6341. ############################################################################
  6342. #
  6343. #  General:
  6344. #
  6345. #      Ichartp implements a simple chart parser - an only marginally
  6346. #  successful strategy for parsing context free grammars (it has a
  6347. #  cubic worst-case time factor), but one which at least allows enough
  6348. #  flexibility to enable it to handle a lot of natural language
  6349. #  constructs.  It also lacks many of the troubles associated with
  6350. #  empty and left-recursive derivations.  To obtain a parse, just
  6351. #  create a BNF file, obtain a line of input, and then invoke the
  6352. #  procedure parse_sentence(sentence, bnf_filename, start-symbol).
  6353. #  Parse_sentence suspends successive edge structures corresponding to
  6354. #  possible parses of the input sentence.  There is a routine called
  6355. #  edge_2_tree() that converts these edges to a more standard form.
  6356. #  See the stub main() procedure for an example of how to make use of
  6357. #  all these facilities.
  6358. #
  6359. #  Implementation details:
  6360. #
  6361. #      The parser itself operates in bottom-up fashion, but it might
  6362. #  just as well have been coded top-down, or for that matter as a
  6363. #  combination bottom-up/top-down parser (chart parsers don't care).
  6364. #  The parser operates in breadth-first fashion, rather than walking
  6365. #  through each alternative until it is exhausted.  As a result, there
  6366. #  tends to be a pregnant pause before any results appear, but when
  6367. #  they appear they come out in rapid succession.  To use a depth-first
  6368. #  strategy, just change the "put" in "put(ch.active, new_e)" to read
  6369. #  "push."  I haven't tried to do this, but it should be that simple
  6370. #  to implement.
  6371. #      BNFs are specified using the same notation used in Griswold &
  6372. #  Griswold, and as described in the IPL program "pargen.icn," with
  6373. #  the difference that all metacharacters (space, tab, vertical slash,
  6374. #  right/left parends, brackets and angle brackets) can be converted
  6375. #  to literals by prepending a backslash (rendering <lb>, <rb>, etc.
  6376. #  as notations for these characters unnecessary).  Comments can be
  6377. #  include along with BNFs using the same notation as for Icon code
  6378. #  (i.e. #-sign).
  6379. #
  6380. #  Gotchas:
  6381. #
  6382. #      Pitfalls to be aware of include things like <L> ::= <L> | ha |
  6383. #  () (a weak attempt at a laugh recognizer).  This grammar will
  6384. #  accept "ha," "ha ha," etc. but will suspend an infinite number of
  6385. #  possible parses.  The right way to do this sort of thing is <L> ::=
  6386. #  ha <S> | ha, or if you really insist on having the empty string as
  6387. #  a possibility, try things like:
  6388. #
  6389. #          <S>      ::= () | <LAUGHS>
  6390. #          <LAUGHS> ::= ha <LAUGHS> | ha
  6391. #
  6392. #  Of course, the whole problem of infinite parses can be avoided by
  6393. #  simply invoking the parser in a context where it is not going to
  6394. #  be resumed, or else one in which it will be resumed a finite number
  6395. #  of times.
  6396. #
  6397. #  Motivation:
  6398. #
  6399. #      I was reading Byte Magazine (vol. 17:2 [February, 1992]), and
  6400. #  ran into an article entitled "A Natural Solution" (pages 237-244)
  6401. #  in which a standard chart parser was described in terms of its C++
  6402. #  implementation.  The author remarked at how his optimizations made
  6403. #  it possible to parse a 14-word sentence in only 32 seconds (versus
  6404. #  146 for a straight Gazdar-Mellish LISP chart parser).  32 seconds
  6405. #  struck me as hardly anything to write home about, so I coded up a
  6406. #  quick system in Icon to see how it compared.  This library is the
  6407. #  result.
  6408. #      I'm quite sure that this code could be very much improved upon.
  6409. #  As it stands, its performance seems as good as the C++ parser in
  6410. #  BYTE, if not better.  It's hard to tell, though, seeing as I have
  6411. #  no idea what hardware the guy was using.  I'd guess a 386 running
  6412. #  DOS.  On a 386 running Xenix the Icon version beats the BYTE times
  6413. #  by a factor of about four.  The Icon compiler creates an executable
  6414. #  that (in the above environment) parses 14-15 word sentences in
  6415. #  anywhere from 6 to 8 seconds.  Once the BNF file is read, it does
  6416. #  short sentences in a second or two.  If I get around to writing it,
  6417. #  I'll probably use the code here as the basic parsing engine for an
  6418. #  adventure game my son wants me to write.
  6419. #
  6420. ############################################################################
  6421. #
  6422. #  Links: structs, slashbal, rewrap, strip, stripcom (ximage for debugging)
  6423. #
  6424. #  Requires:  an up-to-date IPL
  6425. #
  6426. ############################################################################
  6427. #
  6428. #  Here's a sample BNF file (taken, modified, from the BYTE Magazine
  6429. #  article mentioned above).  Note again the conventions a) that
  6430. #  terminals be enclosed in angle brackets & b) that overlong lines be
  6431. #  continued by terminating the preceding line with a backslash.
  6432. #  Although not illustrated below, the metacharacters <, >, (, ), and
  6433. #  | can all be escaped (i.e. can all have their special meaning
  6434. #  neutralized) with a backslash (e.g. \<).  Comments can also be
  6435. #  included using the Icon #-notation.
  6436. #
  6437. #  <S>    ::= <NP> <VP> | <S> <CONJ> <S>
  6438. #  <VP>   ::= <VP> <CONJ> <VP> | <IV> ( () | <PP> ) | \
  6439. #         <TV> ( <NP> | <NP> <PP> | <NP> <VP> | <REL> <S> )
  6440. #  <NP>   ::= <DET> ( <NP> | <ADJ> <NP> | <ADJ> <NP> <PP> | <NP> <PP> ) | \
  6441. #         <ADJ> <NP> | <N> | <N> <CONJ> <N> | \
  6442. #         <NP> <CONJ> <NP>
  6443. #  <PP>   ::= <P> ( <NP> | <ADJ> <NP> ) | <PP> <CONJ> <PP>
  6444. #  <ADJ>  ::= <ADJ> <CONJ> <ADJ>
  6445. #  <CONJ> ::= and
  6446. #  <DET>  ::= the | a | his | her
  6447. #  <NP>   ::= her | he | they
  6448. #  <N>    ::= nurse | nurses | book | books | travel | arrow | arrows | \
  6449. #        fortune | fortunes | report
  6450. #  <ADJ>  ::= outrageous | silly | blue | green | heavy | white | red | \
  6451. #        black | yellow
  6452. #  <IV>   ::= travel | travels | report | see | suffer
  6453. #  <TV>   ::= hear | see | suffer
  6454. #  <P>    ::= on | of
  6455. #  <REL>  ::= that
  6456. #
  6457. ############################################################################
  6458.  
  6459. # I use ximage for debugging purposes.
  6460. link structs, slashbal, rewrap, strip, stripcom#, ximage
  6461.  
  6462. record stats(edge_list, lhs_table, term_set)
  6463. record chart(inactive, active)               # inactive - set; active - list
  6464. record retval(no, item)
  6465.  
  6466. record edge(LHS, RHS, LEN, DONE, BEG, END, SEEN)
  6467. record short_edge(LHS, RHS)
  6468.  
  6469. #
  6470. # For debugging only.
  6471. #
  6472. procedure main(a)
  6473.  
  6474.     local res, filename
  6475.     # &trace := -1
  6476.     filename := \a[1] | "bnfs.byte"
  6477.     while line := read(&input) do {
  6478.         every res := parse_sentence(line, filename, "S") do {
  6479.             if res.no = 0 then
  6480.             write(stree(edge2tree(res.item)))
  6481. #            write(ximage(res.item))
  6482.         else if res.no = 1 then
  6483.         write("unknown terminal symbol, ", res.item)
  6484.         }
  6485.     }
  6486.  
  6487. end
  6488.  
  6489.  
  6490. #
  6491. # parse_sentence:  string x string -> edge records
  6492. #                  (s, filename) -> Es
  6493. #     where s is a chunk of text presumed to constitute a sentence
  6494. #     where filename is the name of a grammar file containing BNFs
  6495. #     where Es are edge records containing possible parses of s
  6496. #
  6497. procedure parse_sentence(s, filename, start_symbol)
  6498.  
  6499.     local file, e, i, elist, ltbl, tset, ch, tokens, st, 
  6500.         memb, new_e, token_set, none_found, active_modified
  6501.     static master, old_filename
  6502.     initial master := table()
  6503.  
  6504.     #
  6505.     # Initialize and store stats for filename (if not already stored).
  6506.     #
  6507.     if not (filename == \old_filename) then {
  6508.         file := open(filename, "r") | p_err(filename, 7)
  6509.         #
  6510.         # Read BNFs from file; turn them into edge structs, and
  6511.         # store them all in a list; insert terminal symbols into a set.
  6512.         #
  6513.         elist := list(); ltbl := table(); tset := set()
  6514.         every e := bnf_file_2_edges(file) do {
  6515.             put(elist, e)                      # main edge list (active)
  6516.             (/ltbl[e.LHS] := set([e])) | insert(ltbl[e.LHS], e) # index LHSs
  6517.             every i := 1 to e.LEN do           # LEN holds length of e.RHS
  6518.                 if /e.RHS[i].RHS then          # RHS for terminals is null
  6519.                     insert(tset, e.RHS[i].LHS) & break
  6520.         }
  6521.         insert(master, filename, stats(elist, ltbl, tset))
  6522.         old_filename := filename
  6523.         close(file)
  6524.     }
  6525.     elist := fullcopy(master[filename].edge_list)
  6526.     ltbl  := fullcopy(master[filename].lhs_table)
  6527.     tset  := master[filename].term_set
  6528.     
  6529.     #
  6530.     # Make edge list into the active section of chart; tokenize the
  6531.     # sentence s & check for unrecognized terminals.
  6532.     #
  6533.     ch := chart(set(), elist)
  6534.     tokens := tokenize(s)
  6535.  
  6536.     #
  6537.     # Begin parse by entering all tokens in s into the inactive set
  6538.     # in the chart as edges with no RHS (a NULL RHS is characteristic
  6539.     # of all terminals).
  6540.     #
  6541.     token_set := set(tokens)
  6542.     every i := 1 to *tokens do {
  6543.         # Flag words not in the grammar as errors.
  6544.         if not member(tset, tokens[i]) then
  6545.             suspend retval(1, tokens[i])
  6546.         # Now, give us an inactive edge corresponding to word i.
  6547.         insert(ch.inactive, e := edge(tokens[i], &null, 1, 1, i, i+1))
  6548.         # Insert word i into the LHS table.
  6549.         (/ltbl[tokens[i]] := set([e])) | insert(ltbl[tokens[i]], e)
  6550.     # Watch out for those empty RHSs.
  6551.     insert(ch.inactive, e := edge("", &null, 1, 1, i, i))
  6552.         (/ltbl[""] := set([e])) | insert(ltbl[""], e)
  6553.     }
  6554.     *tokens = 0 & i := 0
  6555.     insert(ch.inactive, e := edge("", &null, 1, 1, i+1, i+1))
  6556.     (/ltbl[""] := set([e])) | insert(ltbl[""], e)
  6557.  
  6558.     #
  6559.     # Until no new active edges can be built, keep ploughing through
  6560.     # the active edge list, trying to match unconfirmed members of their
  6561.     # RHSs up with inactive edges.
  6562.     #
  6563.     until \none_found do {
  6564. #    write(ximage(ch))
  6565.         none_found := 1
  6566.         every e := !ch.active do {
  6567.             active_modified := &null
  6568.             # keep track of inactive edges we've already tried
  6569.             /e.SEEN := set()
  6570.             #
  6571.             # e.RHS[e.DONE+1] is the first unconfirmed category in the
  6572.             # RHS of e; ltbl[e.RHS[e.DONE+1].LHS] are all edges having
  6573.             # as their LHS the LHS of the first unconfirmed category in
  6574.             # e's RHS; we simply intersect this set with the inactives,
  6575.             # and then subtract out those we've seen before in connec-
  6576.             # tion with this edge -
  6577.             #
  6578.             if *(st := \ltbl[e.RHS[e.DONE+1].LHS] ** ch.inactive -- e.SEEN) > 0
  6579.             then {
  6580.                 # record all the inactive edges being looked at as seen
  6581.                 e.SEEN ++:= st
  6582.                 every memb := !st do {
  6583.             # make sure this inactive edge starts where the
  6584.             # last confirmed edge in e.RHS ends!
  6585.             if memb.BEG ~= \e.RHS[e.DONE].END then next
  6586.             # set none_found to indicate we've created a new edge
  6587.             else none_found := &null
  6588.                     # create a new edge, having the LHS of e, the RHS of e,
  6589.                     # the start point of e, the end point of st, and one more
  6590.                     # confirmed RHS members than e
  6591.                     new_e := edge(e.LHS, fullcopy(e.RHS),
  6592.                   e.LEN, e.DONE+1, e.BEG, memb.END)
  6593.                     new_e.RHS[new_e.DONE] := memb
  6594.                     /new_e.BEG := memb.BEG
  6595.                     if new_e.LEN = new_e.DONE then {      # it's inactive
  6596.                         insert(ch.inactive, new_e)
  6597.                         insert(ltbl[e.LHS], new_e)
  6598.                         if new_e.BEG = 1 & new_e.END = (*tokens+1) then {
  6599.                             if new_e.LHS == start_symbol  # complete parse
  6600.                             then suspend retval(0, new_e)
  6601.                         }
  6602.                     } else {
  6603.                         put(ch.active, new_e)            # it's active
  6604.                         active_modified := 1
  6605.                     }
  6606.                 }
  6607.             }
  6608.             # restart if the ch.active list has been modified
  6609.             if \active_modified then break next
  6610.         }
  6611.     }
  6612.  
  6613. end
  6614.  
  6615.  
  6616. #
  6617. # tokenize:  break up a sentence into constituent words, using spaces,
  6618. #            tabs, and other punctuation as separators (we'll need to
  6619. #            change this a bit later on to cover apostrophed words)
  6620. #
  6621. procedure tokenize(s)
  6622.  
  6623.     local l, word
  6624.  
  6625.     l := list()
  6626.     s ? {
  6627.         while tab(upto(&letters)) do
  6628.             put(l, map(tab(many(&letters))))
  6629.     }
  6630.     return l
  6631.  
  6632. end
  6633.  
  6634.  
  6635. #
  6636. # edge2tree:  edge -> tree
  6637. #             e -> t
  6638. #
  6639. #    where e is an edge structure (active or inactive; both are okay)
  6640. #    where t is a tree like what's described in Ralph Griswold's
  6641. #    structs library (IPL); I don't know about the 2nd ed. of
  6642. #    Griswold & Griswold, but the structure is described in the 1st
  6643. #    ed. in section 16.1
  6644. #
  6645. #    fails if, for some reason, the conversion can't be made (e.g. the
  6646. #    edge structure has been screwed around with in some way)
  6647. #
  6648. procedure edge2tree(e)
  6649.  
  6650.     local memb, t
  6651.  
  6652.     t := [e.LHS]
  6653.     \e.RHS | (return t)                                 # a terminal
  6654.     type(e) == "edge" | (return put(t, []))             # An incomplete edge
  6655.     every memb := !e.RHS do                             # has daughters.
  6656.     put(t, edge2tree(memb))
  6657.     return t
  6658.  
  6659. end
  6660.  
  6661.  
  6662. #
  6663. # bnf_file_2_edges: concatenate backslash-final lines & parse
  6664. #
  6665. procedure bnf_file_2_edges(f)
  6666.  
  6667.     while line := read(f) do {
  6668.     line := stripcom(line)
  6669.         while line ?:= 1(tab(-2) || tab(slashupto('\\')), pos(-1)) || !f
  6670.         suspend bnf_2_edges(line)
  6671.     }
  6672.  
  6673. end
  6674.  
  6675.  
  6676. #
  6677. # bnf_2_edges: string -> edge records
  6678. #              s -> Es (a generator)
  6679. #    where s is a CFPSG rule in BNF form
  6680. #    where Es are edges
  6681. #
  6682. procedure bnf_2_edges(s)
  6683.     
  6684.     #
  6685.     # Take out non-backslashed whitespace (i.e. spaces and tabs).
  6686.     #
  6687.     stripped_s := ""
  6688.     s ? {
  6689.         while stripped_s ||:= tab(slashupto(' \t')) do
  6690.             tab(many(' \t'))
  6691.         stripped_s ||:= tab(0)
  6692.     }
  6693.  
  6694.     #
  6695.     # Break BNF-style CFPSG rule into LHS and RHS.  If there is more
  6696.     # than one RHS (a la the | alternation op), suspend multiple re-
  6697.     # sults.
  6698.     #
  6699.     stripped_s ? {
  6700.         LHS := 1("" ~== tab(slashbal(':', '<', '>')), ="::=") | p_err(s,1)
  6701.         LHS ?:= strip(2(="<", tab(-1), =">"), '\\') | p_err(s, 2)
  6702.     LHS == "" & p_err(s, 6)
  6703.         every RHS := do_slash(tab(0) \ 1) do {
  6704.             RHS := string_2_list(RHS)
  6705.             suspend edge(LHS, RHS, *RHS, 0, &null, &null)
  6706.         }
  6707.     }
  6708.  
  6709. end
  6710.  
  6711.  
  6712. #
  6713. # string_2_list:  string -> list
  6714. #                 s -> L
  6715. #    where L is a list of partially constructed (short) edges, having
  6716. #    only LHS and RHS; in the case of nonterminals, the RHS is set
  6717. #    to 1, while for terminals the RHS is null (and remains that way
  6718. #    throughout the parse)
  6719. #
  6720. procedure string_2_list(s)
  6721.  
  6722.     local RHS_list, LHS
  6723.  
  6724.     (s || "\x00") ? {
  6725.         pos(-1) & (return [short_edge("", &null)])
  6726.         RHS_list := list()
  6727.         until pos(-1) do {
  6728.             if match("<") then {
  6729.                 LHS := ("" ~== tab(slashbal(&cset, '<', '>'))) | p_err(s, 4)
  6730.                 LHS ?:= strip(2(="<", tab(-1), =">"), '\\') | p_err(s, 4)
  6731.                 put(RHS_list, short_edge(LHS, 1))
  6732.             } else {
  6733.                 LHS := tab(slashupto('<') | -1)
  6734.                 slashupto('>', LHS) & p_err(s, 5)
  6735.                 put(RHS_list, short_edge(strip(LHS, '\\'), &null))
  6736.             }
  6737.         }
  6738.     }
  6739.     return RHS_list
  6740.  
  6741. end
  6742.  
  6743.  
  6744. #
  6745. # slashupto:  cset x string x integer x integer -> integers
  6746. #             (c, s, i, j) -> Is (a generator)
  6747. #    where Is are the integer positions in s[i:j] before characters
  6748. #    in c that is not preceded by a backslash escape
  6749. #
  6750. procedure slashupto(c, s, i, j)
  6751.  
  6752.     if /s := &subject
  6753.     then /i := &pos
  6754.     else /i := 1
  6755.     /j := *s + 1
  6756.     
  6757.     /c := &cset
  6758.     c ++:= '\\'
  6759.     s[1:j] ? {
  6760.         tab(i)
  6761.         while tab(upto(c)) do {
  6762.             if (="\\", move(1)) then next
  6763.             suspend .&pos
  6764.             move(1)
  6765.         }
  6766.     }
  6767.  
  6768. end
  6769.  
  6770.  
  6771. #
  6772. # fullcopy:  make full recursive copy of object
  6773. #
  6774. procedure fullcopy(obj)
  6775.  
  6776.     local retval, i, k
  6777.  
  6778.     case type(obj) of {
  6779.         "co-expression"  : return obj
  6780.         "cset"           : return obj
  6781.         "file"           : return obj
  6782.         "integer"        : return obj
  6783.         "list"           : {
  6784.             retval := list(*obj)
  6785.             every i := 1 to *obj do
  6786.                 retval[i] := fullcopy(obj[i])
  6787.             return retval
  6788.         }
  6789.         "null"           :  return &null
  6790.         "procedure"      :  return obj
  6791.         "real"           :  return obj
  6792.         "set"            :  {
  6793.             retval := set()
  6794.             every insert(retval, fullcopy(!obj))
  6795.             return retval
  6796.         }
  6797.         "string"         :  return obj
  6798.         "table"          :  {
  6799.             retval := table(obj[[]])
  6800.             every k := key(obj) do
  6801.                 insert(retval, fullcopy(k), fullcopy(obj[k]))
  6802.             return retval
  6803.         }
  6804.         # probably a record; if not, we're dealing with a new
  6805.         # version of Icon or a nonstandard implementation, and
  6806.     # we're screwed
  6807.         default          :  {
  6808.             retval := copy(obj)
  6809.             every i := 1 to *obj do
  6810.                 retval[i] := fullcopy(obj[i])
  6811.             return retval
  6812.         }
  6813.     }
  6814.  
  6815. end
  6816.  
  6817.  
  6818. #
  6819. # do_slash:  string -> string(s)
  6820. #     Given a|b suspend a then b.  Used in conjunction with do_parends().
  6821. #
  6822. procedure do_slash(s)
  6823.  
  6824.     local chunk
  6825.     s ? {
  6826.     while chunk := tab(slashbal('|', '(', ')')) do {
  6827.         suspend do_parends(chunk)
  6828.         move(1)
  6829.     }
  6830.     suspend do_parends(tab(0))
  6831.     }
  6832.  
  6833. end
  6834.  
  6835.  
  6836. #
  6837. # do_parends:  string -> string(s)
  6838. #    Given a(b)c suspend abc; given a(b|c)d suspend abd and acd, etc.
  6839. #    Used in conjuction with do_slash().
  6840. #
  6841. procedure do_parends(s)
  6842.  
  6843.     local chunk, i, j
  6844.     s ? {
  6845.     if not (i := slashupto('(')) then {
  6846.         chunk := tab(0)
  6847.         slashupto(')') & p_err(s, 8)
  6848.         suspend chunk
  6849.     } else {
  6850.         j := i + slashbal(')', '(', ')', s[i+1:0]) | p_err(s, 9)
  6851.         suspend tab(i) ||
  6852.         (move(1), do_slash(tab(j))) ||
  6853.         (move(1), do_parends(tab(0)))
  6854.     }
  6855.     }
  6856.  
  6857. end
  6858.  
  6859.  
  6860. #
  6861. # p_err:  print error message to stderr & abort
  6862. #
  6863. procedure p_err(s, n)
  6864.  
  6865.     local i, msg
  6866.     static errlist
  6867.     initial {
  6868.         errlist := [[1, "malformed LHS"],
  6869.                     [2, "nonterminal lacks proper <> enclosure"],
  6870.                     [3, "missing left angle bracket"],
  6871.                     [4, "unmatched left angle bracket"],
  6872.                     [5, "unmatched right angle bracket"],
  6873.             [6, "empty symbol in LHS"],
  6874.                     [7, "unable to open file"],
  6875.                     [8, "unmatched right parenthesis"],
  6876.                     [9, "unmatched left parenthesis"]
  6877.                    ]
  6878.     }
  6879.     every i := 1 to *errlist do
  6880.         if errlist[i][1] = n then msg := errlist[i][2]
  6881.     writes(&errout, "error ", n, " (", msg, ") in \n")
  6882.     every write("\t", rewrap(s) | rewrap())
  6883.     exit(n)
  6884.  
  6885. end
  6886. -- 
  6887.  
  6888.    -Richard L. Goerwitz              goer%midway@uchicago.bitnet
  6889.    goer@midway.uchicago.edu          rutgers!oddjob!ellis!goer
  6890.  
  6891.  
  6892. From icon-group-sender  Mon Jul 13 15:21:48 1992
  6893. Received: by cheltenham.cs.arizona.edu; Mon, 13 Jul 1992 07:45:11 -0700
  6894. Date: Mon, 13 Jul 92 13:21:48 +0200
  6895. From: Jan Peter de Ruiter <janpeter@mpi.kun.nl>
  6896. Message-Id: <9207131121.AA23567@mpix10.mpi.kun.nl>
  6897. To: icon-group@cs.arizona.edu
  6898. Subject: Sets
  6899. Cc: maarten@mpi.kun.nl
  6900. Status: R
  6901. Errors-To: icon-group-errors@cs.arizona.edu
  6902.  
  6903.  Hi,
  6904.  
  6905.  Recently I discovered that the set datatype in Icon is not as
  6906.  sophisticated as I would have liked. For instance, the following
  6907.  program:
  6908.  
  6909. procedure main()
  6910.     a := set()
  6911.     b := set()
  6912.     superset := set()
  6913.     insert(a,"one")
  6914.     insert(a,"two")
  6915.     insert(b,"two")
  6916.     insert(b,"one")
  6917.     insert(superset, a)
  6918.     insert(superset, b)
  6919.     write(*superset)
  6920. end
  6921.  
  6922.  writes a 2 on the screen. This means that if the elements of sets
  6923.  are sets, they don't work properly anymore in the mathematical 
  6924.  sense.  
  6925.  
  6926. I can very well imagine that there are technical problems involved in
  6927. implementing a set-type that would write a 1 in the above program, but
  6928. alas, I really do neet that kind of set. 
  6929.  
  6930. Is there anyone out there with  a suggestion of how to implement these
  6931. meta-sets without sorting every set into a list and comparing the
  6932. lists? I am trying to hack together an "insert2" routine, that checks
  6933. whether the inserted set is already present in the victim-set.
  6934.  
  6935. Any suggestion is welcome
  6936.  
  6937. Jan P. A. de Ruiter
  6938. janpeter@mpi.kun.nl
  6939.  
  6940.  
  6941. From icon-group-sender  Mon Jul 13 21:58:43 1992
  6942. Received: by cheltenham.cs.arizona.edu; Mon, 13 Jul 1992 18:21:06 MST
  6943. Date: 13 Jul 92 21:58:43 GMT
  6944. From: youngm@boulder.colorado.edu  (Matthew Young)
  6945. Organization: Center for Study of Earth from Space, U of Colorado, Boulder
  6946. Subject: Superset Problem
  6947. Message-Id: <1992Jul13.215843.1667@colorado.edu>
  6948. Sender: icon-group-request@cs.arizona.edu
  6949. To: icon-group@cs.arizona.edu
  6950. Status: R
  6951. Errors-To: icon-group-errors@cs.arizona.edu
  6952.  
  6953.  
  6954. Jan Peter:
  6955.  
  6956. Did you intend to set superset to
  6957.     { {"one","two"} }?
  6958.  
  6959. If so, I think I what the problem is.  If not, please post the set
  6960. you expected to get.
  6961.  
  6962. mY
  6963.  
  6964.  
  6965.  
  6966. From icon-group-sender  Tue Jul 14 01:03:42 1992
  6967. Received: by cheltenham.cs.arizona.edu; Mon, 13 Jul 1992 18:21:15 MST
  6968. Date: 14 Jul 92 01:03:42 GMT
  6969. From: elroy.jpl.nasa.gov!swrinde!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!linac!newsaintmail@ames.arc.nasa.gov  (Michael Glass at Fermilab)
  6970. Organization: Fermi National Accelerator Laboratory
  6971. Subject: Re: Sets
  6972. Message-Id: <13JUL92190342@adcalc.fnal.gov>
  6973. References: <9207131121.AA23567@mpix10.mpi.kun.nl>
  6974. Sender: icon-group-request@cs.arizona.edu
  6975. To: icon-group@cs.arizona.edu
  6976. Status: R
  6977. Errors-To: icon-group-errors@cs.arizona.edu
  6978.  
  6979. It was proposed that after executing the following, then *superset
  6980. should produce the value 1:
  6981.  
  6982.  1)   a := set()              # You may imagine a non-empty set of strings
  6983.  2)   b := set()              # Imagine an identical LOOKING set
  6984.  3)   superset := set()
  6985.  4)   insert2(superset, a)
  6986.  5)   insert2(superset, b)
  6987.  
  6988. I sat down to write insert2(), purely as an exercise, and the
  6989. semantics confused me.
  6990.  
  6991. ()  What happens to the the value of *superset if we add line 6),
  6992. as follows:
  6993.  
  6994.  3)   superset := set()       # *superset = 0
  6995.  4)   insert2(superset, a)    # *superset = 1
  6996.  5)   insert2(superset, b)    # *superset = 1
  6997.  6)   insert(a, stuff)        # *superset = ?
  6998.  
  6999. ()  Similarly, delete2(insert2(s, x), x) confuses me:
  7000.  
  7001.  3)   superset := set()       # *superset = 0
  7002.  4)   insert2(superset, a)    # *superset = 1
  7003.  5)   insert2(superset, b)    # *superset = 1
  7004.  6)   delete2(superset, b)    # *superset = ?
  7005.  
  7006. ()  In mathematics, one cannot say "let a and b be empty sets."
  7007. Is it true, then, that would you want "a === b" to succeed?
  7008.  
  7009. ()  Suppose the sets contained other structures, e.g.:
  7010.  
  7011.  1)   a := set([table()])     # You may imagine here a non-empty table
  7012.  2)   b := set([table()])     # Imagine a similar-looking table
  7013.  3)   superset := set()
  7014.  4)   insert2(superset, a)
  7015.  5)   insert2(superset, b)    # *superset = ?
  7016.  
  7017.  
  7018. It seems to me that if these questions are answered, then it might be
  7019. possible to write a more-or-less grungy "mathemetical set" package.  I
  7020. do not see how such a package can be beautiful code.
  7021.  
  7022. -- Michael Glass, Fermilab
  7023.    GLASS@ADCALC.FNAL.GOV
  7024.  
  7025.  
  7026. From icon-group-sender  Mon Jul 13 23:28:26 1992
  7027. Received: by cheltenham.cs.arizona.edu; Mon, 13 Jul 1992 18:21:23 MST
  7028. Date: 13 Jul 92 23:28:26 GMT
  7029. From: cis.ohio-state.edu!pacific.mps.ohio-state.edu!linac!uchinews!quads!goer@ucbvax.Berkeley.EDU  (Richard L. Goerwitz)
  7030. Organization: University of Chicago Computing Organizations
  7031. Subject: Re: Sets
  7032. Message-Id: <1992Jul13.232826.21943@midway.uchicago.edu>
  7033. References: <9207131121.AA23567@mpix10.mpi.kun.nl>
  7034. Sender: icon-group-request@cs.arizona.edu
  7035. To: icon-group@cs.arizona.edu
  7036. Status: R
  7037. Errors-To: icon-group-errors@cs.arizona.edu
  7038.  
  7039. janpeter@mpi.kun.nl (Jan Peter de Ruiter) writes:
  7040. >
  7041. >procedure main()
  7042. >...
  7043. >    insert(superset, a)
  7044. >    insert(superset, b)
  7045. >    write(*superset)
  7046. >end
  7047. >
  7048. > writes a 2 on the screen. This means that if the elements of sets
  7049. > are sets, they don't work properly anymore in the mathematical 
  7050. > sense.  
  7051. >
  7052. >Is there anyone out there with  a suggestion of how to implement these
  7053. >meta-sets without sorting every set into a list and comparing the
  7054. >lists? I am trying to hack together an "insert2" routine, that checks
  7055. >whether the inserted set is already present in the victim-set.
  7056.  
  7057. As you probably know, Icon's sets, tables, and lists are actually pointers
  7058. to unique structures.  If you insert a set into a set, you are inserting
  7059. a pointer to a unique set into a set.  You are apparently confusing
  7060. this operation with a 2-set union, which produces a new set, distinct
  7061. from its component sets (see the "++" operator), possessing all the mem-
  7062. bers of both original sets.
  7063.  
  7064. Maybe I'm missing the point, though.  Could you perhaps elaborate on just
  7065. what it is you want to do?
  7066.  
  7067. -- 
  7068.  
  7069.    -Richard L. Goerwitz              goer%midway@uchicago.bitnet
  7070.    goer@midway.uchicago.edu          rutgers!oddjob!ellis!goer
  7071.  
  7072.  
  7073. From icon-group-sender  Tue Jul 14 12:07:45 1992
  7074. Received: by cheltenham.cs.arizona.edu; Tue, 14 Jul 1992 04:51:27 MST
  7075. Date: Tue, 14 Jul 92 12:07:45 +0200
  7076. From: Jan Peter de Ruiter <janpeter@mpi.kun.nl>
  7077. Message-Id: <9207141007.AA26490@mpix10.mpi.kun.nl>
  7078. To: icon-group@cs.arizona.edu
  7079. Subject: Set(Set)
  7080. Cc: maarten@mpi.kun.nl
  7081. Status: R
  7082. Errors-To: icon-group-errors@cs.arizona.edu
  7083.  
  7084. The problem I have is the following: if I insert a string, (or a number)
  7085. twice in the same set, only one is taken to be in the set. Therefore,
  7086.   a) the size of the resulting set is 1
  7087.   b) generating all elements of the resulting set will procude one result
  7088.  
  7089. So far, so good.
  7090.  
  7091. If I try to insert (identical) sets instead of numbers/strings,
  7092. the logic has suddenly changed, since:
  7093.   a) the size of the (meta)set is 2
  7094.   b) generating the elements of the metaset will produce 2 results.
  7095.  
  7096. What should happen, (ideally, I mean; I am fully aware of the implications
  7097. of such a mechanism on the level of the implementation) is that since
  7098. the sets { "one", "two" } and { "one", "two" } are identical, inserting the
  7099. set {"one", "two" } twice in the same set (a set of sets) should result in 
  7100. a set containing ONE element, that element being the *set* { "one", "two" }.
  7101.  
  7102. The problem, and also some of the apparent confusion, seems to
  7103. come from the notion "identical". On the level of the implementation,
  7104. "identical sets" means "sets being the same object in memory". In the 
  7105. mathematical sense, "identical sets " means "sets containing the same members". 
  7106.  
  7107. Now on the level of the implementation there is some inconsistency: If I 
  7108. insert the number 15 twice, the *value* 15 determines whether adding 
  7109. the element 15 will increase the size of the set. If I insert the set X, 
  7110. the *adress* of X will determine whether the set will become larger by 
  7111. one element.
  7112.  
  7113. If one happens to need sets of sets [of sets ...] one could implement
  7114. them 'manually'. The straightforward way is to build new procedures
  7115. that convert any set (or table) into a sorted list, and then use 
  7116. LISP like recursive operations in order to check for a possible equality
  7117. of two sets or tables. This takes up a lot of memory, of course, and, as
  7118. Michael Glass points out in his contribution, the semantics should be
  7119. worked out first. I'll go into his questions in another posting, in order
  7120. to keep this one more general.
  7121.  
  7122. Sets are so useful as data structures *because* identical elements cannot
  7123. appear more than once in it. If I did not need that feature, I might as
  7124. well use lists, and reduce them once in order to remove duplicated strings
  7125. and numbers.
  7126.  
  7127. Jan P. A. de Ruiter
  7128. janpeter@mpi.kun.nl
  7129.  
  7130.  
  7131. From icon-group-sender  Tue Jul 14 13:49:36 1992
  7132. Date: Tue, 14 Jul 1992 13:49:36 MST
  7133. From: icon-group-sender
  7134. Message-Id: <199207142049.AA03416@cheltenham.cs.arizona.edu>
  7135. Received: by cheltenham.cs.arizona.edu; Tue, 14 Jul 1992 13:49:36 MST
  7136. Errors-To: icon-group-errors@cs.arizona.edu
  7137. Apparently-To: icon-group-addresses
  7138.  
  7139.  
  7140.  
  7141. From icon-group-sender  Tue Jul 14 11:24:22 1992
  7142. Received: by cheltenham.cs.arizona.edu; Tue, 14 Jul 1992 13:49:42 MST
  7143. Date:    Tue, 14 Jul 1992 11:24:22 -0500 (CDT)
  7144. From: DJBAILEY@SKYLER.MAVD.HONEYWELL.COM
  7145. Message-Id: <920714112422.2020fdc2@SKYLER.MAVD.HONEYWELL.COM>
  7146. Subject: Sets of things
  7147. To: icon-group@cs.arizona.edu
  7148. X-Vmsmail-To: SMTP%"icon-group@cs.arizona.edu"
  7149. Status: R
  7150. Errors-To: icon-group-errors@cs.arizona.edu
  7151.  
  7152. I did some experimenting with sets based on Jan's concerns and I think he
  7153. has a good point. Sets of integers or strings behave differently from
  7154. sets of higher structures. Run the little program below to see the 
  7155. difference.  Icon should be more consistant than that.
  7156.  
  7157. Jan, here is an implementation idea for you. If you have less than 255
  7158. unique items, you could equate them to characters with a table and use
  7159. csets for your set operations.  If you could equate your elements to 
  7160. integers, again using a table when you need the actual values, and use
  7161. set union instead of insertion, the program change might be easier to
  7162. handle. 
  7163.  
  7164. ==============================================================
  7165. # This is an Icon program to test the nature of sets in Icon.
  7166. # It is inspired by a question from Jan Peter de Ruiter.
  7167.  
  7168. procedure main()
  7169.  
  7170. super1 := set([15,15])
  7171. write("Try set([15,15])")
  7172. write("The size is ",*super1)
  7173.  
  7174. super1 := set( [set([15]), set([15])] )
  7175. write("Try set( [set([15]), set([15])] )")
  7176. write("The size is ",*super1)
  7177.  
  7178. super1 := set([[15],[15]])
  7179. write("Try set([[15],[15]])")
  7180. write("The size is ",*super1)
  7181.  
  7182. super1 := set(["one","one"])
  7183. write("Try set([\"one\",\"one\"])")
  7184. write("The size is ",*super1)
  7185.  
  7186. super1 := set([11,12]) ++ set([12])
  7187. write("Try set([11,12]) ++ set([12])")
  7188. write("The size is ",*super1)
  7189.  
  7190. sub1 := set(["one","two"])
  7191. sub2 := set(["two","one"])
  7192.  
  7193. write(" ") # blank line
  7194. write("sub1 and sub2 are Jan's sets.")
  7195. write("sub1 is ",image(sub1))
  7196. write("sub2 is ",image(sub2))
  7197. super1 := set()
  7198.  
  7199. insert(super1,sub1)
  7200. insert(super1,sub2)
  7201.  
  7202. write("The size of super1 using inserts is ",*super1)
  7203. write("super1 looks like ",image(super1))
  7204.  
  7205. super1 := set()
  7206.  
  7207. super1 ++:= sub1
  7208. super1 ++:= sub2
  7209.  
  7210. write("The size of super1 using set union is ",*super1)
  7211. write("super1 looks like ",image(super1))
  7212.  
  7213. end
  7214.  
  7215. From idealord@dorsai.com  Tue Jul 14 09:37:39 1992
  7216. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Tue, 14 Jul 1992 10:27:42 MST
  7217. Received: from uu3.psi.com by optima.cs.arizona.edu (5.65c/15) via SMTP
  7218.     id AA09732; Tue, 14 Jul 1992 10:27:39 MST
  7219. Received: by uu3.psi.com (5.65b/4.0.071791-PSI/PSINet)
  7220.     id AA22087; Tue, 14 Jul 92 13:27:35 -0400
  7221. From: idealord@dorsai.com (Jeff Harrington)
  7222. Received: by dorsai.com (5.65/3.2.083191-The Dorsai Diplomatic Mission)
  7223.     id AA05518; Tue, 14 Jul 92 09:37:40 -0400
  7224. Message-Id: <9207141337.AA05518@dorsai.com>
  7225. Subject: FTP Address and GA Algorithms in Icon
  7226. To: icon-group@cs.arizona.edu
  7227. Date: Tue, 14 Jul 92 9:37:39 EDT
  7228. X-Mailer: ELM [version 2.3 PL2]
  7229. Status: R
  7230.  
  7231. I would appreciate the FTP address for the Icon Project.  I am
  7232. looking for Icon example code, specifically AI type code, and more
  7233. specifically Genetic Algorithm code in Icon.  You may respond by
  7234. EMail so as not to tie up the list, if you wish.
  7235.  
  7236. Jeff Harrington
  7237. idealord@dorsai.com
  7238.  
  7239. From icon-group-request  Tue Jul 14 18:20:50 1992
  7240. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Tue, 14 Jul 1992 10:35:42 MST
  7241. Received: from ucbvax.Berkeley.EDU by optima.cs.arizona.edu (5.65c/15) via SMTP
  7242.     id AA11481; Tue, 14 Jul 1992 10:35:39 MST
  7243. Received: by ucbvax.Berkeley.EDU (5.63/1.43)
  7244.     id AA01222; Tue, 14 Jul 92 10:31:20 -0700
  7245. Received: from USENET by ucbvax.Berkeley.EDU with netnews
  7246.     for icon-group@cs.arizona.edu (icon-group@cs.arizona.edu)
  7247.     (contact usenet@ucbvax.Berkeley.EDU if you have questions)
  7248. Date: 14 Jul 92 18:20:50 GMT
  7249. From: sun-barr!cs.utexas.edu!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!linac!newsaintmail@ames.arc.nasa.gov  (Michael Glass at Fermilab)
  7250. Organization: Fermi National Accelerator Laboratory
  7251. Subject: Re: Set(Set)
  7252. Message-Id: <14JUL92122050@adcalc.fnal.gov>
  7253. References: <9207141007.AA26490@mpix10.mpi.kun.nl>
  7254. Sender: icon-group-request@cs.arizona.edu
  7255. To: icon-group@cs.arizona.edu
  7256. Status: R
  7257.  
  7258.  
  7259. An implementation note: my first thought was to compare two sets for
  7260. equality by checking set differences.  Thus:
  7261.  
  7262.     procedure set_equal(A, B)
  7263.     return (*A = *B) & (0 = *(A--B) = *(B--A))
  7264.     end
  7265.  
  7266. This works as long as sets A and B contain strings, numbers, csets, etc.
  7267. Procedure set_equal() may not work if sets A and B contain other structures
  7268. such as tables, lists, other sets, etc.  Depending upon how you define set
  7269. equality, your routine might have to check for equality of two general
  7270. structures.
  7271.  
  7272. Comparing two arbitrary structures is messy.  Consider:
  7273.  
  7274.     sort(A) = [ A1, A2 ]    # where A1 and A2 are tables
  7275.     sort(B) = [ B1, B2 ]    # B1 and B2 likewise
  7276.  
  7277. It might be that A1 = B2 and B1 = A2; sort() won't necessarily put them
  7278. in the order you want.  You can check for equality by comparing pairs from
  7279. a subset of the cross product A x B.
  7280.  
  7281. Now consider that a set may contain a heterogeneous mixture of objects of
  7282. all data types.
  7283.  
  7284. Assuming that we have built a function set_equal(A, B) (either the
  7285. simple version above, or a more complicated version which compares
  7286. embedded structure types), it seems to me that Mr. de Ruiter is asking
  7287. for insert2() to make a _copy_ of the set it is inserting.
  7288.  
  7289. It is my belief that insert2() looks something like this, where Copy() is
  7290. some suitable extension of the copy() function:
  7291.  
  7292.     procedure insert2(s, x)
  7293.  
  7294.         if type(s) == type(x) == "set" then {
  7295.             if set_equal(!s, x) then
  7296.                 return s
  7297.             else
  7298.                 return insert(s, Copy(x))
  7299.         }
  7300.         fail
  7301.     end
  7302.  
  7303.  
  7304. -- Michael Glass
  7305.  
  7306. From icon-group-request  Tue Jul 14 15:17:47 1992
  7307. Received: from optima.cs.arizona.edu by cheltenham.cs.arizona.edu; Tue, 14 Jul 1992 11:05:18 MST
  7308. Received: from ucbvax.Berkeley.EDU by optima.cs.arizona.edu (5.65c/15) via SMTP
  7309.     id AA17799; Tue, 14 Jul 1992 11:05:14 MST
  7310. Received: by ucbvax.Berkeley.EDU (5.63/1.43)
  7311.     id AA02770; Tue, 14 Jul 92 11:02:22 -0700
  7312. Received: from USENET by ucbvax.Berkeley.EDU with netnews
  7313.     for icon-group@cs.arizona.edu (icon-group@cs.arizona.edu)
  7314.     (contact usenet@ucbvax.Berkeley.EDU if you have questions)
  7315. Date: 14 Jul 92 15:17:47 GMT
  7316. From: agate!spool.mu.edu!umn.edu!noc.msc.net!uc.msc.edu!shamash!sctc.com!bright@ucbvax.Berkeley.EDU  (David A. Bright)
  7317. Organization: SCTC
  7318. Subject: Re: Sets
  7319. Message-Id: <1992Jul14.151747.12603@sctc.com>
  7320. References: <9207131121.AA23567@mpix10.mpi.kun.nl>
  7321. Sender: icon-group-request@cs.arizona.edu
  7322. To: icon-group@cs.arizona.edu
  7323. Status: R
  7324.  
  7325. janpeter@mpi.kun.nl (Jan Peter de Ruiter) writes:
  7326. > Recently I discovered that the set datatype in Icon is not as
  7327. > sophisticated as I would have liked. For instance, the following
  7328. > program:
  7329. >procedure main()
  7330. >    a := set()
  7331. >    b := set()
  7332. >    superset := set()
  7333. >    insert(a,"one")
  7334. >    insert(a,"two")
  7335. >    insert(b,"two")
  7336. >    insert(b,"one")
  7337. >    insert(superset, a)
  7338. >    insert(superset, b)
  7339. >    write(*superset)
  7340. >end
  7341.  
  7342. > writes a 2 on the screen. This means that if the elements of sets
  7343. > are sets, they don't work properly anymore in the mathematical 
  7344. > sense.  
  7345.  
  7346. >I can very well imagine that there are technical problems involved in
  7347. >implementing a set-type that would write a 1 in the above program, but
  7348. >alas, I really do neet that kind of set. 
  7349.  
  7350. Well, replacing "insert(superset, a)" with "every insert(superset, !a)"
  7351. (and similarly for "b") got what I THINK you were trying to do, but it
  7352. will still print "2" because "a" and "b" both have two identical elements.
  7353. -- 
  7354. David A. Bright        
  7355. Secure Computing        bright@SCTC.COM        (work)
  7356.  
  7357.  
  7358. From icon-group-sender  Tue Jul 14 14:45:17 1992
  7359. Received: by cheltenham.cs.arizona.edu; Tue, 14 Jul 1992 15:18:00 MST
  7360. Date: Tue, 14 Jul 1992 14:45:17 MST
  7361. From: "Clinton Jeffery" <cjeffery>
  7362. Message-Id: <199207142145.AA13408@chuckwalla.cs.arizona.edu>
  7363. To: icon-group
  7364. Subject: sets of things
  7365. Status: R
  7366. Errors-To: icon-group-errors@cs.arizona.edu
  7367.  
  7368. Someone said: Icon should be more consistent.  Icon is consistent, it is
  7369. just that the Icon set type is not what Mr. de Ruiter needs.  He needs
  7370. mathematical sets.
  7371.  
  7372. As several folks have pointed out, Icon sets are not mathematical sets,
  7373. since they can have structure values such as sets and tables as members.
  7374. If you insert a 1 into a set, the set doesn't have to worry about the 1
  7375. ever changing.  If you insert a set S1 into a set S2, you can still insert
  7376. or delete elements from S1.  These Icon sets are not math sets, they are
  7377. changeable (or mutable) structures, Very similar to tables.
  7378.  
  7379. Michael Glass's post was correct: in order to implement math sets, one
  7380. needs a set type with values that are immutable, one needs set operations
  7381. that produce new sets instead of changing old ones, and one needs a
  7382. "structural equality" test for sets.  Maybe someone has already done this
  7383. in Icon along the lines Mr. Glass suggested.  I know math sets are useful
  7384. for a broad class of algorithms that are expressed in terms of sets.
  7385.  
  7386.  
  7387. From icon-group-sender  Wed Jul 15 06:24:53 1992
  7388. Received: by cheltenham.cs.arizona.edu; Wed, 15 Jul 1992 05:33:59 MST
  7389. Date: 15 Jul 92 06:24:53 GMT
  7390. From: world!ksr!tim@decwrl.dec.com  (Tim Peters)
  7391. Organization: Kendall Square Research Corp.
  7392. Subject: Re: Set(Set)
  7393. Message-Id: <13807@ksr.com>
  7394. References: <9207141007.AA26490@mpix10.mpi.kun.nl>
  7395. Sender: icon-group-request@cs.arizona.edu
  7396. To: icon-group@cs.arizona.edu
  7397. Status: R
  7398. Errors-To: icon-group-errors@cs.arizona.edu
  7399.  
  7400. In article <9207141007.AA26490@mpix10.mpi.kun.nl> janpeter@mpi.kun.nl (Jan Peter de Ruiter) writes:
  7401. > ... [notes that Icon sets aren't always mathematical sets] ...
  7402. >If I try to insert (identical) sets instead of numbers/strings,
  7403. >the logic has suddenly changed ...
  7404.  
  7405. The 2nd edition of _The Icon Programming Language_, chapter 10, section
  7406. "Comparing Values" (pp 125-127) explains what's going on, although it
  7407. doesn't explicitly mention sets in that section (& it should).
  7408.  
  7409. The bottom line is that only entities of type
  7410.     cset  integer  null  real  string
  7411. work the way you expect.  Note that I was careful to say "the way you
  7412. expect" instead of "correctly" <grin>.
  7413.  
  7414. Icon *is* consistent in the sense that the same rules apply for table
  7415. referencing and "===" comparison as apply for determining set
  7416. membership.  It would be horrid to have sets use a method different
  7417. from those.
  7418.  
  7419. >Sets are so useful as data structures *because* identical elements cannot
  7420. >appear more than once in it. If I did not need that feature, I might as
  7421. >well use lists, and reduce them once in order to remove duplicated strings
  7422. >and numbers.
  7423.  
  7424. I'm not saying you don't need what you need, but do claim that Icon's
  7425. "sets" are useful nevertheless -- even Icon's flavor of sets of sets.
  7426. Take it for what it is, and you'll find good uses for it; I've written
  7427. oodles of Icon that uses sets of sets & sets of lists etc, and I'm
  7428. grateful that the set functions do an use an inexpensive pointer-
  7429. comparison method (else they'd run way too slowly to be useful in some
  7430. applications).
  7431.  
  7432. It's not always true that lists are as convenient in this context,
  7433. either:  "delete" does something clearly for sets that's clumsy to
  7434. express with list operations.  Ditto intersection, and so on.
  7435.  
  7436. It's also not clear that it's possible to construct a set implementation
  7437. that does "the right thing" in all cases.  Well, actually, it's clearly
  7438. impossible:  consider, e.g., functions (nicely-behaved things of Icon
  7439. type "procedure").  Mathematically, a function is just a set of <input,
  7440. output> pairs, so an implementation of a set (in the mathematical sense)
  7441. of functions would need to be able to determine, for an arbitrary pair
  7442. of functions, whether they compute the same thing for all inputs.
  7443. And that's, in general, unsolvable.
  7444.  
  7445. Once you resign yourself to accepting that sets of procedures should
  7446. (must) use pointer semantics, where do you draw the line?  Icon draws it
  7447. at a defensible place, even though it's not always the ideal place for
  7448. every application.
  7449.  
  7450. Question:  what should this print?
  7451.  
  7452. a := []
  7453. push( a, a )
  7454.  
  7455. b := []
  7456. push( b, b )
  7457.  
  7458. c := set([a,b])
  7459. write(*c)
  7460.  
  7461. I.e., is every instance of "a list that contains only itself" the *same*
  7462. instance?  Or might they be different?  This just hints at the
  7463. complications -- the issues really aren't that clear.  One great virtue
  7464. of Icon's design in this area is that it's easy to understand (although
  7465. not as well documented, I think, as it should be) ...
  7466.  
  7467. paradoxically y'rs  - tim
  7468.  
  7469. Tim Peters   Kendall Square Research Corp
  7470. tim@ksr.com,         ksr!tim@uunet.uu.net
  7471.  
  7472.  
  7473. From icon-group-sender  Wed Jul 15 10:53:51 1992
  7474. Received: by cheltenham.cs.arizona.edu; Wed, 15 Jul 1992 05:34:24 MST
  7475. Date: Wed, 15 Jul 92 10:53:51 +0200
  7476. From: Jan Peter de Ruiter <janpeter@mpi.kun.nl>
  7477. Message-Id: <9207150853.AA28581@mpix10.mpi.kun.nl>
  7478. To: icon-group@cs.arizona.edu
  7479. Subject: solution of set problem
  7480. Cc: maarten@mpi.kun.nl
  7481. Status: R
  7482. Errors-To: icon-group-errors@cs.arizona.edu
  7483.  
  7484. #   Hi,
  7485. #
  7486. #   I solved the set-problem yesterday night. It was not as complicated as I
  7487. #   expected, thanks to the blessings of the type() function and the generator
  7488. #   mechanism. It is somewhat slow, of course, but not as slow as I feared (at
  7489. #   least not on a Dec Ultrix workstation).
  7490. #
  7491. #   If you remove the mail-header, this should run without further ado.
  7492. #
  7493. #   Greetings,
  7494. #
  7495. #   Jan P. A. de Ruiter
  7496. #   janpeter@mpi.kun.nl
  7497. #
  7498. record rek(x,y)  # this record declaration and the procedure main()
  7499. procedure main() # are given only for testing purposes. Library is below.
  7500.    s := set()
  7501.    a := set()
  7502.    b := set()
  7503.  
  7504.    insert2(b, "noot")
  7505.    insert2(b, "aap")
  7506.    insert2(a, "aap")
  7507.    insert2(a, "noot")
  7508.  
  7509.    insert2(s,b) # set b is inserted, but set a, having the same *value*, is
  7510.    delete2(s,a) # removed from s.
  7511.    write("TEST1 : the size of the set is now ",*s)    # should give 0 now
  7512.  
  7513. # a second, more extensive test:
  7514.  
  7515.    insert2(s,cset("abcde"))   # a cset
  7516.    insert2(s,0.5)             # a real
  7517.    insert2(s,5)               # an integer
  7518.    insert2(s,[ 1, 2, 3, "aap",rek("een","twee")])
  7519.                               # a list, containing integer, string and record
  7520.    ta := table()
  7521.    ta[1] := "aap"
  7522.    ta[2] := "noot"
  7523.    insert2(ta)                # a table
  7524.    s2 := copy(s)              # make a 'real' copy
  7525.    delete2(s, [1, 2, 3, "aap",rek("een","twee")])
  7526.                               # an element with this value is present, so
  7527.  
  7528.    write("TEST 2:")
  7529.    write("size of s  : ",*s)  # should give 3
  7530.    write("size of s2 : ",*s2) # should give 4
  7531. end
  7532.  
  7533. #
  7534. #  ABOVE IS THE MAIN ROUTINE AND A RECORD DECLARATION FOR TESTING PURPOSES.
  7535. #
  7536.  
  7537. #
  7538. #  BELOW ARE THE ACTUAL LIB-PROCEDURES
  7539. #
  7540.  
  7541. #############################################################################
  7542. # MSET LIBRARY                                                              #
  7543. #                                                                           #
  7544. # Jan P. de Ruiter, 1992                                                    #
  7545. #                                                                           #
  7546. #                                                                           #
  7547. # Implements the "mset" type.                                               #
  7548. #                                                                           #
  7549. # The idea of the mset type is that no two identical data-structures can be #
  7550. # present in a set, where identity is defined as "containing the same       #
  7551. # elements".                                                                #
  7552. #                                                                           #
  7553. # Definitions implicit in the procedure same_value(..,..):                  #
  7554. #                                                                           #
  7555. # TYPE              IDENTITY TEST                                           #
  7556. #                                                                           #
  7557. # all types            ===          and if this test fails...               #
  7558. #                                                                           #
  7559. # integer               =                                                   #
  7560. # real                  =                                                   #
  7561. # cset, string          ==                                                  #
  7562. # record            all fields have same value                              #
  7563. # list              all elements are the same, including ordering           #
  7564. # table             same keys, and every key has the same associated value  #
  7565. # set               contain the same elements                               #
  7566. #                                                                           #
  7567. #############################################################################
  7568.  
  7569. #
  7570. # This is the core routine.
  7571. # It succeeds if two things have the same value(s).
  7572. #
  7573. procedure same_value(d1,d2)
  7574.     if d1 === d2 then return              # same object
  7575.     else
  7576.     if type(d1) ~== type(d2) then fail  # not the same type
  7577.     else
  7578.     if *d1 ~= *d2 then fail             # not the same size
  7579.     else
  7580.     case type(d1)  of {                 # the same type and size
  7581.        ("set"  | "table"  ) : return same_elements(sort(d1,1),sort(d2,1))
  7582.        ("list")             : return same_elements(d1,d2)
  7583.        ("real" | "integer") : return(d1 = d2)
  7584.        ("cset" | "string" ) : return(d1 == d2)
  7585.        default              : return same_elements(d1,d2) # user defined type
  7586.     }
  7587. end
  7588.  
  7589. #
  7590. # used in same_value:
  7591. #
  7592.  
  7593. procedure same_elements(l1,l2)
  7594.     if l1 === l2 then return   # same objects
  7595.     else
  7596.     if *l1 ~= *l2 then fail    # not the same size
  7597.     else {
  7598.         if *l1 = 0 then return # both lists empty
  7599.         else {
  7600.             every(i := 1 to *l1) do 
  7601.                 if not same_value(l1[i],l2[i]) then fail  # recursion
  7602.             return
  7603.         }
  7604.     }
  7605. end
  7606.     
  7607. #
  7608. # The new insert operation. Insert2 always succeeds
  7609. #
  7610. procedure insert2(S,el)
  7611.     every (if same_value(el,!S) then return)
  7612.     return insert(S,el)
  7613. end     
  7614.  
  7615. #
  7616. # The new member operation, that also detects equal-valued elements
  7617. #
  7618. procedure member2(S,el)
  7619.     every(if same_value(!S,el) then return) 
  7620.     fail
  7621. end
  7622.  
  7623. #
  7624. # The new delete operation, that detects equal-valued elements.
  7625. # Always succeeds
  7626. #
  7627. procedure delete2(S,el)
  7628.     every(t := !S) do if same_value(t,el) then return delete(S,t)
  7629.     return
  7630. end
  7631.  
  7632. #
  7633. # conversion of standard icon set into new mset.
  7634. #
  7635. procedure reduce2(iset)
  7636.     temp := set()
  7637.     every(insert2(temp,!iset))
  7638.     return temp
  7639. end
  7640.  
  7641.  
  7642. From icon-group-sender  Wed Jul 15 10:53:51 1992
  7643. Received: by cheltenham.cs.arizona.edu; Wed, 15 Jul 1992 05:38:27 MST
  7644. Date: Wed, 15 Jul 92 10:53:51 +0200
  7645. From: Jan Peter de Ruiter <janpeter@mpi.kun.nl>
  7646. Message-Id: <9207150853.AA28581@mpix10.mpi.kun.nl>
  7647. To: icon-group@cs.arizona.edu
  7648. Subject: solution of set problem
  7649. Cc: maarten@mpi.kun.nl
  7650. Status: R
  7651. Errors-To: icon-group-errors@cs.arizona.edu
  7652.  
  7653. #   Hi,
  7654. #
  7655. #   I solved the set-problem yesterday night. It was not as complicated as I
  7656. #   expected, thanks to the blessings of the type() function and the generator
  7657. #   mechanism. It is somewhat slow, of course, but not as slow as I feared (at
  7658. #   least not on a Dec Ultrix workstation).
  7659. #
  7660. #   If you remove the mail-header, this should run without further ado.
  7661. #
  7662. #   Greetings,
  7663. #
  7664. #   Jan P. A. de Ruiter
  7665. #   janpeter@mpi.kun.nl
  7666. #
  7667. record rek(x,y)  # this record declaration and the procedure main()
  7668. procedure main() # are given only for testing purposes. Library is below.
  7669.    s := set()
  7670.    a := set()
  7671.    b := set()
  7672.  
  7673.    insert2(b, "noot")
  7674.    insert2(b, "aap")
  7675.    insert2(a, "aap")
  7676.    insert2(a, "noot")
  7677.  
  7678.    insert2(s,b) # set b is inserted, but set a, having the same *value*, is
  7679.    delete2(s,a) # removed from s.
  7680.    write("TEST1 : the size of the set is now ",*s)    # should give 0 now
  7681.  
  7682. # a second, more extensive test:
  7683.  
  7684.    insert2(s,cset("abcde"))   # a cset
  7685.    insert2(s,0.5)             # a real
  7686.    insert2(s,5)               # an integer
  7687.    insert2(s,[ 1, 2, 3, "aap",rek("een","twee")])
  7688.                               # a list, containing integer, string and record
  7689.    ta := table()
  7690.    ta[1] := "aap"
  7691.    ta[2] := "noot"
  7692.    insert2(ta)                # a table
  7693.    s2 := copy(s)              # make a 'real' copy
  7694.    delete2(s, [1, 2, 3, "aap",rek("een","twee")])
  7695.                               # an element with this value is present, so
  7696.  
  7697.    write("TEST 2:")
  7698.    write("size of s  : ",*s)  # should give 3
  7699.    write("size of s2 : ",*s2) # should give 4
  7700. end
  7701.  
  7702. #
  7703. #  ABOVE IS THE MAIN ROUTINE AND A RECORD DECLARATION FOR TESTING PURPOSES.
  7704. #
  7705.  
  7706. #
  7707. #  BELOW ARE THE ACTUAL LIB-PROCEDURES
  7708. #
  7709.  
  7710. #############################################################################
  7711. # MSET LIBRARY                                                              #
  7712. #                                                                           #
  7713. # Jan P. de Ruiter, 1992                                                    #
  7714. #                                                                           #
  7715. #                                                                           #
  7716. # Implements the "mset" type.                                               #
  7717. #                                                                           #
  7718. # The idea of the mset type is that no two identical data-structures can be #
  7719. # present in a set, where identity is defined as "containing the same       #
  7720. # elements".                                                                #
  7721. #                                                                           #
  7722. # Definitions implicit in the procedure same_value(..,..):                  #
  7723. #                                                                           #
  7724. # TYPE              IDENTITY TEST                                           #
  7725. #                                                                           #
  7726. # all types            ===          and if this test fails...               #
  7727. #                                                                           #
  7728. # integer               =                                                   #
  7729. # real                  =                                                   #
  7730. # cset, string          ==                                                  #
  7731. # record            all fields have same value                              #
  7732. # list              all elements are the same, including ordering           #
  7733. # table             same keys, and every key has the same associated value  #
  7734. # set               contain the same elements                               #
  7735. #                                                                           #
  7736. #############################################################################
  7737.  
  7738. #
  7739. # This is the core routine.
  7740. # It succeeds if two things have the same value(s).
  7741. #
  7742. procedure same_value(d1,d2)
  7743.     if d1 === d2 then return              # same object
  7744.     else
  7745.     if type(d1) ~== type(d2) then fail  # not the same type
  7746.     else
  7747.     if *d1 ~= *d2 then fail             # not the same size
  7748.     else
  7749.     case type(d1)  of {                 # the same type and size
  7750.        ("set"  | "table"  ) : return same_elements(sort(d1,1),sort(d2,1))
  7751.        ("list")             : return same_elements(d1,d2)
  7752.        ("real" | "integer") : return(d1 = d2)
  7753.        ("cset" | "string" ) : return(d1 == d2)
  7754.        default              : return same_elements(d1,d2) # user defined type
  7755.     }
  7756. end
  7757.  
  7758. #
  7759. # used in same_value:
  7760. #
  7761.  
  7762. procedure same_elements(l1,l2)
  7763.     if l1 === l2 then return   # same objects
  7764.     else
  7765.     if *l1 ~= *l2 then fail    # not the same size
  7766.     else {
  7767.         if *l1 = 0 then return # both lists empty
  7768.         else {
  7769.             every(i := 1 to *l1) do 
  7770.                 if not same_value(l1[i],l2[i]) then fail  # recursion
  7771.             return
  7772.         }
  7773.     }
  7774. end
  7775.     
  7776. #
  7777. # The new insert operation. Insert2 always succeeds
  7778. #
  7779. procedure insert2(S,el)
  7780.     every (if same_value(el,!S) then return)
  7781.     return insert(S,el)
  7782. end     
  7783.  
  7784. #
  7785. # The new member operation, that also detects equal-valued elements
  7786. #
  7787. procedure member2(S,el)
  7788.     every(if same_value(!S,el) then return) 
  7789.     fail
  7790. end
  7791.  
  7792. #
  7793. # The new delete operation, that detects equal-valued elements.
  7794. # Always succeeds
  7795. #
  7796. procedure delete2(S,el)
  7797.     every(t := !S) do if same_value(t,el) then return delete(S,t)
  7798.     return
  7799. end
  7800.  
  7801. #
  7802. # conversion of standard icon set into new mset.
  7803. #
  7804. procedure reduce2(iset)
  7805.     temp := set()
  7806.     every(insert2(temp,!iset))
  7807.     return temp
  7808. end
  7809.  
  7810.  
  7811. From icon-group-sender  Wed Jul 15 11:30:34 1992
  7812. Received: by cheltenham.cs.arizona.edu; Wed, 15 Jul 1992 05:38:50 MST
  7813. Date: Wed, 15 Jul 92 11:30:34 +0200
  7814. From: Jan Peter de Ruiter <janpeter@mpi.kun.nl>
  7815. Message-Id: <9207150930.AA28651@mpix10.mpi.kun.nl>
  7816. To: icon-group@cs.arizona.edu
  7817. Subject: consistency
  7818. Cc: maarten@mpi.kun.nl
  7819. Status: R
  7820. Errors-To: icon-group-errors@cs.arizona.edu
  7821.  
  7822.  
  7823. I understand that the ball game of sets is  that if the structure that
  7824. is part of a set changes, the contents of the set will change with it.
  7825.  
  7826. Quoting Clinton Jeffery: 
  7827.  
  7828. > Someone said: Icon should be more consistent.  Icon is consistent, it is
  7829. > just that the Icon set type is not what Mr. de Ruiter needs.  He needs
  7830. > mathematical sets.
  7831.  
  7832. > As several folks have pointed out, Icon sets are not mathematical sets,
  7833. > since they can have structure values such as sets and tables as members.
  7834. > If you insert a 1 into a set, the set doesn't have to worry about the 1
  7835. > ever changing.  If you insert a set S1 into a set S2, you can still insert
  7836. > or delete elements from S1.  These Icon sets are not math sets, they are
  7837. > changeable (or mutable) structures, Very similar to tables.
  7838.  
  7839.  
  7840. Of course, Icon sets are what the creator of Icon sets wanted them to 
  7841. be. And I happen to like sets of a more formal kind. No problem,
  7842. that's why I tried to implement "the other kind of set" myself.
  7843.  
  7844. I may be very stubborn, perhaps, but I *still* think that Icon sets are
  7845. not consistent. If I use the statements
  7846.  
  7847.     S := set()
  7848.     a := 1
  7849.     insert(S, a)  
  7850.     a := 2
  7851.     every(write(!S))
  7852.  
  7853. It does *not* write 2, but 1. So if you put a *constant* in a set, 
  7854. then there is no worry about it changing, but if you put a *variable* in
  7855. a set, a change of that variable is not entirely unlikely. 
  7856.  
  7857. Jan P. A. de Ruiter
  7858. janpeter@mpi.kun.nl
  7859.  
  7860.  
  7861. From icon-group-sender  Wed Jul 15 10:22:48 1992
  7862. Received: by cheltenham.cs.arizona.edu; Wed, 15 Jul 1992 11:57:30 MST
  7863. Date: Wed, 15 Jul 1992 10:22:48 MST
  7864. From: "Kenneth Walker" <kwalker>
  7865. Message-Id: <199207151722.AA04624@ponderosa.cs.arizona.edu>
  7866. To: icon-group, janpeter@mpi.kun.nl
  7867. Subject: Re:  consistency
  7868. Status: R
  7869. Errors-To: icon-group-errors@cs.arizona.edu
  7870.  
  7871. > Date: Wed, 15 Jul 92 11:30:34 +0200
  7872. > From: Jan Peter de Ruiter <janpeter@mpi.kun.nl>
  7873. >
  7874. > ... if you put a *variable* in a set ...
  7875.  
  7876. The Icon insert() function dereferences its arguments so you cannot put 
  7877. a variable in a set; you can only put the value of a variable in a set.
  7878. These semantics are internally consistent.
  7879.  
  7880.   Ken Walker / Computer Science Dept / Univ of Arizona / Tucson, AZ 85721
  7881.   +1 602 621-4252  kwalker@cs.arizona.edu   uunet!arizona!kwalker
  7882.  
  7883.  
  7884. From icon-group-sender  Thu Jul 16 13:56:54 1992
  7885. Received: by cheltenham.cs.arizona.edu; Thu, 16 Jul 1992 05:41:43 MST
  7886. Date: Thu, 16 Jul 92 13:56:54 +0200
  7887. From: ms@informatik.uni-hannover.de (Michael Sperber)
  7888. Message-Id: <9207161156.AA25620@informatik.uni-hannover.de>
  7889. To: janpeter@mpi.kun.nl.ddn
  7890. Cc: icon-group@cs.arizona.edu.ddn
  7891. In-Reply-To: Jan Peter de Ruiter's message of Wed, 15 Jul 92 15:32:04 +0200 
  7892.  <9207150930.AA28651@mpix10.mpi.kun.nl*MAILER@cdc2-gw.rrzn.uni-hannover.de>
  7893. Subject: consistency
  7894. Status: R
  7895. Errors-To: icon-group-errors@cs.arizona.edu
  7896.  
  7897. Icon sets ARE consistent.  Of course, you should say
  7898. what they should be consistent with.  The question is
  7899. which equality operator is used to determine if an
  7900. element is already in a set or not. I haven't done 
  7901. any Icon stuff for a long time, but if I remember correctly,
  7902. it uses the == equality -- consistently!
  7903.  
  7904. (And yes, you are stubborn!)
  7905.  
  7906. :-> Cheers, Chipsy
  7907.  
  7908.  
  7909. From icon-group-sender  Tue Jul 28 23:21:20 1992
  7910. Received: by cheltenham.cs.arizona.edu; Tue, 28 Jul 1992 20:16:40 MST
  7911. Date: 28 Jul 92 23:21:20 GMT
  7912. From: cis.ohio-state.edu!magnus.acs.ohio-state.edu!usenet.ins.cwru.edu!news.ysu.edu!malgudi.oar.net!caen!uakari.primate.wisc.edu!crdgw1!newsun!mwalker1@ucbvax.Berkeley.EDU  (Mel Walker)
  7913. Organization: Society of Right-Handed Sesquipedalians
  7914. Subject: Icon language
  7915. Message-Id: <mwalker-280792171316@mwalker1.npd.provo.novell.com.>
  7916. Sender: icon-group-request@cs.arizona.edu
  7917. To: icon-group@cs.arizona.edu
  7918. Status: R
  7919. Errors-To: icon-group-errors@cs.arizona.edu
  7920.  
  7921. I've got a version of Icon that runs under MPW on a mac. It claims to be
  7922. version 8, with TR 90-7 as a (sub-version?) number. It is public domain.
  7923.  
  7924. Is this the latest version of Icon? Are there other version of MPW Icon?
  7925. Other versions of Icon on the Mac, free or not? The one I have tends to
  7926. crash occasionally under Sys7 on a IIci. I am trying to learn the language
  7927. (just for fun and possible future use).
  7928.  
  7929. BTW: Is there a FAQ for this group?
  7930.  
  7931. ------
  7932. Mel Walker                                          mwalker@novell.com
  7933. "Darth & Luke in '92: Jedis for a Better America"
  7934. All opinions above the .sig might be mine. You'll never know, will ya?
  7935.  
  7936.  
  7937. From icon-group-sender  Fri Jul 31 11:38:43 1992
  7938. Received: by cheltenham.cs.arizona.edu; Sat, 1 Aug 1992 11:26:49 MST
  7939. Date: 31 Jul 92 11:38:43 GMT
  7940. From: munnari.oz.au!uniwa!mullet!john@uunet.uu.net  (John West)
  7941. Organization: University Computer Club --- Perth, Western Australia
  7942. Subject: installing Icon on 386BSD - Help me!
  7943. Message-Id: <1992Jul31.113843.15202@mullet.gu.uwa.edu.au>
  7944. Sender: icon-group-request@cs.arizona.edu
  7945. To: icon-group@cs.arizona.edu
  7946. Status: R
  7947. Errors-To: icon-group-errors@cs.arizona.edu
  7948.  
  7949. I would like to install Icon on our 486 machine (intel). It is currently
  7950. running 386BSD version 0.1
  7951. I had a look at the config files in the distribution, but couldn't find
  7952. anything likely. I thought it might be possible to modify one of the other
  7953. 386-type configs, but when I had a look, they all had inline assembler -
  7954. not something I want to mess with.
  7955. Can someone help?
  7956. Please email to gudjm@uniwa.uwa.edu.au - news and mail on mullet are not
  7957. what I'd call particularly reliable.
  7958.  
  7959. TIA
  7960.  
  7961. John West
  7962. -- 
  7963. For the humour impaired: Insert a :-) after every third word
  7964.  
  7965.  
  7966. From icon-group-sender  Fri Jul 31 22:14:43 1992
  7967. Received: by cheltenham.cs.arizona.edu; Sat, 1 Aug 1992 11:26:55 MST
  7968. Date: 31 Jul 92 22:14:43 GMT
  7969. From: uchinews!ellis!goer@handies.ucar.edu  (Richard L. Goerwitz)
  7970. Organization: University of Chicago Computing Organizations
  7971. Subject: Re: installing Icon on 386BSD - Help me!
  7972. Message-Id: <1992Jul31.221443.13172@midway.uchicago.edu>
  7973. References: <1992Jul31.113843.15202@mullet.gu.uwa.edu.au>
  7974. Sender: icon-group-request@cs.arizona.edu
  7975. To: icon-group@cs.arizona.edu
  7976. Status: R
  7977. Errors-To: icon-group-errors@cs.arizona.edu
  7978.  
  7979. john@mullet.gu.uwa.edu.au (John West) writes:
  7980.  
  7981. >I would like to install Icon on our 486 machine (intel). It is currently
  7982. >running 386BSD version 0.1
  7983. >
  7984. >I had a look at the config files in the distribution, but couldn't find
  7985. >anything likely. I thought it might be possible to modify one of the other
  7986. >386-type configs, but when I had a look, they all had inline assembler -
  7987. >not something I want to mess with.
  7988. >Can someone help?
  7989.  
  7990. This is a good question, and worth a posting.  I'll wager that all of the
  7991. inline code you saw was for coexpressions.  Just disable the feature, and
  7992. you'll be fine.
  7993.  
  7994. Alternatively, check through the configs for the Sun/386 (or whatever it
  7995. was).  Perhaps the assembler code there will be close enough to what you
  7996. need. I have no idea how close the 386BSD code is going to be to the
  7997. System V assembler code, but you could try looking in the various SYSV
  7998. configuration directories.  At one point I "implemented" coexpressions for
  7999. Xenix by simply borrowing the Microport implementation.  I've had to
  8000. screw around with it a bit subsequently, but you might find it quite
  8001. easy, as long as your assembler is standard.
  8002.  
  8003. Good luck, and keep us posted.
  8004.  
  8005. -- 
  8006.  
  8007.    -Richard L. Goerwitz              goer%midway@uchicago.bitnet
  8008.    goer@midway.uchicago.edu          rutgers!oddjob!ellis!goer
  8009.  
  8010.  
  8011. From icon-group-sender  Sun Aug  2 14:00:22 1992
  8012. Received: by cheltenham.cs.arizona.edu; Sun, 2 Aug 1992 05:53:17 MST
  8013. Date: Sun, 2 Aug 92 14:00:22 +0200
  8014. From: Jan Peter de Ruiter <janpeter@mpi.kun.nl>
  8015. Message-Id: <9208021200.AA09893@mpix10.mpi.kun.nl>
  8016. To: icon-group@cs.arizona.edu
  8017. Subject: 386/protected mode
  8018. Cc: janpeter@mpi.kun.nl
  8019. Status: R
  8020. Errors-To: icon-group-errors@cs.arizona.edu
  8021.  
  8022. Another  question concerning running Icon on an Intel 386/486 based
  8023. machine, but this time not on 386BSD, but on MSDOS: 
  8024.  
  8025. Recently I discovered that the GNU (Free Software Foundation) C compiler
  8026. is ported to 386/486 DOS based PC's. For those of you who do not know
  8027. about this compiler: the compiler and the resulting executables run
  8028. in Protected Mode, with a flat adress space of whatever you have 
  8029. installed, including memory-disk paging in case of memory shortage.
  8030.  
  8031. While I'm not a crack at deciphering Copyright arrangements, my impression
  8032. is that the FSF doesn't want to be paid as long as the product one builds
  8033. with the compiler is free, and the source code is accessible. 
  8034.  
  8035. Since Icon is free and sources are freely available, couldn't it
  8036. be a good idea to port Icon to 386 - protected mode? It would be great
  8037. to have more memory, 32 bit integers, more speed, and memory paging
  8038. when running Icon on a PC under MS-DOS. (By the way, there are other
  8039. protected mode code builder kits, of course, but many vendors want
  8040. to have a fee for the distribution of the protected mode *loader*)
  8041.  
  8042. My questions: 
  8043. 1. Is there already a protected mode Icon for 386/MSDOS?
  8044. 2. If not, could it be implemented using the GnuCC compiler?
  8045. 3. If yes, is there anyone with experience in Icon implementation
  8046.    who is willing to give it a try? (I myself would like to put
  8047.    a lot of work into it, but I am not familiar with the technical
  8048.    details of the Icon / PC implementation, which  seems to be
  8049.    essential for such a project)
  8050.  
  8051. Greetings,
  8052.  
  8053. Jan de Ruiter
  8054. janpeter@mpi.kun.nl
  8055.  
  8056.  
  8057.  
  8058.  
  8059. From icon-group-sender  Sun Aug  2 06:00:39 1992
  8060. Received: by cheltenham.cs.arizona.edu; Sun, 2 Aug 1992 06:00:50 MST
  8061. Date: Sun, 2 Aug 1992 06:00:39 MST
  8062. From: "Ralph Griswold" <ralph>
  8063. Message-Id: <199208021300.AA06658@cheltenham.cs.arizona.edu>
  8064. To: icon-group@cs.arizona.edu, janpeter@mpi.kun.nl
  8065. Subject: Re:  386/protected mode
  8066. Status: R
  8067. Errors-To: icon-group-errors@cs.arizona.edu
  8068.  
  8069. There already is a 32-bit protected mode implementation of Icon
  8070. for MS-DOS for 386/486 processors.  The current version was built using
  8071. Intel Code Builder.
  8072.  
  8073. It's about 3 times faster than the "standard" 16-bit MS-DOS Icon and
  8074. can access up to 4GB of memory.
  8075.  
  8076. It's available from the Icon Project via FTP, our RBBS, or on
  8077. diskette is the same way as other personal-computer versions of Icon.
  8078.     
  8079. Ralph E. Griswold            ralph@cs.arizona.edu
  8080. Department of Computer Science          uunet!arizona!ralph
  8081. The University of Arizona        602-621-6609 (voice)
  8082. Tucson, AZ 85721            602-621-9618   (fax)
  8083.  
  8084.  
  8085.  
  8086. From icon-group-sender  Sun Aug  2 23:00:54 1992
  8087. Received: by cheltenham.cs.arizona.edu; Mon, 3 Aug 1992 07:36:57 MST
  8088. Date: Sun, 2 Aug 92 23:00:54 EDT
  8089. From: Paul_Abrahams@MTS.cc.Wayne.edu
  8090. To: icon-group@cs.arizona.edu
  8091. Message-Id: <485332@MTS.cc.Wayne.edu>
  8092. Subject: Protected-mode Icon
  8093. Status: R
  8094. Errors-To: icon-group-errors@cs.arizona.edu
  8095.  
  8096. A disadvantage of the protected-mode version of Icon under MS-DOS, at least
  8097. for some people such as me, is that it's incompatible with QEMM.  (Correct me
  8098. if I'm wrong, Ralph.)  So if you're considering using that version, be
  8099. forewarned.
  8100.  
  8101.  
  8102.  
  8103. From icon-group-sender  Mon Aug  3 02:23:50 1992
  8104. Received: by cheltenham.cs.arizona.edu; Mon, 3 Aug 1992 07:37:05 MST
  8105. Via: uk.ac.edinburgh.festival; Mon, 3 Aug 1992 10:23:34 +0100
  8106. Date: 03 Aug 92 10:23:29 BST
  8107. From: R J Hare <ercn72@festival.edinburgh.ac.uk>
  8108. Subject: FFT
  8109. To: icon-group@cs.arizona.edu
  8110. Message-Id: <9208031023.aa11591@uk.ac.ed.festival>
  8111. Status: R
  8112. Errors-To: icon-group-errors@cs.arizona.edu
  8113.  
  8114. Has anyone written any fast Fourier transform routines in Icon? I have had a
  8115. look at the ipl and couldn't see anything there...
  8116.  
  8117. Thanks.
  8118.  
  8119. Roger Hare.
  8120.  
  8121.  
  8122. From icon-group-sender  Mon Aug  3 07:36:44 1992
  8123. Received: by cheltenham.cs.arizona.edu; Mon, 3 Aug 1992 07:37:22 MST
  8124. Date: Mon, 3 Aug 1992 07:36:44 MST
  8125. From: "Ralph Griswold" <ralph>
  8126. Message-Id: <199208031436.AA17164@cheltenham.cs.arizona.edu>
  8127. To: Paul_Abrahams@MTS.cc.Wayne.edu, icon-group@cs.arizona.edu
  8128. Subject: Re:  Protected-mode Icon
  8129. Status: R
  8130. Errors-To: icon-group-errors@cs.arizona.edu
  8131.  
  8132. The present version of MS-DOS/386 Icon runs with QEMM 386 v6.0 (an
  8133. earlier version of 386 Icon didn't).  The only memory environment I know of
  8134. that 386 Icon does not run with is DESQView 386.
  8135.     
  8136. Ralph E. Griswold            ralph@cs.arizona.edu
  8137. Department of Computer Science          uunet!arizona!ralph
  8138. The University of Arizona        602-621-6609 (voice)
  8139. Tucson, AZ 85721            602-621-9618   (fax)
  8140.  
  8141.  
  8142. From icon-group-sender  Fri Aug  7 03:08:58 1992
  8143. Received: by cheltenham.cs.arizona.edu; Fri, 7 Aug 1992 05:54:28 MST
  8144. Date: 7 Aug 92 03:08:58 GMT
  8145. From: munnari.oz.au!uniwa!mullet!john@uunet.uu.net  (John West)
  8146. Organization: University Computer Club --- Perth, Western Australia
  8147. Subject: Icon on 386BSD
  8148. Message-Id: <1992Aug7.030858.28422@mullet.gu.uwa.edu.au>
  8149. Sender: icon-group-request@cs.arizona.edu
  8150. To: icon-group@cs.arizona.edu
  8151. Status: R
  8152. Errors-To: icon-group-errors@cs.arizona.edu
  8153.  
  8154. Well.. I compiled Icon our 486 box, running 386BSD version 0.1
  8155. It goes. At least, it doesn't crash when I compile the tests. I'll have
  8156. to have a close look at the results sometime when I have enough time to
  8157. do it.
  8158. But programs compile and run without crashing, and they appear to produce
  8159. sensible results. Even co-expressions.
  8160.  
  8161. John West
  8162. -- 
  8163. For the humour impaired: Insert a :-) after every third word
  8164.  
  8165.  
  8166. From icon-group-sender  Wed Aug 12 15:40:46 1992
  8167. Received: by cheltenham.cs.arizona.edu; Thu, 13 Aug 1992 12:18:47 MST
  8168. Date: 12 Aug 92 15:40:46 GMT
  8169. From: van-bc!ubc-cs!destroyer!caen!kuhub.cc.ukans.edu!spssig.spss.com!uchinews!ellis!goer@ucbvax.Berkeley.EDU  (Richard L. Goerwitz)
  8170. Organization: University of Chicago Computing Organizations
  8171. Subject: another chart parser
  8172. Message-Id: <1992Aug12.154046.26396@midway.uchicago.edu>
  8173. Sender: icon-group-request@cs.arizona.edu
  8174. To: icon-group@cs.arizona.edu
  8175. Status: R
  8176. Errors-To: icon-group-errors@cs.arizona.edu
  8177.  
  8178. This was posted a couple of months ago.  I've been using it for some
  8179. routine stuff, and found it was really not as flexible as I'd like.
  8180. It also had some bugs, and probably retains those bugs.
  8181.  
  8182. For anyone who wants it, here is a newer version:
  8183.  
  8184. ############################################################################
  8185. #
  8186. #    Name:     ichartp.icn
  8187. #
  8188. #    Title:     Iconish implementation of a simple chart parser
  8189. #
  8190. #    Author:     Richard L. Goerwitz
  8191. #
  8192. #    Version: 1.6
  8193. #
  8194. ############################################################################
  8195. #
  8196. #  General:
  8197. #
  8198. #      Ichartp implements a simple chart parser - a slow but
  8199. #  easy-to-implement strategy for parsing context free grammars (it
  8200. #  has a cubic worst-case time factor).  Chart parsers are flexible
  8201. #  enough to handle a lot of natural language constructs.  They also
  8202. #  lack many of the troubles associated with empty and left-recursive
  8203. #  derivations.  To obtain a parse, just create a BNF file, obtain a
  8204. #  line of input, and then invoke parse_sentence(sentence,
  8205. #  bnf_filename, start-symbol).  Parse_sentence suspends successive
  8206. #  edge structures corresponding to possible parses of the input
  8207. #  sentence.  There is a routine called edge_2_tree() that converts
  8208. #  these edges to a more standard form.  See the stub main() procedure
  8209. #  for an example of how to make use of all these facilities.
  8210. #
  8211. #  Implementation details:
  8212. #
  8213. #      The parser itself operates in bottom-up fashion, but it might
  8214. #  just as well have been coded top-down, or for that matter as a
  8215. #  combination bottom-up/top-down parser (chart parsers don't care).
  8216. #  The parser operates in breadth-first fashion, rather than walking
  8217. #  through each alternative until it is exhausted.  As a result, there
  8218. #  tends to be a pregnant pause before any results appear, but when
  8219. #  they appear they come out in rapid succession.  To use a depth-first
  8220. #  strategy, just change the "put" in "put(ch.active, new_e)" to read
  8221. #  "push."  I haven't tried to do this, but it should be that simple
  8222. #  to implement.
  8223. #      BNFs are specified using the same notation used in Griswold &
  8224. #  Griswold, and as described in the IPL program "pargen.icn," with
  8225. #  the following difference:  All metacharacters (space, tab, vertical
  8226. #  slash, right/left parends, brackets and angle brackets) are
  8227. #  converted to literals by prepending a backslash.  Comments can be
  8228. #  include along with BNFs using the same notation as for Icon code
  8229. #  (i.e. #-sign).
  8230. #
  8231. #  Gotchas:
  8232. #
  8233. #      Pitfalls to be aware of include things like <L> ::= <L> | ha |
  8234. #  () (a weak attempt at a laugh recognizer).  This grammar will
  8235. #  accept "ha," "ha ha," etc. but will suspend an infinite number of
  8236. #  possible parses.  The right way to do this sort of thing is <L> ::=
  8237. #  ha <S> | ha, or if you really insist on having the empty string as
  8238. #  a possibility, try things like:
  8239. #
  8240. #          <S>      ::= () | <LAUGHS>
  8241. #          <LAUGHS> ::= ha <LAUGHS> | ha
  8242. #
  8243. #  Of course, the whole problem of infinite parses can be avoided by
  8244. #  simply invoking the parser in a context where it is not going to
  8245. #  be resumed, or else one in which it will be resumed a finite number
  8246. #  of times.
  8247. #
  8248. #  Motivation:
  8249. #
  8250. #      I was reading Byte Magazine (vol. 17:2 [February, 1992]), and
  8251. #  ran into an article entitled "A Natural Solution" (pages 237-244)
  8252. #  in which a standard chart parser was described in terms of its C++
  8253. #  implementation.  The author remarked at how his optimizations made
  8254. #  it possible to parse a 14-word sentence in only 32 seconds (versus
  8255. #  146 for a straight Gazdar-Mellish LISP chart parser).  32 seconds
  8256. #  struck me as hardly anything to write home about, so I coded up a
  8257. #  quick system in Icon to see how it compared.  This library is the
  8258. #  result.
  8259. #      I'm quite sure that this code could be very much improved upon.
  8260. #  As it stands, its performance seems as good as the C++ parser in
  8261. #  BYTE, if not better.  It's hard to tell, though, seeing as I have
  8262. #  no idea what hardware the guy was using.  I'd guess a 386 running
  8263. #  DOS.  On a 386 running Xenix the Icon version beats the BYTE times
  8264. #  by a factor of about four.  The Icon compiler creates an executable
  8265. #  that (in the above environment) parses 14-15 word sentences in
  8266. #  anywhere from 6 to 8 seconds.  Once the BNF file is read, it does
  8267. #  short sentences in a second or two.  If I get around to writing it,
  8268. #  I'll probably use the code here as the basic parsing engine for an
  8269. #  adventure game my son wants me to write.
  8270. #
  8271. ############################################################################
  8272. #
  8273. #  Links: structs, slashbal, rewrap, strip, stripcom (ximage for debugging)
  8274. #
  8275. #  Requires:  an up-to-date IPL, coexpressions
  8276. #
  8277. ############################################################################
  8278. #
  8279. #       Here's a sample BNF file (taken, modified, from the BYTE
  8280. #  Magazine article mentioned above).  Note again the conventions a)
  8281. #  that nonterminals be enclosed in angle brackets & b) that overlong
  8282. #  lines be continued by terminating the preceding line with a
  8283. #  backslash.  Although not illustrated below, the metacharacters <,
  8284. #  >, (, ), and | can all be escaped (i.e. can all have their special
  8285. #  meaning neutralized) with a backslash (e.g. \<).  Comments can also
  8286. #  be included using the Icon #-notation.  Empty symbols are illegal,
  8287. #  so if you want to specify a zero-derivation, use "()."  There is an
  8288. #  example of this usage below.
  8289. #
  8290. #  <S>    ::= <NP> <VP> | <S> <CONJ> <S>
  8291. #  <VP>   ::= <VP> <CONJ> <VP> | <IV> ( () | <PP> ) | \
  8292. #         <TV> ( <NP> | <NP> <PP> | <NP> <VP> | <REL> <S> )
  8293. #  <NP>   ::= <DET> ( <NP> | <ADJ> <NP> | <ADJ> <NP> <PP> | <NP> <PP> ) | \
  8294. #         <ADJ> <NP> | <N> | <N> <CONJ> <N> | \
  8295. #         <NP> <CONJ> <NP>
  8296. #  <PP>   ::= <P> ( <NP> | <ADJ> <NP> ) | <PP> <CONJ> <PP>
  8297. #  <ADJ>  ::= <ADJ> <CONJ> <ADJ>
  8298. #  <CONJ> ::= and
  8299. #  <DET>  ::= the | a | his | her
  8300. #  <NP>   ::= her | he | they
  8301. #  <N>    ::= nurse | nurses | book | books | travel | arrow | arrows | \
  8302. #        fortune | fortunes | report
  8303. #  <ADJ>  ::= outrageous | silly | blue | green | heavy | white | red | \
  8304. #        black | yellow
  8305. #  <IV>   ::= travel | travels | report | see | suffer
  8306. #  <TV>   ::= hear | see | suffer
  8307. #  <P>    ::= on | of
  8308. #  <REL>  ::= that
  8309. #
  8310. ############################################################################
  8311.  
  8312. # I use ximage for debugging purposes.
  8313. link structs, slashbal, rewrap, strip, stripcom#, ximage
  8314.  
  8315. record stats(edge_list, lhs_table, term_set)
  8316. record chart(inactive, active)               # inactive - set; active - list
  8317. record retval(no, item)
  8318.  
  8319. record edge(LHS, RHS, LEN, DONE, BEG, END, SEEN)
  8320. record short_edge(LHS, RHS)
  8321.  
  8322. #
  8323. # For debugging only.
  8324. #
  8325. procedure main(a)
  8326.  
  8327.     local res, filename
  8328.     # &trace := -1
  8329.     filename := \a[1] | "bnfs.byte"
  8330.     while line := read(&input) do {
  8331.     res := &null
  8332.         every res := parse_sentence(line, filename, "S") do {
  8333.             if res.no = 0 then
  8334.             write(stree(edge2tree(res.item)))
  8335. #            write(ximage(res.item))
  8336.         else if res.no = 1 then {
  8337.         write("hmmm")
  8338.         write(stree(edge2tree(res.item)))
  8339.         }
  8340.         }
  8341.     /res & write("can't parse ",line)
  8342.     }
  8343.  
  8344. end
  8345.  
  8346.  
  8347. #
  8348. # parse_sentence:  string x string -> edge records
  8349. #                  (s, filename) -> Es
  8350. #     where s is a chunk of text presumed to constitute a sentence
  8351. #     where filename is the name of a grammar file containing BNFs
  8352. #     where Es are edge records containing possible parses of s
  8353. #
  8354. procedure parse_sentence(s, filename, start_symbol)
  8355.  
  8356.     local file, e, i, elist, ltbl, tset, ch, tokens, st, 
  8357.         memb, new_e, token_set, none_found, active_modified
  8358.     static master, old_filename
  8359.     initial master := table()
  8360.  
  8361.     #
  8362.     # Initialize and store stats for filename (if not already stored).
  8363.     #
  8364.     if not (filename == \old_filename) then {
  8365.         file := open(filename, "r") | p_err(filename, 7)
  8366.         #
  8367.         # Read BNFs from file; turn them into edge structs, and
  8368.         # store them all in a list; insert terminal symbols into a set.
  8369.         #
  8370.         elist := list(); ltbl := table(); tset := set()
  8371.         every e := bnf_file_2_edges(file) do {
  8372.             put(elist, e)                      # main edge list (active)
  8373.             (/ltbl[e.LHS] := set([e])) | insert(ltbl[e.LHS], e) # index LHSs
  8374.             every i := 1 to e.LEN do           # LEN holds length of e.RHS
  8375.                 if /e.RHS[i].RHS then          # RHS for terminals is null
  8376.                     insert(tset, e.RHS[i].LHS)
  8377.         }
  8378.         insert(master, filename, stats(elist, ltbl, tset))
  8379.         old_filename := filename
  8380.         close(file)
  8381.     }
  8382.     elist := fullcopy(master[filename].edge_list)
  8383.     ltbl  := fullcopy(master[filename].lhs_table)
  8384.     tset  := master[filename].term_set
  8385.     
  8386.     #
  8387.     # Make edge list into the active section of chart; tokenize the
  8388.     # sentence s & check for unrecognized terminals.
  8389.     #
  8390.     ch := chart(set(), elist)
  8391.     tokens := tokenize(s)
  8392.  
  8393.     #
  8394.     # Begin parse by entering all tokens in s into the inactive set
  8395.     # in the chart as edges with no RHS (a NULL RHS is characteristic
  8396.     # of all terminals).
  8397.     #
  8398.     token_set := set(tokens)
  8399.     every i := 1 to *tokens do {
  8400.         # Flag words not in the grammar as errors.
  8401.         if not member(tset, tokens[i]) then
  8402.             suspend retval(1, tokens[i])
  8403.         # Now, give us an inactive edge corresponding to word i.
  8404.         insert(ch.inactive, e := edge(tokens[i], &null, 1, 1, i, i+1))
  8405.         # Insert word i into the LHS table.
  8406.         (/ltbl[tokens[i]] := set([e])) | insert(ltbl[tokens[i]], e)
  8407.     # Watch out for those empty RHSs.
  8408.     insert(ch.inactive, e := edge("", &null, 1, 1, i, i))
  8409.         (/ltbl[""] := set([e])) | insert(ltbl[""], e)
  8410.     }
  8411.     *tokens = 0 & i := 0
  8412.     insert(ch.inactive, e := edge("", &null, 1, 1, i+1, i+1))
  8413.     (/ltbl[""] := set([e])) | insert(ltbl[""], e)
  8414.  
  8415.     #
  8416.     # Until no new active edges can be built, keep ploughing through
  8417.     # the active edge list, trying to match unconfirmed members of their
  8418.     # RHSs up with inactive edges.
  8419.     #
  8420.     until \none_found do {
  8421. #    write(ximage(ch))
  8422.         none_found := 1
  8423.         every e := !ch.active do {
  8424.             active_modified := &null
  8425.             # keep track of inactive edges we've already tried
  8426.             /e.SEEN := set()
  8427.             #
  8428.             # e.RHS[e.DONE+1] is the first unconfirmed category in the
  8429.             # RHS of e; ltbl[e.RHS[e.DONE+1].LHS] are all edges having
  8430.             # as their LHS the LHS of the first unconfirmed category in
  8431.             # e's RHS; we simply intersect this set with the inactives,
  8432.             # and then subtract out those we've seen before in connec-
  8433.             # tion with this edge -
  8434.             #
  8435.             if *(st := \ltbl[e.RHS[e.DONE+1].LHS] ** ch.inactive -- e.SEEN) > 0
  8436.             then {
  8437.                 # record all the inactive edges being looked at as seen
  8438.                 e.SEEN ++:= st
  8439.                 every memb := !st do {
  8440.             # make sure this inactive edge starts where the
  8441.             # last confirmed edge in e.RHS ends!
  8442.             if memb.BEG ~= \e.RHS[e.DONE].END then next
  8443.             # set none_found to indicate we've created a new edge
  8444.             else none_found := &null
  8445.                     # create a new edge, having the LHS of e, the RHS of e,
  8446.                     # the start point of e, the end point of st, and one more
  8447.                     # confirmed RHS members than e
  8448.                     new_e := edge(e.LHS, fullcopy(e.RHS),
  8449.                   e.LEN, e.DONE+1, e.BEG, memb.END)
  8450.                     new_e.RHS[new_e.DONE] := memb
  8451.                     /new_e.BEG := memb.BEG
  8452.                     if new_e.LEN = new_e.DONE then {      # it's inactive
  8453.                         insert(ch.inactive, new_e)
  8454.                         insert(ltbl[e.LHS], new_e)
  8455.                         if new_e.BEG = 1 & new_e.END = (*tokens+1) then {
  8456.                             if new_e.LHS == start_symbol  # complete parse
  8457.                             then suspend retval(0, new_e)
  8458.                         }
  8459.                     } else {
  8460.                         put(ch.active, new_e)            # it's active
  8461.                         active_modified := 1
  8462.                     }
  8463.                 }
  8464.             }
  8465.             # restart if the ch.active list has been modified
  8466.             if \active_modified then break next
  8467.         }
  8468.     }
  8469.  
  8470. end
  8471.  
  8472.  
  8473. #
  8474. # tokenize:  break up a sentence into constituent words, using spaces,
  8475. #            tabs, and other punctuation as separators (we'll need to
  8476. #            change this a bit later on to cover apostrophed words)
  8477. #
  8478. procedure tokenize(s)
  8479.  
  8480.     local l, word
  8481.  
  8482.     l := list()
  8483.     s ? {
  8484.         while tab(upto(&letters)) do
  8485.             put(l, map(tab(many(&letters))))
  8486.     }
  8487.     return l
  8488.  
  8489. end
  8490.  
  8491.  
  8492. #
  8493. # edge2tree:  edge -> tree
  8494. #             e -> t
  8495. #
  8496. #    where e is an edge structure (active or inactive; both are okay)
  8497. #    where t is a tree like what's described in Ralph Griswold's
  8498. #    structs library (IPL); I don't know about the 2nd ed. of
  8499. #    Griswold & Griswold, but the structure is described in the 1st
  8500. #    ed. in section 16.1
  8501. #
  8502. #    fails if, for some reason, the conversion can't be made (e.g. the
  8503. #    edge structure has been screwed around with in some way)
  8504. #
  8505. procedure edge2tree(e)
  8506.  
  8507.     local memb, t
  8508.  
  8509.     t := [e.LHS]
  8510.     \e.RHS | (return t)                                 # a terminal
  8511.     type(e) == "edge" | (return put(t, []))             # An incomplete edge
  8512.     every memb := !e.RHS do                             # has daughters.
  8513.     put(t, edge2tree(memb))
  8514.     return t
  8515.  
  8516. end
  8517.  
  8518.  
  8519. #
  8520. # bnf_file_2_edges: concatenate backslash-final lines & parse
  8521. #
  8522. procedure bnf_file_2_edges(f)
  8523.  
  8524.     local getline
  8525.  
  8526.     getline := create stripcom(!f)
  8527.     while line := @getline do {
  8528.         while line ?:= 1(tab(-2) || tab(slashupto('\\')), pos(-1)) || @getline
  8529.         suspend bnf_2_edges(line)
  8530.     }
  8531.  
  8532. end
  8533.  
  8534.  
  8535. #
  8536. # bnf_2_edges: string -> edge records
  8537. #              s -> Es (a generator)
  8538. #    where s is a CFPSG rule in BNF form
  8539. #    where Es are edges
  8540. #
  8541. procedure bnf_2_edges(s)
  8542.     
  8543.     local tmp
  8544.     #
  8545.     # Break BNF-style CFPSG rule into LHS and RHS.  If there is more
  8546.     # than one RHS (a la the | alternation op), suspend multiple re-
  8547.     # sults.
  8548.     #
  8549.     s ? {
  8550.     # tab upto the ::= sign
  8551.     tmp := (tab(slashupto(':')) || ="::=") | p_err(s, 1)
  8552.     # strip non-backslashed spaces, and extract LHS symbol
  8553.     stripspaces(tmp) ? {
  8554.         LHS := 1(tab(slashbal(':', '<', '>')), ="::=") | p_err(s, 1)
  8555.         LHS ?:= strip(2(="<", tab(-1), =">"), '\\') | p_err(s, 2)
  8556.         LHS == "" & p_err(s, 6)
  8557.     }
  8558.         every RHS := do_slash(tab(0) \ 1) do {
  8559.             RHS := string_2_list(RHS)
  8560.             suspend edge(LHS, RHS, *RHS, 0, &null, &null)
  8561.         }
  8562.     }
  8563.  
  8564. end
  8565.  
  8566.  
  8567. #
  8568. # string_2_list:  string -> list
  8569. #                 s -> L
  8570. #    where L is a list of partially constructed (short) edges, having
  8571. #    only LHS and RHS; in the case of nonterminals, the RHS is set
  8572. #    to 1, while for terminals the RHS is null (and remains that way
  8573. #    throughout the parse)
  8574. #
  8575. procedure string_2_list(s)
  8576.  
  8577.     local tmp, RHS_list, LHS
  8578.  
  8579.     (s || "\x00") ? {
  8580.     tab(many(' \t'))
  8581.         pos(-1) & (return [short_edge("", &null)])
  8582.         RHS_list := list()
  8583.         repeat {
  8584.         tab(many(' \t'))
  8585.         pos(-1) & break
  8586.             if match("<") then {
  8587.                 tmp := ("" ~== tab(slashbal(&cset, '<', '>'))) | p_err(s, 4)
  8588.         LHS := stripspaces(tmp)
  8589.                 LHS ?:= strip(2(="<", tab(-1), =">"), '\\') | p_err(s, 4)
  8590.         LHS == "" & p_err(s, 10)
  8591.                 put(RHS_list, short_edge(LHS, 1))
  8592.             } else {
  8593.                 LHS := stripspaces(tab(slashupto(' <') | -1))
  8594.                 slashupto('>', LHS) & p_err(s, 5)
  8595.                 put(RHS_list, short_edge(strip(LHS, '\\'), &null))
  8596.             }
  8597.         }
  8598.     }
  8599.     return RHS_list
  8600.  
  8601. end
  8602.  
  8603.  
  8604. #
  8605. # slashupto:  cset x string x integer x integer -> integers
  8606. #             (c, s, i, j) -> Is (a generator)
  8607. #    where Is are the integer positions in s[i:j] before characters
  8608. #    in c that is not preceded by a backslash escape
  8609. #
  8610. procedure slashupto(c, s, i, j)
  8611.  
  8612.     if /s := &subject
  8613.     then /i := &pos
  8614.     else /i := 1
  8615.     /j := *s + 1
  8616.     
  8617.     /c := &cset
  8618.     c ++:= '\\'
  8619.     s[1:j] ? {
  8620.         tab(i)
  8621.         while tab(upto(c)) do {
  8622.             if (="\\", move(1)) then next
  8623.             suspend .&pos
  8624.             move(1)
  8625.         }
  8626.     }
  8627.  
  8628. end
  8629.  
  8630.  
  8631. #
  8632. # fullcopy:  make full recursive copy of object
  8633. #
  8634. procedure fullcopy(obj)
  8635.  
  8636.     local retval, i, k
  8637.  
  8638.     case type(obj) of {
  8639.         "co-expression"  : return obj
  8640.         "cset"           : return obj
  8641.         "file"           : return obj
  8642.         "integer"        : return obj
  8643.         "list"           : {
  8644.             retval := list(*obj)
  8645.             every i := 1 to *obj do
  8646.                 retval[i] := fullcopy(obj[i])
  8647.             return retval
  8648.         }
  8649.         "null"           :  return &null
  8650.         "procedure"      :  return obj
  8651.         "real"           :  return obj
  8652.         "set"            :  {
  8653.             retval := set()
  8654.             every insert(retval, fullcopy(!obj))
  8655.             return retval
  8656.         }
  8657.         "string"         :  return obj
  8658.         "table"          :  {
  8659.             retval := table(obj[[]])
  8660.             every k := key(obj) do
  8661.                 insert(retval, fullcopy(k), fullcopy(obj[k]))
  8662.             return retval
  8663.         }
  8664.         # probably a record; if not, we're dealing with a new
  8665.         # version of Icon or a nonstandard implementation, and
  8666.     # we're screwed
  8667.         default          :  {
  8668.             retval := copy(obj)
  8669.             every i := 1 to *obj do
  8670.                 retval[i] := fullcopy(obj[i])
  8671.             return retval
  8672.         }
  8673.     }
  8674.  
  8675. end
  8676.  
  8677.  
  8678. #
  8679. # do_slash:  string -> string(s)
  8680. #     Given a|b suspend a then b.  Used in conjunction with do_parends().
  8681. #
  8682. procedure do_slash(s)
  8683.  
  8684.     local chunk
  8685.     s ? {
  8686.     while chunk := tab(slashbal('|', '(', ')')) do {
  8687.         suspend do_parends(chunk)
  8688.         move(1)
  8689.     }
  8690.     suspend do_parends(tab(0))
  8691.     }
  8692.  
  8693. end
  8694.  
  8695.  
  8696. #
  8697. # do_parends:  string -> string(s)
  8698. #    Given a(b)c suspend abc; given a(b|c)d suspend abd and acd, etc.
  8699. #    Used in conjuction with do_slash().
  8700. #
  8701. procedure do_parends(s)
  8702.  
  8703.     local chunk, i, j
  8704.     s ? {
  8705.     if not (i := slashupto('(')) then {
  8706.         chunk := tab(0)
  8707.         slashupto(')') & p_err(s, 8)
  8708.         suspend chunk
  8709.     } else {
  8710.         j := i + slashbal(')', '(', ')', s[i+1:0]) | p_err(s, 9)
  8711.         suspend tab(i) ||
  8712.         (move(1), do_slash(tab(j))) ||
  8713.         (move(1), do_parends(tab(0)))
  8714.     }
  8715.     }
  8716.  
  8717. end
  8718.  
  8719.  
  8720. #
  8721. # p_err:  print error message to stderr & abort
  8722. #
  8723. procedure p_err(s, n)
  8724.  
  8725.     local i, msg
  8726.     static errlist
  8727.     initial {
  8728.         errlist := [[1,  "malformed LHS"],
  8729.                     [2,  "nonterminal lacks proper <> enclosure"],
  8730.                     [3,  "missing left angle bracket"],
  8731.                     [4,  "unmatched left angle bracket"],
  8732.                     [5,  "unmatched right angle bracket"],
  8733.             [6,  "empty symbol in LHS"],
  8734.                     [7,  "unable to open file"],
  8735.                     [8,  "unmatched right parenthesis"],
  8736.                     [9,  "unmatched left parenthesis"],
  8737.                     [10, "empty symbol in RHS"]
  8738.                    ]
  8739.     }
  8740.     every i := 1 to *errlist do
  8741.         if errlist[i][1] = n then msg := errlist[i][2]
  8742.     writes(&errout, "error ", n, " (", msg, ") in \n")
  8743.     every write("\t", rewrap(s) | rewrap())
  8744.     exit(n)
  8745.  
  8746. end
  8747.  
  8748.  
  8749. #
  8750. # Remove non-backslashed spaces and tabs.
  8751. #
  8752. procedure stripspaces(s)
  8753.  
  8754.     local s2
  8755.  
  8756.     s2 := ""
  8757.     s ? {
  8758.         while s2 ||:= tab(slashupto(' \t')) do
  8759.             tab(many(' \t'))
  8760.         s2 ||:= tab(0)
  8761.     }
  8762.  
  8763.     return s2
  8764.  
  8765. end
  8766. -- 
  8767.  
  8768.    -Richard L. Goerwitz              goer%midway@uchicago.bitnet
  8769.    goer@midway.uchicago.edu          rutgers!oddjob!ellis!goer
  8770.  
  8771.  
  8772. From icon-group-sender  Mon Aug 17 09:30:01 1992
  8773. Received: by cheltenham.cs.arizona.edu; Mon, 17 Aug 1992 09:30:18 MST
  8774. Date: Mon, 17 Aug 1992 09:30:01 MST
  8775. From: "Ralph Griswold" <ralph>
  8776. Message-Id: <199208171630.AA09248@cheltenham.cs.arizona.edu>
  8777. To: icon-group
  8778. Subject: Version 8.7 Icon for UNIX and VMS
  8779. Status: R
  8780. Errors-To: icon-group-errors@cs.arizona.edu
  8781.  
  8782. Version 8.7 of Icon is now available for UNIX and VMS. These implementations
  8783. include X Window System features and both the interpreter and the optimizing
  8784. compiler. The VMS distribution includes executables.
  8785.  
  8786. Complete systems, including source code and the Icon program library, are
  8787. available by anonymous FTP to cs.arizona.edu.  cd /icon/packages/unix
  8788. or /icon/packages/vms and get the READ.ME file there for further
  8789. information.
  8790.  
  8791. Executable binaries and related files are available for the following
  8792. UNIX platforms via FTP:
  8793.  
  8794.     Convex                NeXT
  8795.     DECstation (MIPS risc)        Sequent Symmetry
  8796.     HP 9000/700            Sun 3
  8797.     HP 9000/800            Sun 4 (Sparc)
  8798.     Iris 4D
  8799.  
  8800. cd /icon/binaries/unix and get the READ.ME there for further information.
  8801.  
  8802. The complete UNIX and VMS systems also are available on magnetic media
  8803. with printed documentation.  Shipping is included to addresses in the United
  8804. States, Canada, and Mexico.  The charge for shipping to other countries is
  8805. shown in brackets.
  8806.  
  8807.     UNIX    tape          $30 [$10]
  8808.     UNIX    cartridge      $45 [$10]
  8809.     UNIX    1.44MB diskettes  $25  [$5]
  8810.  
  8811.     VMS    tape          $32 [$11]
  8812.  
  8813. Tapes are 1/2", 9-track, 1600 bpi.  Cartridges are written in QIC-24
  8814. format.
  8815.  
  8816. Payment to The University of Arizona may be made by check in U.S. dollars
  8817. drawn on a bank with a branch in the United States.  MasterCard and Visa
  8818. also are acceptable.
  8819.  
  8820. Direct questions to icon-project@cs.arizona.edu (not icon-group).
  8821.     
  8822.    Ralph E. Griswold            ralph@cs.arizona.edu
  8823.    Department of Computer Science      uunet!arizona!ralph
  8824.    The University of Arizona        602-621-6609 (voice)
  8825.    Tucson, AZ 85721            602-621-9618   (fax)
  8826.  
  8827.  
  8828. From icon-group-sender  Mon Aug 17 10:09:26 1992
  8829. Received: by cheltenham.cs.arizona.edu; Mon, 17 Aug 1992 10:09:32 MST
  8830. Date: Mon, 17 Aug 1992 10:09:26 MST
  8831. From: "Ralph Griswold" <ralph>
  8832. Message-Id: <199208171709.AA10602@cheltenham.cs.arizona.edu>
  8833. To: icon-group
  8834. Subject: 8.7 Icon for UNIX
  8835. Status: R
  8836. Errors-To: icon-group-errors@cs.arizona.edu
  8837.  
  8838. There are very few language differences between Version 8.6 and 8.7.  The
  8839. differences mostly are in the implementation, including bug fixes and
  8840. adjustments to X-Icon.
  8841.  
  8842. If you have 8.6 and aren't having any troubles, you probably don't need to
  8843. get 8.7.
  8844.  
  8845. If you're using X-Icon, however, you probably should get 8.7.  There also
  8846. are several X-Icon programs in the program library in 8.7
  8847.     
  8848. Ralph E. Griswold            ralph@cs.arizona.edu
  8849. Department of Computer Science          uunet!arizona!ralph
  8850. The University of Arizona        602-621-6609 (voice)
  8851. Tucson, AZ 85721            602-621-9618   (fax)
  8852.  
  8853.  
  8854. From icon-group-sender  Tue Aug 18 10:17:04 1992
  8855. Received: by cheltenham.cs.arizona.edu; Tue, 18 Aug 1992 10:17:11 MST
  8856. Date: Tue, 18 Aug 1992 10:17:04 MST
  8857. From: "Ralph Griswold" <ralph>
  8858. Message-Id: <199208181717.AA29479@cheltenham.cs.arizona.edu>
  8859. To: icon-group
  8860. Subject: VMS 8.7 Icon
  8861. Status: R
  8862. Errors-To: icon-group-errors@cs.arizona.edu
  8863.  
  8864. The VMS version of Icon 8.7 was built with X-Window (DecWindows) support
  8865. enabled.  We have found that some sites that do not have DecWindows
  8866. are unable to run Icon at all.  You can check for the presence of the
  8867. necessary library file by entering
  8868.  
  8869.        $ DIR SYS$SHARE:DECW$XLIBSHR.EXE
  8870.  
  8871. If this file does not exist, Icon 8.7 will not run.  We are investigating
  8872. this problem.
  8873.     
  8874. Ralph E. Griswold            ralph@cs.arizona.edu
  8875. Department of Computer Science          uunet!arizona!ralph
  8876. The University of Arizona        602-621-6609 (voice)
  8877. Tucson, AZ 85721            602-621-9618   (fax)
  8878.  
  8879.  
  8880.  
  8881. From icon-group-sender  Tue Aug 18 12:42:02 1992
  8882. Received: by cheltenham.cs.arizona.edu; Wed, 19 Aug 1992 05:27:43 MST
  8883. Date:       Tue, 18 Aug 92 12:42:02 EST
  8884. From: MATH0022@rmc.ca
  8885. Reply-To: lindsay@rmc.ca
  8886. To: icon-group@cs.arizona.edu
  8887. Message-Id: <920818.12420265.040650@RMC.CP6>
  8888. Subject:    (1) ICON & OS/2 ? (2) Strings vs. Lists.
  8889. Status: R
  8890. Errors-To: icon-group-errors@cs.arizona.edu
  8891.  
  8892. (1) Would someone please post some comments, status, considerations or
  8893.     availability information about using ICON with OS/2 (as opposed to DOS or to
  8894.     DOS + WINDOWS or other multitasker) on '386 or '486 type equipment (either
  8895.     the interpreter or a compiler) ?
  8896.  
  8897. (2) A few months ago, there were a few ruminations on this board about
  8898.     processing strings as lists or rather vv.; I'd like to open up and expand
  8899.     the subject again.  Plainly there is a logical parallel between a string and
  8900.     a list, the differences being (a) that strings (in ICON and other languages
  8901.     too) are limited to having characters as components, while lists may have
  8902.     elements of any data type or any one other data type, (b) the obvious
  8903.     implementations on all the machines that I can think of are quite different,
  8904.     and (c) the operations that we tend to impute to lists are quite different
  8905.     from those that are usually associated with strings.  But are they still?
  8906.     Both strings and lists are linear.  We have been processing at least
  8907.     2-dimensional images such as photographs of lunar and planetary surfaces to
  8908.     extract hidden detail and display it, and the image processing that I've
  8909.     seen bears no obvious relation to our current SNOBOLish concept of patterns
  8910.     in a string or list.
  8911.  
  8912.     Hence there seem to be 2 questions that are still open after several years
  8913.     of work: First, can we expand our concept of (linear) pattern so that that
  8914.     sort of pattern matching can be extended into 2 or more dimensions, perhaps
  8915.     via nearest-neighbour paths in an array, and Second, what new operators are
  8916.     needed for 'pattern matching' in 2 or more dimensions or for recognizing
  8917.     patterns in lists of numbers e.g., and what do these new operators say about
  8918.     linear pattern matching?
  8919.  
  8920.     The early attempts to try to deal with these 2 questions seem to have gotten
  8921.     almost nowhere, and the subject has almost been dropped in favour of
  8922.     artificial intelligence and computer vision considerations.  In the early
  8923.     1970's, I believe, I heard of a paper entitled 'How to Parse (the picture
  8924.     of) a Dog', but I never located it.  In view of our recent advances in image
  8925.     analysis, I suggest that another look is in order.
  8926.  
  8927. --------------------------------------------------------------------------------
  8928.  
  8929.             John H. Lindsay,
  8930.             Department of Mathematics and Computer Science,
  8931.             Royal Military College of Canada,
  8932.             Kingston, Ontario, Canada, K7K 5L0.
  8933.  
  8934.             Phones: Office,                          (613) 541-6419
  8935.                     Messages,                              541-6343 or 541-6458
  8936.                     Home,                                  546-6988
  8937.             E-Mail: From Bitnet, NetNorth, ONet:     LINDSAY_JH@RMC.CA
  8938.                     From Canadian Military Colleges: LINDSAY JH@RMC
  8939.             Fax:                                     (613) 542-8129
  8940.  
  8941.                           <*> <*> <*>  END  <*> <*> <*>
  8942.  
  8943.  
  8944. From icon-group-sender  Thu Aug 20 02:17:37 1992
  8945. Received: by cheltenham.cs.arizona.edu; Thu, 20 Aug 1992 05:02:05 MST
  8946. Date: 20 Aug 92 02:17:37 GMT
  8947. From: cis.ohio-state.edu!zaphod.mps.ohio-state.edu!moe.ksu.ksu.edu!ux1.cso.uiuc.edu!uchinews!ellis!goer@ucbvax.Berkeley.EDU  (Richard L. Goerwitz)
  8948. Organization: University of Chicago Computing Organizations
  8949. Subject: Re: (1) ICON & OS/2 ? (2) Strings vs. Lists.
  8950. Message-Id: <1992Aug20.021737.27873@midway.uchicago.edu>
  8951. References: <920818.12420265.040650@RMC.CP6>
  8952. Sender: icon-group-request@cs.arizona.edu
  8953. To: icon-group@cs.arizona.edu
  8954. Status: R
  8955. Errors-To: icon-group-errors@cs.arizona.edu
  8956.  
  8957. In article <920818.12420265.040650@RMC.CP6> lindsay@rmc.ca writes:
  8958.  
  8959. >   A few months ago, there were a few ruminations on this board about
  8960. >   processing strings as lists or rather vv.; I'd like to open up and expand
  8961. >   the subject again.  Plainly there is a logical parallel between a string and
  8962. >   a list,
  8963.  
  8964. Perhaps you could define what you mean by "list."  Do you mean a LISPish vec-
  8965. tor?  Even in Icon, the list is a much more general type, since it can con-
  8966. tain objects of all other types.  Instead of unifying lists and strings, may-
  8967. be it might be better to talk about expanding strings to cover all homogenous
  8968. linear sequences of certain data types.
  8969.  
  8970. But then, of course, we lose a lot of our optimizations, and Icon becomes even
  8971. more polymorphic (is that the right word?), since things like scanning will
  8972. have to be modified to do many different things, depending on the kind of
  8973. string it encounters.
  8974.  
  8975. Maybe what might we worth thinking about is whether it might be possible to
  8976. develop a list scanning mechanism.  I've thought about this a lot, and I don't
  8977. really see an elegant mechanism.  Got any ideas?
  8978.  
  8979. -- 
  8980.  
  8981.    -Richard L. Goerwitz              goer%midway@uchicago.bitnet
  8982.    goer@midway.uchicago.edu          rutgers!oddjob!ellis!goer
  8983.  
  8984.  
  8985. From icon-group-sender  Thu Aug 20 07:13:29 1992
  8986. Received: by cheltenham.cs.arizona.edu; Thu, 20 Aug 1992 07:31:03 MST
  8987. Date: Thu, 20 Aug 1992 07:13:29 MST
  8988. From: "Ralph Griswold" <ralph>
  8989. Message-Id: <199208201413.AA05459@cheltenham.cs.arizona.edu>
  8990. To: icon-group
  8991. Subject: list scanning/pattern matching
  8992. Status: R
  8993. Errors-To: icon-group-errors@cs.arizona.edu
  8994.  
  8995. We've looked at this problem off and on for over 20 years, but have
  8996. never come up with anything that was really useful.  All we've learned
  8997. are the reasons why it is not as good an idea as it appears on the
  8998. surface.
  8999.  
  9000. Richard is right -- the real problem is that list elements are
  9001. not simple.  Think about loops in structures.
  9002.  
  9003. Looking at it another way, string scanning derives much of its
  9004. usefulness from the simplicity of sequences of characters.
  9005.  
  9006. Richard's idea of extending strings to sequences of other atomic
  9007. values is interesting and deserves consideration despite the
  9008. problems he noted with it.
  9009.     
  9010. Ralph E. Griswold            ralph@cs.arizona.edu
  9011. Department of Computer Science          uunet!arizona!ralph
  9012. The University of Arizona        602-621-6609 (voice)
  9013. Tucson, AZ 85721            602-621-9618   (fax)
  9014.  
  9015.  
  9016. From icon-group-sender  Thu Aug 20 16:57:09 1992
  9017. Received: by cheltenham.cs.arizona.edu; Thu, 20 Aug 1992 10:20:35 MST
  9018. Date: Thu, 20 Aug 92 16:57:09 +0200
  9019. From: Jan Peter de Ruiter <janpeter@mpi.kun.nl>
  9020. Message-Id: <9208201457.AA12761@mpix10.mpi.kun.nl>
  9021. To: icon-group@cs.arizona.edu
  9022. Subject: list scanning
  9023. Cc: janpeter@mpi.kun.nl
  9024. Status: R
  9025. Errors-To: icon-group-errors@cs.arizona.edu
  9026.  
  9027. Could someone perhaps elaborate on the problems and/or proposed
  9028. solutions in the field of list-pattern-matching? I certainly believe that
  9029. it is a tough nut to crack, but I'm interested in what efforts have been
  9030. made in this field, and why they are not working (..well enough).
  9031.  
  9032. One aspect of existing attempts at list scanning that I'd like to hear more
  9033. about is the question whether the problems mentioned by Richard & Ralph 
  9034. are problems of a conceptual type (elegance-related) or mainly performance 
  9035. related.
  9036.  
  9037. Jan P. A. de Ruiter
  9038. janpeter@mpi.kun.nl
  9039.  
  9040.  
  9041. From icon-group-sender  Thu Aug 20 10:58:08 1992
  9042. Received: by cheltenham.cs.arizona.edu; Thu, 20 Aug 1992 14:01:26 MST
  9043. Date: Thu, 20 Aug 1992 10:58:08 MST
  9044. From: "Gregg Townsend" <gmt>
  9045. Message-Id: <199208201758.AA01079@owl.cs.arizona.edu>
  9046. To: icon-group
  9047. Subject: does VMS Icon problem affect you?
  9048. Status: R
  9049. Errors-To: icon-group-errors@cs.arizona.edu
  9050.  
  9051. We're unsure how widespread the VMS Icon installation problems are.
  9052. If you're having trouble installing VMS Icon 8.7, or are avoiding
  9053. it because of the problem, please let us know by email to
  9054. icon-project@cs.arizona.edu or uunet!arizona!icon-project.
  9055.  
  9056. To recap, the problem is that neither the compiler nor the interpreter
  9057. will run under VMS if the file SYS$SHARE:DECW$XLIBSHR.EXE is absent.
  9058. This is the shared library for DecWindows (X Windows).
  9059.  
  9060. A short note from anyone who's succeeded with the installation would
  9061. also be appreciated.
  9062.  
  9063.     Gregg Townsend / Computer Science Dept / Univ of Arizona / Tucson, AZ 85721
  9064.     +1 602 621 4325     gmt@cs.arizona.edu     110 57 16 W / 32 13 45 N / +758m
  9065.  
  9066.  
  9067. From icon-group-sender  Thu Aug 20 15:05:36 1992
  9068. Received: by cheltenham.cs.arizona.edu; Thu, 20 Aug 1992 14:01:47 MST
  9069. From: idealord@dorsai.com (Jeff Harrington)
  9070. Message-Id: <9208201905.AA08280@dorsai.com>
  9071. Subject: Re: List Scanning
  9072. To: icon-group@cs.arizona.edu
  9073. Date: Thu, 20 Aug 92 15:05:36 EDT
  9074. X-Mailer: ELM [version 2.3 PL2]
  9075. Status: R
  9076. Errors-To: icon-group-errors@cs.arizona.edu
  9077.  
  9078. Has anyone used the programs in the program library - lscan.icn?  I use
  9079. Icon primarily for music composition/editing and the use of list scanning
  9080. procedures would vastly simplify my programs.  The procedures in lscan.icn
  9081. purport to be modelled on all of the string scanning builtins - find(),
  9082. tab(), etc but I haven't found the opportunity to experiment with them yet.
  9083. Jeff Harrington
  9084. idealord@dorsai.com
  9085.  
  9086.  
  9087. From icon-group-sender  Thu Aug 20 19:27:14 1992
  9088. Received: by cheltenham.cs.arizona.edu; Thu, 20 Aug 1992 14:02:13 MST
  9089. Date: 20 Aug 92 19:27:14 GMT
  9090. From: timbuk.cray.com!walter.cray.com!ferris!gerardo@uunet.uu.net  (Gerardo Cisneros)
  9091. Organization: Cray Research, Inc.
  9092. Subject: Re: list scanning
  9093. Message-Id: <1992Aug20.142714.22838@walter.cray.com>
  9094. References: <9208201457.AA12761@mpix10.mpi.kun.nl>
  9095. Sender: icon-group-request@cs.arizona.edu
  9096. To: icon-group@cs.arizona.edu
  9097. Status: R
  9098. Errors-To: icon-group-errors@cs.arizona.edu
  9099.  
  9100. In article <9208201457.AA12761@mpix10.mpi.kun.nl> janpeter@mpi.kun.nl (Jan Peter de Ruiter) writes:
  9101. >Could someone perhaps elaborate on the problems and/or proposed
  9102. >solutions in the field of list-pattern-matching? I certainly believe that
  9103. >it is a tough nut to crack, but I'm interested in what efforts have been
  9104. >made in this field, and why they are not working (..well enough).
  9105. >[...]
  9106. List pattern matching was implemented in the language CONVERT by Adolfo
  9107. Guzman and Harold V. McIntosh more than 25 years ago:
  9108.  
  9109. A. Guzman and H.V.McIntosh, "CONVERT", Commun. ACM _9_, 604-615 (1966)
  9110.  
  9111. It ran as an interpreter under LISP on the IBM 709 and the AN-FSQ 32.
  9112.  
  9113. Cheers,
  9114.  
  9115. Gerardo Cisneros
  9116. -- 
  9117. Dr. Gerardo Cisneros        |Cray Research de M'exico, S.A. de C.V.
  9118. gerardo.cisneros@cray.com    |Camino a Sta. Teresa 480-A #302
  9119. (+52+5)622-8584         |14020 Tlalpan, D.F., MEXICO
  9120.  Anything I said sound like an opinion? Then it's no one's but my own.
  9121.  
  9122.  
  9123. From icon-group-sender  Thu Aug 20 20:11:00 1992
  9124. Received: by cheltenham.cs.arizona.edu; Thu, 20 Aug 1992 18:21:12 MST
  9125. Date: 20 Aug 92 20:11:00 GMT
  9126. From: destroyer!wsu-cs!usenet.ins.cwru.edu!wariat!ppetto@gumby.wisc.edu  (Peter J. Petto)
  9127. Organization: Akademia Pana Kleksa, Public Access Uni* Site
  9128. Subject: Icon Question(s)
  9129. Message-Id: <1992Aug20.201100.25164@wariat.org>
  9130. Sender: icon-group-request@cs.arizona.edu
  9131. To: icon-group@cs.arizona.edu
  9132. Status: R
  9133. Errors-To: icon-group-errors@cs.arizona.edu
  9134.  
  9135. I'm trying to learn Icon, and have run into a little roadblock.  I'm
  9136. hoping that someone here might help me get unstuck.  I'm starting by
  9137. trying to convert an old SNOBOL routine to Icon.  The routine I'm
  9138. working on is as follows:
  9139.  
  9140. *
  9141. *   CHOP USENET FILE INTO MORE READABLE FORM
  9142. *
  9143.      &ANCHOR = 1
  9144.      &TRIM = 1
  9145.        HONE = 'Article: '
  9146.        HTWO = 'From: '
  9147.      HTHREE = 'Subject: '
  9148.       HFOUR = 'Date: '
  9149.       HFIVE = 'Organization: '
  9150.        SONE = 'From ncoast'
  9151.        STWO = 'From usenet'
  9152.      STHREE = 'From wariat'
  9153.      HMATCH = HONE | HTWO | HTHREE | HFOUR | HFIVE
  9154.      SMATCH = SONE | STWO | STHREE
  9155. *
  9156. *
  9157.      INPUT('READLINE', 5, 1024)
  9158.      OUTPUT('PRINT', 6, 1024)
  9159. *
  9160. *
  9161. HREAD LINE = READLINE                             :F(END)
  9162.       EQ(0,SIZE(LINE))                            :S(BREAD)
  9163.       LINE HMATCH                                 :F(HREAD)
  9164.       PRINT = LINE                                :(HREAD)
  9165. *
  9166. *
  9167. BREAD PRINT = LINE
  9168. BLOOP LINE = READLINE                             :F(END)
  9169.       LINE SMATCH                                 :S(HREAD)
  9170.       PRINT = LINE                                :(BLOOP)
  9171. *
  9172. END
  9173.  
  9174.  
  9175. One of my first attempts at an Icon equivelant is as follows:
  9176.  
  9177. #  unet.icn
  9178. #
  9179. #     filter Usenet news headers
  9180. #     for printing and reading
  9181. #
  9182.  
  9183. global Mode
  9184.  
  9185. procedure main()
  9186.    Mode := "header"
  9187.    while line := read() do
  9188.       if Mode := "header"
  9189.          then head(line)
  9190.          else body(line)
  9191.    end
  9192.  
  9193.  
  9194. procedure head(line)
  9195.    if match("Article: " | "Date: " | "From: " | "Organization: " | "Subject: ", line) then write(line)
  9196.    if *line = 0 then { write(line); Mode := "body" }
  9197.    end
  9198.  
  9199.  
  9200. procedure body(line)
  9201.    if match("From ncoast" | "From usenet" | "From wariat", line)
  9202.       then Mode := "header"
  9203.       else write(line)
  9204.    end
  9205.  
  9206.  
  9207. This Icon program seems to filter the headers properly, but I'm not
  9208. getting any body text through.  I'm stumped and KNOW that I'm missing
  9209. something obvious.  Please help me!  I'd also appreciate some advice
  9210. as to rephrasing the match patterns as co-expressions -- assuming
  9211. that this would be a better method.
  9212.  
  9213. (I think if I get this one right, I should be able to translate the
  9214. rest of my routines.)  Thanks in advance for any and all help.
  9215.  
  9216. ---
  9217. Peter Petto          |       ppetto@wariat.org
  9218. Bay Village, Ohio    |    73125.617@compuserve.com
  9219.  
  9220.  
  9221. From icon-group-sender  Fri Aug 21 04:51:43 1992
  9222. Received: by cheltenham.cs.arizona.edu; Fri, 21 Aug 1992 05:35:34 MST
  9223. Date: 21 Aug 92 04:51:43 GMT
  9224. From: cis.ohio-state.edu!pacific.mps.ohio-state.edu!linac!uchinews!ellis!goer@ucbvax.Berkeley.EDU  (Richard L. Goerwitz)
  9225. Organization: University of Chicago Computing Organizations
  9226. Subject: Re: list scanning
  9227. Message-Id: <1992Aug21.045143.23619@midway.uchicago.edu>
  9228. References: <9208201457.AA12761@mpix10.mpi.kun.nl>, <1992Aug20.142714.22838@walter.cray.com>
  9229. Sender: icon-group-request@cs.arizona.edu
  9230. To: icon-group@cs.arizona.edu
  9231. Status: R
  9232. Errors-To: icon-group-errors@cs.arizona.edu
  9233.  
  9234. gerardo@ferris.cray.com (Gerardo Cisneros) writes:
  9235. >
  9236. >List pattern matching was implemented in the language CONVERT by Adolfo
  9237. >Guzman and Harold V. McIntosh more than 25 years ago:
  9238. >A. Guzman and H.V.McIntosh, "CONVERT", Commun. ACM _9_, 604-615 (1966)
  9239. >It ran as an interpreter under LISP on the IBM 709 and the AN-FSQ 32.
  9240.  
  9241. If it's not too much of an imposition, could you perhaps summarize
  9242. the salient points, and (if you every actually used this system) how
  9243. it "looked and felt"?
  9244.  
  9245. -- 
  9246.  
  9247.    -Richard L. Goerwitz              goer%midway@uchicago.bitnet
  9248.    goer@midway.uchicago.edu          rutgers!oddjob!ellis!goer
  9249.  
  9250.  
  9251. From icon-group-sender  Fri Aug 21 05:28:22 1992
  9252. Received: by cheltenham.cs.arizona.edu; Fri, 21 Aug 1992 05:35:43 MST
  9253. Date: 21 Aug 92 05:28:22 GMT
  9254. From: uchinews!ellis!goer@speedy.wisc.edu  (Richard L. Goerwitz)
  9255. Organization: University of Chicago Computing Organizations
  9256. Subject: Re: List Scanning
  9257. Message-Id: <1992Aug21.052822.24847@midway.uchicago.edu>
  9258. References: <9208201905.AA08280@dorsai.com>
  9259. Sender: icon-group-request@cs.arizona.edu
  9260. To: icon-group@cs.arizona.edu
  9261. Status: R
  9262. Errors-To: icon-group-errors@cs.arizona.edu
  9263.  
  9264. idealord@dorsai.com (Jeff Harrington) writes:
  9265.  
  9266. >Has anyone used the programs in the program library - lscan.icn?  I use
  9267. >Icon primarily for music composition/editing and the use of list scanning
  9268. >procedures would vastly simplify my programs.  The procedures in lscan.icn
  9269. >purport to be modelled on all of the string scanning builtins - find(),
  9270. >tab(), etc but I haven't found the opportunity to experiment with them yet.
  9271.  
  9272. I wrote the lscan routines, and can say (definitively) that they are of
  9273. very limited scope, mainly useful only for lists of strings.  I really think
  9274. that scanning lists in Icon is not the way to go.  Scanning only makes sense
  9275. for homogenous linear sequences.  Csets are not linear, so they wouldn't be
  9276. usable (except if converted).  Integers don't make sense, either, unless we
  9277. are talking a) about "large" characters (in which case, we're not talking
  9278. about integers at all), or b) bit series.  I have many times wanted to scan
  9279. integers as "strings" of 1s and 0s, without having to actually convert them
  9280. to genuine Icon strings.
  9281.  
  9282. If Icon's strings were simply altered to permit "characters" of any rea-
  9283. sonable width (from a single bit on up), this would probably not interact
  9284. very well with current computer architectures, even if it would be *very*
  9285. useful to us (and compatible with previous implementations).  Right now,
  9286. strings are implemented as series of characters, as defined by the machine
  9287. on which the implementation is running.  You can write 8 characters on an
  9288. output stream, and then read them back in.  No big deal.  What if we are
  9289. trying to write 32-bit characters?  Or 1-bit characters?  Reading them
  9290. back in would require some thought on the part of the user.  There would
  9291. have to be consistency.
  9292.  
  9293. If the defaults were set up properly, though, I guess the user would not
  9294. have to think much anyway.
  9295.  
  9296. My mind boggles at the idea.  Imagine:  Strings specified as having a
  9297. character-width.  Type conversions?  Convert an integer to a string of
  9298. 1-bit-wide characters, and then scan it.  Neat for compressing informa-
  9299. tion.  Conversions, naturally, would not be possible for incompatible
  9300. strings (e.g. 3-bit wide chars vs 8-bit wide ones).  Output streams
  9301. would also be defined as requiring a specific character-width (e.g. 8-
  9302. bit), and all writes to those streams would trigger conversions or er-
  9303. ror messages, in cases of incompatible strings.
  9304.  
  9305. Imagine:  If ISO 10646 is ever combined with Unicode, and accepted as
  9306. a standard, there'd be no trouble using the system.  Just use 32-bit-
  9307. wide strings.  These would automatically be type-converted when neces-
  9308. sary to 8-bit-wide strings.
  9309.  
  9310. Would this actually work, or is it just too late at night for me to
  9311. think straight?
  9312.  
  9313. -- 
  9314.  
  9315.    -Richard L. Goerwitz              goer%midway@uchicago.bitnet
  9316.    goer@midway.uchicago.edu          rutgers!oddjob!ellis!goer
  9317.  
  9318.  
  9319. From icon-group-sender  Fri Aug 21 09:53:02 1992
  9320. Received: by cheltenham.cs.arizona.edu; Fri, 21 Aug 1992 10:03:33 MST
  9321. Date: Fri, 21 Aug 1992 09:53:02 MST
  9322. From: "Kenneth Walker" <kwalker>
  9323. Message-Id: <199208211653.AA11058@optima.cs.arizona.edu>
  9324. To: icon-group
  9325. Subject: Re:  Icon Question(s)
  9326. Status: R
  9327. Errors-To: icon-group-errors@cs.arizona.edu
  9328.  
  9329. > From: destroyer!wsu-cs!usenet.ins.cwru.edu!wariat!ppetto@gumby.wisc.edu  (Peter J. Petto)
  9330. > ...
  9331. >       if Mode := "header"
  9332. >          then head(line)
  9333.  
  9334. It looks like you have a simple typo, try
  9335.  
  9336. >       if Mode == "header"
  9337.  
  9338.   Ken Walker  kwalker@cs.arizona.edu   uunet!arizona!kwalker
  9339.  
  9340.  
  9341. From icon-group-sender  Mon Aug 24 12:26:14 1992
  9342. Received: by cheltenham.cs.arizona.edu; Mon, 24 Aug 1992 15:49:05 MST
  9343. Date: Mon, 24 Aug 1992 12:26:14 MST
  9344. From: "Ralph Griswold" <ralph>
  9345. Message-Id: <199208241926.AA26083@cheltenham.cs.arizona.edu>
  9346. To: icon-group
  9347. Subject: Version 8.7 Icon Sun 4 binaries
  9348. Status: R
  9349. Errors-To: icon-group-errors@cs.arizona.edu
  9350.  
  9351. Due to a clerical mistake, the 8.7 Icon binaries for the Sun 4 in our
  9352. FTP area (/icon/binaries/unix/sun4/sun4.tar.Z) were configured without
  9353. X facilities.  That error was corrected this morning.
  9354.     
  9355. Ralph E. Griswold            ralph@cs.arizona.edu
  9356. Department of Computer Science          uunet!arizona!ralph
  9357. The University of Arizona        602-621-6609 (voice)
  9358. Tucson, AZ 85721            602-621-9618   (fax)
  9359.  
  9360.  
  9361. From icon-group-sender  Wed Aug 26 22:57:55 1992
  9362. Received: by cheltenham.cs.arizona.edu; Thu, 27 Aug 1992 05:58:19 MST
  9363. Date: 26 Aug 92 22:57:55 GMT
  9364. From: usc!sol.ctr.columbia.edu!eff!news.oc.com!spssig.spss.com!uchinews!iitmax!thssbxv@uunet.uu.net  (Super *MAN*)
  9365. Organization: Illinois Institute of Technology
  9366. Subject: Icon compiler for DOS or SUN
  9367. Message-Id: <1992Aug26.225755.22847@iitmax.iit.edu>
  9368. Sender: icon-group-request@cs.arizona.edu
  9369. To: icon-group@cs.arizona.edu
  9370. Status: RO
  9371. Errors-To: icon-group-errors@cs.arizona.edu
  9372.  
  9373.  
  9374. Hi, I am looking for ICON compiler for DOS or SUN. Does somebody know
  9375. ftp site where I could get one (if it is public domain of course).
  9376. Thanks    thssbxv@iitmax.iit.edu
  9377.  
  9378.  
  9379. From icon-group-sender  Thu Aug 27 05:58:01 1992
  9380. Received: by cheltenham.cs.arizona.edu; Thu, 27 Aug 1992 05:58:28 MST
  9381. Date: Thu, 27 Aug 1992 05:58:01 MST
  9382. From: "Ralph Griswold" <ralph>
  9383. Message-Id: <199208271258.AA25350@cheltenham.cs.arizona.edu>
  9384. To: usc!sol.ctr.columbia.edu!eff!news.oc.com!spssig.spss.com!uchinews!iitmax!thssbxv@uunet.uu.net
  9385. Subject: Re:  Icon compiler for DOS or SUN
  9386. Cc: icon-group
  9387. Status: R
  9388. Errors-To: icon-group-errors@cs.arizona.edu
  9389.  
  9390. There are many public-domain implementations of Icon, including ones
  9391. for the platforms you want, available from cs.arizona.edu.  cd /icon
  9392. and get READ.ME.
  9393.  
  9394. If you need further information, let me know.
  9395.     
  9396. Ralph E. Griswold            ralph@cs.arizona.edu
  9397. Department of Computer Science          uunet!arizona!ralph
  9398. The University of Arizona        602-621-6609 (voice)
  9399. Tucson, AZ 85721            602-621-9618   (fax)
  9400.  
  9401.  
  9402. From icon-group-sender  Sat Aug 29 18:13:36 1992
  9403. Received: by cheltenham.cs.arizona.edu; Sun, 30 Aug 1992 11:15:17 MST
  9404. Date: Sat, 29 Aug 92 18:13:36 EDT
  9405. From: Paul_Abrahams@MTS.cc.Wayne.edu
  9406. To: icon-group@cs.arizona.edu
  9407. Message-Id: <493113@MTS.cc.Wayne.edu>
  9408. Subject: Icon BBS
  9409. Status: R
  9410. Errors-To: icon-group-errors@cs.arizona.edu
  9411.  
  9412. A small suggestion:  the information on the Icon BBS included in
  9413. the Icon Newsletter should include the available baud rates and
  9414. the required parity and stop bit settings.  (For now, perhaps you
  9415. could post that information as a response to this message.)
  9416. Thanks.
  9417.  
  9418. Paul Abrahams
  9419.  
  9420.  
  9421.  
  9422. From icon-group-sender  Sun Aug 30 11:19:01 1992
  9423. Received: by cheltenham.cs.arizona.edu; Sun, 30 Aug 1992 11:19:08 MST
  9424. Date: Sun, 30 Aug 1992 11:19:01 MST
  9425. From: "Ralph Griswold" <ralph>
  9426. Message-Id: <199208301819.AA06603@cheltenham.cs.arizona.edu>
  9427. To: icon-group
  9428. Subject: Icon RBBS
  9429. Status: R
  9430. Errors-To: icon-group-errors@cs.arizona.edu
  9431.  
  9432. The information you want is a bit bulky to put in every Icon Newsletter.
  9433. There was an article covering this in Icon Newsletter 38.
  9434.     
  9435. Ralph E. Griswold            ralph@cs.arizona.edu
  9436. Department of Computer Science          uunet!arizona!ralph
  9437. The University of Arizona        602-621-6609 (voice)
  9438. Tucson, AZ 85721            602-621-9618   (fax)
  9439.  
  9440.  
  9441.  
  9442. From icon-group-sender  Sun Aug 30 11:21:59 1992
  9443. Received: by cheltenham.cs.arizona.edu; Sun, 30 Aug 1992 11:22:06 MST
  9444. Date: Sun, 30 Aug 1992 11:21:59 MST
  9445. From: "Ralph Griswold" <ralph>
  9446. Message-Id: <199208301821.AA06688@cheltenham.cs.arizona.edu>
  9447. To: icon-group
  9448. Subject: Icon RBBS
  9449. Status: R
  9450. Errors-To: icon-group-errors@cs.arizona.edu
  9451.  
  9452. I see the article in Newsletter 38 does not contain all the information
  9453. someone might want to use the Icon RBBS.  The settings are standard,
  9454. but I'll dig additional information out of an ealier Newsetter and
  9455. post it in a day or so.
  9456.     
  9457. Ralph E. Griswold            ralph@cs.arizona.edu
  9458. Department of Computer Science          uunet!arizona!ralph
  9459. The University of Arizona        602-621-6609 (voice)
  9460. Tucson, AZ 85721            602-621-9618   (fax)
  9461.  
  9462.  
  9463. From icon-group-sender  Mon Aug 31 09:18:57 1992
  9464. Received: by cheltenham.cs.arizona.edu; Mon, 31 Aug 1992 10:48:16 MST
  9465. Date: Mon, 31 Aug 1992 09:18:57 MST
  9466. From: "Cliff Hathaway" <cliff>
  9467. Message-Id: <199208311618.AA22060@javelina.cs.arizona.edu>
  9468. To: icon-group
  9469. Subject: Icon RBBS particulars
  9470. Status: R
  9471. Errors-To: icon-group-errors@cs.arizona.edu
  9472.  
  9473.  
  9474. Some folks have requested the particulars for connecting to the Icon 
  9475. electronic bulletin board.
  9476.  
  9477. Phone:  602-621-2283
  9478. Settings:  8N1 (8 bits, no parity, 1 stop bit)
  9479.        1200 - 9600 baud
  9480.  
  9481. Downloads can be done via kermit, Xmodem or Ymodem.
  9482.  
  9483. We try to log in to the RBBS several times a week to check for messages,
  9484. but email to icon-project is a more reliable means of getting a prompt
  9485. reply from us.
  9486.  
  9487. We try to ensure that the RBBS is available as much as possible.  When we
  9488. do bring it down for maintenance, we do it during normal working hours for
  9489. us (0800 - 1700 Mountain Standard Time).
  9490.  
  9491.  
  9492.     Cliff Hathaway
  9493.     Dept. of Computer Science (602)621-4291
  9494.     University of Arizona     cliff@cs.arizona.edu             (internet) 
  9495.     Tucson, Ariz. 85721          {cmcl2,noao,uunet}!arizona!cliff    (uucp)
  9496.  
  9497.  
  9498.  
  9499.  
  9500. From icon-group-sender  Tue Sep  1 18:58:28 1992
  9501. Received: by cheltenham.cs.arizona.edu; Wed, 2 Sep 1992 06:37:34 MST
  9502. Date: 1 Sep 92 18:58:28 GMT
  9503. From: newross!dynastar!nr@princeton.edu
  9504. Organization: Princeton University, Dept. of Computer Science
  9505. Subject: Icon question about sorting
  9506. Message-Id: <1992Sep1.185828.2803@newross.Princeton.EDU>
  9507. Sender: icon-group-request@cs.arizona.edu
  9508. To: icon-group@cs.arizona.edu
  9509. Status: R
  9510. Errors-To: icon-group-errors@cs.arizona.edu
  9511.  
  9512. I have a set of strings that I want to sort.  I would like the case of
  9513. letters to be ignored during sorting, but I don't want the results to
  9514. come out all in one case.  The only thing I've been able to think of
  9515. is ugly: make a new set of mapped strings, sort that, and then for
  9516. each element of the original array find the position in the mapped
  9517. list.  There must be a better way; what is it?
  9518.  
  9519. -- 
  9520. Norman Ramsey
  9521. nr@princeton.edu
  9522.  
  9523.  
  9524. From icon-group-sender  Wed Sep  2 08:55:07 1992
  9525. Received: by cheltenham.cs.arizona.edu; Wed, 2 Sep 1992 12:56:37 MST
  9526. Date: 02 Sep 1992 08:55:07 -0600 (CST)
  9527. From: Chris Tenaglia - 257-8765 <TENAGLIA@mis.mcw.edu>
  9528. Subject: Sorting strings
  9529. To: icon-group@cs.arizona.edu
  9530. Message-Id: <01GOAX3V9SO694DRQW@mis.mcw.edu>
  9531. Organization: Medical College of Wisconsin (Milwaukee, WI)
  9532. X-Vms-To: IN%"icon-group@cs.arizona.edu"
  9533. Mime-Version: 1.0
  9534. Content-Type: TEXT/PLAIN; CHARSET=US-ASCII
  9535. Content-Transfer-Encoding: 7BIT
  9536. Status: R
  9537. Errors-To: icon-group-errors@cs.arizona.edu
  9538.  
  9539. > From:    IN%"newross!dynastar!nr@princeton.edu"  2-SEP-1992 08:42:26.93
  9540. > To:    IN%"icon-group@cs.arizona.edu"
  9541. > Subj:    Icon question about sorting
  9542.  
  9543. > I have a set of strings that I want to sort.  I would like the case of
  9544. > letters to be ignored during sorting, but I don't want the results to
  9545. > come out all in one case.  The only thing I've been able to think of
  9546. > is ugly: make a new set of mapped strings, sort that, and then for
  9547. > each element of the original array find the position in the mapped
  9548. > list.  There must be a better way; what is it?
  9549.  
  9550. > -- 
  9551. > Norman Ramsey
  9552. > nr@princeton.edu
  9553.  
  9554. I've had this and the problem of wanting to sort on a key that was several
  9555. non-contiguous fields in the strings. Unfortunately, I had to use a brute
  9556. force method of forming a sort list with the sort keys prepended to the
  9557. front of each string in the list. I also wanted to be able to sort in reverse
  9558. order, so I had to convert those fields as I built the sort key with a
  9559. map(line,&cset,reverse(&cset)). Then comes the sort, and then you've got to
  9560. strip the keys off, leaving your sorted data. Well maybe you could define
  9561. the first n bytes of each line as a general purpose sort key, and ignore
  9562. it during other processing? That depends on whether the data is your file
  9563. or someone elses' I suppose. Depending on the OS, sometimes they have a SORT
  9564. utility. You'd write your data to a temp file, use the OS SORT with all the
  9565. magical options via a system() command, and then reload the sorted data.
  9566.  
  9567. Chris Tenaglia (System Manager) |  "The past explained,     
  9568. Medical College of Wisconsin    |   the future fortold, 
  9569. 8701 W. Watertown Plank Rd.     |   the present largely appologized for."
  9570. Milwaukee, WI 53226             |   Organon to The Doctor
  9571. (414)257-8765                   |     
  9572. tenaglia@mis.mcw.edu
  9573.  
  9574.  
  9575.  
  9576. From icon-group-sender  Wed Sep  2 09:10:00 1992
  9577. Received: by cheltenham.cs.arizona.edu; Wed, 2 Sep 1992 12:57:00 MST
  9578. Message-Id: <199209021445.AA26968@optima.cs.arizona.edu>
  9579. From: nowlin@iwtqg.att.com
  9580. Date: Wed, 2 Sep 92 09:10 CDT
  9581. To: att!cs.arizona.edu!icon-group
  9582. Subject: Re: sorting question
  9583. Status: R
  9584. Errors-To: icon-group-errors@cs.arizona.edu
  9585.  
  9586.  > I have a set of strings that I want to sort.  I would like the case of
  9587.  > letters to be ignored during sorting, but I don't want the results to
  9588.  > come out all in one case.  The only thing I've been able to think of
  9589.  > is ugly: make a new set of mapped strings, sort that, and then for
  9590.  > each element of the original array find the position in the mapped
  9591.  > list.  There must be a better way; what is it?
  9592.  > 
  9593.  > -- 
  9594.  > Norman Ramsey
  9595.  > nr@princeton.edu
  9596.  
  9597. Let Icon do that for you.  Tables were born for this kind of thing:
  9598.  
  9599.         procedure main()
  9600.                 t := table()
  9601.                 while s := read() do t[map(s)] := s
  9602.                 every write((!sort(t))[2])
  9603.         end
  9604.  
  9605. This program reads strings, one per line from standard input, and prints
  9606. them back out in sorted order, ignoring case.  Just what you asked for as
  9607. far as I can tell.
  9608.  
  9609. Jerry Nowlin
  9610.  
  9611.  
  9612. From icon-group-sender  Wed Sep  2 09:56:27 1992
  9613. Received: by cheltenham.cs.arizona.edu; Wed, 2 Sep 1992 12:57:14 MST
  9614. Resent-Date: 02 Sep 1992 09:56:27 -0500 (CDT)
  9615. Resent-From: stone@HILBERT.MATH.GRIN.EDU
  9616. Date: 02 Sep 1992 09:56:27 -0500 (CDT)
  9617. From: John David Stone <stone@HILBERT.math.grin.edu>
  9618. Subject: Icon question about sorting
  9619. Resent-To: icon-group@cs.arizona.edu
  9620. To: Icon-group@arizona.edu
  9621. Resent-Message-Id: <01GOAVDKXM5E8ZF60X@Arizona.edu>
  9622. Message-Id: <9209021456.AA08102@HILBERT.MATH.GRIN.EDU>
  9623. X-Vms-To: IN%"Icon-group@Arizona.edu"
  9624. Content-Type: TEXT/PLAIN; CHARSET=US-ASCII
  9625. Content-Transfer-Encoding: 7BIT
  9626. Status: R
  9627. Errors-To: icon-group-errors@cs.arizona.edu
  9628.  
  9629.         The only part of the process that you can speed up, as far as I
  9630. can see, is the recovery of the original strings.  You'd do this by
  9631. keeping the original and mapped strings together during the sort:
  9632.  
  9633. procedure case_insensitive_sort(string_set)
  9634. local string_table, str, string_list
  9635.  
  9636.     string_table := table()
  9637.     every str := !string_set do
  9638.         string_table[map(str, &ucase, &lcase)] := str
  9639.     string_list := list(0)
  9640.     every put(string_list, (!sort(string_table))[2])
  9641.     return string_list
  9642. end
  9643.  
  9644. ------  John David Stone - Lecturer in Computer Science and Philosophy  -----
  9645. --------------  Manager of the Mathematics Local-Area Network  --------------
  9646. --------------  Grinnell College - Grinnell, Iowa 50112 - USA  --------------
  9647. --------  stone@math.grin.edu - (515) 269-3181 - stone@grin1.bitnet  --------
  9648.  
  9649.  
  9650. From icon-group-sender  Wed Sep  2 13:23:03 1992
  9651. Received: by cheltenham.cs.arizona.edu; Wed, 2 Sep 1992 12:57:22 MST
  9652. Date: 2 Sep 92 13:23:03 GMT
  9653. From: mcsun!uknet!glasgow!gnik@uunet.uu.net  (David King)
  9654. Organization: Glasgow University Computing Science Dept.
  9655. Subject: Denotational semantics for Icon?
  9656. Message-Id: <BtyD6F.4Fs@dcs.glasgow.ac.uk>
  9657. Sender: icon-group-request@cs.arizona.edu
  9658. To: icon-group@cs.arizona.edu
  9659. Status: R
  9660. Errors-To: icon-group-errors@cs.arizona.edu
  9661.  
  9662. Does anyone know if a formal semantics exists for Icon? If so could
  9663. you tell me where I could get hold of it.
  9664.  
  9665.  
  9666. Thanks very much
  9667.  
  9668. -- 
  9669. David  J.  King         --------------------- 
  9670. Department of Computing Science        gnik@dcs.glasgow.ac.uk
  9671. University of Glasgow,  G12 8QQ        Phone:  (041) 339 8855
  9672.  
  9673.  
  9674. From icon-group-sender  Wed Sep  2 18:48:38 1992
  9675. Received: by cheltenham.cs.arizona.edu; Wed, 2 Sep 1992 17:20:52 MST
  9676. Date: Wed, 2 Sep 92 18:48:38 EDT
  9677. From: Paul_Abrahams@MTS.cc.Wayne.edu
  9678. To: icon-group@cs.arizona.edu
  9679. Message-Id: <494568@MTS.cc.Wayne.edu>
  9680. Subject: VEMD.386 for MS-DOS Icon
  9681. Status: R
  9682. Errors-To: icon-group-errors@cs.arizona.edu
  9683.  
  9684. Has anyone successfully used VEMD.386, the floating-point emulator that
  9685. comes with MS-DOS Icon Version 8.5, under Windows 3.1?  When I tried it,
  9686. the program hung and I could only break out by closing the window.  I
  9687. have no way of knowing whether the problem has to do with Windows or with
  9688. the peculiarities of my machine (a Gateway 386/33 Cache).
  9689.  
  9690. Paul Abrahams
  9691.  
  9692.  
  9693. From icon-group-sender  Wed Sep  2 23:00:27 1992
  9694. Received: by cheltenham.cs.arizona.edu; Thu, 3 Sep 1992 06:30:05 MST
  9695. Date: 02 Sep 1992 23:00:27 -0600 (CST)
  9696. From: Chris Tenaglia - 257-8765 <TENAGLIA@mis.mcw.edu>
  9697. Subject: Labor Day Doodle
  9698. To: icon-group@cs.arizona.edu
  9699. Message-Id: <01GOBQ1F77DU94DT0X@mis.mcw.edu>
  9700. Organization: Medical College of Wisconsin (Milwaukee, WI)
  9701. X-Vms-To: IN%"icon-group@cs.arizona.edu"
  9702. Mime-Version: 1.0
  9703. Content-Type: TEXT/PLAIN; CHARSET=US-ASCII
  9704. Content-Transfer-Encoding: 7BIT
  9705. Status: R
  9706. Errors-To: icon-group-errors@cs.arizona.edu
  9707.  
  9708.  
  9709. I  have a habit of posting games on holidays. Labor day is almost here and
  9710. I  don't  have  a  game,  but  I  did put together a toy. Reading the Icon
  9711. Newsletter  there  was  a section about student projects using X-Icon. I'm
  9712. not a student but I like doing those kinds of projects and so here's mine.
  9713. It's  a simulation of a 4-D cube (tessarect). The code is not too elegant.
  9714. I  had  the  help  of Dewdneys' Armchair Universe and a math expert (Bruce
  9715. Salzman)  to  put it together in Quick C on a PC about 4 to 5 years ago. I
  9716. then  ported  it  to  PC  BASIC as an exercize about 3 to 4 years ago. Now
  9717. there's  the  X-icon version, which you can tell is derived from the BASIC
  9718. version  because  it  has so many global variables. Well maybe some of you
  9719. will have some helpful suggestions. I especially hate doing two
  9720. dimensional arrays using tables keyed off concatenated string indices.
  9721.  
  9722. The fun part is that you can move closer or further. Up or down. Turn it
  9723. on the X axis, Y axis, Z axis, and the Other axis ;-). Rotate on all four
  9724. at once and watch it explode and zoom and twist and mehardula (a 4-d
  9725. term I made up for some motion incomprehensible to us 3-d creatures).
  9726.  
  9727. I've compiled and run it under both VAX/VMS 5.5 with Decwindows/Motif and
  9728. DEC RISC Ultrix Unix, so it should be pretty portable. Enjoy!
  9729.  
  9730. Chris Tenaglia (System Manager) |  "The past explained,     
  9731. Medical College of Wisconsin    |   the future fortold, 
  9732. 8701 W. Watertown Plank Rd.     |   the present largely appologized for."
  9733. Milwaukee, WI 53226             |   Organon to The Doctor
  9734. (414)257-8765                   |     
  9735. tenaglia@mis.mcw.edu
  9736. -------------------------------------------------------------------------------
  9737. #TITLE TESSARECT 4-D VIRTUAL REALITY MANIPULATOR
  9738. #EJECT
  9739. #
  9740. # FILE : TESS.ICN
  9741. # DESC : TUMBLING TESSARECT SIMULTATION WRITTEN FOR X WINDOWS
  9742. # USAGE: TESS  [size]
  9743. #        The size is optional. I believe it's pixels. The window produced is
  9744. #        square shaped. The size defaults to 1024. Of course you need an X
  9745. #        display to run this. It has been successfully run under VMS and
  9746. #        Ultrix unix as is. It's written for monochrome displays. You will
  9747. #        have to prep your environment for X before running it.
  9748. #
  9749. # UPDATE       BY        WHAT
  9750. # 22-AUG-1992  TENAGLIA  INITIAL PORTING FROM DOS BASIC
  9751. # 23-AUG-1992  TENAGLIA  OPTIMIZE AND ELIMINATE UNNECESSARY VARIABLES
  9752. # 28-AUG-1992  TENAGLIA  MADE HANDLE BOUNDARY CONDITIONS BETTER
  9753. #
  9754. global vs, vt,  ne,  pi, twopi, vs2, vs3,   # view parameters
  9755.        vx, vy,  vz,  vw,                    # view projectors
  9756.        ox, oy, oldx, oldy,                  # old x,y positions
  9757.        x,   h,  dh,  xi,                    # axis pointer & increment
  9758.        y,   p,  dp,  yi,                    # axis pointer & increment
  9759.        z,   b,  db,                         # axis pointer & increment
  9760.        w,   a,  da,                         # axis pointer & increment
  9761.        dv, dd,  d,                          # distance increments
  9762.        sa,  sb, sp,  sh,                    # sine constants
  9763.        ca,  cb, cp,  ch,                    # cosine constants
  9764.        ppux,ppuy,scale,                     # more projection constants
  9765.        projtessarect,                       # new projection matrices
  9766.        oldproj,                             # former matrix
  9767.        tessarect,                           # tessarect matrix
  9768.        edges,                               # edges matrix
  9769.        xwindow, lines, columns              # xwindow variables
  9770. #SUB MAIN AND SETUP PROCEDURES
  9771. #EJECT
  9772. #
  9773. # this is the main drawing loop
  9774. #
  9775. procedure main(stuff)
  9776.   setup(stuff)
  9777.   getview()
  9778.   repeat
  9779.     {
  9780.     genview()
  9781.     testkey(stuff)
  9782.     changeview()
  9783.     }
  9784.   end
  9785.  
  9786. #
  9787. # this sets up some main x variables and constants
  9788. #
  9789. procedure setup(settings)
  9790.   vs := real(settings[1] | 1024.0)
  9791.   vs2:= vs * 5.0
  9792.   vs3:= -vs* 4.0
  9793.   vt := 16
  9794.   ne := 48
  9795.   pi := 3.1415927
  9796.   twopi     := pi * 2.0
  9797.   tessarect := [ [ 1, 1,-1,-1 ],      # C
  9798.                  [ 1,-1,-1,-1 ],      # 8
  9799.                  [-1,-1,-1,-1 ],      # 0
  9800.                  [-1, 1,-1,-1 ],      # 4
  9801.                  [ 1, 1, 1,-1 ],      # E
  9802.                  [ 1,-1, 1,-1 ],      # A
  9803.                  [-1,-1, 1,-1 ],      # 2
  9804.                  [-1, 1, 1,-1 ],      # 6
  9805.                  [ 1, 1,-1, 1 ],      # D
  9806.                  [ 1,-1,-1, 1 ],      # 9
  9807.                  [-1,-1,-1, 1 ],      # 1
  9808.                  [-1, 1,-1, 1 ],      # 5
  9809.                  [ 1, 1, 1, 1 ],      # F
  9810.                  [ 1,-1, 1, 1 ],      # B
  9811.                  [-1,-1, 1, 1 ],      # 3
  9812.                  [-1, 1, 1, 1 ] ]     # 7
  9813.   edges     :=  [ -1,  9, -2, 10, -3, 11, -4, 12,
  9814.                   -5, 13, -6, 14, -7, 15, -8, 16,
  9815.                   -1,  2,  3,  4,  1,  5,  6,  7,
  9816.                    8,  5, -2,  6, -3,  7, -4,  8,
  9817.                   -9, 10, 11, 12,  9, 13, 14, 15,
  9818.                   16, 13,-10, 14,-11, 15,-12, 16 ]
  9819.   projtessarect := table(0)
  9820.   oldproj       := table(0)
  9821.   end
  9822. #SUB BUILD WINDOW & OTHER NEEDED CONSTANTS
  9823. #EJECT
  9824. #
  9825. # set up other important windowing variables and constants
  9826. #
  9827. procedure getview()
  9828.   ox      := vs / 2.0
  9829.   oy      := vs / 2.0
  9830.   lines   := integer(vs / 14.22 + 0.5)
  9831.   columns := integer(vs /  5.69 + 0.5)
  9832.   scale   := 5.0
  9833.   ppux    := scale * 10.0 ; ppuy    := scale *  8.0
  9834.   dv      := 2.0          ; dd      := 0.0          ; d       := 2.0
  9835.   h       := pi / 4.0     ; dh      := 0.040        ; xi      := 0.0
  9836.   p       := 0.0          ; dp      := 0.0          ; yi      := 0.0
  9837.   b       := 0.0          ; db      := 0.0
  9838.   a       := 0.015        ; da      := 0.0
  9839.   write("\nTessarect Simulation\n")
  9840.   write(" x : move x-axis          | r : reset to original settings")
  9841.   write(" y : move y-axis          | o : move futher out")
  9842.   write(" z : move z-axis          | i : move closer in ")
  9843.   write(" a : move the OTHER axis  | q : quit")
  9844.   write(" up/down/left/right arrows move shape on screen")
  9845.   write(" f : freeze rotation      |   : blank stop movement")
  9846. #
  9847. # configure the X-connection
  9848. #
  9849.   (xwindow := open("TESS","x",
  9850.                    "x=" || vs,"y=" || vs,
  9851.                    "bg=black","fg=white",
  9852.                    "lines=" || lines,"columns=" || columns)) |
  9853.     {
  9854.     write("Can't open window. Press <RETURN>")
  9855.     stop("ABEND ANOX")
  9856.     }
  9857.   XSync(xwindow)
  9858.   XSetStipple(xwindow,8,0)
  9859.   XAttrib(xwindow,"drawop=xor")
  9860.   XGotoRC(xwindow,1,1)
  9861.   write(xwindow,"Tessarect Simulation\n")
  9862.   write(xwindow," x : move x-axis          | r : reset to original settings")
  9863.   write(xwindow," y : move y-axis          | o : move futher out")
  9864.   write(xwindow," z : move z-axis          | i : move closer in ")
  9865.   write(xwindow," a : move the OTHER axis  | q : quit")
  9866.   write(xwindow," up/down/left/right arrows move shape on screen")
  9867.   write(xwindow," f : freeze rotation      |   : blank stop movement")
  9868.   end
  9869. #SUB ACTUAL TESSARECT ANIMATOR
  9870. #EJECT
  9871. #
  9872. # calculate points in 4 dimensions
  9873. #
  9874. procedure calcview()
  9875.   sh := sin(h)    ; ch := cos(h)
  9876.   sp := sin(p)    ; cp := cos(p)
  9877.   sb := sin(b)    ; cb := cos(b)
  9878.   sa := sin(a)    ; ca := cos(a)
  9879.   vx := -dv * ca * cp * sh
  9880.   vy := -dv * ca * cp * ch
  9881.   vz := -dv * ca * sp
  9882.   vw := -dv * sa
  9883.   end
  9884. #
  9885. # run a display pass
  9886. #
  9887. procedure genview()
  9888.   calcview()
  9889.   project()
  9890.   connect()
  9891.   oldproj := copy(projtessarect)
  9892.   end
  9893. #
  9894. # project 4 dimensions to fewer dimensions
  9895. #
  9896. procedure project()
  9897.   projtessarect := table(0)
  9898.   every i := 1 to vt do
  9899.     {
  9900.     x := tessarect[i][1] - vx
  9901.     y := tessarect[i][2] - vy
  9902.     z := tessarect[i][3] - vz
  9903.     w := tessarect[i][4] - vw
  9904.     q := w * sa
  9905.  
  9906.     x := (x * ca - q) / w
  9907.     y := (y * ca - q) / w
  9908.     z := (z * ca - q) / w
  9909.  
  9910.     xa:= ch * x - sh * y
  9911.     ya:= sh * x + ch * y
  9912.     za:= cp * z - sp * ya
  9913.  
  9914.     tx:= cb * xa + sb * za
  9915.     ty:= cp * ya + sp * z
  9916.     tz:= cb * za - sb * xa
  9917.  
  9918.     projtessarect[i || "," || 1] := ox + ppux * d * tx / ty
  9919.     projtessarect[i || "," || 2] := oy + ppuy * d * tz / ty
  9920.     }
  9921.   end
  9922. #EJECT
  9923. #
  9924. # perform motion
  9925. #
  9926. procedure changeview()
  9927.   if (h +:= dh) > twopi  then h  -:= twopi
  9928.   if (p -:= dp) < -twopi then p  +:= twopi
  9929.   if (a +:= da) > twopi  then a  -:= twopi
  9930.   if (b -:= db) < -twopi then b  +:= twopi
  9931.   if (dv > 0.0) & (dv < 6.0) then
  9932.     {
  9933.     dv +:= dd
  9934.     } else {
  9935.     dv -:= (2.0 * dd)
  9936.     dd  := 0.0
  9937.     }
  9938.   if (ox > 0.0) & (ox < vs) then
  9939.     {
  9940.     ox +:= xi
  9941.     } else {
  9942.     ox -:= (2.0 * xi)
  9943.     xi  := 0.0
  9944.     }
  9945.   if (oy > 0.0) & (oy < vs) then
  9946.     {
  9947.     oy +:= yi
  9948.     } else {
  9949.     oy -:= (2.0 * yi)
  9950.     yi  := 0.0
  9951.     }
  9952.   end
  9953. #EJECT
  9954. #
  9955. # draw it
  9956. #
  9957. procedure connect()
  9958.   every i := 1 to ne do
  9959.     {
  9960.     pt := abs(edges[i])
  9961.     b1 := oldproj[pt || "," || 1]
  9962.     b2 := oldproj[pt || "," || 2]
  9963.     a1 := projtessarect[pt || "," || 1]
  9964.     a2 := projtessarect[pt || "," || 2]
  9965.     if edges[i] < 0 then
  9966.       {
  9967.       oldx := a1
  9968.       oldy := a2
  9969.       oldxb:= b1
  9970.       oldyb:= b2
  9971.       next
  9972.       }
  9973.  
  9974.     if ((vs2 > oldxb > vs3) &
  9975.         (vs2 > b1    > vs3) &
  9976.         (vs2 > oldyb > vs3) &
  9977.         (vs2 > b2    > vs3)) then
  9978.        XDrawLine(xwindow,oldxb,oldyb,b1,b2)
  9979.  
  9980.     if ((vs2 > oldx > vs3) &
  9981.         (vs2 > a1   > vs3) &
  9982.         (vs2 > oldy > vs3) &
  9983.         (vs2 > a2   > vs3)) then
  9984.        XDrawLine(xwindow,oldx,oldy,a1,a2)
  9985.  
  9986.     oldx := a1
  9987.     oldy := a2
  9988.     oldxb:= b1
  9989.     oldyb:= b2
  9990.     }
  9991.   XSync(xwindow)
  9992.   end
  9993. #EJECT
  9994. #
  9995. # sense the outside world
  9996. #
  9997. procedure testkey(window)
  9998.   static    uparrow,  downarrow, leftarrow,   rightarrow,
  9999.             xrotate,  yrotate,   zrotate,     arotate,
  10000.             closer,   further,   halt,        freeze,
  10001.             quit,     restart
  10002.   initial { uparrow   := "65362" ; downarrow  := "65364"
  10003.             leftarrow := "65361" ; rightarrow := "65363"
  10004.             xrotate   := "x"     ; yrotate    := "y"
  10005.             zrotate   := "z"     ; arotate    := "a"
  10006.             closer    := "i"     ; further    := "o"
  10007.             halt      := " "     ; freeze     := "f"
  10008.             quit      := "q"     ; restart    := "r"
  10009.           }
  10010.   if (things := XPending(xwindow)) & (*things > 0) then
  10011.     {
  10012.     request := map(XEvent(xwindow))
  10013.     } else {
  10014.     kbhit() | return
  10015.     request := map(getch())
  10016.     }
  10017.   case request of
  10018.     {
  10019.     xrotate    : dh := if dh = 0.0 then 0.070 else 0.00
  10020.     yrotate    : dp := if dp = 0.0 then 0.039 else 0.00
  10021.     zrotate    : db := if db = 0.0 then 0.025 else 0.00
  10022.     arotate    : da := if da = 0.0 then 0.016 else 0.00
  10023.     closer     : dd := if dd = 0.0 then -0.05 else 0.00
  10024.     further    : dd := if dd = 0.0 then 0.05  else 0.00
  10025.     leftarrow  : xi := -5.0
  10026.     rightarrow : xi :=  5.0
  10027.     uparrow    : yi := -5.0
  10028.     downarrow  : yi :=  5.0
  10029.     halt       : { xi := 0.00 ; yi := 0.00 ; dd := 0.00 }
  10030.     freeze     : { dh := 0.00 ; dp := 0.00 ; db := 0.00 ; da := 0.00 }
  10031.     restart    : { close(xwindow) ; setup(window) ; getview() ; connect() }
  10032.     quit       : stop("Execution Interrupted")
  10033.     }
  10034.   end
  10035. # END OF PROGRAM
  10036.  
  10037.  
  10038.  
  10039. From icon-group-sender  Thu Sep  3 13:46:36 1992
  10040. Received: by cheltenham.cs.arizona.edu; Thu, 3 Sep 1992 06:30:24 MST
  10041. Date: Thu, 3 Sep 92 13:46:36 +0200
  10042. From: Jan Peter de Ruiter <janpeter@mpi.kun.nl>
  10043. Message-Id: <9209031146.AA13971@mpix10.mpi.kun.nl>
  10044. To: icon-group@cs.arizona.edu
  10045. Subject: sorting
  10046. Status: R
  10047. Errors-To: icon-group-errors@cs.arizona.edu
  10048.  
  10049. Wouldn't it be most convenient if Icon allowed the programmer to
  10050. define his/her own compare-function used in the sort() procedure?
  10051.  
  10052. If that were possible, the case sensitivity could be avoided by defining
  10053. a compare-function that simply ignores case, and from then on 
  10054. everything would be the same. I imagine something along the lines
  10055. of a &compare keyword that points to the (possibly user defined)
  10056. function that returns either -1, 0 or 1, depending on the outcome
  10057. of the comparison. In that way the most esoteric sorting functions
  10058. could be written, without deteriorating the programming style.
  10059.  
  10060. Jan. P. A. de Ruiter
  10061. janpeter@mpi.nl 
  10062.  
  10063.  
  10064. From icon-group-sender  Thu Sep  3 09:32:19 1992
  10065. Received: by cheltenham.cs.arizona.edu; Thu, 3 Sep 1992 07:46:17 MST
  10066. Date: Thu, 3 Sep 92 09:32:19 CDT
  10067. From: "Richard L. Goerwitz" <goer@midway.uchicago.edu>
  10068. Message-Id: <9209031432.AA03653@midway.uchicago.edu>
  10069. To: icon-group@cs.arizona.edu
  10070. Subject: sorting
  10071. Status: R
  10072. Errors-To: icon-group-errors@cs.arizona.edu
  10073.  
  10074. Jan says:
  10075.  
  10076.     Wouldn't it be most convenient if Icon allowed the programmer to
  10077.     define his/her own compare-function used in the sort() procedure?
  10078.  
  10079. In general, one should (IMHO) be able to count on the various built-in
  10080. functions remaining static.  If somebody needs an exotic sort procedure,
  10081. it should be named something else.  It just makes for easier-to-read-and-
  10082. maintain code.  I personally detest working on code where somebody has
  10083. gone in and redefined built-ins!
  10084.  
  10085. Sorting is often usefully done in a case-insensitive manner, and I note
  10086. that you suggest using a keyword to turn on this behavior.  The problem
  10087. here is that you're using a side-effect that will confuse people merci-
  10088. lessly.  If you need a case-insensitive sort for certain things, it is
  10089. very easy just to create a procedure to do it yourself.  Jerry Nowlin's
  10090. posting a couple of days ago was a fine example of this.  By creating a
  10091. user-defined sort procedure, and naming it something other than "sort,"
  10092. you'll tip anyone who reads your code off that you're not doing a stan-
  10093. dard system sort.
  10094.  
  10095. If in fact a case-insensitive sort were added to Icon, I'd say it would
  10096. be better to do it as a different function (e.g. sorti).  Icon is big, and
  10097. its intrinsic namespace could easily become cluttered, though, so perhaps
  10098. the best idea would be to implement a new sort as a library procedure.
  10099.  
  10100. I haven't checked the IPL for a sort routine, but I'd guess that that
  10101. would be the very sort of thing the Icon Project would have included in
  10102. its distribution.  If one is not there, well, then if somebody writes one
  10103. that handles arbitrary types and structures the same way as the system
  10104. sort, I'd certainly think it would be good to post it here, and at the
  10105. same time send a copy to the Icon Project for possible inclusion in the
  10106. Icon Program Library distribution.
  10107.  
  10108.  
  10109.  
  10110.    -Richard L. Goerwitz              goer%midway@uchicago.bitnet
  10111.    goer@midway.uchicago.edu          rutgers!oddjob!ellis!goer
  10112.  
  10113.  
  10114. From icon-group-sender  Fri Sep  4 14:05:54 1992
  10115. Received: by cheltenham.cs.arizona.edu; Fri, 4 Sep 1992 10:08:45 MST
  10116. Date: 4 Sep 92 14:05:54 GMT
  10117. From: cis.ohio-state.edu!zaphod.mps.ohio-state.edu!sol.ctr.columbia.edu!The-Star.honeywell.com!umn.edu!sctc.com!beede@ucbvax.Berkeley.EDU  (Mike Beede)
  10118. Organization: SCTC
  10119. Subject: Re: sorting
  10120. Message-Id: <1992Sep4.140554.5727@sctc.com>
  10121. References: <9209031432.AA03653@midway.uchicago.edu>
  10122. Sender: icon-group-request@cs.arizona.edu
  10123. To: icon-group@cs.arizona.edu
  10124. Status: RO
  10125. Errors-To: icon-group-errors@cs.arizona.edu
  10126.  
  10127. goer@MIDWAY.UCHICAGO.EDU ("Richard L. Goerwitz") writes:
  10128.  
  10129. >Sorting is often usefully done in a case-insensitive manner, and I note
  10130. >that you suggest using a keyword to turn on this behavior.
  10131.  
  10132. It's been several years since I used Icon, so I don't know whether
  10133. this is workable: can't you pass in the comparison function as an
  10134. argument?  This abstracts the sorting algorithm from the ordering
  10135. function, which seems to be Mom-and-Apple-Pie.  The procedure should
  10136. be called something other than ``sort'', unless ``sort'' with a single
  10137. parameter could use the default comparisons, and with two use the
  10138. user-supplied one.  
  10139.  
  10140. I agree completely that using a side-effect to control sorting
  10141. behavior would be extremely unfriendly.
  10142.  
  10143. -- 
  10144. Mike Beede         Secure Computing
  10145. beede@sctc.com     1210 W. County Rd E, Suite 100           
  10146. ------------------ Arden Hills, MN  55112
  10147.                     (612) 482-7420
  10148.  
  10149.  
  10150. From icon-group-sender  Sat Sep  5 08:31:47 1992
  10151. Received: by cheltenham.cs.arizona.edu; Sat, 5 Sep 1992 07:55:41 MST
  10152. Date: 05 Sep 1992 08:31:47 -0600 (CST)
  10153. From: Chris Tenaglia - 257-8765 <TENAGLIA@mis.mcw.edu>
  10154. Subject: Nice Sample VMS Program
  10155. To: icon-group@cs.arizona.edu
  10156. Message-Id: <01GOF2UCJESI94DUZV@mis.mcw.edu>
  10157. Organization: Medical College of Wisconsin (Milwaukee, WI)
  10158. X-Vms-To: IN%"icon-group@cs.arizona.edu"
  10159. Mime-Version: 1.0
  10160. Content-Type: TEXT/PLAIN; CHARSET=US-ASCII
  10161. Content-Transfer-Encoding: 7BIT
  10162. Status: R
  10163. Errors-To: icon-group-errors@cs.arizona.edu
  10164.  
  10165.  
  10166. We'll there probably aren't a not of X-icon users out there yet. There are
  10167. probably not a lot of VMS-icon users either, but VMS users usually seem to
  10168. need a little more help (I know I did when I first started). Here's a
  10169. little program that does DIR/SIZE sorting by size and filterable by boolean
  10170. on the size rather than regular expression on the file. I call the program
  10171. SIZES. Here are some samples :
  10172.  
  10173.                   ICONX SIZES EQ 0    ! find files with 0 blocks
  10174.                   ICONX SIZES GT 1000 ! find files over 1000 blocks in size
  10175.                   ICONX SIZES NE 8    ! find files that aren't 8 blocks
  10176.                   ICONX SIZES         ! display all files
  10177.  
  10178. Output files are specified using unixlike redirectors:
  10179.  
  10180.      ICONX SIZES LT 100 >S.TMP      ! write output to S.TMP
  10181.      ICONX SIZES GT 2000 >>S.TALLY  ! append output to S.TALLY
  10182.  
  10183. The output is sorted by size from highest to lowest. The program uses
  10184. string scanning and has comments. Maybe someone might want to post a
  10185. unix or DOS version? Here's the code :
  10186.  
  10187. #
  10188. # FILE : SIZES.ICN
  10189. # DESC : VMS DIR/SIZE SORTED BY SIZE INSTEAD BY FILENAME
  10190. # USE  : ICONX SIZES [compare size]
  10191. #        WHERE compare IS AL, GT, LT, EQ, GE, LE, NE AND
  10192. #        SIZE IS A NUMBER MEANING ALLOCATED BLOCKS SO FOR
  10193. #        EXAMPLE iconx sizes gt 1000 WILL DO A DIR/SIZE
  10194. #        SHOWING ONLY FILES GREATER THAN 1000 BLOCKS SORTED
  10195. #        BY BLOCKS WITH BIGGEST FILES FIRST.
  10196. #
  10197. # UPDATE          BY          WHAT
  10198. # 5-SEP-1992      TENAGLIA    INITIAL CREATION
  10199. #
  10200. procedure main(param)
  10201.   cache   := []
  10202.   dir     := ""
  10203.   grand   := 0
  10204.   if *param = 2 then       # if something is specified
  10205.     {                      # then
  10206.     method := param[1]     # get method of compare
  10207.     limit  := param[2]     # compare sizes with this
  10208.     } else {               # otherwise
  10209.     method := "al"         # look at all of them
  10210.     limit  := -1           # and this is a place holder
  10211.     }
  10212.   command := "dir/size=alloc/nohead/notrail "
  10213.   pipe    := open(command,"pr")
  10214.   while (name := read(pipe)) & (size := read(pipe)) do
  10215.     {
  10216.     if dir == "" then name ? (dir := tab(upto(']') + 1))
  10217.     name ? {
  10218.            move(upto(']'))
  10219.            file := tab(0)
  10220.            }
  10221.     if compare(size,limit,param[1]) then
  10222.       {
  10223.       put(cache,right(size,7) || "   " || trim(file))
  10224.       grand +:= size
  10225.       }
  10226.     }
  10227.   close(pipe)
  10228.   results := sort(cache)
  10229.   write("\n",dir,"\n")
  10230.   while write(pull(results))
  10231.   write("\nTotal Allocated Blocks = ",grand)
  10232.   end
  10233.  
  10234. #
  10235. # GENERIC BOOLEAN COMPARE EITHER RETURNS OR FAILS
  10236. # A & B MUST BE NUMERICS, AND CONDITION IS A BOOLEAN ABBREVIATION
  10237. #
  10238. procedure compare(a,b,condition)
  10239.   case condition of
  10240.     {
  10241.     "al" : return                  # always
  10242.     "gt" : if a >  b then return   # greater than
  10243.     "lt" : if a <  b then return   # less than
  10244.     "eq" : if a =  b then return   # equal to
  10245.     "ge" : if a >= b then return   # greater than or equal to
  10246.     "le" : if a <= b then return   # less than or equal to
  10247.     "ne" : if a ~= b then return   # not equal
  10248.     default : fail                 # never
  10249.     }
  10250.   fail
  10251.   end
  10252.  
  10253. ################# end of program ####################
  10254.  
  10255. Chris Tenaglia (System Manager) | Medical College of Wisconsin
  10256. 8701 W. Watertown Plank Rd.     | Milwaukee, WI 53226
  10257. (414)257-8765                   | tenaglia@mis.mcw.edu, mcwmis!tenaglia
  10258.  
  10259.  
  10260.  
  10261.  
  10262. From icon-group-sender  Sat Sep  5 07:48:57 1992
  10263. Received: by cheltenham.cs.arizona.edu; Sat, 5 Sep 1992 07:55:48 MST
  10264. Date: Sat, 5 Sep 1992 07:48:57 MST
  10265. From: "Ralph Griswold" <ralph>
  10266. Message-Id: <199209051448.AA17632@cheltenham.cs.arizona.edu>
  10267. To: icon-group
  10268. Subject: "debugify"
  10269. Status: R
  10270. Errors-To: icon-group-errors@cs.arizona.edu
  10271.  
  10272. Icon Newsletter 39 has an article on an Icon debugger by Charles
  10273. Shartsis.  His method requires modifying the "ucode" produced by
  10274. the Icon translator and specifically relies on the numerical codes
  10275. used in ucode for representing keywords.
  10276.  
  10277. Unfortunately, these numeric codes sometimes change.  Specifically,
  10278. the codes used in his program are for Version 8.0, and these codes
  10279. have changed in more recent releases.
  10280.  
  10281. His debugger in the present Icon program library and our FTP area
  10282. therefore will not work properly on the current version of Icon
  10283. for most platforms.
  10284.  
  10285. He is working on fixing the problem.  In the meantime, if you want to
  10286. use "debugify" on recent versions of Icon, you will need to change to
  10287. keyword codes.  We can't tell you excatly what to do, since it varies
  10288. from version to version, but you might find it an interesting exercise
  10289. to figure out what to do.
  10290.     
  10291. Ralph E. Griswold            ralph@cs.arizona.edu
  10292. Department of Computer Science          uunet!arizona!ralph
  10293. The University of Arizona        602-621-6609 (voice)
  10294. Tucson, AZ 85721            602-621-9618   (fax)
  10295.  
  10296.  
  10297. From icon-group-sender  Sat Sep  5 07:54:49 1992
  10298. Received: by cheltenham.cs.arizona.edu; Sat, 5 Sep 1992 07:55:54 MST
  10299. Date: Sat, 5 Sep 1992 07:54:49 MST
  10300. From: "Ralph Griswold" <ralph>
  10301. Message-Id: <199209051454.AA17700@cheltenham.cs.arizona.edu>
  10302. To: icon-group
  10303. Subject: X-Icon editor
  10304. Status: R
  10305. Errors-To: icon-group-errors@cs.arizona.edu
  10306.  
  10307. The program library in release 8.7 of Icon for UNIX and VMS has an
  10308. editor written in X-Icon.
  10309.  
  10310. Unfortunately when we made recent changes in X-Icon, we failed to
  10311. properly update the code in this editor.  We've now corrected the
  10312. problem, but if you picked up UNIX or VMS Icon by FTP prior to
  10313. September 1, you may have a defective copy of the editor.
  10314.  
  10315. We have placed corrected versions of the two files that were in error in our
  10316. FTP area, in /icon/library.  They are
  10317.  
  10318.     xed.icn        main program
  10319.     textedit.icn    procedure used by xed.
  10320.     
  10321. Ralph E. Griswold            ralph@cs.arizona.edu
  10322. Department of Computer Science          uunet!arizona!ralph
  10323. The University of Arizona        602-621-6609 (voice)
  10324. Tucson, AZ 85721            602-621-9618   (fax)
  10325.  
  10326.  
  10327. From icon-group-sender  Sun Sep  6 21:56:57 1992
  10328. Received: by cheltenham.cs.arizona.edu; Sun, 6 Sep 1992 19:30:47 MST
  10329. Date: 6 Sep 92 21:56:57 GMT
  10330. From: pipex!demon!apusapus.demon.co.uk!tfj@uunet.uu.net  (Trevor Jenkins)
  10331. Organization: Job hunters use Parachute
  10332. Subject: W3-Icon possible?
  10333. Message-Id: <715816617snx@apusapus.demon.co.uk>
  10334. Sender: icon-group-request@cs.arizona.edu
  10335. To: icon-group@cs.arizona.edu
  10336. Status: R
  10337. Errors-To: icon-group-errors@cs.arizona.edu
  10338.  
  10339. In issue 39 of the Icon newsletter there was an item on X-Icon but else
  10340. where it is stated that most use of Icon is on MS-DOS machines this got me
  10341. thinking as to the whether a Windows3 Icon is possible? (For me it is
  10342. desirable as I'm not likely to use Icon on anything other than a PC.)
  10343.  
  10344. -------------------------------------------------------------
  10345. Trevor Jenkins                                   Radio: G6AJG
  10346. 134 Frankland Rd, Croxley Green, Rickmansworth, WD3 3AU
  10347. email: tfj@apusapus.demon.co.uk
  10348. phone: +44 (0)923 776436
  10349.  
  10350.  
  10351. From icon-group-sender  Mon Sep  7 04:50:12 1992
  10352. Received: by cheltenham.cs.arizona.edu; Mon, 7 Sep 1992 05:58:01 MST
  10353. Date: 7 Sep 92 04:50:12 GMT
  10354. From: uchinews!ellis!goer@handies.ucar.edu  (Richard L. Goerwitz)
  10355. Organization: University of Chicago Computing Organizations
  10356. Subject: Re: W3-Icon possible?
  10357. Message-Id: <1992Sep7.045012.9932@midway.uchicago.edu>
  10358. References: <715816617snx@apusapus.demon.co.uk>
  10359. Sender: icon-group-request@cs.arizona.edu
  10360. To: icon-group@cs.arizona.edu
  10361. Status: R
  10362. Errors-To: icon-group-errors@cs.arizona.edu
  10363.  
  10364. tfj@apusapus.demon.co.uk (Trevor Jenkins) writes:
  10365.  
  10366. >In issue 39 of the Icon newsletter there was an item on X-Icon but else
  10367. >where it is stated that most use of Icon is on MS-DOS machines this got me
  10368. >thinking as to the whether a Windows3 Icon is possible?  (For me it is
  10369. >desirable as I'm not likely to use Icon on anything other than a PC.)
  10370.  
  10371. It would be ideal to have Icon implemented under every windowing system
  10372. in existence, in the sense of providing X-Iconish functionality - espe-
  10373. cially under popular ones like the OS/2 presentation manager, the Mac, and
  10374. Windows.  Doing so would not be at all impossible.  The specs for X-Icon
  10375. have been written up as part of a U of Arizona technical report.  If you
  10376. were to try your hand at implementing X-Icon functionality under Win-
  10377. dows, I'm sure you'd be able to count on support from other users here,
  10378. as also from the Icon Project itself - although one suspects that they are
  10379. probably busy enough just designing and implementing the base language for
  10380. their platforms that Windows would not be a high priority for them.
  10381.  
  10382. -- 
  10383.  
  10384.    -Richard L. Goerwitz              goer%midway@uchicago.bitnet
  10385.    goer@midway.uchicago.edu          rutgers!oddjob!ellis!goer
  10386.  
  10387.  
  10388. From icon-group-sender  Mon Sep  7 11:55:33 1992
  10389. Received: by cheltenham.cs.arizona.edu; Mon, 7 Sep 1992 12:02:45 MST
  10390. Date: Mon, 7 Sep 1992 11:55:33 MST
  10391. From: "Clint Jeffery" <cjeffery>
  10392. Message-Id: <199209071855.AA18803@chuckwalla.cs.arizona.edu>
  10393. To: icon-group
  10394. Subject: X-Icon has been ported to OS/2 Presentation Manager API
  10395. Status: R
  10396. Errors-To: icon-group-errors@cs.arizona.edu
  10397.  
  10398.  
  10399. Although it was designed with portability in mind, we downplayed
  10400. X-Icon's potential on other platforms for at least two reasons:
  10401.  
  10402. (1) The large amount of X Window code makes porting a major effort,
  10403. (2) Porting *all* its X-specific features would be near impossible.
  10404.  
  10405. Nevertheless, a gifted and determined programmer named Darren Merrill
  10406. of the University of Arizona has done a port of X-Icon to OS/2 2.0.
  10407. It is a near-complete port, with very few of X-Icon's features 
  10408. altered or missing.  Its graphics performance on a 486 processor is 
  10409. competitive with low-end workstations.  It is in the testing phase,
  10410. and we plan to release it when it is ready.
  10411.  
  10412. So, X-Icon can be ported, but it is not easy.  We are not funded to
  10413. port to other window systems and cannot justify it as research, but we
  10414. are always interested in hearing from folks who undertake such efforts.
  10415.  
  10416. Clint Jeffery, Icon Project
  10417.  
  10418.  
  10419. From icon-group-sender  Tue Sep  8 07:12:32 1992
  10420. Received: by cheltenham.cs.arizona.edu; Tue, 8 Sep 1992 09:58:05 MST
  10421. Via: uk.ac.edinburgh.festival; Tue, 8 Sep 1992 15:10:18 +0100
  10422. Date: 08 Sep 92 15:10:01 BST
  10423. From: R J Hare <ercn72@festival.ed.ac.uk>
  10424. Subject: fail/break
  10425. To: icon-group@cs.arizona.edu
  10426. Message-Id: <9209081510.aa04013@uk.ac.ed.festival>
  10427. Status: R
  10428. Errors-To: icon-group-errors@cs.arizona.edu
  10429.  
  10430.  
  10431. I have a situation where I am doing something like:
  10432.  
  10433. procedure main()
  10434.   .
  10435.   .
  10436. repeat action()
  10437. stop()
  10438. end
  10439.  
  10440. procedure action()
  10441.   .
  10442.   .
  10443. if test then break
  10444.   .
  10445.   .
  10446. end
  10447.  
  10448. in other words, I am repeating the procedure action which takes one or another
  10449. action depending on a value. Some values just bale out of the action and try
  10450. again by repeating the procedure.
  10451.  
  10452. My problem is this - if I replace the break in the above with fail, I seem to
  10453. get the same effect. Which is correct please, break or fail?
  10454.  
  10455. Thanks.
  10456.  
  10457. Roger Hare.
  10458.  
  10459.  
  10460. From icon-group-sender  Tue Sep  8 13:03:00 1992
  10461. Received: by cheltenham.cs.arizona.edu; Tue, 8 Sep 1992 14:30:11 MST
  10462. Message-Id: <199209081811.AA14861@optima.cs.arizona.edu>
  10463. From: nowlin@iwtqg.att.com
  10464. Date: Tue, 8 Sep 92 13:03 CDT
  10465. To: att!cs.arizona.edu!icon-group
  10466. Subject: Re: fail/break
  10467. Status: R
  10468. Errors-To: icon-group-errors@cs.arizona.edu
  10469.  
  10470.  > I have a situation where I am doing something like:
  10471.  > 
  10472.  > procedure main()
  10473.  >   .
  10474.  >   .
  10475.  > repeat action()
  10476.  > stop()
  10477.  > end
  10478.  > 
  10479.  > procedure action()
  10480.  >   .
  10481.  >   .
  10482.  > if test then break
  10483.  >   .
  10484.  >   .
  10485.  > end
  10486.  > 
  10487.  > My problem is this - if I replace the break in the above with fail, I
  10488.  > seem to get the same effect. Which is correct please, break or fail?
  10489.  > 
  10490.  > Roger Hare.
  10491.  
  10492. There's not enough context in your example.  The break control structure
  10493. only makes sense in the context of a loop.  Your example piece of code
  10494. contains no evidence of a loop surrounding the break.  If there is a loop
  10495. around the break, and inside the action() procedure, that loop would be the
  10496. one the break is in effect for - not the repeat loop in the main()
  10497. procedure.  In the case of this example, it looks like ONLY fail makes
  10498. sense.  You should get a translation error with an orphaned break.
  10499.  
  10500. Jerry Nowlin
  10501.  
  10502.  
  10503. From icon-group-sender  Tue Sep  8 20:20:24 1992
  10504. Received: by cheltenham.cs.arizona.edu; Wed, 9 Sep 1992 03:50:15 MST
  10505. Date: Tue, 8 Sep 92 20:20:24 -0400
  10506. From: isidev!nowlin@uunet.uu.net
  10507. Message-Id: <9209090020.AA28885@relay2.UU.NET>
  10508. To: uunet!cs.arizona.edu!icon-group@uunet.UU.NET
  10509. Subject: Re: fail/break
  10510. Status: R
  10511. Errors-To: icon-group-errors@cs.arizona.edu
  10512.  
  10513.  > procedure main()
  10514.  > repeat action()
  10515.  > stop()
  10516.  > end
  10517.  
  10518. By the way.  Did I forget to mention that unless the action() procedure
  10519. terminates the program with a call to exit() or stop(), you have an infinite
  10520. loop here?  The failure of action() will not terminate the repeat loop.
  10521.  
  10522. Jerry Nowlin
  10523.  
  10524.  
  10525.  
  10526. From icon-group-sender  Tue Sep  8 18:38:39 1992
  10527. Received: by cheltenham.cs.arizona.edu; Wed, 9 Sep 1992 03:50:21 MST
  10528. Date: 8 Sep 92 18:38:39 GMT
  10529. From: cis.ohio-state.edu!pacific.mps.ohio-state.edu!linac!uchinews!ellis!goer@ucbvax.Berkeley.EDU  (Richard L. Goerwitz)
  10530. Organization: University of Chicago Computing Organizations
  10531. Subject: Re: fail/break
  10532. Message-Id: <1992Sep8.183839.22407@midway.uchicago.edu>
  10533. References: <9209081510.aa04013@uk.ac.ed.festival>
  10534. Sender: icon-group-request@cs.arizona.edu
  10535. To: icon-group@cs.arizona.edu
  10536. Status: R
  10537. Errors-To: icon-group-errors@cs.arizona.edu
  10538.  
  10539. ercn72@FESTIVAL.ED.AC.UK (R J Hare) asks a good question that really ought
  10540. to be answered properly.  I'll give it my best shot.  He says:
  10541.  
  10542. >I have a situation where I am doing something like:
  10543. >
  10544. >procedure main()
  10545. >    repeat action()
  10546. >end
  10547. >
  10548. >procedure action()
  10549. >    if test then break
  10550. >end
  10551.  
  10552. As far as break is concerned, the only loops it knows about are the ones
  10553. within the procedure it is invoked from.  The whole idea behind a lexically
  10554. scoped language, with procedural isolation, is that the programmer should
  10555. break his or task down into smaller units that communicate with the rest
  10556. of the program via a limited and easily controllable interface (namely arg-
  10557. ment passing).  Put more simply, when you create an action(arg) pro-
  10558. cedure, you are saying that you want to isolate a specific task having to
  10559. do with arg.  If break could break out of loops in the procedure you called
  10560. action() from, it would defeat the whole reason for isolating the procedure
  10561. in the first place.  The correct way to do what you want is to turn
  10562.  
  10563.     repeat {
  10564.         action()
  10565.     }
  10566.     procedure action()
  10567.         if something then break
  10568.     end
  10569.  
  10570. into something like this:
  10571.  
  10572.     repeat {
  10573.         if something then break
  10574.     }
  10575.  
  10576. Think what would happen if Icon control structures could be "broken" out
  10577. of from any procedure invoked from within them:  Very ugly side-effects
  10578. would certainly cause mysterious bugs, and tracebacks would not be able
  10579. to locate them!
  10580.  
  10581.  
  10582. -- 
  10583.  
  10584.    -Richard L. Goerwitz              goer%midway@uchicago.bitnet
  10585.    goer@midway.uchicago.edu          rutgers!oddjob!ellis!goer
  10586.  
  10587.  
  10588. From icon-group-sender  Thu Sep 10 13:56:09 1992
  10589. Received: by cheltenham.cs.arizona.edu; Sun, 13 Sep 1992 17:14:15 MST
  10590. Date: Thu, 10 Sep 92 13:56:09 CDT
  10591. From: "Richard L. Goerwitz" <goer@midway.uchicago.edu>
  10592. Message-Id: <9209101856.AA25441@midway.uchicago.edu>
  10593. To: icon-group@cs.arizona.edu
  10594. Subject: bug; 8.6 + UNIX + keyboard functions + compiler
  10595. Status: R
  10596. Errors-To: icon-group-errors@cs.arizona.edu
  10597.  
  10598. When I compile in keyboard functions with 8.6, the linking phase
  10599. with my C compiler turns up a missing _keyboard_error function in
  10600. one of the rt.a object files.  This does not occur when the pro-
  10601. gram in question is interpreted.
  10602.  
  10603. -Richard
  10604.  
  10605.  
  10606. From icon-group-sender  Fri Sep 11 12:56:11 1992
  10607. Received: by cheltenham.cs.arizona.edu; Sun, 13 Sep 1992 17:14:26 MST
  10608. Date: 11 Sep 92 12:56:11 GMT
  10609. From: dog.ee.lbl.gov!hellgate.utah.edu!caen!uwm.edu!zazen!mis.mcw.edu!tenaglia@ucbvax.Berkeley.EDU
  10610. Organization: Medical College of Wisconsin
  10611. Subject: X-Icon Sample Program
  10612. Message-Id: <1992Sep11.075611.311@mis.mcw.edu>
  10613. Sender: icon-group-request@cs.arizona.edu
  10614. To: icon-group@cs.arizona.edu
  10615. Status: R
  10616. Errors-To: icon-group-errors@cs.arizona.edu
  10617.  
  10618.  
  10619. I imagine X-Icon hasn't caught on real big yet, however, I'd like to post
  10620. a sample. It's a doodler of recursive Sierpinski triangles. The mouse is
  10621. polled as is the keyboard. The code could probably be better, but I thought
  10622. we could get a few more X-Icon posts going by getting out some samples.
  10623.  
  10624. Chris Tenaglia (System Manager) |  "The past explained,     
  10625. Medical College of Wisconsin    |   the future fortold, 
  10626. 8701 W. Watertown Plank Rd.     |   the present largely appologized for."
  10627. Milwaukee, WI 53226             |   Organon to The Doctor
  10628. (414)257-8765                   |     
  10629. tenaglia@mis.mcw.edu
  10630.  
  10631. #
  10632. # FILE : SIER.ICN
  10633. # DESC : DRAWS SIERPINSKI TRIANGLES IN X-WINDOWS
  10634. # USAGE: ICONX SIER WIDTH HEIGHT
  10635. #        WIDTH AND HEIGHT ARE USED TO SIZE THE XWINDOW. THREE RANDOM POINTS
  10636. #        ARE AUTOMATICALLY CHOOSEN. 2000 DOTS PER TRIANGLE IS THE DEFAULT.
  10637. #        THE MOUSE IS USED TO ADJUST THINGS.
  10638. #        MOUSE BUTTON 1 -- SET A TRIANGLE CORNER
  10639. #        MOUSE BUTTON 2 -- SET THE NUMBER OF DOTS TO PLOT  (ALSO "D")
  10640. #        MOUSE BUTTON 3 -- START DRAWING TRIANGLE          (ALSO "C")
  10641. #        ALSO "S" SAVES THE PICTURE TO SIERPINSKI.IMG
  10642. #        ALSO "E" ERASES THE PICTURE SO YOU CAN START OVER
  10643. #        ALSO "Q" QUITS THE PROGRAM
  10644. #
  10645. # UPDATE          BY          WHAT
  10646. # 11-SEP-1992     TENAGLIA    INITIAL PORT FROM ADEX CHROMAGRAPH & C
  10647. #
  10648.  
  10649. global VW,VH,yes,x,ox,y,oy,xw,yw,
  10650.        wl,wr,wt,wb,CW,CR,mode,answer,
  10651.        xwindow,px,py,lines,columns,pass
  10652.  
  10653. procedure main(param)
  10654.   setup(param)
  10655.   until (answer ~== yes) & (trim(answer) ~== "") do
  10656.     {
  10657. #
  10658. #  LOAD THE SEED MATRIX TO DETERMINE THE INITIAL DIMENSIONS
  10659. #
  10660.     every i := 1 to 3 do
  10661.       {
  10662.       px[i]   := ?VW
  10663.       px[i+3] := px[i]
  10664.       py[i]   := ?VH
  10665.       py[i+3] := py[i]
  10666.       }
  10667. #
  10668. # ALLOW MOUSE TO CHANGE THE TRIANGLE CORNER POINTS
  10669. #
  10670.     XDrawPoint(xwindow,px[1],py[1],px[2],py[2],px[3],py[3])
  10671.     adjust()
  10672.  
  10673. #
  10674. #  DRAW THE INITIAL OUTLINE OF THE TRIANGLE  AND SET SEED NUMBERS
  10675. #
  10676.     XDrawLine(xwindow,px[1],py[1],px[2],py[2],px[3],py[3],px[1],py[1])
  10677.  
  10678.     h := ?VW
  10679.     v := ?VH
  10680.  
  10681. #
  10682. #  THIS IS THE MAIN DRAWING LOOP FOR THE RECURSIVE TRIANGLE
  10683. #
  10684.     writes(at(24,1),blink("Drawing...."))
  10685.     every times := 1 to mode do
  10686.       {
  10687.       p   := ?6     # PICK SOME INTERESTING PLACE
  10688.       h1  := px[p]
  10689.       v1  := py[p]
  10690.       h   := integer(real((h1 - h) / 2.0 + h))
  10691.       v   := integer(real((v1 - v) / 2.0 + v))
  10692.       XDrawPoint(xwindow,h,v)
  10693.       }
  10694.    }
  10695.   close(xwindow)
  10696.   end
  10697.  
  10698. #
  10699. # SETUP INITIAL GLOBAL PARAMETERS AND CONSTANTS
  10700. #
  10701. procedure setup(items)
  10702.   VW    := integer(items[1]) | 500
  10703.   VH    := integer(items[2]) | 400
  10704.   mode  := 2000
  10705.   yes   := "y"
  10706.  
  10707.   OX    := 0
  10708.   OY    := 0
  10709.   xw    := VW - 2 * OX
  10710.   yw    := VH - 2 * OY
  10711.   pass  := 0
  10712.  
  10713.   wl    := -xw/2
  10714.   wr    := - wl
  10715.   wb    := -yw/2
  10716.   wt    := - wb
  10717.   px    := [0,0,0,0,0,0]
  10718.   py    := [0,0,0,0,0,0]
  10719.  
  10720.   lines    := integer(VH / 14.22 + 0.5)
  10721.   columns  := integer(VW /  5.69 + 0.5)
  10722.   &random  := map(&clock,":","0")
  10723.   answer   := yes
  10724.  
  10725.   (xwindow := open("SIERPINSKI","x",
  10726.                    "x=" || VW,"y=" || VH,
  10727.                    "bg=black","fg=white",
  10728.                    "lines=" || lines,"columns=" || columns)) |
  10729.     {
  10730.     write("Can't open window. Press <RETURN>")
  10731.     stop("ABEND ANOX")
  10732.     }
  10733.   XSync(xwindow)
  10734.   XSetStipple(xwindow,8,0)
  10735.   end
  10736.  
  10737. #
  10738. # PROMPT FOR AN INPUT STRING
  10739. #
  10740. procedure input(prompt)
  10741.   writes(prompt)
  10742.   return read()
  10743.   end
  10744.  
  10745. #
  10746. # ALLOW MOUSE TO ADJUST THE TRIANGLE CORNER POINTS
  10747. #
  10748. procedure adjust()
  10749.   i := 1
  10750.   writes(cls())
  10751.   write("+---------------------------------------------+")
  10752.   write("|                                             |")
  10753.   write("| Press M1 to plant a corner                  |")   
  10754.   write("| Press M2 to set the dot count               |")
  10755.   write("| Press M3 or enter 'C' to start plotting     |")
  10756.   write("| Enter E  to Erase window                    |")
  10757.   write("| Enter S  to Save window                     |")
  10758.   write("| Enter Q  to Quit program                    |")
  10759.   write("+---------------------------------------------+")
  10760.   write(at(2,20),"Sierpinski Triangle # ",pass)
  10761.   byte := ""                      
  10762.   while byte := map(XEvent(xwindow)) do
  10763.     {
  10764.     xy := []
  10765.     every put(xy,XQueryPointer(w))
  10766.     x := xy[1] - 10 ; y := xy[2] - 40
  10767.     case byte of
  10768.       {
  10769.       string(&lpress) :
  10770.         {
  10771.         XDrawPoint(xwindow,px[i],py[i])
  10772.         px[i]   := x
  10773.         px[i+3] := x
  10774.         py[i]   := y
  10775.         py[i+3] := y
  10776.         XDrawPoint(xwindow,x,y)
  10777.         if (i +:= 1) > 3 then i := 1
  10778.         }
  10779.       string(&mpress) | "D" | "d" :
  10780.         {
  10781.         tmp := open("DOT QUANTITY","x","font=-*-Terminal-*-*-*-*-*-*-*-*-*-160-*-*")
  10782.         write(tmp,"How many dots to plot")
  10783.         itera := read(tmp)
  10784.         if not(numeric(itera)) then
  10785.           {
  10786.           write(tmp,"\7Numeric input needed. Press <RETURN>")
  10787.           read(tmp)
  10788.           close(tmp)
  10789.           byte := ""
  10790.           XFlush(xwindow)
  10791.           next
  10792.           }
  10793.         close(tmp)
  10794.         mode := itera
  10795.         }
  10796.       string(&rpress) | "C" | "c" :
  10797.         {
  10798.         write(at(2,20),"Sierpinski Triangle # ",(pass+:=1))
  10799.         return
  10800.         }
  10801.       "S" | "s" :
  10802.         {
  10803.         writes(at(24,1),blink("Writing Image to sierpinski.img"))
  10804.         XWriteImage(xwindow,"sierpinski.img")
  10805.         writes(at(24,1),"\e[K\7")
  10806.         }
  10807.       "E" | "e" : { XEraseArea(xwindow,0,0,0,0) ; pass := 0 }
  10808.       "Q" | "q" : stop(at(23,1),"X SIERPINSKI cancelled")
  10809.       default   : &null
  10810.       }
  10811.     byte := ""
  10812.     XFlush(xwindow)
  10813.     }
  10814.   end
  10815.  
  10816. #
  10817. # PROCEDURE USES ANSI SEQUENCE TO SET CURSOR TO SCREEN LOCATION
  10818. #
  10819. procedure at(row,column)
  10820.   return "\e[" || row || ";" || column || "f"
  10821.   end
  10822.  
  10823. #
  10824. # PROCEDURE RETURNS AN ANSI BLINKING STRING
  10825. #                                
  10826. procedure blink(str)
  10827.   return "\e[5m" || str || "\e[m"
  10828.   end
  10829.   
  10830. #
  10831. # PROCEDURE RETURNS AN ANSI STRING TO CLEAR THE TERM WINDOW
  10832. #
  10833. procedure cls()
  10834.   return "\e[2J\e[H"
  10835.   end
  10836.  
  10837.  
  10838. From icon-group-sender  Sun Sep 13 01:32:00 1992
  10839. Received: by cheltenham.cs.arizona.edu; Sun, 13 Sep 1992 17:14:33 MST
  10840. Date: 13 Sep 92 01:32:00 GMT
  10841. From: cis.ohio-state.edu!pacific.mps.ohio-state.edu!linac!uchinews!ellis!goer@ucbvax.Berkeley.EDU  (Richard L. Goerwitz)
  10842. Organization: University of Chicago Computing Organizations
  10843. Subject: profiler, part3
  10844. Message-Id: <1992Sep13.013200.26598@midway.uchicago.edu>
  10845. References: <1992Sep13.012856.26377@midway.uchicago.edu>
  10846. Sender: icon-group-request@cs.arizona.edu
  10847. To: icon-group@cs.arizona.edu
  10848. Status: R
  10849. Errors-To: icon-group-errors@cs.arizona.edu
  10850.  
  10851.  
  10852. ---- Cut Here and feed the following to sh ----
  10853. #!/bin/sh
  10854. # this is profile.03 (part 3 of a multipart archive)
  10855. # do not concatenate these parts, unpack them in order with /bin/sh
  10856. # file iolib.icn continued
  10857. #
  10858. if test ! -r _shar_seq_.tmp; then
  10859.     echo 'Please unpack part 1 first!'
  10860.     exit 1
  10861. fi
  10862. (read Scheck
  10863.  if test "$Scheck" != 3; then
  10864.     echo Please unpack part "$Scheck" next!
  10865.     exit 1
  10866.  else
  10867.     exit 0
  10868.  fi
  10869. ) < _shar_seq_.tmp || exit 1
  10870. if test ! -f _shar_wnt_.tmp; then
  10871.     echo 'x - still skipping iolib.icn'
  10872. else
  10873. echo 'x - continuing file iolib.icn'
  10874. sed 's/^X//' << 'SHAR_EOF' >> 'iolib.icn' &&
  10875. X        }
  10876. X        else isFILE := 1
  10877. X    }
  10878. X    }
  10879. X
  10880. X    # The logic here probably isn't clear.  The idea is to try to use
  10881. X    # the termcap environment variable successively as 1) a termcap en-
  10882. X    # try and then 2) as a termcap file.  If neither works, 3) go to
  10883. X    # the /etc/termcap file.  The else clause here does 2 and, if ne-
  10884. X    # cessary, 3.  The "\termcap_string ? (not match..." expression
  10885. X    # handles 1.
  10886. X
  10887. X    if \isFILE            # if find(slash, \termcap_string)
  10888. X    then f := open(\termcap_string)
  10889. X    /f := open(!termcap_names) |
  10890. X    er("getentry","I can't access your termcap file.  Read iolib.icn.",1)
  10891. X    
  10892. X    getline := create read_file(f)
  10893. X    
  10894. X    while line := @getline do {
  10895. X    if line ? (pos(1) | tab(find("|")+1), =name, any(':|')) then {
  10896. X        entry := ""
  10897. X        while (\line | @getline) ? {
  10898. X        if entry ||:= 1(tab(find(":")+1), pos(0))
  10899. X        then {
  10900. X            close(f)
  10901. X            # if entry ends in tc= then add in the named tc entry
  10902. X            entry ?:= tab(find("tc=")) ||
  10903. X            # recursively fetch the new termcap entry
  10904. X            (move(3), getentry(tab(find(":"))) ?
  10905. X             # remove the name field from the new entry
  10906. X             (tab(find(":")+1), tab(0)))
  10907. X            return entry
  10908. X        }
  10909. X        else {
  10910. X            \line := &null # must precede the next line
  10911. X            entry ||:= trim(trim(tab(0),'\\'),':')
  10912. X        }
  10913. X        }
  10914. X    }
  10915. X    }
  10916. X
  10917. X    close(f)
  10918. X    er("getentry","can't find and/or process your termcap entry",3)
  10919. Xend
  10920. X
  10921. X
  10922. X
  10923. Xprocedure read_file(f)
  10924. X
  10925. X    # Suspends all non #-initial lines in the file f.
  10926. X    # Removes leading tabs and spaces from lines before suspending
  10927. X    # them.
  10928. X
  10929. X    local line
  10930. X
  10931. X    \f | er("read_tcap_file","no valid termcap file found",3)
  10932. X    while line := read(f) do {
  10933. X    match("#",line) & next
  10934. X    line ?:= (tab(many('\t ')) | &null, tab(0))
  10935. X    suspend line
  10936. X    }
  10937. X
  10938. X    fail
  10939. X
  10940. Xend
  10941. X
  10942. X
  10943. X
  10944. Xprocedure maketc_table(entry)
  10945. X
  10946. X    # Maketc_table(s) (where s is a valid termcap entry for some
  10947. X    # terminal-type): Returns a table in which the keys are termcap
  10948. X    # capability designators, and the values are the entries in
  10949. X    # "entry" for those designators.
  10950. X
  10951. X    local k, v, str, decoded_value
  10952. X
  10953. X    /entry & er("maketc_table","no entry given",8)
  10954. X    if entry[-1] ~== ":" then entry ||:= ":"
  10955. X    
  10956. X    /tc_table := table()
  10957. X
  10958. X    entry ? {
  10959. X
  10960. X    tab(find(":")+1)    # tab past initial (name) field
  10961. X
  10962. X    while tab((find(":")+1) \ 1) ? {
  10963. X        &subject == "" & next
  10964. X        if k := 1(move(2), ="=") then {
  10965. X        # Get rid of null padding information.  Iolib can't
  10966. X        # handle it (unlike itlib.icn).  Leave star in.  It
  10967. X        # indicates a real dinosaur terminal, and will later
  10968. X        # prompt an abort.
  10969. X        str := ="*" | ""; tab(many(&digits))
  10970. X        decoded_value := Decode(str || tab(find(":")))
  10971. X        }
  10972. X        else if k := 1(move(2), ="#")
  10973. X        then decoded_value := integer(tab(find(":")))
  10974. X        else if k := 1(tab(find(":")), pos(-1))
  10975. X        then decoded_value := true()
  10976. X        else er("maketc_table", "your termcap file has a bad entry",3)
  10977. X        /tc_table[k] := decoded_value
  10978. X        &null
  10979. X    }
  10980. X    }
  10981. X
  10982. X    return tc_table
  10983. X
  10984. Xend
  10985. X
  10986. X
  10987. X
  10988. Xprocedure getval(id)
  10989. X
  10990. X    /tc_table := maketc_table(getentry(getname())) |
  10991. X    er("getval","can't make a table for your terminal",4)
  10992. X
  10993. X    return \tc_table[id] | fail
  10994. X    # er("getval","the current terminal doesn't support "||id,7)
  10995. X
  10996. Xend
  10997. X
  10998. X
  10999. X
  11000. Xprocedure Decode(s)
  11001. X
  11002. X    # Does things like turn ^ plus a letter into a genuine control
  11003. X    # character.
  11004. X
  11005. X    local new_s, chr, chr2
  11006. X
  11007. X    new_s := ""
  11008. X
  11009. X    s ? {
  11010. X
  11011. X    while new_s ||:= tab(upto('\\^')) do {
  11012. X        chr := move(1)
  11013. X        if chr == "\\" then {
  11014. X        new_s ||:= {
  11015. X            case chr2 := move(1) of {
  11016. X            "\\" : "\\"
  11017. X            "^"  : "^"
  11018. X            "E"  : "\e"
  11019. X            "b"  : "\b"
  11020. X            "f"  : "\f"
  11021. X            "n"  : "\n"
  11022. X            "r"  : "\r"
  11023. X            "t"  : "\t"
  11024. X            default : {
  11025. X                if any(&digits,chr2) then {
  11026. X                char(integer("8r"||chr2||move(2 to 0 by -1))) |
  11027. X                    er("Decode","bad termcap entry",3)
  11028. X                }
  11029. X               else chr2
  11030. X            }
  11031. X            }
  11032. X        }
  11033. X        }
  11034. X        else new_s ||:= char(ord(map(move(1),&lcase,&ucase)) - 64)
  11035. X    }
  11036. X    new_s ||:= tab(0)
  11037. X    }
  11038. X
  11039. X    return new_s
  11040. X
  11041. Xend
  11042. X
  11043. X
  11044. X
  11045. Xprocedure igoto(cm,col,line)
  11046. X
  11047. X    local colline, range, increment, padding, str, outstr, chr, x, y
  11048. X
  11049. X    if \col > (tc_table["co"]) | \line > (tc_table["li"]) then {
  11050. X    colline := string(\col) || "," || string(\line) | string(\col|line)
  11051. X    range := "(" || tc_table["co"]-1 || "," || tc_table["li"]-1 || ")"
  11052. X    er("igoto",colline || " out of range " || (\range|""),9)
  11053. X    } 
  11054. X
  11055. X    # Use the Iconish 1;1 upper left corner & not the C-ish 0 offsets
  11056. X    increment := -1
  11057. X    outstr := ""
  11058. X    
  11059. X    cm ? {
  11060. X    while outstr ||:= tab(find("%")) do {
  11061. X        tab(match("%"))
  11062. X        if padding := integer(tab(any('23')))
  11063. X        then chr := (="d" | "d")
  11064. X        else chr := move(1)
  11065. X        if case \chr of {
  11066. X        "." :  outstr ||:= char(line + increment)
  11067. X        "+" :  outstr ||:= char(line + ord(move(1)) + increment)
  11068. X        "d" :  {
  11069. X            str := string(line + increment)
  11070. X            outstr ||:= right(str, \padding, "0") | str
  11071. X        }
  11072. X        }
  11073. X        then line :=: col
  11074. X        else {
  11075. X        case chr of {
  11076. X            "n" :  line := ixor(line,96) & col := ixor(col,96)
  11077. X            "i" :  increment := 0
  11078. X            "r" :  line :=: col
  11079. X            "%" :  outstr ||:= "%"
  11080. X            "B" :  line := ior(ishift(line / 10, 4), line % 10)
  11081. X            ">" :  {
  11082. X            x := move(1); y := move(1)
  11083. X            line > ord(x) & line +:= ord(y)
  11084. X            &null
  11085. X            }
  11086. X        } | er("goto","bad termcap entry",5)
  11087. X        }
  11088. X    }
  11089. X    return outstr || tab(0)
  11090. X    }
  11091. X
  11092. Xend
  11093. X
  11094. X
  11095. X
  11096. Xprocedure iputs(cp, affcnt)
  11097. X
  11098. X    # Writes cp to the screen.  Use this instead of writes() for
  11099. X    # compatibility with itlib (a UNIX-only version which can handle
  11100. X    # albeit inelegantly) terminals that need padding.
  11101. X
  11102. X    static num_chars
  11103. X    initial num_chars := &digits ++ '.'
  11104. X
  11105. X    type(cp) == "string" |
  11106. X    er("iputs","you can't iputs() a non-string value!",10)
  11107. X
  11108. X    cp ? {
  11109. X    if tab(many(num_chars)) & ="*" then
  11110. X        stop("iputs:  iolib can't use terminals that require padding.")
  11111. X    writes(tab(0))
  11112. X    }
  11113. X
  11114. X    return
  11115. X
  11116. Xend
  11117. SHAR_EOF
  11118. echo 'File iolib.icn is complete' &&
  11119. true || echo 'restore of iolib.icn failed'
  11120. rm -f _shar_wnt_.tmp
  11121. fi
  11122. # ============= iscreen.icn ==============
  11123. if test -f 'iscreen.icn' -a X"$1" != X"-c"; then
  11124.     echo 'x - skipping iscreen.icn (File already exists)'
  11125.     rm -f _shar_wnt_.tmp
  11126. else
  11127. > _shar_wnt_.tmp
  11128. echo 'x - extracting iscreen.icn (Text)'
  11129. sed 's/^X//' << 'SHAR_EOF' > 'iscreen.icn' &&
  11130. X############################################################################
  11131. X#
  11132. X#    Name:     iscreen.icn
  11133. X#
  11134. X#    Title:     Icon screen functions
  11135. X#
  11136. X#    Author:     Richard L. Goerwitz
  11137. X#
  11138. X#    Version: 1.28
  11139. X#
  11140. X############################################################################
  11141. X#
  11142. X#  This and future version of iscreen are placed in the public domain - RLG
  11143. X#
  11144. X############################################################################
  11145. X#  
  11146. X#      This file contains some rudimentary screen functions for use with
  11147. X#  itlib.icn (termlib-like routines for Icon).
  11148. X#
  11149. X#      clear()              - clears the screen (tries several methods)
  11150. X#      emphasize()          - initiates emphasized (usu. = reverse) mode
  11151. X#      boldface()           - initiates bold mode
  11152. X#      blink()              - initiates blinking mode
  11153. X#      normal()             - resets to normal mode
  11154. X#      message(s)           - displays message s on 2nd-to-last line
  11155. X#      underline()          - initiates underline mode
  11156. X#      status_line(s,s2,p)  - draws status line s on the 3rd-to-last
  11157. X#        screen line; if s is too short for the terminal, s2 is used;
  11158. X#        if p is nonnull then it either centers, left-, or right-justi-
  11159. X#        fies, depending on the value, "c," "l," or "r."
  11160. X#      clear_emphasize()    - horrible way of clearing the screen to all-
  11161. X#        emphasize mode; necessary for many terminals
  11162. X#
  11163. X############################################################################
  11164. X#
  11165. X#  Requires: UNIX
  11166. X#
  11167. X#  Links: itlib.icn (or your OS-specific port of itlib)
  11168. X#
  11169. X#  See also: boldface.icn
  11170. X#
  11171. X############################################################################
  11172. X
  11173. X
  11174. Xprocedure clear()
  11175. X
  11176. X    # Clears the screen.  Tries several methods.
  11177. X    local i
  11178. X
  11179. X    normal()
  11180. X    if not iputs(getval("cl"))
  11181. X    then iputs(igoto(getval("cm"),1,1) | getval("ho"))
  11182. X    if not iputs(getval("cd"))
  11183. X    then {
  11184. X    every i := 1 to getval("li") do {
  11185. X        iputs(igoto(getval("cm"),1,i))
  11186. X        iputs(getval("ce"))
  11187. X    }
  11188. X    iputs(igoto(getval("cm"),1,1))
  11189. X    }
  11190. X    return
  11191. X
  11192. Xend
  11193. X
  11194. X
  11195. X
  11196. Xprocedure boldface()
  11197. X    
  11198. X    static bold_str, cookie_str
  11199. X    initial {
  11200. X    if bold_str := getval("md")
  11201. X    then cookie_str := repl(getval("le"|"bc") | "\b", getval("mg"))
  11202. X    else {
  11203. X        # One global procedure value substituted for another.
  11204. X        boldface := emphasize
  11205. X        return emphasize()
  11206. X    }
  11207. X    }        
  11208. X    normal()
  11209. X    iputs(\bold_str)
  11210. X    iputs(\cookie_str)
  11211. X    return
  11212. X
  11213. Xend
  11214. X
  11215. X
  11216. X
  11217. Xprocedure blink()
  11218. X    
  11219. X    static blink_str, cookie_str
  11220. X    initial {
  11221. X    if blink_str := getval("mb")
  11222. X    then cookie_str :=
  11223. X         repl(getval("le"|"bc") | "\b", getval("mg"))
  11224. X    else {
  11225. X        # One global procedure value substituted for another.
  11226. X        blink := emphasize
  11227. X        return emphasize()
  11228. X    }
  11229. X    }        
  11230. X    normal()
  11231. X    iputs(\blink_str)
  11232. X    iputs(\cookie_str)
  11233. X    return
  11234. X
  11235. Xend
  11236. X
  11237. X
  11238. X
  11239. Xprocedure emphasize()
  11240. X    
  11241. X    static emph_str, cookie_str
  11242. X    initial {
  11243. X    if emph_str := getval("so")
  11244. X    then cookie_str := repl(getval("le"|"bc") | "\b", getval("sg"))
  11245. X    else {
  11246. X        if emph_str := getval("mr")
  11247. X        then cookie_str := repl(getval("le"|"bc") | "\b", getval("mg"))
  11248. X        else if emph_str := getval("us")
  11249. X        then cookie_str := repl(getval("le"|"bc") | "\b", getval("ug"))
  11250. X    }
  11251. X    }        
  11252. X    normal()
  11253. X    iputs(\emph_str)
  11254. X    iputs(\cookie_str)
  11255. X    return
  11256. X
  11257. Xend
  11258. X
  11259. X
  11260. X
  11261. Xprocedure underline()
  11262. X    
  11263. X    static underline_str, cookie_str
  11264. X    initial {
  11265. X    if underline_str := getval("us")
  11266. X    then cookie_str := repl(getval("le"|"bc") | "\b", getval("ug"))
  11267. X    }
  11268. X
  11269. X    normal()
  11270. X    iputs(\underline_str)
  11271. X    iputs(\cookie_str)
  11272. X    return
  11273. X
  11274. Xend
  11275. X
  11276. X
  11277. X
  11278. Xprocedure normal(mode)
  11279. X
  11280. X    static UN_emph_str, emph_cookie_str,
  11281. X    UN_underline_str, underline_cookie_str,
  11282. X    UN_bold_str, bold_cookie_str
  11283. X
  11284. X    initial {
  11285. X
  11286. X    # Find out code to turn off emphasize (reverse video) mode.
  11287. X    if UN_emph_str := getval("se") then
  11288. X        # Figure out how many backspaces we need to erase cookies.
  11289. X        emph_cookie_str := repl(getval("le"|"bc") | "\b", getval("sg"))
  11290. X    else UN_emph_str := ""
  11291. X
  11292. X    # Finally, figure out how to turn off underline mode.
  11293. X    if UN_underline_str := (UN_emph_str ~== getval("ue")) then
  11294. X        underline_cookie_str := repl(getval("le"|"bc")|"\b", getval("ug"))
  11295. X    else UN_underline_str := ""
  11296. X
  11297. X    # Figure out how to turn off boldface mode.
  11298. X    if UN_bold_str := 
  11299. X        (UN_underline_str ~== (UN_emph_str ~== getval("me"))) then
  11300. X        # Figure out how many backspaces we need to erase cookies.
  11301. X        bold_cookie_str := repl(getval("le"|"bc") | "\b", getval("mg"))
  11302. X    else UN_bold_str := ""
  11303. X
  11304. X    }        
  11305. X    
  11306. X    iputs("" ~== UN_emph_str) &
  11307. X    iputs(\emph_cookie_str)
  11308. X
  11309. X    iputs("" ~== UN_underline_str) &
  11310. X    iputs(\underline_cookie_str)
  11311. X
  11312. X    iputs("" ~== UN_bold_str) &
  11313. X    iputs(\bold_cookie_str)
  11314. X
  11315. X    return
  11316. X
  11317. Xend
  11318. X
  11319. X
  11320. X
  11321. Xprocedure status_line(s,s2,p)
  11322. X
  11323. X    # Writes a status line on the terminal's third-to-last line
  11324. X    # The only necessary argument is s.  S2 (optional) is used
  11325. X    # for extra narrow screens.  In other words, by specifying
  11326. X    # s2 you give status_line an alternate, shorter status string
  11327. X    # to display, in case the terminal isn't wide enough to sup-
  11328. X    # port s.  If p is nonnull, then the status line is either
  11329. X    # centered (if equal to "c"), left justified ("l"), or right
  11330. X    # justified ("r").
  11331. X
  11332. X    local width
  11333. X
  11334. X    /s := ""; /s2 := ""; /p := "c"
  11335. X    width := getval("co")
  11336. X    if *s > width then {
  11337. X    (*s2 < width, s := s2) |
  11338. X        er("status_line","Your terminal is too narrow.",4)
  11339. X    }
  11340. X
  11341. X    case p of {
  11342. X    "c"    : s := center(s,width)
  11343. X    "l"    : s := left(s,width)
  11344. X    "r"    : s := right(s,width)
  11345. X    default: stop("status_line:  Unknown option "||string(p),4)
  11346. X    }
  11347. X
  11348. X    iputs(igoto(getval("cm"), 1, getval("li")-2))
  11349. X    emphasize(); writes(s)
  11350. X    normal()
  11351. X    return
  11352. X
  11353. Xend
  11354. X
  11355. X
  11356. X
  11357. Xprocedure message(s)
  11358. X
  11359. X    # Display prompt s on the second-to-last line of the screen.
  11360. X    # I hate to use the last line, due to all the problems with
  11361. X    # automatic scrolling.
  11362. X
  11363. X    /s := ""
  11364. X    normal()
  11365. X    iputs(igoto(getval("cm"), 1, getval("li")))
  11366. X    iputs(getval("ce"))
  11367. X    normal()
  11368. X    iputs(igoto(getval("cm"), 1, getval("li")-1))
  11369. X    iputs(getval("ce"))
  11370. X    writes(s[1:getval("co")] | s)
  11371. X    return
  11372. X
  11373. Xend
  11374. X
  11375. X
  11376. X
  11377. Xprocedure clear_underline()
  11378. X
  11379. X    # Horrible way of clearing the screen to all underline mode, but
  11380. X    # the only apparent way we can do it "portably" using the termcap
  11381. X    # capability database.
  11382. X
  11383. X    local i
  11384. X
  11385. X    underline()
  11386. X    iputs(igoto(getval("cm"),1,1))
  11387. X    if getval("am") then {
  11388. X    underline()
  11389. X        every 1 to (getval("li")-1) * getval("co") do
  11390. X        writes(" ")
  11391. X    }
  11392. X    else {
  11393. X    every i := 1 to getval("li")-1 do {
  11394. X        iputs(igoto(getval("cm"), 1, i))
  11395. X        underline()
  11396. X        writes(repl(" ",getval("co")))
  11397. X    }
  11398. X    }
  11399. X    iputs(igoto(getval("cm"),1,1))
  11400. X
  11401. Xend
  11402. X
  11403. X
  11404. X
  11405. Xprocedure clear_emphasize()
  11406. X
  11407. X    # Horrible way of clearing the screen to all reverse-video, but
  11408. X    # the only apparent way we can do it "portably" using the termcap
  11409. X    # capability database.
  11410. X
  11411. X    local i
  11412. X
  11413. X    emphasize()
  11414. X    iputs(igoto(getval("cm"),1,1))
  11415. X    if getval("am") then {
  11416. X    emphasize()
  11417. X        every 1 to (getval("li")-1) * getval("co") do
  11418. X        writes(" ")
  11419. X    }
  11420. X    else {
  11421. X    every i := 1 to getval("li")-1 do {
  11422. X        iputs(igoto(getval("cm"), 1, i))
  11423. X        emphasize()
  11424. X        writes(repl(" ",getval("co")))
  11425. X    }
  11426. X    }
  11427. X    iputs(igoto(getval("cm"),1,1))
  11428. X
  11429. Xend
  11430. SHAR_EOF
  11431. true || echo 'restore of iscreen.icn failed'
  11432. rm -f _shar_wnt_.tmp
  11433. fi
  11434. # ============= Makefile.dist ==============
  11435. if test -f 'Makefile.dist' -a X"$1" != X"-c"; then
  11436.     echo 'x - skipping Makefile.dist (File already exists)'
  11437.     rm -f _shar_wnt_.tmp
  11438. else
  11439. > _shar_wnt_.tmp
  11440. echo 'x - extracting Makefile.dist (Text)'
  11441. sed 's/^X//' << 'SHAR_EOF' > 'Makefile.dist' &&
  11442. X# Don't change this unless you're sure of what you're doing.
  11443. XPROGNAME = profile
  11444. X
  11445. X# You may need to change this (new users, use icont).
  11446. XICONC = /usr/icon/v8/bin/icont
  11447. X# ICONC = /usr/icon/v8/bin/iconc
  11448. X
  11449. X# If your system has old-style terminals attached (ones that require
  11450. X# padding), use itlib instead of iolib.  Otherwise, delete itlib.icn.
  11451. X# ITLIB = itlib
  11452. XITLIB = iolib
  11453. X
  11454. X# Please edit these to reflect your local file structure & conventions.
  11455. XDESTDIR = /usr/local/bin
  11456. XOWNER = bin
  11457. XGROUP = bin
  11458. X
  11459. XSHELL = /bin/sh
  11460. XMAKE = /bin/make
  11461. X
  11462. X# Please don't change these.
  11463. XSRC = $(PROGNAME).icn $(ITLIB).icn iscreen.icn
  11464. X
  11465. X# I hope you won't have to use this.
  11466. X# DEBUGFLAG = -t
  11467. X
  11468. X$(PROGNAME): $(SRC)
  11469. X    $(ICONC) $(DEBUGFLAG) -o $(PROGNAME) $(SRC)
  11470. X
  11471. X# Pessimistic assumptions regarding the environment (in particular,
  11472. X# I don't assume you have the BSD "install" shell script).
  11473. Xinstall: $(PROGNAME)
  11474. X    test -d $(DESTDIR) || (mkdir $(DESTDIR) && chmod 755 $(DESTDIR))
  11475. X    cp $(PROGNAME) $(DESTDIR)/
  11476. X    chgrp $(GROUP) $(DESTDIR)/$(PROGNAME)
  11477. X    chown $(OWNER) $(DESTDIR)/$(PROGNAME)
  11478. X    @echo "Installation done."
  11479. X    @echo ""
  11480. X
  11481. Xclean:
  11482. X    -rm -f *~ *.u?
  11483. X    -rm -f $(PROGNAME)
  11484. SHAR_EOF
  11485. true || echo 'restore of Makefile.dist failed'
  11486. rm -f _shar_wnt_.tmp
  11487. fi
  11488. rm -f _shar_seq_.tmp
  11489. echo You have unpacked the last part
  11490. exit 0
  11491. -- 
  11492.  
  11493.    -Richard L. Goerwitz              goer%midway@uchicago.bitnet
  11494.    goer@midway.uchicago.edu          rutgers!oddjob!ellis!goer
  11495.  
  11496.  
  11497. From icon-group-sender  Sun Sep 13 01:30:05 1992
  11498. Received: by cheltenham.cs.arizona.edu; Sun, 13 Sep 1992 17:14:40 MST
  11499. Date: 13 Sep 92 01:30:05 GMT
  11500. From: agate!spool.mu.edu!darwin.sura.net!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!linac!uchinews!ellis!goer@ucbvax.Berkeley.EDU  (Richard L. Goerwitz)
  11501. Organization: University of Chicago Computing Organizations
  11502. Subject: profiler, part2
  11503. Message-Id: <1992Sep13.013005.26494@midway.uchicago.edu>
  11504. References: <1992Sep13.012856.26377@midway.uchicago.edu>
  11505. Sender: icon-group-request@cs.arizona.edu
  11506. To: icon-group@cs.arizona.edu
  11507. Status: R
  11508. Errors-To: icon-group-errors@cs.arizona.edu
  11509.  
  11510.  
  11511. ---- Cut Here and feed the following to sh ----
  11512. #!/bin/sh
  11513. # this is profile.02 (part 2 of a multipart archive)
  11514. # do not concatenate these parts, unpack them in order with /bin/sh
  11515. # file itlib.icn continued
  11516. #
  11517. if test ! -r _shar_seq_.tmp; then
  11518.     echo 'Please unpack part 1 first!'
  11519.     exit 1
  11520. fi
  11521. (read Scheck
  11522.  if test "$Scheck" != 2; then
  11523.     echo Please unpack part "$Scheck" next!
  11524.     exit 1
  11525.  else
  11526.     exit 0
  11527.  fi
  11528. ) < _shar_seq_.tmp || exit 1
  11529. if test ! -f _shar_wnt_.tmp; then
  11530.     echo 'x - still skipping itlib.icn'
  11531. else
  11532. echo 'x - continuing file itlib.icn'
  11533. sed 's/^X//' << 'SHAR_EOF' >> 'itlib.icn' &&
  11534. X        if line ? (pos(1) | tab(find("|")+1), =name, any(':|')) then {
  11535. X        entry := ""
  11536. X        while (\line | @getline) ? {
  11537. X            if entry ||:= 1(tab(find(":")+1), pos(0))
  11538. X            then {
  11539. X            close(f)
  11540. X            # if entry ends in tc= then add in the named tc entry
  11541. X            entry ?:= tab(find("tc=")) ||
  11542. X                # recursively fetch the new termcap entry
  11543. X                (move(3), getentry(tab(find(":"))) ?
  11544. X                    # remove the name field from the new entry
  11545. X                     (tab(find(":")+1), tab(0)))
  11546. X            return entry
  11547. X            }
  11548. X            else {
  11549. X            \line := &null # must precede the next line
  11550. X            entry ||:= trim(trim(tab(0),'\\'),':')
  11551. X            }
  11552. X        }
  11553. X        }
  11554. X    }
  11555. X    }
  11556. X
  11557. X    close(f)
  11558. X    er("getentry","can't find and/or process your termcap entry",3)
  11559. Xend
  11560. X
  11561. X
  11562. X
  11563. Xprocedure read_file(f)
  11564. X
  11565. X    # Suspends all non #-initial lines in the file f.
  11566. X    # Removes leading tabs and spaces from lines before suspending
  11567. X    # them.
  11568. X
  11569. X    local line
  11570. X
  11571. X    \f | er("read_tcap_file","no valid termcap file found",3)
  11572. X    while line := read(f) do {
  11573. X    match("#",line) & next
  11574. X    line ?:= (tab(many('\t ')) | &null, tab(0))
  11575. X    suspend line
  11576. X    }
  11577. X
  11578. X    fail
  11579. X
  11580. Xend
  11581. X
  11582. X
  11583. X
  11584. Xprocedure maketc_table(entry)
  11585. X
  11586. X    # Maketc_table(s) (where s is a valid termcap entry for some
  11587. X    # terminal-type): Returns a table in which the keys are termcap
  11588. X    # capability designators, and the values are the entries in
  11589. X    # "entry" for those designators.
  11590. X
  11591. X    local k, v, decoded_value
  11592. X
  11593. X    /entry & er("maketc_table","no entry given",8)
  11594. X    if entry[-1] ~== ":" then entry ||:= ":"
  11595. X    
  11596. X    /tc_table := table()
  11597. X
  11598. X    entry ? {
  11599. X
  11600. X    tab(find(":")+1)    # tab past initial (name) field
  11601. X
  11602. X    while tab((find(":")+1) \ 1) ? {
  11603. X        &subject == "" & next
  11604. X        if k := 1(move(2), ="=")
  11605. X        then decoded_value := Decode(tab(find(":")))
  11606. X        else if k := 1(move(2), ="#")
  11607. X        then decoded_value := integer(tab(find(":")))
  11608. X        else if k := 1(tab(find(":")), pos(-1))
  11609. X        then decoded_value := true()
  11610. X        else er("maketc_table", "your termcap file has a bad entry",3)
  11611. X        /tc_table[k] := decoded_value
  11612. X        &null
  11613. X    }
  11614. X    }
  11615. X
  11616. X    return tc_table
  11617. X
  11618. Xend
  11619. X
  11620. X
  11621. X
  11622. Xprocedure getval(id)
  11623. X
  11624. X    /tc_table := maketc_table(getentry(getname())) |
  11625. X    er("getval","can't make a table for your terminal",4)
  11626. X
  11627. X    return \tc_table[id] | fail
  11628. X    # er("getval","the current terminal doesn't support "||id,7)
  11629. X
  11630. Xend
  11631. X
  11632. X
  11633. X
  11634. Xprocedure Decode(s)
  11635. X
  11636. X    # Does things like turn ^ plus a letter into a genuine control
  11637. X    # character.
  11638. X
  11639. X    new_s := ""
  11640. X
  11641. X    s ? {
  11642. X
  11643. X    while new_s ||:= tab(upto('\\^')) do {
  11644. X        chr := move(1)
  11645. X        if chr == "\\" then {
  11646. X        new_s ||:= {
  11647. X            case chr2 := move(1) of {
  11648. X            "\\" : "\\"
  11649. X            "^"  : "^"
  11650. X            "E"  : "\e"
  11651. X            "b"  : "\b"
  11652. X            "f"  : "\f"
  11653. X            "n"  : "\n"
  11654. X            "r"  : "\r"
  11655. X            "t"  : "\t"
  11656. X            default : {
  11657. X                if any(&digits,chr2) then {
  11658. X                char(integer("8r"||chr2||move(2 to 0 by -1))) |
  11659. X                    er("Decode","bad termcap entry",3)
  11660. X                }
  11661. X               else chr2
  11662. X            }
  11663. X            }
  11664. X        }
  11665. X        }
  11666. X        else new_s ||:= char(ord(map(move(1),&lcase,&ucase)) - 64)
  11667. X    }
  11668. X    new_s ||:= tab(0)
  11669. X    }
  11670. X
  11671. X    return new_s
  11672. X
  11673. Xend
  11674. X
  11675. X
  11676. X
  11677. Xprocedure igoto(cm,col,line)
  11678. X
  11679. X    local colline, range, increment, padding, str, outstr, chr, x, y
  11680. X
  11681. X    if \col > (tc_table["co"]) | \line > (tc_table["li"]) then {
  11682. X    colline := string(\col) || "," || string(\line) | string(\col|line)
  11683. X    range := "(" || tc_table["co"]-1 || "," || tc_table["li"]-1 || ")"
  11684. X    er("igoto",colline || " out of range " || (\range|""),9)
  11685. X    } 
  11686. X
  11687. X    # Use the Iconish 1;1 upper left corner & not the C-ish 0 offsets
  11688. X    increment := -1
  11689. X    outstr := ""
  11690. X    
  11691. X    cm ? {
  11692. X    while outstr ||:= tab(find("%")) do {
  11693. X        tab(match("%"))
  11694. X        if padding := integer(tab(any('23')))
  11695. X        then chr := (="d" | "d")
  11696. X        else chr := move(1)
  11697. X        if case \chr of {
  11698. X        "." :  outstr ||:= char(line + increment)
  11699. X        "+" :  outstr ||:= char(line + ord(move(1)) + increment)
  11700. X        "d" :  {
  11701. X            str := string(line + increment)
  11702. X            outstr ||:= right(str, \padding, "0") | str
  11703. X        }
  11704. X        }
  11705. X        then line :=: col
  11706. X        else {
  11707. X        case chr of {
  11708. X            "n" :  line := ixor(line,96) & col := ixor(col,96)
  11709. X            "i" :  increment := 0
  11710. X            "r" :  line :=: col
  11711. X            "%" :  outstr ||:= "%"
  11712. X            "B" :  line := ior(ishift(line / 10, 4), line % 10)
  11713. X            ">" :  {
  11714. X            x := move(1); y := move(1)
  11715. X            line > ord(x) & line +:= ord(y)
  11716. X            &null
  11717. X            }
  11718. X        } | er("goto","bad termcap entry",5)
  11719. X        }
  11720. X    }
  11721. X    return outstr || tab(0)
  11722. X    }
  11723. X
  11724. Xend
  11725. X
  11726. X
  11727. X
  11728. Xprocedure iputs(cp, affcnt)
  11729. X
  11730. X    local baud_rates, char_rates, i, delay, PC, minimum_padding_speed
  11731. X    static num_chars, char_times
  11732. X    # global tty_speed
  11733. X
  11734. X    initial {
  11735. X    num_chars := &digits ++ '.'
  11736. X    char_times := table()
  11737. X    # Baud rates in decimal, not octal (as in termio.h)
  11738. X    baud_rates := [0,7,8,9,10,11,12,13,14,15,16]
  11739. X    char_rates := [0,333,166,83,55,41,20,10,10,10,10]
  11740. X    every i := 1 to *baud_rates do {
  11741. X        char_times[baud_rates[i]] := char_rates[i]
  11742. X    }
  11743. X    }
  11744. X
  11745. X    type(cp) == "string" |
  11746. X    er("iputs","you can't iputs() a non-string value!",10)
  11747. X
  11748. X    cp ? {
  11749. X    delay := tab(many(num_chars))
  11750. X    if ="*" then {
  11751. X        delay *:= \affcnt |
  11752. X        er("iputs","affected line count missing",6)
  11753. X    }
  11754. X    writes(tab(0))
  11755. X    }
  11756. X
  11757. X    if (\delay, tty_speed ~= 0) then {
  11758. X    minimum_padding_speed := getval("pb")
  11759. X    if /minimum_padding_speed | tty_speed >= minimum_padding_speed then {
  11760. X        PC := tc_table["pc"] | "\000"
  11761. X        char_time := char_times[tty_speed] | (return "speed error")
  11762. X        delay := (delay * char_time) + (char_time / 2)
  11763. X        every 1 to delay by 10
  11764. X        do writes(PC)
  11765. X    }
  11766. X    }
  11767. X
  11768. X    return
  11769. X
  11770. Xend
  11771. X
  11772. X
  11773. X
  11774. Xprocedure getspeed()
  11775. X
  11776. X    local stty_g, stty_output, c_cflag, o_speed
  11777. X
  11778. X    stty_g := open("/bin/stty -g 2>&1","pr") |
  11779. X    er("getspeed","Can't access your stty command.",4)
  11780. X    stty_output := !stty_g
  11781. X    close(stty_g)
  11782. X
  11783. X    \stty_output ? {
  11784. X    # tab to the third field of the output of the stty -g cmd
  11785. X        tab(find(":")+1) & tab(find(":")+1) &
  11786. X    c_cflag := integer("16r"||tab(find(":")))
  11787. X    } | er("getspeed","Unable to unwind your stty -g output.",4)
  11788. X
  11789. X    o_speed := iand(15,c_cflag)
  11790. X    return o_speed
  11791. X
  11792. Xend
  11793. SHAR_EOF
  11794. echo 'File itlib.icn is complete' &&
  11795. true || echo 'restore of itlib.icn failed'
  11796. rm -f _shar_wnt_.tmp
  11797. fi
  11798. # ============= iolib.icn ==============
  11799. if test -f 'iolib.icn' -a X"$1" != X"-c"; then
  11800.     echo 'x - skipping iolib.icn (File already exists)'
  11801.     rm -f _shar_wnt_.tmp
  11802. else
  11803. > _shar_wnt_.tmp
  11804. echo 'x - extracting iolib.icn (Text)'
  11805. sed 's/^X//' << 'SHAR_EOF' > 'iolib.icn' &&
  11806. X########################################################################
  11807. X#    
  11808. X#    Name:    iolib.icn
  11809. X#    
  11810. X#    Title:    Icon termlib-type tools for MS-DOS and UNIX
  11811. X#    
  11812. X#    Author:    Richard L. Goerwitz (with help from Norman Azadian)
  11813. X#
  11814. X#    Version: 1.13
  11815. X#
  11816. X#########################################################################
  11817. X#
  11818. X#  The authors place this and future versions of iolib in the public
  11819. X#  domain.
  11820. X#
  11821. X#########################################################################
  11822. X#
  11823. X#  The following library represents a series of rough functional
  11824. X#  equivalents to the standard Unix low-level termcap routines.  It is
  11825. X#  not meant as an exact termlib clone.  Nor is it enhanced to take
  11826. X#  care of magic cookie terminals, terminals that use \D in their
  11827. X#  termcap entries, or archaic terminals that require padding.  This
  11828. X#  library is geared mainly for use with ANSI and VT-100 devices.
  11829. X#  Note that this file may, in most instances, be used in place of the
  11830. X#  older UNIX-only itlib.icn file.  It essentially replaces the DOS-
  11831. X#  only itlibdos routines.  For DOS users not familiar with the whole
  11832. X#  notion of generalized screen I/O, I've included extra documentation
  11833. X#  below.  Please read it.
  11834. X#
  11835. X#  The sole disadvantage of this over the old itlib routines is that
  11836. X#  iolib.icn cannot deal with archaic or arcane UNIX terminals and/or
  11837. X#  odd system file arrangements.  Note that because these routines
  11838. X#  ignore padding, they can (unlike itlib.icn) be run on the NeXT and
  11839. X#  other systems which fail to implement the -g option of the stty
  11840. X#  command.  Iolib.icn is also simpler and faster than itlib.icn.
  11841. X#
  11842. X#  I want to thank Norman Azadian for suggesting the whole idea of
  11843. X#  combining itlib.icn and itlibdos.icn into one distribution, for
  11844. X#  suggesting things like letting drive specifications appear in DOS
  11845. X#  TERMCAP environment variables, and for finding several bugs (e.g.
  11846. X#  the lack of support for %2 and %3 in cm).  Although he is loathe
  11847. X#  to accept this credit, I think he deserves it.
  11848. X#
  11849. X#########################################################################
  11850. X#
  11851. X#  Contents:
  11852. X#
  11853. X#  setname(term)
  11854. X#    Use only if you wish to initialize itermlib for a terminal
  11855. X#  other than what your current environment specifies.  "Term" is the
  11856. X#  name of the termcap entry to use.  Normally this initialization is
  11857. X#  done automatically, and need not concern the user.
  11858. X#
  11859. X#  getval(id)
  11860. X#    Works something like tgetnum, tgetflag, and tgetstr.  In the
  11861. X#  spirit of Icon, all three have been collapsed into one routine.
  11862. X#  Integer valued caps are returned as integers, strings as strings,
  11863. X#  and flags as records (if a flag is set, then type(flag) will return
  11864. X#  "true").  Absence of a given capability is signalled by procedure
  11865. X#  failure.
  11866. X#
  11867. X#  igoto(cm,destcol,destline) - NB:  default 1 offset (*not* zero)!
  11868. X#    Analogous to tgoto.  "Cm" is the cursor movement command for
  11869. X#  the current terminal, as obtained via getval("cm").  Igoto()
  11870. X#  returns a string which, when output via iputs, will cause the
  11871. X#  cursor to move to column "destcol" and line "destline."  Column and
  11872. X#  line are always calculated using a *one* offset.  This is far more
  11873. X#  Iconish than the normal zero offset used by tgoto.  If you want to
  11874. X#  go to the first square on your screen, then include in your program
  11875. X#  "iputs(igoto(getval("cm"),1,1))."
  11876. X#
  11877. X#  iputs(cp,affcnt)
  11878. X#    Equivalent to tputs.  "Cp" is a string obtained via getval(),
  11879. X#  or, in the case of "cm," via igoto(getval("cm"),x,y).  Affcnt is a
  11880. X#  count of affected lines.  It is completely irrelevant for most
  11881. X#  modern terminals, and is supplied here merely for the sake of
  11882. X#  backward compatibility with itlib, a UNIX-only version of these
  11883. X#  routines (one which handles padding on archaic terminals).
  11884. X#
  11885. X##########################################################################
  11886. X#
  11887. X#  Notes for MS-DOS users:
  11888. X#
  11889. X#    There are two basic reasons for using the I/O routines
  11890. X#  contained in this package.  First, by using a set of generalized
  11891. X#  routines, your code will become much more readable.  Secondly, by
  11892. X#  using a high level interface, you can avoid the cardinal
  11893. X#  programming error of hard coding things like screen length and
  11894. X#  escape codes into your programs.
  11895. X#
  11896. X#    To use this collection of programs, you must do two things.
  11897. X#  First, you must add the line "device=ansi.sys" (or the name of some
  11898. X#  other driver, like zansi.sys, nansi.sys, or nnansi.sys [=new
  11899. X#  nansi.sys]) to your config.sys file.  Secondly, you must add two
  11900. X#  lines to your autoexec.bat file: 1) "set TERM=ansi-mono" and 2)
  11901. X#  "set TERMCAP=\location\termcap."  The purpose of setting the TERM
  11902. X#  variable is to tell this program what driver you are using.  If you
  11903. X#  have a color system, you could use "ansi-color" instead of
  11904. X#  "ansi-mono," although for compatibility with a broader range of
  11905. X#  users, it would perhaps be better to stick with mono.  The purpose
  11906. X#  of setting TERMCAP is to make it possible to determine where the
  11907. X#  termcap database file is located.  The termcap file (which should
  11908. X#  have been packed with this library as termcap.dos) is a short
  11909. X#  database of all the escape sequences used by the various terminal
  11910. X#  drivers.  Set TERMCAP so that it reflects the location of this file
  11911. X#  (which should be renamed as termcap, for the sake of consistency
  11912. X#  across UNIX and MS-DOS spectra).  If desired, you can also try
  11913. X#  using termcap2.dos.  Certain games work a lot better using this
  11914. X#  alternate file.  To try it out, rename it to termcap, and set
  11915. X#  the environment variable TERMCAP to its location.
  11916. X#
  11917. X#    Although the authors make no pretense of providing here a
  11918. X#  complete introduction to the format of the termcap database file,
  11919. X#  it will be useful, we believe, to explain a few basic facts about
  11920. X#  how to use this program in conjunction with it.  If, say, you want
  11921. X#  to clear the screen, add the line,
  11922. X#
  11923. X#    iputs(getval("cl"))
  11924. X#
  11925. X#  to your program.  The function iputs() outputs screen control
  11926. X#  sequences.  Getval retrieves a specific sequence from the termcap
  11927. X#  file.  The string "cl" is the symbol used in the termcap file to
  11928. X#  mark the code used to clear the screen.  By executing the
  11929. X#  expression "iputs(getval("cl"))," you are 1) looking up the "cl"
  11930. X#  (clear) code in the termcap database entry for your terminal, and
  11931. X#  the 2) outputting that sequence to the screen.
  11932. X#
  11933. X#    Some other useful termcap symbols are "ce" (clear to end of
  11934. X#  line), "ho" (go to the top left square on the screen), "so" (begin
  11935. X#  standout mode), and "se" (end standout mode).  To output a
  11936. X#  boldfaced string, str, to the screen, you would write -
  11937. X#
  11938. X#    iputs(getval("so"))
  11939. X#    writes(str)
  11940. X#    iputs(getval("se"))
  11941. X#
  11942. X#  You can also write "writes(getval("so") || str || getval("se")),
  11943. X#  but this would make reimplementation for UNIX terminals that
  11944. X#  require padding rather difficult.
  11945. X#
  11946. X#    It is also heartily to be recommended that MS-DOS programmers
  11947. X#  try not to assume that everyone will be using a 25-line screen.
  11948. X#  Most terminals are 24-line.  Some 43.  Some have variable window
  11949. X#  sizes.  If you want to put a status line on, say, the 2nd-to-last
  11950. X#  line of the screen, then determine what that line is by executing
  11951. X#  "getval("li")."  The termcap database holds not only string-valued
  11952. X#  sequences, but numeric ones as well.  The value of "li" tells you
  11953. X#  how many lines the terminal has (compare "co," which will tell you
  11954. X#  how many columns).  To go to the beginning of the second-to-last
  11955. X#  line on the screen, type in:
  11956. X#
  11957. X#    iputs(igoto(getval("cm"), 1, getval("li")-1))
  11958. X#
  11959. X#  The "cm" capability is a special capability, and needs to be output
  11960. X#  via igoto(cm,x,y), where cm is the sequence telling your computer
  11961. X#  to move the cursor to a specified spot, x is the column, and y is
  11962. X#  the row.  The expression "getval("li")-1" will return the number of
  11963. X#  the second-to-last line on your screen.
  11964. X#
  11965. X##########################################################################
  11966. X#
  11967. X#  Requires: UNIX or MS-DOS, co-expressions
  11968. X#
  11969. X#  See also: itlib.icn, iscreen.icn
  11970. X#
  11971. X##########################################################################
  11972. X
  11973. X
  11974. Xglobal tc_table, isDOS
  11975. Xrecord true()
  11976. X
  11977. X
  11978. Xprocedure check_features()
  11979. X
  11980. X    initial {
  11981. X
  11982. X    if find("UNIX",&features) then
  11983. X        isDOS := &null
  11984. X    else if find("MS-DOS", &features) then
  11985. X        isDOS := 1
  11986. X    else stop("check_features:  OS not (yet?) supported.")
  11987. X
  11988. X    find("expressi",&features) |
  11989. X        er("check_features","co-expressions not implemented - &$#!",1)
  11990. X    }
  11991. X
  11992. X    return
  11993. X
  11994. Xend
  11995. X
  11996. X
  11997. X
  11998. Xprocedure setname(name)
  11999. X
  12000. X    # Sets current terminal type to "name" and builds a new termcap
  12001. X    # capability database (residing in tc_table).  Fails if unable to
  12002. X    # find a termcap entry for terminal type "name."  If you want it
  12003. X    # to terminate with an error message under these circumstances,
  12004. X    # comment out "| fail" below, and uncomment the er() line.
  12005. X
  12006. X    #tc_table is global
  12007. X    
  12008. X    check_features()
  12009. X
  12010. X    tc_table := table()
  12011. X    tc_table := maketc_table(getentry(name)) | fail
  12012. X    # er("setname","no termcap entry found for "||name,3)
  12013. X    return "successfully reset for terminal " || name
  12014. X
  12015. Xend
  12016. X
  12017. X
  12018. X
  12019. Xprocedure getname()
  12020. X
  12021. X    # Getname() first checks to be sure we're running under DOS or
  12022. X    # UNIX, and, if so, tries to figure out what the current terminal
  12023. X    # type is, checking successively the value of the environment
  12024. X    # variable TERM, and then (under UNIX) the output of "tset -".
  12025. X    # Terminates with an error message if the terminal type cannot be
  12026. X    # ascertained.  DOS defaults to "mono."
  12027. X
  12028. X    local term, tset_output
  12029. X
  12030. X    check_features()
  12031. X
  12032. X    if \isDOS then {
  12033. X        term := getenv("TERM") | "mono"
  12034. X    }
  12035. X    else {
  12036. X    if not (term := getenv("TERM")) then {
  12037. X        tset_output := open("/bin/tset -","pr") |
  12038. X        er("getname","can't find tset command",1)
  12039. X        term := !tset_output
  12040. X        close(tset_output)
  12041. X    }
  12042. X    }
  12043. X
  12044. X    return \term |
  12045. X    er("getname","can't seem to determine your terminal type",1)
  12046. X
  12047. Xend
  12048. X
  12049. X
  12050. X
  12051. Xprocedure er(func,msg,errnum)
  12052. X
  12053. X    # short error processing utility
  12054. X    write(&errout,func,":  ",msg)
  12055. X    exit(errnum)
  12056. X
  12057. Xend
  12058. X
  12059. X
  12060. X
  12061. Xprocedure getentry(name, termcap_string)
  12062. X
  12063. X    # "Name" designates the current terminal type.  Getentry() scans
  12064. X    # the current environment for the variable TERMCAP.  If the
  12065. X    # TERMCAP string represents a termcap entry for a terminal of type
  12066. X    # "name," then getentry() returns the TERMCAP string.  Otherwise,
  12067. X    # getentry() will check to see if TERMCAP is a file name.  If so,
  12068. X    # getentry() will scan that file for an entry corresponding to
  12069. X    # "name."  If the TERMCAP string does not designate a filename,
  12070. X    # getentry() will scan the termcap file for the correct entry.
  12071. X    # Whatever the input file, if an entry for terminal "name" is
  12072. X    # found, getentry() returns that entry.  Otherwise, getentry()
  12073. X    # fails.
  12074. X
  12075. X    local isFILE, f, getline, line, nm, ent1, ent2, entry
  12076. X    static slash, termcap_names
  12077. X    initial {
  12078. X    if \isDOS then {
  12079. X        slash := "\\"
  12080. X        termcap_names := ["termcap","termcap.dos","termcap2.dos"]
  12081. X    }
  12082. X    else {
  12083. X        slash := "/"
  12084. X        termcap_names := ["/etc/termcap"]
  12085. X    }
  12086. X    }
  12087. X
  12088. X
  12089. X    # You can force getentry() to use a specific termcap file by cal-
  12090. X    # ling it with a second argument - the name of the termcap file
  12091. X    # to use instead of the regular one, or the one specified in the
  12092. X    # termcap environment variable.
  12093. X    /termcap_string := getenv("TERMCAP")
  12094. X
  12095. X    if \isDOS then {
  12096. X    if \termcap_string then {
  12097. X        if termcap_string ? (
  12098. X         not ((tab(any(&letters)), match(":")) | match(slash)),
  12099. X         pos(1) | tab(find("|")+1), =name)
  12100. X        then {
  12101. X        # if entry ends in tc= then add in the named tc entry
  12102. X        termcap_string ?:= tab(find("tc=")) ||
  12103. X            # Recursively fetch the new termcap entry w/ name trimmed.
  12104. X            # Note that on the next time through name won't match the
  12105. X            # termcap environment variable, so getentry() will look for
  12106. X            # a termcap file.
  12107. X            (move(3), getentry(tab(find(":"))) ?
  12108. X             (tab(find(":")+1), tab(0)))
  12109. X        return termcap_string
  12110. X        }
  12111. X        else isFILE := 1
  12112. X    }
  12113. X    }
  12114. X    else {
  12115. X    if \termcap_string then {
  12116. X        if termcap_string ? (
  12117. X            not match(slash), pos(1) | tab(find("|")+1), =name)
  12118. X        then {
  12119. X        # if entry ends in tc= then add in the named tc entry
  12120. X        termcap_string ?:= tab(find("tc=")) ||
  12121. X            # Recursively fetch the new termcap entry w/ name trimmed.
  12122. X            (move(3), getentry(tab(find(":")), "/etc/termcap") ?
  12123. X             (tab(find(":")+1), tab(0)))
  12124. X        return termcap_string
  12125. SHAR_EOF
  12126. true || echo 'restore of iolib.icn failed'
  12127. fi
  12128. echo 'End of  part 2'
  12129. echo 'File iolib.icn is continued in part 3'
  12130. echo 3 > _shar_seq_.tmp
  12131. exit 0
  12132. -- 
  12133.  
  12134.    -Richard L. Goerwitz              goer%midway@uchicago.bitnet
  12135.    goer@midway.uchicago.edu          rutgers!oddjob!ellis!goer
  12136.  
  12137.  
  12138. From icon-group-sender  Sun Sep 13 01:28:56 1992
  12139. Received: by cheltenham.cs.arizona.edu; Sun, 13 Sep 1992 17:14:46 MST
  12140. Date: 13 Sep 92 01:28:56 GMT
  12141. From: cis.ohio-state.edu!pacific.mps.ohio-state.edu!linac!uchinews!ellis!goer@ucbvax.Berkeley.EDU  (Richard L. Goerwitz)
  12142. Organization: University of Chicago Computing Organizations
  12143. Subject: simple profiler
  12144. Message-Id: <1992Sep13.012856.26377@midway.uchicago.edu>
  12145. Sender: icon-group-request@cs.arizona.edu
  12146. To: icon-group@cs.arizona.edu
  12147. Status: R
  12148. Errors-To: icon-group-errors@cs.arizona.edu
  12149.  
  12150. Appended to this posting is part 1 of a three-part shell archive containing
  12151. a simple Icon profiler for UNIX.  I needed it to determine why a program I
  12152. wrote was running so slowly.  It's not extensively tested, but I thought I'd
  12153. post it, since I'd guess it would be the sort of thing a lot of people would
  12154. want.
  12155.  
  12156. -Richard
  12157.  
  12158. ---- Cut Here and feed the following to sh ----
  12159. #!/bin/sh
  12160. # This is a shell archive (produced by shar 3.49)
  12161. # To extract the files from this archive, save it to a file, remove
  12162. # everything above the "!/bin/sh" line above, and type "sh file_name".
  12163. #
  12164. # made 09/13/1992 01:04 UTC by goer@midway.uchicago.edu
  12165. # Source directory /u/richard/Profile
  12166. #
  12167. # existing files will NOT be overwritten unless -c is specified
  12168. # This format requires very little intelligence at unshar time.
  12169. # "if test", "cat", "rm", "echo", "true", and "sed" may be needed.
  12170. #
  12171. # This is part 1 of a multipart archive                                    
  12172. # do not concatenate these parts, unpack them in order with /bin/sh        
  12173. #
  12174. # This shar contains:
  12175. # length  mode       name
  12176. # ------ ---------- ------------------------------------------
  12177. #   9756 -r--r--r-- profile.icn
  12178. #  13556 -r--r--r-- itlib.icn
  12179. #  18055 -r--r--r-- iolib.icn
  12180. #   7164 -r--r--r-- iscreen.icn
  12181. #   1126 -rw-r--r-- Makefile.dist
  12182. #
  12183. if test -r _shar_seq_.tmp; then
  12184.     echo 'Must unpack archives in sequence!'
  12185.     echo Please unpack part `cat _shar_seq_.tmp` next
  12186.     exit 1
  12187. fi
  12188. # ============= profile.icn ==============
  12189. if test -f 'profile.icn' -a X"$1" != X"-c"; then
  12190.     echo 'x - skipping profile.icn (File already exists)'
  12191.     rm -f _shar_wnt_.tmp
  12192. else
  12193. > _shar_wnt_.tmp
  12194. echo 'x - extracting profile.icn (Text)'
  12195. sed 's/^X//' << 'SHAR_EOF' > 'profile.icn' &&
  12196. X############################################################################
  12197. X#
  12198. X#    Name:     profile.icn
  12199. X#
  12200. X#    Title:     simple Icon profiler for UNIX
  12201. X#
  12202. X#    Author:     Richard L. Goerwitz
  12203. X#
  12204. X#    Version: 1.3
  12205. X#
  12206. X############################################################################
  12207. X#
  12208. X#  This very simple profiler takes a single argument - an Icon program
  12209. X#  compiled with the -t option.  Displays stats on which procedures
  12210. X#  were called the most often, and from what lines in what files they
  12211. X#  were called.  Use this program to figure out what procedures are
  12212. X#  getting worked the hardest and why.  Counts only invocations and
  12213. X#  resumptions; not suspensions, returns, failures.
  12214. X#
  12215. X#  If you are running a program that reads from a file, be sure to
  12216. X#  protect the redirection symbol from the shell (i.e. "profile
  12217. X#  'myprog < input'" instead of "profile myprog < input").  If a given
  12218. X#  program normally reads &input, please redirect stdin to read from
  12219. X#  another tty than the one you are running profile from.  If you
  12220. X#  forget to do this, the results might be very interesting....  Also,
  12221. X#  don't redirect stderr, as this contains the trace that profile will
  12222. X#  be reading and using to obtain run-time statistics.  Profile
  12223. X#  automatically redirects stdout to /dev/null.
  12224. X#
  12225. X#  Currently runs only under UNIX, but with some tweaking could be
  12226. X#  made to run elsewhere as well.
  12227. X#
  12228. X#  The display should be pretty much self-explanatory.  Filenames and
  12229. X#  procedures get truncated at nineteen characters (if the display
  12230. X#  gets too wide, it can become hard to read).  A star is prepended to
  12231. X#  procedures whose statistics have changed since the last screen
  12232. X#  update.
  12233. X#
  12234. X############################################################################
  12235. X#
  12236. X#  Requires:  coexpressions, keyboard functions, pipes, UNIX
  12237. X#
  12238. X#  Links:  iolib or itlib, iscreen
  12239. X#
  12240. X############################################################################
  12241. X
  12242. X# link iscreen
  12243. Xglobal CM, LI, CO, CE
  12244. X
  12245. Xprocedure main(a)
  12246. X
  12247. X    local whitespace, firstidchars, idchars, usage, in_data,
  12248. X    cmd, line, filename, linenum, procname, t, threshhold
  12249. X
  12250. X    whitespace   := '\t '
  12251. X    firstidchars := &letters ++ '_'
  12252. X    idchars      := &digits ++ &letters ++ '_'
  12253. X    usage        := "usage:  profile filename _
  12254. X             (filename = Icon program compiled with -t option)"
  12255. X
  12256. X    #
  12257. X    # If called with a program name as the first argument, open it,
  12258. X    # and pipe the trace output back to this program.  Assume the
  12259. X    # user knew enough to compile it with the "-t" option.
  12260. X    #
  12261. X    if *a > 0 then {
  12262. X    if find("UNIX", &features) then {
  12263. X        cmd := ""; every cmd ||:= !a || " "
  12264. X        if find("2>"|"2>&1", cmd) then
  12265. X        stop("profile:  Please don't redirect stderr!")
  12266. X        in_data := open(cmd || " 2>&1 1> /dev/null", "pr") |
  12267. X        stop("profile:  Can't find or execute ", cmd, ".")
  12268. X    } else stop("profile:  Your OS is not (yet) supported.")
  12269. X    }
  12270. X    else stop(usage)
  12271. X
  12272. X    # clear screen, set up global variables; initialize table
  12273. X    setup_screen()
  12274. X    t := table()
  12275. X
  12276. X    threshhold := 0
  12277. X    while line := read(in_data) do {
  12278. X    threshhold +:= 1
  12279. X    #
  12280. X    # Break each line down into a file name, line number, and
  12281. X    # procedure name.
  12282. X    #
  12283. X    line ? {
  12284. X        tab(many(whitespace))
  12285. X        match(":") & next
  12286. X        { 
  12287. X        filename := trim(tab(find(":"))) &
  12288. X          tab(many(whitespace ++ ':')) &
  12289. X          linenum  := tab(many(&digits)) &
  12290. X          tab(many(whitespace ++ '|')) &
  12291. X          procname := tab(any(firstidchars)) || tab(many(idchars))
  12292. X        } | next
  12293. X        tab(many(whitespace))
  12294. X        # Count only invocations and resumptions.
  12295. X        match("suspended"|"failed"|"returned") & next
  12296. X    }
  12297. X
  12298. X    #
  12299. X    # Enter statistics into table.
  12300. X    #
  12301. X    /t[procname] := table()
  12302. X    /t[procname][filename] := table(0)
  12303. X     t[procname][filename][linenum] +:= 1
  12304. X
  12305. X    #
  12306. X    # Display stats interactively.
  12307. X    #
  12308. X    if threshhold > 50 then {
  12309. X        threshhold := 0
  12310. X        display_stats(t)
  12311. X    }
  12312. X    }
  12313. X
  12314. X    display_stats(t)
  12315. X    # Write a nice exit message.
  12316. X    goodbye()
  12317. X
  12318. Xend
  12319. X
  12320. X
  12321. X#
  12322. X# display_stats:  display the information in t interactively
  12323. X#
  12324. Xprocedure display_stats(t)
  12325. X
  12326. X    local l, input, c
  12327. X    static top, len, firstline
  12328. X    # sets global variables CM, LI, CO, and CE
  12329. X    initial {
  12330. X    top := 1
  12331. X    # The first line we can write data to on the screen.
  12332. X    firstline := 3
  12333. X    len := LI - 4 - firstline
  12334. X    }
  12335. X
  12336. X    #
  12337. X    # Structure the information in t into a list.  Note that to obtain
  12338. X    # the number of procedures, one must divide l in half.
  12339. X    #
  12340. X    l := sort_table(t)
  12341. X
  12342. X    #
  12343. X    # Check for user input.
  12344. X    #
  12345. X    while kbhit() do {
  12346. X    iputs(igoto(CM, 1, LI-1))
  12347. X    writes("Press j/k/^/$/p/q:  ")
  12348. X    iputs(CE)
  12349. X    writes(input := map(getch()))
  12350. X    case input of {
  12351. X        # Increase or decrease top by 4; don't go beyond 0 or
  12352. X        # *l; no even numbers for top (the 4 also must be even).
  12353. X        "j"    : top := (*l > (top+2) | *l-1)
  12354. X        "\r"   : top := (*l > (top+2) | *l-1)
  12355. X        "\n"   : top := (*l > (top+2) | *l-1)
  12356. X        "k"    : top := (0  < (top-2) | 1)
  12357. X        "\x02" : top := (0  < (top-4) | 1)
  12358. X        "\x15": top := (0  < (top-4) | 1)
  12359. X        " "    : top := (*l > (top+4) | *l-1)
  12360. X        "\x06" : top := (*l > (top+4) | *l-1)
  12361. X        "\x04" : top := (*l > (top+4) | *l-1)
  12362. X        "^"    : top := 1
  12363. X        "$"    : top := *l-1
  12364. X        "p"    : {
  12365. X        iputs(igoto(CM, 1, LI-1))
  12366. X        writes("Press any key to continue: "); iputs(CE)
  12367. X        until kbhit() & getch() do delay(500)
  12368. X        }
  12369. X            "q"    : goodbye()
  12370. X            "\x0C" : setup_screen()
  12371. X        "\x012": setup_screen()
  12372. X        default: {
  12373. X        if any(&digits, input) then {
  12374. X            while c := getche() do {
  12375. X            if c == ("\n"|"\r") then {
  12376. X                if not (input <:= 1) then
  12377. X                input +:= input % 2 - 1
  12378. X                top := (0  < input | 1)
  12379. X                top := (*l > input | *l-1)
  12380. X                break
  12381. X            } else {
  12382. X                if any(&digits, c)
  12383. X                then input ||:= c & next
  12384. X                else break
  12385. X            }
  12386. X            }
  12387. X        }
  12388. X        }
  12389. X    }
  12390. X    iputs(igoto(CM, 1, LI-1))
  12391. X    writes("Press j/k/^/$/p/q:  ")
  12392. X    iputs(CE)
  12393. X    }
  12394. X
  12395. X    #
  12396. X    # Display the information contained in table t via list l2.
  12397. X    #
  12398. X    write_list(l, top, len, firstline)
  12399. X    return
  12400. X
  12401. Xend
  12402. X
  12403. X
  12404. X#
  12405. X# sort_table:  structure the info in t into a list
  12406. X#
  12407. X#     What a mess.  T is a table, keys = procedure names, values =
  12408. X#     another table.  These other tables are tables where keys = file
  12409. X#     names and values = yet another table.  These yet other tables
  12410. X#     are structured as follows: keys = line numbers, values = number
  12411. X#     of invocations.  The idea is to collapse all of these tables
  12412. X#     into sorted lists, and at the same time count up the total
  12413. X#     number of invocations for a given procedure name (going through
  12414. X#     all its invocations at every line in every file).  A new table
  12415. X#     is then created where keys = procedure names and values = total
  12416. X#     number of invocations.  Yet another sort is done on the basis of
  12417. X#     total number of invocations.
  12418. X#
  12419. Xprocedure sort_table(t)
  12420. X
  12421. X    local t2, total_t, k, total, i, l, l2
  12422. X    static old_totals
  12423. X    initial old_totals := table()
  12424. X
  12425. X    t2 := copy(t)
  12426. X    total_t := table()
  12427. X    every k := key(t2) do {
  12428. X    t2[k] := sort(t2[k], 3)
  12429. X    total := 0
  12430. X    every i := 2 to *t2[k] by 2 do {
  12431. X        every total +:= !t2[k][i]
  12432. X        t2[k][i] := sort(t2[k][i], 3)
  12433. X    }
  12434. X    insert(total_t, k, total)
  12435. X    }
  12436. X    l2 := list(); l := sort(total_t, 4)
  12437. X    every i := 1 to *l-1 by 2 do {
  12438. X    push(l2, t2[l[i]])
  12439. X    if not (total_t[l[i]] <= \old_totals[l[i]]) then
  12440. X        l[i] := "*" || l[i]
  12441. X    push(l2, l[i])
  12442. X    }
  12443. X
  12444. X    old_totals := total_t
  12445. X    return l2
  12446. X
  12447. Xend
  12448. X
  12449. X
  12450. X#
  12451. X# write_list:  write statistics in the upper part of the screen
  12452. X#
  12453. Xprocedure write_list(l, top, len, firstline)
  12454. X
  12455. X    local   i, j, k, z, w
  12456. X    static  last_i
  12457. X    #global CM, CE
  12458. X    initial last_i := 2
  12459. X
  12460. X    # Arg1, l, is a sorted table of sorted tables of sorted tables!
  12461. X    # Firstline is the first line on the screen we can write data to.
  12462. X    #
  12463. X    i := firstline
  12464. X    iputs(igoto(CM, 1, i)); iputs(CE)
  12465. X    every j := top to *l by 2 do {
  12466. X    writes(left(l[j], 19, " "))
  12467. X    every k := 1 to *l[j+1]-1 by 2 do {
  12468. X        iputs(igoto(CM, 20, i))
  12469. X        writes(left(l[j+1][k], 19, " "))
  12470. X        every z := 1 to *l[j+1][k+1]-1 by 2 do {
  12471. X        iputs(igoto(CM, 40, i))
  12472. X        writes(left(l[j+1][k+1][z], 7, " "))
  12473. X        iputs(igoto(CM, 48, i))
  12474. X        writes(l[j+1][k+1][z+1])
  12475. X        if (i +:= 1) > (firstline + len) then
  12476. X            break break break
  12477. X        else iputs(igoto(CM, 1, i)) & iputs(CE)
  12478. X        }
  12479. X    }
  12480. X    }
  12481. X
  12482. X    # Clear the remaining lines down to the status line.
  12483. X    #
  12484. X    every w := i to last_i do {
  12485. X    iputs(igoto(CM, 1, w))
  12486. X    iputs(CE)
  12487. X    }
  12488. X    last_i := i
  12489. X
  12490. X    return
  12491. X
  12492. Xend
  12493. X
  12494. X
  12495. X#
  12496. X# setup_screen: clear screen, set up status line.
  12497. X#
  12498. Xprocedure setup_screen()
  12499. X
  12500. X    # global CM, LI, CO, CE
  12501. X    initial {
  12502. X    CM := getval("cm") |
  12503. X        stop("setup_screen:  No cm capability!")
  12504. X    LI := getval("li")
  12505. X    CO := getval("co")
  12506. X    CE := getval("ce")
  12507. X    # UNIX-specific command to disable character echo.
  12508. X    system("stty -echo")
  12509. X    }
  12510. X
  12511. X    clear()
  12512. X    iputs(igoto(CM, 1, 1))
  12513. X    emphasize()
  12514. X    writes(left(left("procedure name", 19, " ") ||
  12515. X        left("source file", 20, " ") ||
  12516. X        left("line", 8, " ") ||
  12517. X        "number of invocations/resumptions",
  12518. X        CO, " "))
  12519. X    normal()
  12520. X    status_line("- \"Profile,\" by Richard Goerwitz -")
  12521. X    iputs(igoto(CM, 1, LI-1))
  12522. X    writes("J or CR=down; k=up; ^=begin; $=end; p=pause; q=quit: ")
  12523. X    iputs(CE)
  12524. X
  12525. X    return
  12526. X
  12527. Xend
  12528. X
  12529. X#
  12530. X# goodbye: exit, say something nice
  12531. X#
  12532. Xprocedure goodbye()
  12533. X
  12534. X    # UNIX-specific command.
  12535. X    system("stty echo")
  12536. X
  12537. X    status_line("- \"Profile,\" by Richard Goerwitz -")
  12538. X    every boldface() | emphasize() | normal() |
  12539. X      boldface() | emphasize() | normal()
  12540. X    do {
  12541. X    delay(50)
  12542. X    iputs(igoto(CM, 1, LI-1))
  12543. X    writes("Hope you enjoyed using profile! ")
  12544. X    normal(); iputs(CE)
  12545. X    }
  12546. X    exit()
  12547. X
  12548. Xend
  12549. X
  12550. X
  12551. X#
  12552. X# stop_profile:  graceful exit after error
  12553. X# 
  12554. Xprocedure stop_profile(s)
  12555. X
  12556. X    # UNIX-specific command.
  12557. X    system("stty echo")
  12558. X
  12559. X    status_line("- \"Profile,\" by Richard Goerwitz -")
  12560. X    iputs(igoto(CM, 1, LI-1))
  12561. X    writes(s); iputs(CE)
  12562. X    iputs(igoto(CM, 1, LI))
  12563. X    stop()
  12564. X
  12565. Xend
  12566. SHAR_EOF
  12567. true || echo 'restore of profile.icn failed'
  12568. rm -f _shar_wnt_.tmp
  12569. fi
  12570. # ============= itlib.icn ==============
  12571. if test -f 'itlib.icn' -a X"$1" != X"-c"; then
  12572.     echo 'x - skipping itlib.icn (File already exists)'
  12573.     rm -f _shar_wnt_.tmp
  12574. else
  12575. > _shar_wnt_.tmp
  12576. echo 'x - extracting itlib.icn (Text)'
  12577. sed 's/^X//' << 'SHAR_EOF' > 'itlib.icn' &&
  12578. X########################################################################
  12579. X#    
  12580. X#    Name:    itlib.icn
  12581. X#    
  12582. X#    Title:    Icon termlib-type tools
  12583. X#    
  12584. X#    Author:    Richard L. Goerwitz
  12585. X#
  12586. X#    Version: 1.33
  12587. X#
  12588. X#########################################################################
  12589. X#
  12590. X#  I place this and future versions of itlib in the public domain - RLG
  12591. X#
  12592. X#########################################################################
  12593. X#
  12594. X#  The following library represents a series of rough functional
  12595. X#  equivalents to the standard Unix low-level termcap routines.  They
  12596. X#  are not meant as exact termlib clones.  Nor are they enhanced to
  12597. X#  take care of magic cookie terminals, terminals that use \D in their
  12598. X#  termcap entries, or, in short, anything I felt would not affect my
  12599. X#  normal, day-to-day work with ANSI and vt100 terminals.  There are
  12600. X#  some machines with incomplete or skewed implementations of stty for
  12601. X#  which itlib will not work.  See the BUGS section below for work-
  12602. X#  arounds.
  12603. X#
  12604. X#  Requires:  A unix platform & co-expressions.  There is an MS-DOS
  12605. X#  version, itlibdos.icn.
  12606. X#
  12607. X#  setname(term)
  12608. X#    Use only if you wish to initialize itermlib for a terminal
  12609. X#  other than what your current environment specifies.  "Term" is the
  12610. X#  name of the termcap entry to use.  Normally this initialization is
  12611. X#  done automatically, and need not concern the user.
  12612. X#
  12613. X#  getval(id)
  12614. X#    Works something like tgetnum, tgetflag, and tgetstr.  In the
  12615. X#  spirit of Icon, all three have been collapsed into one routine.
  12616. X#  Integer valued caps are returned as integers, strings as strings,
  12617. X#  and flags as records (if a flag is set, then type(flag) will return
  12618. X#  "true").  Absence of a given capability is signalled by procedure
  12619. X#  failure.
  12620. X#
  12621. X#  igoto(cm,destcol,destline) - NB:  default 1 offset (*not* zero)!
  12622. X#    Analogous to tgoto.  "Cm" is the cursor movement command for
  12623. X#  the current terminal, as obtained via getval("cm").  Igoto()
  12624. X#  returns a string which, when output via iputs, will cause the
  12625. X#  cursor to move to column "destcol" and line "destline."  Column and
  12626. X#  line are always calculated using a *one* offset.  This is far more
  12627. X#  Iconish than the normal zero offset used by tgoto.  If you want to
  12628. X#  go to the first square on your screen, then include in your program
  12629. X#  "iputs(igoto(getval("cm"),1,1))."
  12630. X#
  12631. X#  iputs(cp,affcnt)
  12632. X#    Equivalent to tputs.  "Cp" is a string obtained via getval(),
  12633. X#  or, in the case of "cm," via igoto(getval("cm"),x,y).  Affcnt is a
  12634. X#  count of affected lines.  It is only relevant for terminals which
  12635. X#  specify proportional (starred) delays in their termcap entries.
  12636. X#
  12637. X#  BUGS:  I have not tested these routines much on terminals that
  12638. X#  require padding.  These routines WILL NOT WORK if your machine's
  12639. X#  stty command has no -g option (tisk, tisk).  This includes 1.0 NeXT
  12640. X#  workstations, and some others that I haven't had time to pinpoint.
  12641. X#  If you are on a BSD box, try typing "sh -c 'stty -g | more'" it may
  12642. X#  be that your stty command is too clever (read stupid) to write its
  12643. X#  output to a pipe.  The current workaround is to replace every in-
  12644. X#  stance of /bin/stty with /usr/5bin/stty (or whatever your system
  12645. X#  calls the System V stty command) in this file.  If you have no SysV
  12646. X#  stty command online, try replaceing "stty -g 2>&1" below with, say,
  12647. X#  "stty -g 2>&1 1> /dev/tty."  If you are using mainly modern ter-
  12648. X#  minals that don't need padding, consider using iolib.icn instead of
  12649. X#  itlib.icn.
  12650. X#
  12651. X##########################################################################
  12652. X#
  12653. X#  Requires: UNIX, co-expressions
  12654. X#
  12655. X#  See also: iscreen.icn (a set of companion utilities), iolib.icn
  12656. X#
  12657. X##########################################################################
  12658. X
  12659. X
  12660. Xglobal tc_table, tty_speed
  12661. Xrecord true()
  12662. X
  12663. X
  12664. Xprocedure check_features()
  12665. X
  12666. X    local in_params, line
  12667. X    # global tty_speed
  12668. X
  12669. X    initial {
  12670. X    find("unix",map(&features)) |
  12671. X        er("check_features","unix system required",1)
  12672. X    find("o-expres",&features) |
  12673. X        er("check_features","co-expressions not implemented - &$#!",1)
  12674. X    system("/bin/stty tabs") |
  12675. X        er("check_features","can't set tabs option",1)
  12676. X    }
  12677. X
  12678. X    # clumsy, clumsy, clumsy, and probably won't work on all systems
  12679. X    tty_speed := getspeed()
  12680. X    return "term characteristics reset; features check out"
  12681. X
  12682. Xend
  12683. X
  12684. X
  12685. X
  12686. Xprocedure setname(name)
  12687. X
  12688. X    # Sets current terminal type to "name" and builds a new termcap
  12689. X    # capability database (residing in tc_table).  Fails if unable to
  12690. X    # find a termcap entry for terminal type "name."  If you want it
  12691. X    # to terminate with an error message under these circumstances,
  12692. X    # comment out "| fail" below, and uncomment the er() line.
  12693. X
  12694. X    #tc_table is global
  12695. X    
  12696. X    check_features()
  12697. X
  12698. X    tc_table := table()
  12699. X    tc_table := maketc_table(getentry(name)) | fail
  12700. X    # er("setname","no termcap entry found for "||name,3)
  12701. X    return "successfully reset for terminal " || name
  12702. X
  12703. Xend
  12704. X
  12705. X
  12706. X
  12707. Xprocedure getname()
  12708. X
  12709. X    # Getname() first checks to be sure we're running under Unix, and,
  12710. X    # if so, tries to figure out what the current terminal type is,
  12711. X    # checking successively the value of the environment variable
  12712. X    # TERM, and then the output of "tset -".  Terminates with an error
  12713. X    # message if the terminal type cannot be ascertained.
  12714. X
  12715. X    local term, tset_output
  12716. X
  12717. X    check_features()
  12718. X
  12719. X    if not (term := getenv("TERM")) then {
  12720. X    tset_output := open("/bin/tset -","pr") |
  12721. X        er("getname","can't find tset command",1)
  12722. X    term := !tset_output
  12723. X    close(tset_output)
  12724. X    }
  12725. X    return \term |
  12726. X    er("getname","can't seem to determine your terminal type",1)
  12727. X
  12728. Xend
  12729. X
  12730. X
  12731. X
  12732. Xprocedure er(func,msg,errnum)
  12733. X
  12734. X    # short error processing utility
  12735. X    write(&errout,func,":  ",msg)
  12736. X    exit(errnum)
  12737. X
  12738. Xend
  12739. X
  12740. X
  12741. X
  12742. Xprocedure getentry(name, termcap_string)
  12743. X
  12744. X    # "Name" designates the current terminal type.  Getentry() scans
  12745. X    # the current environment for the variable TERMCAP.  If the
  12746. X    # TERMCAP string represents a termcap entry for a terminal of type
  12747. X    # "name," then getentry() returns the TERMCAP string.  Otherwise,
  12748. X    # getentry() will check to see if TERMCAP is a file name.  If so,
  12749. X    # getentry() will scan that file for an entry corresponding to
  12750. X    # "name."  If the TERMCAP string does not designate a filename,
  12751. X    # getentry() will scan /etc/termcap for the correct entry.
  12752. X    # Whatever the input file, if an entry for terminal "name" is
  12753. X    # found, getentry() returns that entry.  Otherwise, getentry()
  12754. X    # fails.
  12755. X
  12756. X    local f, getline, line, nm, ent1, ent2
  12757. X
  12758. X    # You can force getentry() to use a specific termcap file by cal-
  12759. X    # ling it with a second argument - the name of the termcap file
  12760. X    # to use instead of the regular one, or the one specified in the
  12761. X    # termcap environment variable.
  12762. X    /termcap_string := getenv("TERMCAP")
  12763. X
  12764. X    if \termcap_string ? (not match("/"), pos(1) | tab(find("|")+1), =name)
  12765. X    then {
  12766. X    # if entry ends in tc= then add in the named tc entry
  12767. X    termcap_string ?:= tab(find("tc=")) ||
  12768. X        # Recursively fetch the new termcap entry w/ name trimmed.
  12769. X        (move(3), getentry(tab(find(":")), "/etc/termcap") ?
  12770. X         (tab(find(":")+1), tab(0)))
  12771. X    return termcap_string
  12772. X    }
  12773. X    else {
  12774. X
  12775. X    # The logic here probably isn't clear.  The idea is to try to use
  12776. X    # the termcap environment variable successively as 1) a termcap en-
  12777. X    # try and then 2) as a termcap file.  If neither works, 3) go to
  12778. X    # the /etc/termcap file.  The else clause here does 2 and, if ne-
  12779. X    # cessary, 3.  The "\termcap_string ? (not match..." expression
  12780. X    # handles 1.
  12781. X
  12782. X    if find("/",\termcap_string)
  12783. X    then f := open(termcap_string)
  12784. X    /f := open("/etc/termcap") |
  12785. X        er("getentry","I can't access your /etc/termcap file",1)
  12786. X
  12787. X    getline := create read_file(f)
  12788. X    
  12789. X    while line := @getline do {
  12790. SHAR_EOF
  12791. true || echo 'restore of itlib.icn failed'
  12792. fi
  12793. echo 'End of  part 1'
  12794. echo 'File itlib.icn is continued in part 2'
  12795. echo 2 > _shar_seq_.tmp
  12796. exit 0
  12797. -- 
  12798.  
  12799.    -Richard L. Goerwitz              goer%midway@uchicago.bitnet
  12800.    goer@midway.uchicago.edu          rutgers!oddjob!ellis!goer
  12801.  
  12802.  
  12803.