home *** CD-ROM | disk | FTP | other *** search
/ ftp.cs.arizona.edu / ftp.cs.arizona.edu.tar / ftp.cs.arizona.edu / icon / newsgrp / group87.txt < prev    next >
Internet Message Format  |  1988-10-29  |  282KB

  1. From ralph  Sat Jan 24 16:52:26 1987
  2. From: "Ralph Griswold" <ralph>
  3. To: icon-group
  4. Subject: Book on the implementation of Icon
  5. Status: RO
  6.  
  7. The book on the implementation of the Icon programming language been published.
  8. It corresponds to Version 6 of Icon, which is currently running on UNIX, VMS,
  9. and MS-DOS computers.  The book concentrates on the run-time system and
  10. describes data structures, the Icon virtual machine, the interpreter,
  11. how generators work, and the techniques for storage allocation and garbage
  12. collection. Its appendices include information on modifying and extending the
  13. implementation.
  14.  
  15. The publication information is:
  16.  
  17.     title: The Implementation of the Icon Programming Language
  18.     authors: Ralph E. Griswold and Madge T. Griswold
  19.     publisher: Princeton University Press
  20.     ISBN 0-691-08431-9
  21.     Hardbound, 336 pages, $39.50.
  22.  
  23. The book may be ordered from local bookstores or directly from the publisher:
  24.  
  25.     Princeton University Press
  26.     3175 Princeton Pike
  27.     Lawrenceville, NJ   08648
  28.  
  29.     (609) 896-1344
  30.  
  31. There is no shipping charge for orders sent fourth class. UPS delivery
  32. is available for a small additional charge that depends on the destination.
  33. There is sales tax of 6.5% in California and 6% in New Jersey.
  34.  
  35. Note: This book is not available from the Icon Project.
  36.  
  37. From wyle%ifi.ethz.chunet@RELAY.CS.NET  Fri Jan 30 08:52:35 1987
  38. From: Wyle <wyle%ifi.ethz.chunet@RELAY.CS.NET>
  39. To: Icon-Group%Arizona.csnet%ifi.ethz.chunet@RELAY.CS.NET
  40. Mmdf-Warning:  Parse error in original version of preceding line at SWITZERLAND.CSNET
  41. Cc: Icon-Project%Arizona.csnet%ifi.ethz.chunet@RELAY.CS.NET
  42. Subject: icon programming
  43. Status: RO
  44.  
  45. I have a student project under design here in which
  46. a palatte of icons will be developed for higher level
  47. modules in a visual information retrieval system.
  48.  
  49. I am interested in your mailing list.  Can you send
  50. more information?
  51. --
  52.                       M i t c h e l l     F     W y l e
  53.  
  54.     EEEEE TTTTTT H   H  Eidgenoessische      | wyle%ifi.ethz.chunet@csnet-relay
  55.    E       T    H   H  Technische Hochschule | wyle@ethz.uucp
  56.   EEEE    T    HHHHH  Zuerich                | ...!cernvax!ethz!wyle
  57.  E       T    H   H  Institut fuer Informatik| Telephone: 011 41 1 256 5235 
  58. EEEEE   T    H   H  8092 Zuerich, Switzerland| "Ignore alien orders"
  59.  
  60. From ralph  Mon Feb  9 14:26:13 1987
  61. From: "Ralph Griswold" <ralph>
  62. To: icon-group@arizona.edu
  63. Subject: Status of icon-group
  64. Status: RO
  65.  
  66. Several years ago we set up icon-group as a mail-redistribution
  67. system whereby addressees on a list kept at the University of
  68. Arizona could recieve electronic mail about the Icon programming
  69. language and in turn have their mail to icon-group redistributed to
  70. others on the list.
  71.  
  72. The idea was to encourage the exchange of information. Historically,
  73. most of the mail has originated at the University of Arizona and has
  74. consisted mostly of announcements. Relatively few messages have come in
  75. from outside the University of Arizona for redistribution.
  76.  
  77. Last July a mail-server bug caused some addressees to receive
  78. multiple copies of the same message. Since this was a comparatively
  79. serious problem, we disconnected icon-group service.  We now have a
  80. a way around for the problem.
  81.  
  82. However, the usefulness of icon-group depends on the active participation
  83. of its members. Let us hear from you. If you have questions, ask.
  84. If you have problems with programming in Icon, try icon-group; perhaps
  85. someone can help.
  86.  
  87. For reference, here are the relevant addresses:
  88.  
  89.     icon-project@arizona.edu    mail just to the Icon Project
  90.     icon-group@arizona.edu        mail for redistribution icon-group list
  91.     icon-group-request@ariona.edu    requests to be added to icon-group
  92.  
  93. From naucse!sbw  Mon Feb  9 16:29:03 1987
  94. From: naucse!sbw (Steve Wampler)
  95. To: arizona!icon-group
  96. Subject: formatting (shudder) in Icon
  97. Status: RO
  98.  
  99.  
  100. I'm looking for nice ways to format floating point numbers in Icon.
  101. Something along the lines of:
  102.  
  103.    write(format(x,"5.2"))
  104.  
  105. or
  106.  
  107.    Write("f5.2  f5.2",x,y)
  108.  
  109. say.  Any ideas are welcome, as are other approaches.  However, I
  110. am not particularly interested in FORTRAN- (or C-)style solutions.
  111.  
  112.     -Steve Wampler
  113.  
  114. From amdcad!bandy@decwrl.DEC.COM  Tue Feb 10 00:23:43 1987
  115. From: amdcad!bandy@decwrl.DEC.COM (Andy Beals)
  116. To: icon-group@arizona.edu
  117. Subject: status of icon group
  118. Status: RO
  119.  
  120. >From amdcad!bandy@decwrl.DEC.COM Mon Feb  9 16:48:20 1987
  121. To: ralph@arizona.edu
  122. Subject: Re:  Status of icon-group
  123.  
  124. I admit it!  I haven't been using icon at all - I haven't written
  125. a single line of code - I'm wasting my time working on a portable c-based
  126. snobol4 interpreter.  Ouch!  Hit me hit me!
  127.  
  128. Seriously though, I think that one of the reasons that the icon-group hasn't
  129. gotten much traffic is because there are very few people using it -- imagine
  130. how it would be if Icon got the publicity and coverage (in cs courses (they're
  131. still teaching snobol in every computing languages survey course I've seen!)
  132. as well as useful / fun programs posted to the net) that say (ugh) Modula2
  133. has.  
  134.  
  135. How does the current vax (or sun) implementation of icon compare to awk
  136. in terms of speed when you use it for reading and decoding uucp LOGFILES
  137. or netnews' log file?  I think that if you could take Erik Fair's popular
  138. scripts that do just these things and convert them to Icon and show that
  139. they're faster than the scripts in awk, I'm sure that you could get a lot
  140. of system-hacker types interested -- I still manage to write a coupld little
  141. awk programs a month, again mostly state-machine file summarizers.
  142.  
  143. ramble ramble ramble
  144. andy
  145.  
  146.  
  147.  
  148.  
  149. From ralph  Tue Feb 10 04:31:57 1987
  150. From: "Ralph Griswold" <ralph>
  151. To: icon-group@arizona.edu
  152. Subject: Icon for the Atari ST
  153. Status: RO
  154.  
  155. O. Rick Fonorow and Jerry D. Nowlin report that they have completed
  156. an implementation of Version 6.3 of Icon for the Atari ST computer family.
  157.  
  158. The Lattice C compiler was used for the port (giving 32-bit ints). This
  159. version takes all available memory, but uses fixed-sized regions for Icon's
  160. data.  It will run on the 520ST with no other programs (i.e. desk
  161. accessories) resident.
  162.  
  163. This implementation is available on the Atari Base BBS: (408) 745-4758.
  164.  
  165. From @po3.andrew.cmu.edu:mss#@andrew.cmu.edu  Tue Feb 10 06:56:17 1987
  166. X-Trace: MS Version 3.21 on ibm032 host westchester, by mss (1342).
  167. From: mss#@andrew.cmu.edu (Mark Steven Sherman)
  168. To: icon-group@arizona.edu
  169. Subject: Use in CS classes
  170. Cc: amdcad!bandy@decwrl.DEC.COM
  171. Status: RO
  172.  
  173. It may have been a while since you were in a comparative languages course. I
  174. taught it several times at Dartmouth and we used Icon, not Snobol, and one of
  175. the three sections of it here at CMU is also using Icon (the other two are
  176. using neither Icon nor Snobol). I think you overestimate the fall-out of
  177. usage from these classes of any language. A language gets used by undergrads
  178. when their part-time workstudy employer tells them to use it.
  179.                 -Mark
  180.  
  181.  
  182.  
  183. From shafto@nprdc.arpa  Tue Feb 10 10:12:06 1987
  184. From: shafto@nprdc.arpa
  185. Reply-To: shafto@nprdc.arpa
  186. To: icon-group@arizona.edu
  187. Subject: reads(&input,1) under MSDOS Icon
  188. Status: RO
  189.  
  190.  
  191. Using SNOBOL4+ under MSDOS, I can define keyboard input
  192. to be "R,B,Q,1" = Read, Binary, Quiet, 1-character,
  193. and I have 1-character input from the keyboard, without echo,
  194. which is useful for control characters, function keys, etc.,
  195. in interactive programs.
  196.  
  197. In Icon under MSDOS, I try to get the same effect by asking
  198. for the result of reads(&input,1), but I do NOT get the
  199. same effect.  reads() waits for a CR.
  200.  
  201. Is anyone else bothered by this problem, and better
  202. yet, has anyone fixed it?
  203.  
  204. (You can use the ANSI.SYS-dependent key-redefinition to make
  205. control- and function-keys generate a code followed by
  206. a CR, but this is inelegant.)
  207.  
  208. Mike Shafto
  209. shafto@nprdc
  210. Office of Naval Research, Code 1142CS
  211. 800 N. Quincy St.
  212. Arlington, VA   22217-5000
  213. 202/696-4596
  214.  
  215.  
  216. From ralph  Tue Feb 10 10:20:48 1987
  217. From: "Ralph Griswold" <ralph>
  218. To: icon-group@arizona.edu
  219. Subject: reading single characters in MS-DOS Icon
  220. Status: RO
  221.  
  222. In response to Mike Shafto's query, there are a number of extensions to
  223. MS-DOS Icon that are in the works to solve this problem and in general
  224. give the MS-DOS programmer access to almost anything from the Icon
  225. source level.
  226.  
  227. I'm not sure how long it will take to get these completed, tested,
  228. documented, and packaged for distribution. Perhaps a month.
  229.  
  230. I'll try to get a preliminary description of what's in the works
  231. out to icon-group within a week.
  232.  
  233.     Ralph Griswold
  234.  
  235. From naucse!sbw  Tue Feb 10 10:47:24 1987
  236. From: naucse!sbw (Steve Wampler)
  237. To: arizona!mss#@andrew.cmu.edu
  238. Subject: Re:  Use in CS classes
  239. Cc: arizona!icon-group
  240. Status: RO
  241.  
  242. I agree.  My feeling is that the way to increase the popularity of Icon
  243. is by distributing some really useful programs that also show off the
  244. power of the language.  Icon-group could help do this.
  245.  
  246. From SARASWAT@C.CS.CMU.EDU  Tue Feb 10 14:25:54 1987
  247. From: vijay <Vijay.Saraswat@C.CS.CMU.EDU>
  248. Subject: Increasing the popularity of ICON
  249. To: icon-group@arizona.edu
  250. Cc: Vijay.Saraswat@C.CS.CMU.EDU
  251. Status: RO
  252.  
  253. Or have some country like S.Korea pick it up as the basis for their 
  254. Next Generation Software Miracle! :-)
  255. -------
  256.  
  257. From notkin@timor.cs.washington.edu  Tue Feb 10 16:29:01 1987
  258. To: icon-group@arizona.edu
  259. Cc: amdcad!bandy@DECWRL.dec.com, wgg@timor.cs.washington.edu
  260. Subject: icon in courses
  261. From: David Notkin <notkin@timor.cs.washington.edu>
  262. Status: RO
  263.  
  264. Here at the University of Washington we also teach Icon as part of a
  265. junior-level comparative languages class (this year, the other languages we
  266. are teaching are Lisp, Prolog, and Smalltalk).  It's at least the fourth
  267. quarter we are using Icon in this course.
  268.  
  269. David
  270.  
  271. From whm  Thu Feb 12 13:45:56 1987
  272. From: "Bill Mitchell" <whm>
  273. To: icon-group
  274. Subject: Re:  formatting (shudder) in Icon
  275. In-Reply-To: <8702092256.AA17254@naucse>
  276. Status: RO
  277.  
  278. I think that Icon's output facilities are really weak with respect to
  279. the rest of the language -- all there is a function that concatenates
  280. a bunch of strings and prints the result.  Purists will no doubt cringe,
  281. but I think that C's printf is vastly more usable.  For a couple of large
  282. projects in Icon I added a C function called format that was really just a
  283. front-end to printf's internal routine doprnt, which really does the work.
  284.  
  285. To wit:
  286.  
  287.     format(s, x1, ... xn)
  288.  
  289. Returns a string produced by formatting the values x1-xn according the
  290. printf-style specification s.
  291.  
  292. For example,
  293.  
  294.     write(format("i = %d, hex: %x, octal: %o", i, i, i))
  295.  
  296.  
  297. From ralph  Thu Feb 12 15:30:30 1987
  298. From: "Ralph Griswold" <ralph>
  299. To: icon-group@arizona.edu
  300. Subject: Formatting (shudder)
  301. Status: RO
  302.  
  303.  
  304. I wouldn't argue that a printf-like facility in Icon would not be
  305. useful.  However, from a language-design viewpoint, I'd rather see
  306. something at a higher level. In fact, the real problem is not
  307. just output formatting, but the synthesis of strings (witness the
  308. usefulness of sprintf in C).
  309.  
  310. I've thought about abstractions for synthesis comparable to the
  311. pattern abstractions for analysis. It's possible to formulate some
  312. of these in Icon itself, much in the fashion that string scanning
  313. and pattern matching can be formulated in Icon to model the built-in
  314. facilities.
  315.  
  316. However, while you can argue that analysis and synthesis should be
  317. treated symmetrically, it seems there are many more problems that
  318. require string analysis than there are that require string synthesis.
  319. Hence, it is hard to justify such an elaborate mechanism for synthesis.
  320.  
  321. Of course, if high-level analysis and synthesis could be unified ...
  322.  
  323. From @po3.andrew.cmu.edu:mss#@andrew.cmu.edu  Thu Feb 12 17:47:41 1987
  324. X-Trace: MS Version 3.21 on ibm032 host cmu-ws-ardara, by mss (1342).
  325. From: mss#@andrew.cmu.edu (Mark Steven Sherman)
  326. To: icon-group@arizona.edu
  327. Subject: MacIcon
  328. Status: RO
  329.  
  330.  
  331. I think purely by coincidence, the Usenet Macintosh newsgroup started
  332. discussing Icon on the Mac. Last I heard, someone was working on it, but I
  333. never heard of a release being available from Arizona or anywhere else (there
  334. was a suggestion to check on Sumex, which I will do). What is the current
  335. status of Icon on the Macintosh?
  336.  
  337.  
  338.  
  339. From ralph  Thu Feb 12 18:02:36 1987
  340. From: "Ralph Griswold" <ralph>
  341. To: icon-group@arizona.edu
  342. Subject: Icon for the Macintosh
  343. Status: RO
  344.  
  345. In response to Mark Steven Sherman's query about Icon for the Macintosh:
  346.  
  347. Funny you should ask, as they say; I was preparing an announcement.
  348. Here it is:
  349.  
  350. Bob Alexander has completed an implementation of Version 6 of Icon that runs
  351. under MPW.  It is not a stand-alone application; MPW is required.
  352.  
  353. It is a large-memory model implementation that requires at least a 512K Mac.
  354.  
  355. This implementation is in the public domain and eventually will be
  356. available from a variety of sources.  We will provide a copy along
  357. with printed documentation for $15, payable to the University of
  358. Arizona.  Add $5 for air mail delivery outside the United States and
  359. Canada.
  360.  
  361. Source code and the Icon program library will be available at a later date.
  362.  
  363. Please note: MPW is *required* to run this application. MPW is
  364. a window-oriented development system available exclusively through
  365.  
  366.     Apple Developer's and Programmer's Association
  367.     290 SW 43rd Street
  368.     Renton, WA   98055
  369.  
  370.     (206) 251-6548
  371.  
  372. The fee to join APDA is $20 and MPW costs $150.  There also is a C
  373. compiler, but it is not needed to run Icon.
  374.  
  375. From ralph  Thu Feb 12 18:44:13 1987
  376. From: "Ralph Griswold" <ralph>
  377. To: icon-group@arizona.edu
  378. Subject: Our Postal Mailing Address
  379. Status: RO
  380.  
  381. It only occurred to me after sending information on getting
  382. Icon for the Macintosh from us that some of you may not
  383. know our postal address.  In fact, it recently has acquired
  384. an adornment, courtesy of the relocation of our department
  385. to a newly constructed building.  Here's the best address:
  386.  
  387.     Icon Project
  388.     Department of Computer Science
  389.     Gould-Simpson Science Building
  390.     The University of Arizona
  391.     Tuscon, AZ   87521
  392.  
  393. Our telephone number remains the same:  (602) 621-6613
  394.  
  395. From gus@shasta.stanford.edu  Thu Feb 12 22:11:44 1987
  396. From: Gus Fernandez <gus@shasta.stanford.edu>
  397. Subject: Re:  Icon for the Macintosh
  398. To: icon-group@arizona.edu, ralph@arizona.edu
  399. Status: RO
  400.  
  401.  
  402.  
  403. From gus@shasta.stanford.edu  Thu Feb 12 22:12:05 1987
  404. From: Gus Fernandez <gus@shasta.stanford.edu>
  405. Subject: Re:  Icon for the Macintosh
  406. To: icon-group@arizona.edu, ralph@arizona.edu
  407. Status: RO
  408.  
  409.  
  410.  
  411. From gus@shasta.stanford.edu  Thu Feb 12 22:29:08 1987
  412. From: Gus Fernandez <gus@shasta.stanford.edu>
  413. Subject: 8 queens revisited.
  414. To: icon-group@arizona.edu
  415. Status: RO
  416.  
  417. Hello, I am new to this group, and to ICON, but I would like to discuss two
  418. objecttions which I have to the "8 queeens" problem implementation which 
  419. appears on page 153 of Griswold's book. As a refresher, here it is...
  420.  
  421. procedure main()
  422.    every write(q(1),q(2),q(3),q(4),q(5),q(6),q(7),q(8))
  423. end
  424.  
  425. procedure q(c)
  426.    suspend place(1 to 8,c)            # Look for a row
  427. end
  428.  
  429. procedure place(r,c)
  430.    static up,down,row
  431.    initial {
  432.       up:= list(15,0)
  433.       down := list(15,0)
  434.       row := list(8,0)
  435.       }
  436.    if row[r] = down[r+c-1] = up[8+r-c] = 0
  437.    then suspend row[r] <- down[r+c-1] <-
  438.      up[8+r-c] <- r                    # Place if free
  439. end
  440.  
  441. My first objection seems to be the necessity of having to explicitly invoke
  442. q() 8 times in the main() procedure. Just typing every q(1 to 8) does not work
  443. since q(1) immediately succeeds after placing the first queen. Perhaps what I
  444. want is a more general itterator which applies the output of a generator to
  445. a co-expression and backtracks when necessary. How would one write something 
  446. like that in ICON?
  447.  
  448. My second objection is to the use of static variables in the place routine. I
  449. may have just answered my own question. Make an instance of place into a co-
  450. expression, and use it instead of the static variables, but I will have
  451. to try it out to see if it works. Does anyone have an elegant way of having
  452. two or more queens sequences active, and being able to call on either one to
  453. get the next valid queen configuration for that list? This seems easy in a 
  454. language like smalltalk, but I am convinced that with little work, it should
  455. be possible in ICON as well
  456.  
  457.                             Gus Fernandez
  458.  
  459. From icon-group-request  Fri Feb 13 17:41:49 1987
  460. From: "Bill Mitchell" <whm>
  461. To: icon-group
  462. Subject: Testing Icon-Group
  463. Errors-To: icon-group-request
  464. Status: RO
  465.  
  466. This test should be local only -- my apologies if it goes further.
  467.  
  468. From icon-group-request  Fri Feb 13 18:04:23 1987
  469. From: "Bill Mitchell" <whm>
  470. To: icon-group
  471. Subject: mailer improvements
  472. Errors-To: icon-group-request
  473. Status: RO
  474.  
  475. We've made some changes in the local processing of the list that will
  476. hopefully cause failed mail to be redirected back to the icon-group-request
  477. address rather than going to the sender of the particular message.
  478.  
  479. If you send a message after today (2/13) and get back failed mail from it,
  480. we'd appreciate it if you'd forward the failed messages to icon-group-request.
  481.  
  482. From ralph  Sat Feb 14 15:38:01 1987
  483. From: "Ralph Griswold" <ralph>
  484. To: icon-group@arizona.edu
  485. Subject: N Queens
  486. Errors-To: icon-group-request
  487. Status: RO
  488.  
  489. As a partial response to Gus Fernandez' query about the n-queens problem,
  490. here is a version from the Icon program library that approaches the
  491. situation a little differently from the approach in the Icon book (which
  492. is designed to illustrate goal-directed evaluation and data backtracking,
  493. rather than the issues Gus Fernandez raised):
  494. =========================================================================
  495. #    QUEENS
  496. #
  497. #    Solutions to n nonattacking queens
  498. #
  499. #    Stephen B. Wampler
  500. #
  501. #    Last modified 8/14/84
  502. #
  503.  
  504. global n, solution
  505.  
  506. procedure main(args)
  507.    local i
  508.    n := args[1] | 6        # 6 queens by default
  509.    if not(0 < integer(n)) then stop("usage [ n ]")
  510.    solution := list(n)        # ... and a list of column solutions
  511.    write(n,"-Queens:")
  512.    every q(1)            # start by placing queen in first col.
  513. end
  514.  
  515. # q(c) - place a queen in column c.
  516. #
  517. procedure q(c)
  518.    local r
  519.    static up, down, rows
  520.    initial {
  521.       up := list(2*n-1,0)
  522.       down := list(2*n-1,0)
  523.       rows := list(n,0)
  524.       }
  525.    every 0 = rows[r := 1 to n] = up[n+r-c] = down[r+c-1] &
  526.       rows[r] <- up[n+r-c] <- down[r+c-1] <- 1        do {
  527.          solution[c] := r    # record placement.
  528.          if c = n then show()
  529.          else q(c + 1)        # try to place next queen.
  530.          }
  531. end
  532.  
  533. # show the solution on a chess board.
  534. #
  535. procedure show()
  536.    static count, line, border
  537.    initial {
  538.       count := 0
  539.       line := repl("|   ",n) || "|"
  540.       border := repl("----",n) || "-"
  541.       }
  542.    write("solution: ", count+:=1)
  543.    write("  ", border)
  544.    every line[4*(!solution - 1) + 3] <- "Q" do {
  545.       write("  ", line)
  546.       write("  ", border)
  547.       }
  548.    write()
  549. end
  550.  
  551. From icon-group-request  Sun Feb 15 00:27:18 1987
  552. Return-Path: <kinner@wsu>
  553. From: Bill Kinnersley  <kinner%wsu.csnet@RELAY.CS.NET>
  554. To: icon-group@arizona.edu
  555. Errors-To: icon-group-request
  556. Status: RO
  557.  
  558.  
  559.  
  560. Well OK, Ralph.  I too would like to see more active discussion of
  561. Icon in this group.  Let me help to start the ball rolling.
  562.  
  563. I am certainly not an Icon expert.  I have been fascinated with the
  564. language for the past two years, and I taught it to my class in
  565. Programming Language Design.  What puzzles me is how little I use
  566. it.  Our conclusion in class was that Icon was much more in the 
  567. experimental stage than Smalltalk, Prolog, etc.
  568.  
  569. According to the book, Icon is good for string processing, quick
  570. one-shot programs, and heuristic solutions to complex problems.
  571. In other words, AI.
  572.  
  573. From an internal point of view, surely the central feature of the
  574. language is generators.  Most of the cost of Icon implementation
  575. must be allowing each and every expression to be a generator.  One
  576. needs to ask, therefore, whether that feature is worth the cost.
  577.  
  578. From my own ignorant and biased perspective, let's list some good
  579. points and some bad...
  580.  
  581. Syntax - I find the syntax natural, and the innovations particularly
  582.     appealing.  :=: and "break break" should be in every language.
  583.  
  584. Csets - No use for this, myself.
  585.  
  586. Lists - One of Icon's best aspects.  Much easier to use than Lisp.
  587.     I do get confused between get(), put(), push(), and pop().  My
  588.     impression is that many of the things that used to be done using
  589.     string manipulation are better done with lists anyway.
  590.  
  591. Implicit type conversion - not such a great idea.  Mainly it's the
  592.     conversion to and from strings that's unusual, and I'd 
  593.     rather do it explicitly when I really need to.
  594.  
  595.     Typelessness of variables has an unpleasant side effect--
  596.     It puts the burden on the operators to decide the type of an
  597.     outcome, and as a result there are FAR TOO MANY operators.
  598.     Mentioning ~===:= to the class is always good for a giggle.
  599.  
  600. Procedure invocation - again very nicely done.
  601.  
  602. Generators - outside the string-search context, I find it a little
  603.     hard to explain what these are, and what they're good for.
  604.  
  605.     Me: "Well, they're like a generalized for loop.  Suppose you
  606.       didn't want to just go 1, 2, 3, ... say, but for every number
  607.       obeying some complicated condition..."
  608.     Student: "Well then, I'd use a while loop, and write a subroutine
  609.       with some static variables, and I'd just keep calling that to
  610.       get the next number."
  611.     Me: "Yes, but this is cleaner conceptually.  And more general.
  612.       And you can write your own generators...and, uh, in fact they
  613.       look just like subroutines, only they suspend."
  614.     (Student stares at me, and whispers something to his neighbor.
  615.      Other student smiles and nods his head.)
  616.  
  617.     Seriously, as the heart and soul of Icon, generators need a strong
  618.     sales push.  Do they really open up new worlds, or are they
  619.     rarely used and easy to simulate?  Go through a book on algorithms
  620.     and count how many times a generator would come in handy.
  621.  
  622. Backtracking - this is great!  One of the real reasons for choosing
  623.     Icon to program in.  The Eight Queens problem deserves its place
  624.     on the cover, and it's not too hard to produce other examples
  625.     which are equally impressive.
  626.  
  627. Suggestion: Here's a common situation that needs to be handled better.
  628.     Where it says
  629.  
  630.        write (q(1), q(2), q(3), q(4), q(5), q(6), q(7), q(8))
  631.  
  632.     Remember that?   This is a trick we use to get the q's to mutually 
  633.     succeed.  Or, we could have used q(1) & q(2) & ...  This does come
  634.     up a lot, and it can get out of hand pretty quickly if there are more
  635.     than 8 items.  Maybe what we need is a new construct:
  636.  
  637.        all q(1 to 8)
  638.  
  639. Summary - We teach that a well designed programming language is more
  640.     than a collection of useful features.  It must have a uniform
  641.     syntax, an easily-expressed purpose and philosophy, and a set of
  642.     features which are consistent, powerful, and thrifty.  Often as not,
  643.     a language can be improved by removing features, not just adding.
  644.  
  645.     Object-oriented languages are all the rage these days.  People are
  646.     diligently putting objects into Pascal, C, Lisp, etc.  For heavens
  647.     sakes, don't anyone try to do that to Icon!
  648.  
  649.  
  650.  
  651. From mark  Sun Feb 15 09:41:19 1987
  652. From: "Mark L. Langley" <mark>
  653. To: icon-group@arizona.edu, kinner%wsu.csnet@RELAY.CS.NET
  654. Subject: Kinnersley Comments
  655. In-Reply-To: <8702150726.AA24707@arizona.arizona.edu>
  656. Errors-To: icon-group-request
  657. Status: RO
  658.  
  659. I enjoyed the comments of Bill Kinnersley.  I would like to add
  660. to them with my own perspective remarks...
  661.     
  662.     According to the book, Icon is good for string processing, quick
  663.     one-shot programs, and heuristic solutions to complex problems.
  664.     In other words, AI.
  665.     
  666.     >From an internal point of view, surely the central feature of the
  667.     language is generators.  Most of the cost of Icon implementation
  668.     must be allowing each and every expression to be a generator.  One
  669.     needs to ask, therefore, whether that feature is worth the cost.
  670.  
  671. My experience is that the central feature or the language is data structures
  672. and the unique control mechanisms exist to manipulate them with idiomatic
  673. operations!  I acknowledge that generators-in-a-vacuum seem kind of odd.
  674. But the key is that I always use generators with something particular in
  675. mind.  For example emumerating the elements of a list or string with '!'.
  676. The non-icon way of enumerating the elements of some data structure is
  677. by producing successive subscripts or dereferencing consecutive pointers.
  678. In Icon, you just say
  679.     every i := !Thing do
  680.        do_something(i)
  681. Thus one can eliminate the subscript-scaffolding present in other flavors of
  682. solutions.
  683.  
  684. The word-parsing programs in the book are another good example.  You just
  685. want to say -- "Yea, I figured out how to get the first one, you go
  686. get the next one..."
  687.  
  688.     Csets - No use for this, myself.
  689.  
  690. The key to Csets is that most string-functions take a cset as an
  691. argument.  They simply represent a character class in pattern matching,
  692. I've found.
  693.     
  694.     Implicit type conversion - not such a great idea.  Mainly it's the
  695.         conversion to and from strings that's unusual, and I'd 
  696.         rather do it explicitly when I really need to.
  697.     
  698.         Typelessness of variables has an unpleasant side effect--
  699.         It puts the burden on the operators to decide the type of an
  700.         outcome, and as a result there are FAR TOO MANY operators.
  701.         Mentioning ~===:= to the class is always good for a giggle.
  702.     
  703. Interesting point.  As for the string-to-number property,
  704. It is nice to be able to read something in and have it 
  705. be added to at the same time.  It would be nice if you
  706. could trap errors though, rather than have to check explicitly in advance...
  707.    ie
  708.     t := 0
  709.     while (t +:= read())
  710.     write (t)
  711.   and
  712.     t := 0
  713.     while (t +:= number(read()) | tilt())
  714.     write (t)
  715.  
  716. My own personal objections are that functions can be overwritten
  717. but not defined on the fly.  And there are severe performance
  718. penalties for having to check the type of an object (which is syntacticaly
  719. a function) before calling it.  (ie someone may overwrite "write"...)
  720. I particularly don't like the global side effect of overwriting "write".
  721. ie if I say
  722.     write := foonley
  723. Then it tries to call foonley the next time I call write, since functions
  724. are first class objects with global scope.
  725.  
  726. From gudeman  Sun Feb 15 14:19:52 1987
  727. From: "David Gudeman" <gudeman>
  728. To: icon-group@arizona.edu
  729. In-Reply-To: Bill Kinnersley's message of Sat, 14 Feb 87 10:36:44 PST
  730. Subject: generators and backtracking
  731. Errors-To: icon-group-request
  732. Status: RO
  733.  
  734.    Date: Sat, 14 Feb 87 10:36:44 PST
  735.    From: Bill Kinnersley  <kinner%wsu.csnet@RELAY.CS.NET>
  736.    ...
  737.        Seriously, as the heart and soul of Icon, generators need a strong
  738.        sales push.  Do they really open up new worlds, or are they
  739.        rarely used and easy to simulate?  Go through a book on algorithms
  740.        and count how many times a generator would come in handy.
  741.  
  742.    Backtracking - this is great!  One of the real reasons for choosing
  743.        Icon to program in.  The Eight Queens problem deserves its place
  744.        on the cover, and it's not too hard to produce other examples
  745.        which are equally impressive.
  746.  
  747. It seems that a lot of people think of generators as "just a sort of
  748. implicit loop".  They are actually much more than that, specifically,
  749. they are the mechanism on which backtracking is based.  It is hard to
  750. imagine how there could be backtracking without generators.  So if you
  751. think backtracking is great, you should like generators.
  752.  
  753. From icon-group-request  Sun Feb 15 14:58:51 1987
  754. From: nessus@EDDIE.MIT.EDU (Doug Alan)
  755. To: icon-group@arizona.edu
  756. Subject: Re:  generators and backtracking
  757. Errors-To: icon-group-request
  758. Status: RO
  759.  
  760. Personally, I think that generators are much more important than
  761. backtracking.  Generators are a good form "control abstraction", which
  762. is just as essential, but much more often neglected than, procedural
  763. abstraction and data abstraction.  Saying "I don't need generators --
  764. I could do that in a for loop," is like saying "I don't need
  765. procedures -- I can just stick the code for that right in here."
  766. Control abstraction allows you to provide, for example, a way of
  767. iterating through all the components of an abstract data type in a way
  768. that may not be possible otherwise without violating the interface of
  769. the abstract data type.  It provides a clean and simple mechanism for
  770. doing co-routining.  Generators are a clean generalization of data
  771. streams.  Instead they are computation streams.
  772.  
  773.                 |>oug  /\lan
  774.  
  775. --
  776. Nessus@Eddie.MIT.EDU
  777. {allegra,seismo,decvax!genrad}!mit-eddie!nessus
  778. MIT, E40-358a, Cambridge, MA 02139 (617) 253-0147
  779.  
  780.  
  781. From icon-group-request  Sun Feb 15 16:21:01 1987
  782. From: wgg@june.cs.washington.edu (William Griswold)
  783. Return-Path: <wgg@june.cs.washington.edu>
  784. To: icon-group@arizona.edu, nessus@EDDIE.MIT.edu
  785. Subject: Re:  generators and backtracking
  786. Errors-To: icon-group-request
  787. Status: RO
  788.  
  789.  
  790. I like Doug Alan's comments on generators supporting computation streams.
  791. One thing I would like to point out is that computation streams, unlike
  792. data streams, experience false dead-ends.  To generate all possible results
  793. in a computation stream it is absolutely necessary to backtrack from a
  794. given result and find another one.  Even the simplist case of generating
  795. all the elements in a list requires this.  The concept of a generator is
  796. a control structure for implementing backtracking.  The two are in fact the
  797. same thing.  The Icon book describes Icon's evaluation method as 
  798. ``goal directed''.  When thought of this way, the duality of generators
  799. versus backtracking should vanish.
  800.  
  801.                         Bill Griswold
  802.  
  803. From ralph  Mon Feb 16 10:54:26 1987
  804. From: "Ralph Griswold" <ralph>
  805. To: icon-group@arizona.edu
  806. Subject: Enhancements to Version 6 of Icon for MS-DOS
  807. Errors-To: icon-group-request
  808. Status: RO
  809.  
  810. What follows is a condensed version of working notes from Cheyenne Wills
  811. for the enchancements he has implemented for MS-DOS Icon. I've left out
  812. details of error and failure conditions, examples, and so forth, in
  813. the interests of brevity.  I'll be happy to mail a copy of the complete
  814. notes to ineterested persons.
  815.  
  816. Comments are welcome and will be passed on to Cheyenne.
  817.  
  818.     - Ralph Griswold
  819.       ralph@arizona.edu
  820.  
  821. =========================================================================
  822. Console input routines:
  823.  
  824. getch()        Wait until a keyboard character is available. Then return
  825.         a one-character string containing it. The character is not
  826.         displayed on the screen. getch() returns a "\0" value for
  827.         a character that doesn't have a ASCII equivalent. The next
  828.         call to getch returns the keyboard scan code.
  829.  
  830. getche()    Same as getch() except that characters are echoed as they
  831.         are typed.
  832.  
  833. kbhit()        Succeeds if there is a character available for getch or
  834.         getche. Otherwise it fails.
  835.  
  836. =========================================================================
  837. Miscelaneous functions:
  838.  
  839. getenv(s)    Return contents of environment variable s. It fails if s is
  840.         not in environment.
  841.  
  842. seek(f,i1,i2)    Seek to offset byte from start in file.  Returns byte offset
  843.         within file.
  844.         fails if an error occurs.
  845.  
  846. =========================================================================
  847. MS-DOS interface routines:
  848.  
  849. Disclaimer: The following routines are included as a "gateway" to functions
  850. provided by MS-DOS and ROM BIOS. They should be used with care, as Icon
  851. maintains a strict control on its environment (although it uses standard MS-DOS
  852. interfaces and doesn't bypass MS-DOS or ROM BIOS in any way).
  853.  
  854. The descriptions that follow are low-level descriptions. They assume knowlege
  855. of the Intel 8086 (8088, 80x86 etc.) architecture.
  856.  
  857. Int86(l)    Generate a hardware interrupt. The input (l) is a list of
  858.         integer values [interrupt #, ax, bx, cx, dx, si, di, es, ds]
  859.         It returns a list: [flags, ax, bx, cx, dx, si, di, es, ds].
  860.  
  861. GetSpace(i)    Allocate a static block of storage outside of Icon's direct
  862.         control (i.e., it will not be affected by garbage collection).
  863.  
  864. FreeSpace(A)    Free a static block of storage. A is the value returned by
  865.         GetSpace.
  866.  
  867. Peek(A,i)    Build a string pointing to the address specified
  868.         by A with a length of i.
  869.  
  870. Poke(A,s)    Copy a string s to location A
  871.  
  872.  
  873. From icon-group-request  Mon Feb 16 16:08:51 1987
  874. From: "Bill Mitchell" <whm>
  875. To: ralph
  876. Subject: Re:  Enhancements to Version 6 of Icon for MS-DOS
  877. Cc: icon-group@arizona.edu
  878. In-Reply-To: <8702161754.AA10393@megaron.arizona.edu>
  879. Errors-To: icon-group-request
  880. Status: RO
  881.  
  882. Gosh, those MS-DOS guys have it made.  I've been wanting a getenv in
  883. UNIX Icon for years and still no luck.
  884.  
  885. From icon-group-request  Mon Feb 16 18:15:11 1987
  886. From: "Bill Mitchell" <whm>
  887. To: icon-group
  888. Subject: Re:  Formatting (shudder)
  889. In-Reply-To: <8702122230.AA03382@megaron.arizona.edu>
  890. Errors-To: icon-group-request
  891. Status: RO
  892.  
  893.    From ralph Thu Feb 12 15:30:48 1987
  894.    To: icon-group@arizona.edu
  895.    Subject: Formatting (shudder)
  896.    
  897.    I wouldn't argue that a printf-like facility in Icon would not be
  898.    useful.  However, from a language-design viewpoint, I'd rather see
  899.    something at a higher level. In fact, the real problem is not
  900.    just output formatting, but the synthesis of strings (witness the
  901.    usefulness of sprintf in C).
  902.  
  903. String synthesis is an interesting problem, but I don't often find myself
  904. wanting more string synthesis facilities, but the lack of formatting
  905. capabilities darkens my Icon programs on very regular basis.
  906.  
  907. It seems that the printf syntax is really fairly good -- it's concise,
  908. it doesn't try to do everything, and it usually covers all the bases.
  909. I don't recall anything that I like better than printf; are there simple
  910. formatting methods that are preferred by others?
  911.  
  912. I'd imagine that the printf syntax was inspired by FORTRAN's FORMAT.
  913. Was FORMAT in the very first FORTRAN?  If so, is that to say that we
  914. really haven't had any advances in this area?
  915.  
  916. From icon-group-request  Tue Feb 17 07:55:27 1987
  917. From: Guy Lapalme <lapalme%iro.udem.cdn%ubc.csnet@RELAY.CS.NET>
  918. To: icon-group@arizona.edu
  919. Subject: string formatting
  920. Errors-To: icon-group-request
  921. Status: RO
  922.  
  923. I think that people that are only considering C and Fortran like formatting
  924. facilities should look at what is done in COBOL using the "PICTURE" 
  925. specifications. Given that icon is not in the same class as COBOL, but
  926. the formatting specifications are very well done.
  927.  
  928. Should somebody really want high level formatting specifications, go
  929. and see what was done in Algol-68, you'll see a quite simple and efficient
  930. way (and very systematic too) approach to formatting. It would surely be
  931. interesting to write and Icon procedure that implements Algol68 IO.
  932. As Algol68 was meant to be compiled, it does not need to be all interpreted
  933. at run-time. 
  934.  
  935. I also want to point out that Common Lisp has a very extensive (if not too 
  936. much) set of formatting commands in which you can even write number in
  937. roman or in letters, you can right justify paragraphs etc...
  938.  
  939. Guy Lapalme
  940. Universite de Montreal
  941.  
  942.  
  943. From icon-group-request  Tue Feb 17 14:03:33 1987
  944. From: shafto@nprdc.arpa
  945. Reply-To: shafto@nprdc.arpa
  946. To: icon-group-request@arizona.edu
  947. Subject: Rolling the ball
  948. Cc: icon-group@arizona.edu, shafto@nprdc.arpa
  949. Errors-To: icon-group-request
  950. Status: RO
  951.  
  952. Original message From: Bill Kinnersley  <kinner%wsu.csnet@RELAY.CS.NET>
  953. To: icon-group@arizona.edu
  954. Errors-To: icon-group-request@arizona.edu
  955.  
  956. I am certainly not an Icon expert.  I have been fascinated with the
  957. language for the past two years, and I taught it to my class in
  958. Programming Language Design.  What puzzles me is how little I use
  959. it.  Our conclusion in class was that Icon was much more in the 
  960. experimental stage than Smalltalk, Prolog, etc.
  961.  
  962. -----
  963. I'm not sure what "experimental" means.  All I know is that
  964. I have some very practical programs which I use every day for
  965. budget-management and for managing a volatile set of distribution
  966. lists.  I maintain these programs myself, even though I'm far
  967. from being a professional programmer, and I really have zero time
  968. to devote to software development/maintenance.  The exact same
  969. programs run on a Zenith 120 (not IBM compatible), IBM-XT,
  970. Leading Edge, KayPro, Vax 11/780 running Unix, Vax 11/750
  971. running VMS, and an Apollo.  For general usability and portability,
  972. what language compares with Icon?
  973. Smalltalk?  Prolog??  Lisp???  Get serious.
  974. -----
  975.  
  976. According to the book, Icon is good for string processing, quick
  977. one-shot programs, and heuristic solutions to complex problems.
  978. In other words, AI.
  979.  
  980. -----
  981. I think Icon falls a little short as an "AI language," due to the
  982. fact that -- for example -- there aren't full-fledged analogues
  983. to SNOBOL4's EXPRESSION, PATTERN, and CODE datatypes.  I believe
  984. SNOBOL4 and LISP are the only generally available languages which
  985. support the full range of atrocities needed for he-man AI.
  986. -----
  987.  
  988. >From an internal point of view, surely the central feature of the
  989. language is generators.  Most of the cost of Icon implementation
  990. must be allowing each and every expression to be a generator.  One
  991. needs to ask, therefore, whether that feature is worth the cost.
  992.  
  993. >From my own ignorant and biased perspective, let's list some good
  994. points and some bad...
  995.  
  996. Syntax - I find the syntax natural, and the innovations particularly
  997.     appealing.  :=: and "break break" should be in every language.
  998.  
  999. -----
  1000. I did an experiment recently in which I sent a 25-line
  1001. Icon program to a friend who was familiar with Pascal
  1002. but not Icon.  My program was uncommented & I challenged
  1003. him to figure out what it did & insert comments.  He wass able
  1004. to do this perfectly (Except:  he enclosed the comments
  1005. in /* */) and even to provide one slight re-write.  Since I
  1006. did this as an afterthought, having written the program for
  1007. a typically Icon-ish ad hoc purpose, I think it provides a fair
  1008. demonstration of what one might mean by "natural syntax."
  1009. -----
  1010.  
  1011. Csets - No use for this, myself.
  1012.  
  1013. Lists - One of Icon's best aspects.  Much easier to use than Lisp.
  1014.     I do get confused between get(), put(), push(), and pop().  My
  1015.     impression is that many of the things that used to be done using
  1016.     string manipulation are better done with lists anyway.
  1017.  
  1018. Implicit type conversion - not such a great idea.  Mainly it's the
  1019.     conversion to and from strings that's unusual, and I'd 
  1020.     rather do it explicitly when I really need to.
  1021.  
  1022.     Typelessness of variables has an unpleasant side effect--
  1023.     It puts the burden on the operators to decide the type of an
  1024.     outcome, and as a result there are FAR TOO MANY operators.
  1025.     Mentioning ~===:= to the class is always good for a giggle.
  1026.  
  1027. -----
  1028. Agree re: lists.  Disagree re: implicit type conversion.  In my
  1029. opinion, you leave the realm of byte-pushing and enter the
  1030. realm of high-level programming languages when memory
  1031. management and typing are handled as transparently as possible.
  1032. -----
  1033.  
  1034. Procedure invocation - again very nicely done.
  1035.  
  1036. Generators - outside the string-search context, I find it a little
  1037.     hard to explain what these are, and what they're good for.
  1038.  
  1039.     Me: "Well, they're like a generalized for loop.  Suppose you
  1040.       didn't want to just go 1, 2, 3, ... say, but for every number
  1041.       obeying some complicated condition..."
  1042.     Student: "Well then, I'd use a while loop, and write a subroutine
  1043.       with some static variables, and I'd just keep calling that to
  1044.       get the next number."
  1045.     Me: "Yes, but this is cleaner conceptually.  And more general.
  1046.       And you can write your own generators...and, uh, in fact they
  1047.       look just like subroutines, only they suspend."
  1048.     (Student stares at me, and whispers something to his neighbor.
  1049.      Other student smiles and nods his head.)
  1050.  
  1051.     Seriously, as the heart and soul of Icon, generators need a strong
  1052.     sales push.  Do they really open up new worlds, or are they
  1053.     rarely used and easy to simulate?  Go through a book on algorithms
  1054.     and count how many times a generator would come in handy.
  1055.  
  1056. -----
  1057. I generally disagree with the above, but it raises an interesting 
  1058. issue in conjunction with the earlier "multiplicity of
  1059. operators" observations:  Why are there so many different
  1060. operators in a language in which you get so much mileage
  1061. out of the humble "!" operator?
  1062. Or, why isn't == as generic as !?
  1063. -----
  1064.  
  1065. Backtracking - this is great!  One of the real reasons for choosing
  1066.     Icon to program in.  The Eight Queens problem deserves its place
  1067.     on the cover, and it's not too hard to produce other examples
  1068.     which are equally impressive.
  1069.  
  1070. Suggestion: Here's a common situation that needs to be handled better.
  1071.     Where it says
  1072.  
  1073.        write (q(1), q(2), q(3), q(4), q(5), q(6), q(7), q(8))
  1074.  
  1075.     Remember that?   This is a trick we use to get the q's to mutually 
  1076.     succeed.  Or, we could have used q(1) & q(2) & ...  This does come
  1077.     up a lot, and it can get out of hand pretty quickly if there are more
  1078.     than 8 items.  Maybe what we need is a new construct:
  1079.  
  1080.        all q(1 to 8)
  1081.  
  1082. Summary - We teach that a well designed programming language is more
  1083.     than a collection of useful features.  It must have a uniform
  1084.     syntax, an easily-expressed purpose and philosophy, and a set of
  1085.     features which are consistent, powerful, and thrifty.  Often as not,
  1086.     a language can be improved by removing features, not just adding.
  1087.  
  1088.     Object-oriented languages are all the rage these days.  People are
  1089.     diligently putting objects into Pascal, C, Lisp, etc.  For heavens
  1090.     sakes, don't anyone try to do that to Icon!
  1091.  
  1092. -----
  1093. That's a big 10-4!
  1094. Although I've found the added feature of true sets
  1095. to be enormously useful.  Oddly, tables and lists
  1096. can be quite awkward (at least conceptually) when what
  1097. you want is sets.
  1098. -----
  1099. -----
  1100.  
  1101.  
  1102.  
  1103. From icon-group-request  Tue Feb 17 14:04:12 1987
  1104. From: shafto@nprdc.arpa
  1105. Reply-To: shafto@nprdc.arpa
  1106. To: ralph@arizona.edu
  1107. Subject: Re: Enhancements to Version 6 of Icon for MS-DOS
  1108. Cc: icon-group@arizona.edu, shafto@nprdc.arpa
  1109. Errors-To: icon-group-request
  1110. Status: RO
  1111.  
  1112.  
  1113.  
  1114. I'm an interested person.  You can mail me a copy of Wills's complete
  1115. notes at the following address:
  1116.  
  1117. Dr. Michael G. Shafto
  1118. Office of Naval Research, Code 1142CS
  1119. 800 N. Quincy Street
  1120. Arlington, VA   22217-5000
  1121.  
  1122. Also, I'm ready to mail in my 25 bucks or whatever
  1123. when these enhancements are released.
  1124.  
  1125. Mike
  1126.  
  1127. From icon-group-request  Fri Feb 20 19:10:34 1987
  1128. From: "Bill Mitchell" <whm>
  1129. To: icon-group
  1130. Subject: .2 + .2 = 4
  1131. Errors-To: icon-group-request
  1132. Status: RO
  1133.  
  1134. It's true that in the Icon book a decimal literal, a type of real constant,
  1135. is defined as:
  1136.  
  1137.     digit+ . digits*
  1138.  
  1139. but it seems to me that it's not hard to imagine someone writing something
  1140. like x := y * .9 and then being surprised that x = y * 9 .  I just did this
  1141. and must admit that I was mystified for an embarrassing length of time.
  1142.  
  1143. A quick look at tran/lex.c seems to indicate that this wouldn't be hard
  1144. to arrange -- if the current character is '.', peek at the next character
  1145. and if it's a digit, call getnum instead of gathering an operator.  getnum
  1146. would also need a little work, but considering the likelihood of others
  1147. falling over this (any victims out there?), it seems like a reasonable
  1148. thing to do.
  1149.  
  1150. From icon-group-request  Fri Feb 20 19:14:51 1987
  1151. From: "Ralph Griswold" <ralph>
  1152. To: icon-group, whm
  1153. Subject: Re:  .2 + .2 = 4
  1154. In-Reply-To: <8702210210.AA25290@megaron.arizona.edu>
  1155. Errors-To: icon-group-request
  1156. Status: RO
  1157.  
  1158. Since the unary prefix operator does dereferencing, there is a fundamental
  1159. ambiguity.  SNOBOL4 has it too.
  1160.  
  1161. I, for one, while I realize the pitfall, would have trouble with .2 and .x
  1162. (not to mention ."2") being treated in fundamentally different ways.
  1163.  
  1164. cheer up ... .2 + .2 = .4
  1165.  
  1166. From icon-group-request  Sat Feb 21 01:45:38 1987
  1167. To: icon-group%arizona.edu@relay.cs.csnet
  1168. From: U249101%HNYKUN11.BITNET@WISCVM.WISC.EDU
  1169. Subject: Icon in Holland
  1170. Errors-To: icon-group-request
  1171. Status: RO
  1172.  
  1173. Date: 19 February 1987, 13:33:41 MET
  1174. From: Jan Blom                                       U249101  at HNYKUN11
  1175. To:   ICON-GROUP at ARIZONA.EDU
  1176.  
  1177. I'm glad to see that the Icon-group functions after all!
  1178. We use Icon here on a VAX/750 (VMS), and it also appears to run on
  1179. a Microvax II under MicroVMS.
  1180. I would like to know what implementations are available for Atari/ST and
  1181. MS/DOS machines, and how I can obtain them here in Europe (Holland).
  1182.  
  1183.                                                          Jan Blom
  1184.  
  1185. From icon-group-request  Sat Feb 21 06:13:19 1987
  1186. From: "Ralph Griswold" <ralph>
  1187. To: U249101%HNYKUN11.BITNET@WISCVM.WISC.EDU, icon-group
  1188. Subject: Re:  Icon in Holland
  1189. In-Reply-To: <8702210845.AA02934@arizona.arizona.edu>
  1190. Errors-To: icon-group-request
  1191. Status: RO
  1192.  
  1193. Thanks for letting us know about your use of Icon.
  1194.  
  1195. Icon is available both for the Atari ST and for MS-DOS.
  1196.  
  1197. The Atari implementation is available for downloading frm the Atari Base BBS
  1198. in this country.  I don't know if there is a corresponding service in Europe.
  1199. We do not have an Atari ST locally and did not do the implementation of Icon
  1200. for it, so our ability to help you is limited.  I will, however, forward your
  1201. request to the person who did the implementation.
  1202.  
  1203. We distribute the MS-DOS implementation and I'll send you a recent Icon
  1204. Newletter describing how you can get this implementation from us.  We have
  1205. no "distributors" in Europe, although there are many persons there who
  1206. have Icon, including a good number in your country.
  1207.  
  1208. You raise a question that has come up several times -- how persons in countries
  1209. that are inconveniently distant from ours can get Icon locally.  We encourage
  1210. persons to install Icon on electronic bulletin boards and since the implement-
  1211. ations are in the public domain, anyone can serve as a distributor.  We would
  1212. welcome volunteers and will pass along information that we get about such
  1213. services.
  1214.  
  1215. From icon-group-request  Sat Feb 21 12:23:05 1987
  1216. From: "Gregg Townsend" <gmt>
  1217. To: icon-group
  1218. Subject: Re: .2 + .2 = 4
  1219. Errors-To: icon-group-request
  1220. Status: RO
  1221.  
  1222. I've also been bitten by the problem of trying to write a real as .nnn and
  1223. instead finding that I was really dereferencing an integer.  I had a little
  1224. one-shot program which went
  1225.  
  1226.     every r := 0 to 7 do
  1227.     every g := 0 to 7 do
  1228.         every b := 0 to 7 do
  1229.         write ((.30 * r + .59 * g + .11 * b) / 7.0)
  1230.  
  1231. and when the output began coming out
  1232.     
  1233.     0.0
  1234.     1.5714286
  1235.     3.1428571
  1236.     4.7142857
  1237.     6.2857143
  1238.        ...
  1239.  
  1240. I began wondering why I was getting multiples of pi/2.  Had I somehow connected
  1241. with some trigonometric functions?  After quite a bit of head-scratching I
  1242. figured out the real problem and realized that the red herring came from
  1243. inadvertent calculation of the common approximation of pi as a fraction,
  1244. namely 22/7.
  1245.  
  1246. I'd favor a change if it could be done cleanly.  I doubt that any existing
  1247. programs would be invalidated.  As for ambiguity, it's already there in people's
  1248. minds, and is resolved the wrong way.  In the statement
  1249.     off := .47
  1250. most people wouldn't notice "." as an operator any more than they'd notice that
  1251. the variable name begins with a reserved word.  People look at things in
  1252. context.
  1253.  
  1254.      Gregg Townsend / Computer Science Dept / Univ of Arizona / Tucson, AZ 85721
  1255.      +1 602 621 4325      gmt@Arizona.EDU       110 57 17 W / 32 13 47 N / +758m
  1256.  
  1257. From icon-group-request  Sat Feb 21 13:03:29 1987
  1258. From: "Ralph Griswold" <ralph>
  1259. To: gmt, icon-group
  1260. Subject: Re: .2 + .2 = 4
  1261. In-Reply-To: <8702211923.AA01862@megaron.arizona.edu>
  1262. Errors-To: icon-group-request
  1263. Status: RO
  1264.  
  1265. Gregg has a good point about the more important ambiguity.  I'd be willing
  1266. to make the change if it is strictly limited to a period followed by a
  1267. digit meaning a real literal. (Documenting the syntax will be unpleasant,
  1268. however.)
  1269.  
  1270. Or, to be more accurate, I'll add it to the huge pile of things that ought
  1271. to be done to Icon.
  1272.  
  1273. I have a program that this change will affect.  Not that it's an important
  1274. program.  Can anyone guess what it might be?
  1275.  
  1276. As another exercise, would anyone care to catalog all the changes that
  1277. need to be made to distributed Icon material when/if this change is made?
  1278.  
  1279. From icon-group-request  Sat Feb 21 14:54:25 1987
  1280. From: "Bill Mitchell" <whm>
  1281. To: icon-group
  1282. Subject: Re: .2 + .2 = 4
  1283. In-Reply-To: <8702211923.AA01862@megaron.arizona.edu>
  1284. Errors-To: icon-group-request
  1285. Status: RO
  1286.  
  1287. I thought about this some more and making .digits into a decimal literal
  1288. could be a bad idea since programs developed under the new version that
  1289. have constants of this type would then mysteriously malfunction when run on
  1290. earlier versions.
  1291.  
  1292. How about just arranging for .digits to produce a warning message?  This
  1293. would serve to alert the programmer to the problem, but wouldn't produce
  1294. any inter-version incompatibilities.  This could be done in either the
  1295. lexical analyzer or during the code generation tree walk.  The former would
  1296. allow `. n' to be used for `.n' and not draw a warning, but it might be
  1297. hard to localize the overhead for that check.  Checking during the tree
  1298. walk would probably be a little cleaner, but the `. n' ruse wouldn't work.
  1299.  
  1300. This approach would seem to require a minimum of changes outside the code --
  1301. just a note in the Version N document saying that .digits now produces a
  1302. warning.
  1303.  
  1304. Thus, in the worst case you have a program that generates warning messages
  1305. and in the best case, a programmer's sanity is saved.
  1306.  
  1307. From icon-group-request  Sun Feb 22 08:05:39 1987
  1308. From: "Mark L. Langley" <mark>
  1309. To: icon-group, whm
  1310. Subject: Re: .2 + .2 = 4
  1311. In-Reply-To: <8702212154.AA12199@megaron.arizona.edu>
  1312. Errors-To: icon-group-request
  1313. Status: RO
  1314.  
  1315.     From icon-group-request Sat Feb 21 14:54:39 1987
  1316.     Received: by megaron.arizona.edu; Sat, 21 Feb 87 14:54:27 MST
  1317.     Date: Sat, 21 Feb 87 14:54:25 MST
  1318.     From: "Bill Mitchell" <whm>
  1319.     
  1320.     I thought about this some more and making .digits into a decimal literal
  1321.     could be a bad idea since programs developed under the new version that
  1322.     have constants of this type would then mysteriously malfunction when run on
  1323.     earlier versions.
  1324.     
  1325. I think I disagree.  First of all, when was the last time you dereferenced
  1326. a constant?  Second when was the last time you dereferenced a constant
  1327. that began with a digit?  (Obviously you can't dereference a variable
  1328. that begins with a digit...)
  1329.  
  1330. I think one usually dereferences variables unless the object of the
  1331. program is to find bugs in the compiler.
  1332.  
  1333. Other languages enforce the "Floats must begin with a digit" rule, (ie
  1334. Pascal) but I always thought Icon was supposed to suggest improvements.
  1335. Furthermore the incompatible version argument has been violated before,
  1336. for example when versions of Icon were distributed without co-expressions.
  1337. And I don't think Icon is ready to have an ANSI standard...
  1338.  
  1339. From icon-group-request  Thu Feb 26 16:52:44 1987
  1340. From: "Bill Mitchell" <whm>
  1341. To: icon-group
  1342. Subject: % operator
  1343. Errors-To: icon-group-request
  1344. Status: RO
  1345.  
  1346. I was just noticing that in the Icon book on page 20, n % m is defined
  1347. as being the remainder of n divided by m with the sign of m, but the
  1348. code that implements % just uses the C % operator and when a negative
  1349. operand is involved, different implementations of C do different things
  1350. when remaindering.
  1351.  
  1352. From icon-group-request  Wed Mar  4 10:40:17 1987
  1353. From: "Ralph Griswold" <ralph>
  1354. To: icon-group
  1355. Subject: fyi
  1356. In-Reply-To: 
  1357.     From shafto@nprdc.arpa Wed Mar  4 10:35:45 1987
  1358.     Received: by megaron.arizona.edu; Wed, 4 Mar 87 10:35:43 MST
  1359.     Received: by arizona.arizona.edu; Wed, 4 Mar 87 10:34:46 MST
  1360.     Received: by nprdc.arpa (5.51/ 1.1)
  1361.         id AA13801; Wed, 4 Mar 87 09:35:17 PST
  1362.     Message-Id: <8703041735.AA13801@nprdc.arpa>
  1363.     Date: 4 March 1987 0935-PST (Wednesday)
  1364.     From: shafto@nprdc.arpa
  1365.     Reply-To: shafto@nprdc.arpa
  1366.     To: ralph@arizona.edu
  1367.     Subject: MS-DOS Icon goodies
  1368.     
  1369.     
  1370.     
  1371.     I received the hard-copy of Cheyenne Wills's notes.  Thanks.
  1372.     (You have my correct net address -- I guess
  1373.     something somewhere was just down.)
  1374.     
  1375.     One thing that us psychologists like to use microcomputers
  1376.     for is running experiments.  Reaction time is one of our
  1377.     favorite dependent variables.  Software evaluation is
  1378.     another area where people like to get fine-grained timing
  1379.     information in the microsecond to millisecond range.
  1380.     
  1381.     Three recent articles have pointed out that it is possible to
  1382.     use the IBM-PC and similar machines to get accurate
  1383.     microsecond-level times without any special hardware or
  1384.     software.  The three articles are the following:
  1385.     
  1386.     Smith, B., & Puckett, T.  (April, 1984).  Life in the
  1387.     fast lane.  PC Tech Journal, 63-74.
  1388.     
  1389.     Sheppard, B.  (January, 1987).  Programming insight:  High-
  1390.     performance software analysis on the IBM PC.  Byte, 12(1),
  1391.     157-168.
  1392.     
  1393.     Graves, R., & Bradley, R.  (Fedruary, 1987).  Millisecond
  1394.     interval timer and auditory reaction time programs for the IBM PC.
  1395.     Behavior Research Methods, Instruments, and Computers, 19(1), 30-35.
  1396.     
  1397.     
  1398.     All these articles use the same method:  The system timing
  1399.     chip is re-programmed (software programmable) to "Mode 2"
  1400.     rather than the BIOS setting of "Mode 3."
  1401.     
  1402.     Without getting into the mysteries of the timing chip and
  1403.     its associated ports and counters, suffice it to say that
  1404.     I've experimented extensively with this gimmick.  It does
  1405.     not require any assembly-level programming (contrary to
  1406.     what the articles above would suggest).  You can do it all
  1407.     with Turbo Pascal.
  1408.     
  1409.     Which brings me to my point:  Turbo Pascal has two
  1410.     capabilities which are not represented in Cheyenne's notes
  1411.     and which are necessary to get this no-fuss microsecond
  1412.     hardware timer:  
  1413.     
  1414.     1)  The ability to read and write ports.  This is
  1415.     represented in Turbo Pascal as the pseudo-arrays Port and
  1416.     PortW.  You read a port by reading Port[i] & write a port
  1417.     by assigning a value to Port[i] (or PortW for 2-byte
  1418.     reads and writes).
  1419.     
  1420.     2)  A limited capability to exec
  1421. Status: RO
  1422.  
  1423. Errors-To: icon-group-request
  1424.  
  1425. ute in-line machine code.
  1426.     Specifically, CLI and STI instructions must be placed
  1427.     around the code that reads the memory locations which
  1428.     maintain the timer interrupt count.
  1429.     
  1430.     In addition, the Peek() function would be used.
  1431.     
  1432.     I realize that both of these "features" -- especially #2 --
  1433.     might be hard to justify as additions to MS-DOS Icon.  An
  1434.     alternative would be to implement three functions, say,
  1435.     time_start, time_stop, and delay.
  1436.     
  1437.     time_start would start a 1.19 Mh stopwatch, and subsequent
  1438.     references to &time would return the elapsed time in
  1439.     (floating-point) milliseconds since the call to time_start.
  1440.     The system clock would be operating in Mode 2 (fast,
  1441.     nonstandard).
  1442.     
  1443.     time_stop would stop the fast clock and re-set the system
  1444.     clock to Mode 3 (slow, 55-msec interrupts; BIOS standard
  1445.     setting);
  1446.     
  1447.     delay(n) would delay for n milliseconds.
  1448.     
  1449.     
  1450.     Potential problems:  I've found that it's important to
  1451.     run the clock in Mode 2 only when really necessary.  For
  1452.     some reason, the system tends to hang occasionally and'
  1453.     unpredictably when the clock is in Mode 2 (and i/o is
  1454.     performed? -- I still don't know the cause, but I do know
  1455.     that the problem can be managed for practical purposes and
  1456.     programs that use this feature can be highly reliable).
  1457.     
  1458.     Another problem -- having delay(n) call time_init
  1459.     and then monitor &time until it goes above n is not
  1460.     as good an idea as it might seem.  If this approach is
  1461.     used and there are a lot of "long" 1-2 sec delays in a 
  1462.     run (as there would be in the typical psychological
  1463.     experiment) the hang-up problem emerges.  Thus, the
  1464.     practical approach is to calibrate a loop (figure out
  1465.     how many iterations are required to produce the
  1466.     desired delay -- using the fast clock for the calibration
  1467.     only), then use the calibrated loop to produce the
  1468.     actual delays during long runs.
  1469.     
  1470.     I know this is special pleading for psychologists -- but
  1471.     maybe there is enough interest among software people to
  1472.     justify some kind of fast-clock feature in MS-DOS
  1473.     Icon.
  1474.     
  1475.     Mike Shafto
  1476.     
  1477.     PS:  I fogot another problem I've found:
  1478.     KayPro PC's and perhaps some others have a 4.77Mh/8 Mh
  1479.     dual clock-speed option controlled by a toggle switch.
  1480.     If the 8 Mh, nonstandard clock option is in effect, the
  1481.     timer routines cited above go to hell.
  1482.     
  1483.     mgs
  1484.     
  1485.  
  1486. From icon-group-request  Wed Mar  4 11:24:11 1987
  1487. From: "Ralph Griswold" <ralph>
  1488. To: icon-group
  1489. Subject: bogus mail
  1490. Errors-To: icon-group-request
  1491. Status: RO
  1492.  
  1493. For some as yet unknown reason, a portion of a message that I was
  1494. remailing to persons here on the Icon Project wound up in the
  1495. outgoing icon-group mail.  It's subject is "fyi" and its
  1496. contents will no doubt appear mysterious.  Ignore it.
  1497.  
  1498. My apologies for the bother.
  1499.  
  1500. From icon-group-request  Wed Mar  4 12:56:04 1987
  1501. From: shafto@nprdc.arpa
  1502. Reply-To: shafto@nprdc.arpa
  1503. To: icon-group@arizona.edu
  1504. Subject: micro- to millisecond timing in MS-DOS Icon?
  1505. Cc: cdavis@a.isi.edu
  1506. Errors-To: icon-group-request
  1507. Status: RO
  1508.  
  1509. NOTE:  THIS IS A REBROADCAST OF A NOTE THAT I SENT TO
  1510. RALPH GRISWOLD.  PART OF THAT PREVIOUS MESSAGE WAS ACCIDENTALLY
  1511. DISTRIBUTED TO ICON-GROUP.
  1512.  
  1513. MGS
  1514.  
  1515.  
  1516. One thing that us psychologists like to use microcomputers
  1517. for is running experiments.  Reaction time is one of our
  1518. favorite dependent variables.  Software evaluation is
  1519. another area where people like to get fine-grained timing
  1520. information in the microsecond to millisecond range.
  1521.  
  1522. Three recent articles have pointed out that it is possible to
  1523. use the IBM-PC and similar machines to get accurate
  1524. microsecond-level times without any special hardware or
  1525. software.  The three articles are the following:
  1526.  
  1527. Smith, B., & Puckett, T.  (April, 1984).  Life in the
  1528. fast lane.  PC Tech Journal, 63-74.
  1529.  
  1530. Sheppard, B.  (January, 1987).  Programming insight:  High-
  1531. performance software analysis on the IBM PC.  Byte, 12(1),
  1532. 157-168.
  1533.  
  1534. Graves, R., & Bradley, R.  (Fedruary, 1987).  Millisecond
  1535. interval timer and auditory reaction time programs for the IBM PC.
  1536. Behavior Research Methods, Instruments, and Computers, 19(1), 30-35.
  1537.  
  1538.  
  1539. All these articles use the same method:  The system timing
  1540. chip is re-programmed (via software) to "Mode 2"
  1541. rather than the BIOS setting of "Mode 3."
  1542.  
  1543. Without getting into the mysteries of the timing chip and
  1544. its associated ports and counters, suffice it to say that
  1545. I've experimented extensively with this gimmick.  It does
  1546. not require any assembly-level programming (contrary to
  1547. what the articles above would suggest).  You can do it all
  1548. with Turbo Pascal.
  1549.  
  1550. (You have to cheat and use the Turbo inline() function
  1551. in order to disable and enable interrupts -- see below).
  1552.  
  1553.  
  1554. Which brings me to my point:  Turbo Pascal has two
  1555. capabilities which are not represented in 
  1556. the working notes for additions to MS-DOS Icon (Cheyenne Wills)
  1557. and which are necessary to get this no-fuss microsecond
  1558. hardware timer:  
  1559.  
  1560. 1)  The ability to read and write ports.  This is
  1561. represented in Turbo Pascal as the pseudo-arrays Port and
  1562. PortW.  You read a port by referencing Port[i] & write a port
  1563. by assigning a value to Port[i] (or PortW[i] for 2-byte
  1564. reads and writes).
  1565.  
  1566. 2)  A limited capability to execute in-line machine code.
  1567. Specifically, CLI and STI instructions must be placed
  1568. around the code that reads the memory locations which
  1569. maintain the timer interrupt count.
  1570.  
  1571. In addition, the Peek() function would be used.
  1572.  
  1573. I realize that both of these "features" -- especially #2 --
  1574. might be hard to justify as additions to MS-DOS Icon.  An
  1575. alternative would be to implement three functions, say,
  1576. time_start, time_stop, and delay.
  1577.  
  1578. time_start would start a 1.19 Mh stopwatch, and subsequent
  1579. references to &time would return the elapsed time in
  1580. (floating-point) milliseconds since the call to time_start.
  1581. The system clock would be operating in Mode 2 (fast,
  1582. nonstandard).
  1583.  
  1584. time_stop would stop the fast clock and re-set the system
  1585. clock to Mode 3 (slow, 55-msec interrupts; BIOS standard
  1586. setting);
  1587.  
  1588. delay(n) would delay for n milliseconds.
  1589.  
  1590.  
  1591. Potential problems:  I've found that it's important to
  1592. run the clock in Mode 2 only when really necessary.  For
  1593. some reason, the system tends to hang occasionally and'
  1594. unpredictably when the clock is in Mode 2 (and i/o is
  1595. performed? -- I still don't know the cause, but I do know
  1596. that the problem can be managed for practical purposes and
  1597. programs that use this feature can be highly reliable).
  1598.  
  1599. Another problem -- having delay(n) call time_init
  1600. and then monitor &time until it goes above n is not
  1601. as good an idea as it might seem.  If this approach is
  1602. used and there are a lot of "long" 1-2 sec delays in a 
  1603. run (as there would be in the typical psychological
  1604. experiment) the hang-up problem emerges.  Thus, the
  1605. practical approach is to calibrate a loop (figure out
  1606. how many iterations are required to produce the
  1607. desired delay -- using the fast clock for the calibration
  1608. only), then use the calibrated loop to produce the
  1609. actual delays during long runs.
  1610. This might mean that the delay() function is not a good
  1611. candidate for a built-in function & should be implemented
  1612. and calibrated as a user-defined function.
  1613. I've been using the hardware clock on my PC to
  1614. calibrate the built-in delay procedure in Turbo.
  1615.  
  1616. I know this is special pleading for psychologists -- but
  1617. maybe there is enough interest among software people to
  1618. justify some kind of fast-clock feature in MS-DOS
  1619. Icon.
  1620.  
  1621. Mike Shafto
  1622.  
  1623. PS:  I forgot another problem I've found:
  1624. KayPro PC's and perhaps some others have a 4.77Mh/8 Mh
  1625. dual clock-speed option controlled by a toggle switch.
  1626. If the 8 Mh, nonstandard clock option is in effect, the
  1627. timer routines cited above go to hell.
  1628.  
  1629. mgs
  1630.  
  1631.  
  1632. From icon-group-request  Wed Mar  4 16:18:27 1987
  1633. From: "David Gudeman" <gudeman>
  1634. To: icon-group
  1635. Subject: proof-reader
  1636. Errors-To: icon-group-request
  1637. Status: RO
  1638.  
  1639. I've been thinking about writing a proof-reading program in Icon.
  1640. The program would check spelling, punctuation, word choice, phrase
  1641. choice, sentence structure, and paragraph structure.  It would need to
  1642. store an entire English dictionary in a table cross-referenced with
  1643. various information such as synonyms, syntactic category, aesthetic
  1644. quality, etc.  I think that such a program would be very useful for us
  1645. careless writers.
  1646.  
  1647. This is a fairly major project, and I am hoping for some opinion on
  1648. the feasibility and best procedure.  Also, does anyone know of other
  1649. programs that do this?  (I am aware of the Unix utilities.)  I would
  1650. also like to find a dictionary that is already on a computer.  I know
  1651. about word-lists, I need a dictionary with syntactic category and
  1652. synonym information.
  1653.  
  1654. Here is my general idea.  I guess (without much evidence) that there
  1655. are less than 256 legal syllables in English words.  If this is the
  1656. case, then it is possible to represent words as strings where each
  1657. character represents a whole syllable.  Otherwise (if there are too
  1658. many syllables for this), words could be represented as lists of
  1659. strings where each string is a syllable.
  1660.  
  1661. The reason I want to represent words as strings of syllables is to
  1662. help in identifying misspelled words.  When a word is not recognized,
  1663. the program will try replacing syllables with other syllables that
  1664. might represent the same sound, then check if that is a real word.  If
  1665. syllables can be represented as characters, then I could use csets to
  1666. represent equivalence classes of syllables.
  1667.  
  1668. English sentences could be parsed as a context-sensitive grammar,
  1669. incomplete of course, but I think I could get one complete enough for
  1670. most sentences that are written in semi-formal style.  To detect
  1671. errors in sentence structure and punctuation, I need information on
  1672. what kinds of errors are most often made.  Then I can include these
  1673. errors in the grammar as a kind of error production.
  1674.  
  1675. The program will have to read words, selecting one syntactic category
  1676. for those words that have multiple categories.  If the sentence cannot
  1677. be parsed, the program must backtrack to the selection point and chose
  1678. a different syntactic category for the word.  In other words, the
  1679. program must be able force backtracking of lexical analysis by failure
  1680. in syntactic analysis.
  1681.  
  1682. Even more difficult than this, I have to specify some sort of grammar
  1683. to describe paragraphs.  It is not enough to say that a paragraph is a
  1684. sequence of sentences.  There must be some sort of context similarity
  1685. in the sentences of a paragraph.  I don't know whether this is
  1686. formally specifiable, but I would like to try.
  1687.  
  1688. More questions: Is Icon going to be able to handle all of this without
  1689. spending ten minutes on each paragraph?  Do I need to change Icon's
  1690. internal table functions to make this sort of program efficient?  Has
  1691. anyone done something similar in Icon?
  1692.  
  1693.  
  1694.  
  1695. From icon-group-request  Wed Mar  4 18:25:40 1987
  1696. From: "Ralph Griswold" <ralph@arizona.edu>
  1697. To: icon-group@arizona.edu
  1698. Subject: bogus mail
  1699. Errors-To: icon-group-request@arizona.edu
  1700. Errors-To: icon-group-request
  1701. Status: RO
  1702.  
  1703. For some as yet unknown reason, a portion of a message that I was
  1704. remailing to persons here on the Icon Project wound up in the
  1705. outgoing icon-group mail.  It's subject is "fyi" and its
  1706. contents will no doubt appear mysterious.  Ignore it.
  1707.  
  1708. My apologies for the bother.
  1709.  
  1710.  
  1711. From icon-group-request  Wed Mar  4 18:39:17 1987
  1712. From: "David Gudeman" <gudeman@arizona.edu>
  1713. To: icon-group@arizona.edu
  1714. Subject: proof-reader
  1715. Errors-To: icon-group-request@arizona.edu
  1716. Errors-To: icon-group-request
  1717. Status: RO
  1718.  
  1719. I've been thinking about writing a proof-reading program in Icon.
  1720. The program would check spelling, punctuation, word choice, phrase
  1721. choice, sentence structure, and paragraph structure.  It would need to
  1722. store an entire English dictionary in a table cross-referenced with
  1723. various information such as synonyms, syntactic category, aesthetic
  1724. quality, etc.  I think that such a program would be very useful for us
  1725. careless writers.
  1726.  
  1727. This is a fairly major project, and I am hoping for some opinion on
  1728. the feasibility and best procedure.  Also, does anyone know of other
  1729. programs that do this?  (I am aware of the Unix utilities.)  I would
  1730. also like to find a dictionary that is already on a computer.  I know
  1731. about word-lists, I need a dictionary with syntactic category and
  1732. synonym information.
  1733.  
  1734. Here is my general idea.  I guess (without much evidence) that there
  1735. are less than 256 legal syllables in English words.  If this is the
  1736. case, then it is possible to represent words as strings where each
  1737. character represents a whole syllable.  Otherwise (if there are too
  1738. many syllables for this), words could be represented as lists of
  1739. strings where each string is a syllable.
  1740.  
  1741. The reason I want to represent words as strings of syllables is to
  1742. help in identifying misspelled words.  When a word is not recognized,
  1743. the program will try replacing syllables with other syllables that
  1744. might represent the same sound, then check if that is a real word.  If
  1745. syllables can be represented as characters, then I could use csets to
  1746. represent equivalence classes of syllables.
  1747.  
  1748. English sentences could be parsed as a context-sensitive grammar,
  1749. incomplete of course, but I think I could get one complete enough for
  1750. most sentences that are written in semi-formal style.  To detect
  1751. errors in sentence structure and punctuation, I need information on
  1752. what kinds of errors are most often made.  Then I can include these
  1753. errors in the grammar as a kind of error production.
  1754.  
  1755. The program will have to read words, selecting one syntactic category
  1756. for those words that have multiple categories.  If the sentence cannot
  1757. be parsed, the program must backtrack to the selection point and chose
  1758. a different syntactic category for the word.  In other words, the
  1759. program must be able force backtracking of lexical analysis by failure
  1760. in syntactic analysis.
  1761.  
  1762. Even more difficult than this, I have to specify some sort of grammar
  1763. to describe paragraphs.  It is not enough to say that a paragraph is a
  1764. sequence of sentences.  There must be some sort of context similarity
  1765. in the sentences of a paragraph.  I don't know whether this is
  1766. formally specifiable, but I would like to try.
  1767.  
  1768. More questions: Is Icon going to be able to handle all of this without
  1769. spending ten minutes on each paragraph?  Do I need to change Icon's
  1770. internal table functions to make this sort of program efficient?  Has
  1771. anyone done something similar in Icon?
  1772.  
  1773.  
  1774.  
  1775.  
  1776. From icon-group-request  Wed Mar  4 18:54:14 1987
  1777. From: "Ralph Griswold" <ralph@arizona.edu>
  1778. To: icon-group@arizona.edu
  1779. Subject: fyi
  1780. In-Reply-To: 
  1781.         From shafto@nprdc.arpa Wed Mar  4 10:35:45 1987
  1782.         Received: by megaron.arizona.edu; Wed, 4 Mar 87 10:35:43 MST
  1783.         Received: by arizona.arizona.edu; Wed, 4 Mar 87 10:34:46 MST
  1784.         Received: by nprdc.arpa (5.51/ 1.1)
  1785.                 id AA13801; Wed, 4 Mar 87 09:35:17 PST
  1786.         Message-Id: <8703041735.AA13801@nprdc.arpa>
  1787.         Date: 4 March 1987 0935-PST (Wednesday)
  1788.         From: shafto@nprdc.arpa
  1789.         Reply-To: shafto@nprdc.arpa
  1790.         To: ralph@arizona.edu
  1791.         Subject: MS-DOS Icon goodies
  1792. Errors-To: icon-group-request
  1793. Status: RO
  1794.  
  1795.  
  1796.  
  1797.         I received the hard-copy of Cheyenne Wills's notes.  Thanks.
  1798.         (You have my correct net address -- I guess
  1799.         something somewhere was just down.)
  1800.  
  1801.         One thing that us psychologists like to use microcomputers
  1802.         for is running experiments.  Reaction time is one of our
  1803.         favorite dependent variables.  Software evaluation is
  1804.         another area where people like to get fine-grained timing
  1805.         information in the microsecond to millisecond range.
  1806.  
  1807.         Three recent articles have pointed out that it is possible to
  1808.         use the IBM-PC and similar machines to get accurate
  1809.         microsecond-level times without any special hardware or
  1810.         software.  The three articles are the following:
  1811.  
  1812.         Smith, B., & Puckett, T.  (April, 1984).  Life in the
  1813.         fast lane.  PC Tech Journal, 63-74.
  1814.  
  1815.         Sheppard, B.  (January, 1987).  Programming insight:  High-
  1816.         performance software analysis on the IBM PC.  Byte, 12(1),
  1817.         157-168.
  1818.  
  1819.         Graves, R., & Bradley, R.  (Fedruary, 1987).  Millisecond
  1820.         interval timer and auditory reaction time programs for the IBM PC.
  1821.         Behavior Research Methods, Instruments, and Computers, 19(1), 30-35.
  1822.  
  1823.  
  1824.         All these articles use the same method:  The system timing
  1825.         chip is re-programmed (software programmable) to "Mode 2"
  1826.         rather than the BIOS setting of "Mode 3."
  1827.  
  1828.         Without getting into the mysteries of the timing chip and
  1829.         its associated ports and counters, suffice it to say that
  1830.         I've experimented extensively with this gimmick.  It does
  1831.         not require any assembly-level programming (contrary to
  1832.         what the articles above would suggest).  You can do it all
  1833.         with Turbo Pascal.
  1834.  
  1835.         Which brings me to my point:  Turbo Pascal has two
  1836.         capabilities which are not represented in Cheyenne's notes
  1837.         and which are necessary to get this no-fuss microsecond
  1838.         hardware timer:
  1839.  
  1840.         1)  The ability to read and write ports.  This is
  1841.         represented in Turbo Pascal as the pseudo-arrays Port and
  1842.         PortW.  You read a port by reading Port[i] & write a port
  1843.         by assigning a value to Port[i] (or PortW for 2-byte
  1844.         reads and writes).
  1845.  
  1846.         2)  A limited capability to e
  1847.  
  1848.  
  1849. Errors-To: icon-group-request
  1850.  
  1851. ute in-line machine code.
  1852.         Specifically, CLI and STI instructions must be placed
  1853.         around the code that reads the memory locations which
  1854.         maintain the timer interrupt count.
  1855.  
  1856.         In addition, the Peek() function would be used.
  1857.  
  1858.         I realize that both of these "features" -- especially #2 --
  1859.         might be hard to justify as additions to MS-DOS Icon.  An
  1860.         alternative would be to implement three functions, say,
  1861.         time_start, time_stop, and delay.
  1862.  
  1863.         time_start would start a 1.19 Mh stopwatch, and subsequent
  1864.         references to &time would return the elapsed time in
  1865.         (floating-point) milliseconds since the call to time_start.
  1866.         The system clock would be operating in Mode 2 (fast,
  1867.         nonstandard).
  1868.  
  1869.         time_stop would stop the fast clock and re-set the system
  1870.         clock to Mode 3 (slow, 55-msec interrupts; BIOS standard
  1871.         setting);
  1872.  
  1873.         delay(n) would delay for n milliseconds.
  1874.  
  1875.  
  1876.         Potential problems:  I've found that it's important to
  1877.         run the clock in Mode 2 only when really necessary.  For
  1878.         some reason, the system tends to hang occasionally and'
  1879.         unpredictably when the clock is in Mode 2 (and i/o is
  1880.         performed? -- I still don't know the cause, but I do know
  1881.         that the problem can be managed for practical purposes and
  1882.         programs that use this feature can be highly reliable).
  1883.  
  1884.         Another problem -- having delay(n) call time_init
  1885.         and then monitor &time until it goes above n is not
  1886.         as good an idea as it might seem.  If this approach is
  1887.         used and there are a lot of "long" 1-2 sec delays in a
  1888.         run (as there would be in the typical psychological
  1889.         experiment) the hang-up problem emerges.  Thus, the
  1890.         practical approach is to calibrate a loop (figure out
  1891.         how many iterations are required to produce the
  1892.         desired delay -- using the fast clock for the calibration
  1893.         only), then use the calibrated loop to produce the
  1894.         actual delays during long runs.
  1895.  
  1896.         I know this is special pleading for psychologists -- but
  1897.         maybe there is enough interest among software people to
  1898.         justify some kind of fast-clock feature in MS-DOS
  1899.         Icon.
  1900.  
  1901.         Mike Shafto
  1902.  
  1903.         PS:  I fogot another problem I've found:
  1904.         KayPro PC's and perhaps some others have a 4.77Mh/8 Mh
  1905.         dual clock-speed option controlled by a toggle switch.
  1906.         If the 8 Mh, nonstandard clock option is in effect, the
  1907.         timer routines cited above go to hell.
  1908.  
  1909.         mgs
  1910.  
  1911.  
  1912.  
  1913. From icon-group-request  Wed Mar  4 18:55:46 1987
  1914. From: shafto@nprdc.arpa
  1915. Reply-To: shafto@nprdc.arpa
  1916. To: icon-group@arizona.edu
  1917. Subject: micro- to millisecond timing in MS-DOS Icon?
  1918. Cc: cdavis@a.isi.edu
  1919. Errors-To: icon-group-request@arizona.edu
  1920. Errors-To: icon-group-request
  1921. Status: RO
  1922.  
  1923. NOTE:  THIS IS A REBROADCAST OF A NOTE THAT I SENT TO
  1924. RALPH GRISWOLD.  PART OF THAT PREVIOUS MESSAGE WAS ACCIDENTALLY
  1925. DISTRIBUTED TO ICON-GROUP.
  1926.  
  1927. MGS
  1928.  
  1929.  
  1930. One thing that us psychologists like to use microcomputers
  1931. for is running experiments.  Reaction time is one of our
  1932. favorite dependent variables.  Software evaluation is
  1933. another area where people like to get fine-grained timing
  1934. information in the microsecond to millisecond range.
  1935.  
  1936. Three recent articles have pointed out that it is possible to
  1937. use the IBM-PC and similar machines to get accurate
  1938. microsecond-level times without any special hardware or
  1939. software.  The three articles are the following:
  1940.  
  1941. Smith, B., & Puckett, T.  (April, 1984).  Life in the
  1942. fast lane.  PC Tech Journal, 63-74.
  1943.  
  1944. Sheppard, B.  (January, 1987).  Programming insight:  High-
  1945. performance software analysis on the IBM PC.  Byte, 12(1),
  1946. 157-168.
  1947.  
  1948. Graves, R., & Bradley, R.  (Fedruary, 1987).  Millisecond
  1949. interval timer and auditory reaction time programs for the IBM PC.
  1950. Behavior Research Methods, Instruments, and Computers, 19(1), 30-35.
  1951.  
  1952.  
  1953. All these articles use the same method:  The system timing
  1954. chip is re-programmed (via software) to "Mode 2"
  1955. rather than the BIOS setting of "Mode 3."
  1956.  
  1957. Without getting into the mysteries of the timing chip and
  1958. its associated ports and counters, suffice it to say that
  1959. I've experimented extensively with this gimmick.  It does
  1960. not require any assembly-level programming (contrary to
  1961. what the articles above would suggest).  You can do it all
  1962. with Turbo Pascal.
  1963.  
  1964. (You have to cheat and use the Turbo inline() function
  1965. in order to disable and enable interrupts -- see below).
  1966.  
  1967.  
  1968. Which brings me to my point:  Turbo Pascal has two
  1969. capabilities which are not represented in
  1970. the working notes for additions to MS-DOS Icon (Cheyenne Wills)
  1971. and which are necessary to get this no-fuss microsecond
  1972. hardware timer:
  1973.  
  1974. 1)  The ability to read and write ports.  This is
  1975. represented in Turbo Pascal as the pseudo-arrays Port and
  1976. PortW.  You read a port by referencing Port[i] & write a port
  1977. by assigning a value to Port[i] (or PortW[i] for 2-byte
  1978. reads and writes).
  1979.  
  1980. 2)  A limited capability to execute in-line machine code.
  1981. Specifically, CLI and STI instructions must be placed
  1982. around the code that reads the memory locations which
  1983. maintain the timer interrupt count.
  1984.  
  1985. In addition, the Peek() function would be used.
  1986.  
  1987. I realize that both of these "features" -- especially #2 --
  1988. might be hard to justify as additions to MS-DOS Icon.  An
  1989. alternative would be to implement three functions, say,
  1990. time_start, time_stop, and delay.
  1991.  
  1992. time_start would start a 1.19 Mh stopwatch, and subsequent
  1993. references to &time would return the elapsed time in
  1994. (floating-point) milliseconds since the call to time_start.
  1995. The system clock would be operating in Mode 2 (fast,
  1996. nonstandard).
  1997.  
  1998. time_stop would stop the fast clock and re-set the system
  1999. clock to Mode 3 (slow, 55-msec interrupts; BIOS standard
  2000. setting);
  2001.  
  2002. delay(n) would delay for n milliseconds.
  2003.  
  2004.  
  2005. Potential problems:  I've found that it's important to
  2006. run the clock in Mode 2 only when really necessary.  For
  2007. some reason, the system tends to hang occasionally and'
  2008. unpredictably when the clock is in Mode 2 (and i/o is
  2009. performed? -- I still don't know the cause, but I do know
  2010. that the problem can be managed for practical purposes and
  2011. programs that use this feature can be highly reliable).
  2012.  
  2013. Another problem -- having delay(n) call time_init
  2014. and then monitor &time until it goes above n is not
  2015. as good an idea as it might seem.  If this approach is
  2016. used and there are a lot of "long" 1-2 sec delays in a
  2017. run (as there would be in the typical psychological
  2018. experiment) the hang-up problem emerges.  Thus, the
  2019. practical approach is to calibrate a loop (figure out
  2020. how many iterations are required to produce the
  2021. desired delay -- using the fast clock for the calibration
  2022. only), then use the calibrated loop to produce the
  2023. actual delays during long runs.
  2024. This might mean that the delay() function is not a good
  2025. candidate for a built-in function & should be implemented
  2026. and calibrated as a user-defined function.
  2027. I've been using the hardware clock on my PC to
  2028. calibrate the built-in delay procedure in Turbo.
  2029.  
  2030. I know this is special pleading for psychologists -- but
  2031. maybe there is enough interest among software people to
  2032. justify some kind of fast-clock feature in MS-DOS
  2033. Icon.
  2034.  
  2035. Mike Shafto
  2036.  
  2037. PS:  I forgot another problem I've found:
  2038. KayPro PC's and perhaps some others have a 4.77Mh/8 Mh
  2039. dual clock-speed option controlled by a toggle switch.
  2040. If the 8 Mh, nonstandard clock option is in effect, the
  2041. timer routines cited above go to hell.
  2042.  
  2043. mgs
  2044.  
  2045.  
  2046.  
  2047. From icon-group-request  Wed Mar  4 23:47:34 1987
  2048. From: "Bill Mitchell" <whm>
  2049. To: icon-group
  2050. Subject: duplicates
  2051. Errors-To: icon-group-request
  2052. Status: RO
  2053.  
  2054. We had a problem earlier today with several messages appearing twice,
  2055. but it has been corrected.  Sorry about that.
  2056.  
  2057. From icon  Wed Dec 31 11:37:36 1986
  2058. From: shafto@nprdc.arpa
  2059. Reply-To: shafto@nprdc.arpa
  2060. To: icon-group@arizona.edu
  2061. Subject: mathematics vs. computer science
  2062. Errors-To: icon-group-request
  2063. Status: RO
  2064.  
  2065.  
  2066.  
  2067. The Icon Newsletter (Number 23 -- February 3, 1987) contains
  2068. a puzzling statement on page 5 regarding the "Knuth method"
  2069. for shuffling a deck of cards:
  2070.  
  2071. "Whether or not this produces a 'good' shuffle is somewhat
  2072. of an open question, but it seems to work well in practice."
  2073.  
  2074. Perhaps this was intended as a subtle joke; if so, my
  2075. apologies.
  2076.  
  2077. In any case, it's easy to prove that the method produces a truly
  2078. random shuffle (if the Icon random number generator is truly
  2079. random).  A truly random shuffle is one in which any arbitrarily
  2080. chosen card (c) has a probability of 1/N of appearing in the
  2081. k-th position in the shuffled deck (N = number of cards in
  2082. deck; k in [1..N]).
  2083.  
  2084. Let c be any card in the original deck.  The first time through
  2085. the loop, c is moved to position N with probability 1/N; this
  2086. takes into account the possibility that c is already in position
  2087. N and is left there.
  2088.  
  2089. The probability that c is moved to position N-1 on the second
  2090. iteration is the product of two probabilities: the probability 
  2091. that c was NOT moved to position N on the first pass; the
  2092. probability that it IS moved to position N-1 on the
  2093. second pass, i.e.,
  2094.  
  2095. ((N-1)/N) * (1/(N-1)) = 1/N
  2096.  
  2097. The argument continues, leading to the conclusion that
  2098.  
  2099. the probability c ends up in the k-th position in the
  2100. shuffled deck is
  2101.  
  2102. ((N-1)/N) * ((N-2)/(N-1)) * ... * ((N-k)/(N-k+1)) * (1/(N-k))
  2103.  
  2104. = 1/N
  2105.  
  2106.  
  2107. So if the random number generator is nice and uniform, the shuffle
  2108. is completely fair (completely random), and every possible permutation
  2109. of the cards is equally likely.
  2110.  
  2111. Mike Shafto
  2112.  
  2113. From icon  Tue Mar 10 13:13:13 1987
  2114. From: "David Gudeman" <gudeman>
  2115. To: icon-group
  2116. Subject: opendir for Icon
  2117. Errors-To: icon-group-request
  2118. Status: RO
  2119.  
  2120. Here are some useful procedures for Unix programming in Icon.  It
  2121. would be nice if there were also a procedure that runs "ls -dgl" on a
  2122. file and parses the output to create a record of file attributes.
  2123. I'll probably do that sometime, unless someone else does it first and
  2124. posts it to icon-group.  Procedures readfile() and tempfile() will
  2125. probably work on non-Unix machines.
  2126.  
  2127. # Return a set of all the file names in dir (except . and ..).  If
  2128. #   dir is not the name of a directory, fail.  If dir is not a string
  2129. #   or is "", then an error occurs.
  2130. #
  2131. procedure opendir(dir)
  2132.     local pipe, file_names, name_set, s
  2133.  
  2134.     (dir := string(dir), dir ~== "") |
  2135.         stop("opendir: ", image(dir), " is not a name")
  2136.  
  2137.     if dir[-1] ~== "/" then dir ||:= "/"
  2138.     pipe := open("echo " || dir || ".* " || dir || "*", "pr")
  2139.     file_names := readfile(pipe)
  2140.     close(pipe)
  2141.  
  2142.     if file_names[*dir+:3] == "/.*" then fail      # not a directory
  2143.  
  2144.     name_set := set([])
  2145.     file_names ?
  2146.     while s := tab(find(" ")) do {
  2147.         move(1)
  2148.         if s[-2:0] == "/." | s[-3:0] == "/.." then next
  2149.         insert(name_set, s)
  2150.         }
  2151.     return name_set
  2152. end
  2153. #Read the entire file, f, into a single string, and return the string.
  2154. # (the constant 1000000 may have to be reduced on machines with small
  2155. #   word sizes)
  2156. procedure readfile(f)
  2157.     local s
  2158.  
  2159.     s := ""
  2160.     while s ||:= reads(f,1000000)
  2161.     return s
  2162. end
  2163.  
  2164. # Find an unused file name beginning with prefix, open it for
  2165. #   writing, and return the file.  The name of the file can be found
  2166. #   with image(file)[6:-1].  If a temporary file cannot be found,
  2167. #   then an error occurs.
  2168. #
  2169. procedure tempfile(prefix)
  2170.     local name
  2171.  
  2172.     prefix ||:= map(&clock[4:0],":",".")
  2173.     (every name := prefix || (1 to 20) do
  2174.         close(open(name, "r")) | break) |
  2175.     stop("can't open a temporary file")
  2176.     return open(name, "c")
  2177. end
  2178.  
  2179. From icon  Tue Mar 10 14:44:19 1987
  2180. From: "Bill Mitchell" <whm>
  2181. To: gudeman
  2182. Subject: Re:  proof-reader
  2183. Cc: icon-group
  2184. In-Reply-To: <8703042318.AA01701@megaron.arizona.edu>
  2185. Errors-To: icon-group-request
  2186. Status: RO
  2187.  
  2188. AT&T's "Writer's Workbench" has some programs that supposedly do some
  2189. non-trivial sentence analysis, but I don't really have any more details at
  2190. my fingertips.  Is anyone on the list familar with the WWB programs?
  2191.  
  2192. Personally speaking, a tool that could just find omitted words would be
  2193. wonderful.
  2194.  
  2195. From icon  Tue Mar 10 14:49:57 1987
  2196. From: "Ralph Griswold" <ralph>
  2197. To: gudeman, whm
  2198. Subject: Re:  proof-reader
  2199. Cc: icon-group
  2200. In-Reply-To: <8703102144.AA22427@megaron.arizona.edu>
  2201. Errors-To: icon-group-request
  2202. Status: RO
  2203.  
  2204.     From icon Tue Mar 10 14:44:31 1987
  2205.     Received: by megaron.arizona.edu; Tue, 10 Mar 87 14:44:22 MST
  2206.     Date: Tue, 10 Mar 87 14:44:19 MST
  2207.     From: "Bill Mitchell" <whm>
  2208.     Message-Id: <8703102144.AA22427@megaron.arizona.edu>
  2209.     Received: by megaron.arizona.edu; Tue, 10 Mar 87 14:44:19 MST
  2210.     To: gudeman
  2211.     Subject: Re:  proof-reader
  2212.     Cc: icon-group
  2213.     In-Reply-To: <8703042318.AA01701@megaron.arizona.edu>
  2214.     Errors-To: icon-group-request
  2215.     
  2216.     AT&T's "Writer's Workbench" has some programs that supposedly do some
  2217.     non-trivial sentence analysis, but I don't really have any more details at
  2218.     my fingertips.  Is anyone on the list familar with the WWB programs?
  2219.     
  2220.     Personally speaking, a tool that could just find omitted words would be
  2221.     wonderful.
  2222.     
  2223.  
  2224. No doubt you'd like to start with an empty file and have it fill
  2225. in the document for you ...
  2226.  
  2227.  
  2228. From icon  Tue Mar 10 14:51:45 1987
  2229. From: "Ralph Griswold" <ralph>
  2230. To: whm
  2231. Subject: Re:  proof-reader
  2232. Cc: icon-group
  2233. In-Reply-To: <8703102144.AA22427@megaron.arizona.edu>
  2234. Errors-To: icon-group-request
  2235. Status: RO
  2236.  
  2237. IBM Research at Yorktown Heights has done a lot of work in this area.
  2238. Their system parses input text, does spelling and other checks, and
  2239. suggests corrections.  I don't know how much about their work is
  2240. in the public literature -- perhaps someone in icon-group knows and
  2241. will respond.
  2242.  
  2243. From icon-group-request  Tue Mar 10 15:20:05 1987
  2244. From: "Bill Mitchell" <whm>
  2245. To: ralph
  2246. Subject: Re:  proof-reader
  2247. Cc: icon-group
  2248. In-Reply-To: <8703102149.AA22781@megaron.arizona.edu>
  2249. Errors-To: icon-group-request
  2250. Status: RO
  2251.  
  2252.    From: "Ralph Griswold" <ralph>
  2253.    To: gudeman, whm
  2254.    Subject: Re:  proof-reader
  2255.    Cc: icon-group
  2256.    
  2257.    No doubt you'd like to start with an empty file and have it fill
  2258.    in the document for you ...
  2259.    
  2260. I'd be willing to supply the title of the document as the command line
  2261. argument, naturally.  The program would also need to be able to produce
  2262. at least 100 words a day.  Otherwise, would be faster for me to do it myself.
  2263.  
  2264. From icon-group-request  Tue Mar 10 16:31:50 1987
  2265. From: naucse!sbw (Steve Wampler)
  2266. To: arizona!shafto@nprdc.arpa
  2267. Subject: Re:  mathematics vs. computer science
  2268. Cc: arizona!icon-group
  2269. Errors-To: icon-group-request
  2270. Status: RO
  2271.  
  2272. I'm not sure that the statement is one of whether the shuffle
  2273. produces a mathematically 'good' shuffle, but whether a
  2274. mathematically 'good' shuffle is a 'good' shuffle when
  2275. simulating shuffling a deck of playing cards.  That is,
  2276. normal human shuffling techniques do not typically produce
  2277. truly random shuffles.
  2278.  
  2279. From icon-group-request  Tue Mar 10 23:21:38 1987
  2280. From: amdcad!bandy@decwrl.DEC.COM (Andy Beals)
  2281. To: icon-group@arizona.edu
  2282. Subject: article generator (whm)
  2283. Errors-To: icon-group-request
  2284. Status: RO
  2285.  
  2286. Have you looked at "markov3" by jbuck@epicen?  Perhaps someone could
  2287. re-implement it (or do better!) in icon?
  2288.     andy
  2289.  
  2290. From icon-group-request  Wed Mar 11 11:24:44 1987
  2291. From: ihnp4!iwsam!orf
  2292. Postmark: fonorow,owen r 60045184-5 iw1z261 3129797173 iwsam!orf
  2293. To: arizona!icon-group
  2294. Subject: Re:  proof-reader
  2295. Errors-To: icon-group-request
  2296. Status: RO
  2297.  
  2298. >
  2299. >IBM Research at Yorktown Heights has done a lot of work in this area.
  2300. >Their system parses input text, does spelling and other checks, and
  2301. >suggests corrections.  I don't know how much about their work is
  2302. >in the public literature -- perhaps someone in icon-group knows and
  2303. >will respond.
  2304. >
  2305. I have used both the IBM "Proof" system (described above) and the
  2306. AT&T WWB programs. I don`t really know how much of the AT&T stuff
  2307. is in the "public domain" so I will confine my comments to the
  2308. I.B.M. system - which I thought was terrific!
  2309.  
  2310. The system I used was running on a mainframe and was a tool for their
  2311. technical writing department. The user interface was marvelous. It
  2312. would high-lite misspelled words (and words that were too "complicated"
  2313. for the education level of the expected audience of the document.) 
  2314.  
  2315. A page at a time is displayed, and the user hits an arrow key to move
  2316. the cursor to the next hi-lited word.  A function key is then depressed
  2317. and a box (window) is displayed showing suggested spellings or authorized
  2318. replacements (synonyms). I was amazed because of all my misspellings,
  2319. the correct spelling was *always* one of the alternatives in the box.
  2320. To replace a word, a single key was hit corresponding to the number of
  2321. the alternative in the box.  It was very very good. A large document
  2322. can be "proofed" in a matter of minutes..
  2323.  
  2324. I was amazed to read a couple of years ago that IBM started marketing
  2325. this system on their PC's -- for $30 BUCKS!!!  I don't have an IBM
  2326. PC, but if it is 1/2 as good as the mainframe system, it is worth a
  2327. lot more than $30 bucks.. They call it "proof".
  2328.  
  2329. O. R. Fonorow
  2330. IW 1Z-261 x7173
  2331. iwsam!orf
  2332.  
  2333.  
  2334.  
  2335. From icon-group-request  Wed Mar 11 13:45:23 1987
  2336. From: shafto@nprdc.arpa
  2337. Reply-To: shafto@nprdc.arpa
  2338. To: icon-group-request@arizona.edu
  2339. Subject: Re: article generator (whm)
  2340. Cc: icon-group@arizona.edu, shafto@nprdc.arpa
  2341. Errors-To: icon-group-request
  2342. Status: RO
  2343.  
  2344.  
  2345.  
  2346. Check out RPOEM in Jim Gimpel's book
  2347. Algorithms in SNOBOL4 (Wiley, 1976?)
  2348.  
  2349.  
  2350. From icon-group-request  Wed Mar 11 13:48:17 1987
  2351. From: shafto@nprdc.arpa
  2352. Reply-To: shafto@nprdc.arpa
  2353. To: icon@arizona.edu
  2354. Subject: Re: Re:  proof-reader
  2355. Cc: whm@arizona.edu, icon-group@arizona.edu, shafto@nprdc.arpa
  2356. Errors-To: icon-group-request
  2357. Status: RO
  2358.  
  2359.  
  2360.  
  2361. Someone who has done serious work on more semantically based
  2362. text parsing, especially technical material, is
  2363.  
  2364. Dr. David Kieras
  2365. David_Kieras@um.cc.umich.edu
  2366.  
  2367.  
  2368. From icon-group-request  Wed Mar 11 13:51:19 1987
  2369. From: shafto@nprdc.arpa
  2370. Reply-To: shafto@nprdc.arpa
  2371. To: icon-group-request@arizona.edu
  2372. Subject: Re: Re:  proof-reader
  2373. Cc: ralph@arizona.edu, icon-group@arizona.edu, shafto@nprdc.arpa
  2374. Errors-To: icon-group-request
  2375. Status: RO
  2376.  
  2377.  
  2378.  
  2379. There's a lot of interest in applied text-processing research
  2380. at the Navy Personnel R&D Center, San Diego.
  2381.  
  2382. A good contact person, and old-time SNOBOLler, is
  2383. Dr. Wallace Wulfeck
  2384. wulfeck@NPRDC.ARPA
  2385.  
  2386.  
  2387. From icon-group-request  Wed Mar 11 13:54:54 1987
  2388. From: shafto@nprdc.arpa
  2389. Reply-To: shafto@nprdc.arpa
  2390. To: icon@arizona.edu
  2391. Subject: Re: Re:  proof-reader
  2392. Cc: gudeman@arizona.edu, icon-group@arizona.edu, shafto@nprdc.arpa
  2393. Errors-To: icon-group-request
  2394. Status: RO
  2395.  
  2396.  
  2397.  
  2398. Here are two people with relevant knowledge:
  2399.  
  2400. Dr. Fred Chang
  2401. Pacific Bell
  2402. pdsfac!ptsfa!tricep!ptsrat!frc@sdcsvax
  2403.  
  2404. Dr. George Miller
  2405. Princeton University
  2406. princeton!mind!geo@seismo.CSS.GOV
  2407.  
  2408.  
  2409. From icon-group-request  Wed Mar 11 15:44:25 1987
  2410. From: shafto@nprdc.arpa
  2411. Reply-To: shafto@nprdc.arpa
  2412. To: icon@arizona.edu
  2413. Subject: Re: Re:  proof-reader
  2414. Cc: whm@arizona.edu, icon-group@arizona.edu, shafto@nprdc.arpa
  2415. Errors-To: icon-group-request
  2416. Status: RO
  2417.  
  2418.  
  2419.  
  2420. Someone who has done serious work on more semantically based
  2421. text parsing, especially technical material, is
  2422.  
  2423. Dr. David Kieras
  2424. David_Kieras@um.cc.umich.edu
  2425.  
  2426.  
  2427. From icon-group-request  Wed Mar 11 15:55:10 1987
  2428. From: "Ralph Griswold" <ralph>
  2429. To: icon-group
  2430. Subject: proof-readers and such
  2431. Errors-To: icon-group-request
  2432. Status: RO
  2433.  
  2434. A friend at IBM Reseach sent me the following information from their
  2435. brochure "Computer Science at the Thomas J. Watson Research Center":
  2436.  
  2437. The CRITIQUE Advanced Text Critiquing System
  2438.  
  2439. CRITIQUE is an experimental system that aids in the preparation of written
  2440. text. It is based on state-of-the-art natural language processing techniques
  2441. and combines theoretical work in computational linguistics with practical
  2442. work in systems design.  It currently diagnoses about 25 grammar errors, such
  2443. as subject-verb number disagreement and wrong case of pronouns, and diagnoses
  2444. about 50 style errors, such as split infinitives and too many premodifiers in
  2445. a noun phrase. The system also can provide about 40 word and phrase critiques,
  2446. such as misspelled words, and it produces about 50 summary analysis critiques,
  2447. including the Flesch/Kincaid readability score.
  2448.  
  2449. The central component of CRITIQUE is a natural language parser and its
  2450. associated English grammar, both of which are written in PLNLP (Programming
  2451. Language for Natural Language Processing), developed at IBM Research.
  2452. PLNLP is a procedural programming language, with LISP-style semantics, and
  2453. a rule language for writing grammars. The PLNLP English Grammar (PEG) is a
  2454. broad-coverage, computational grammar of ordinary English, with special
  2455. features for detecting common grammatical errors. It consists of about 250
  2456. rules, which comprise about 7,000 lines of PLNLP code. An on-line dictionary
  2457. of over 100,000 entries gives it an essentially unlimited vocabulary.
  2458.  
  2459. From icon-group-request  Wed Mar 11 16:14:20 1987
  2460. From: shafto@nprdc.arpa
  2461. Reply-To: shafto@nprdc.arpa
  2462. To: icon-group-request@arizona.edu
  2463. Subject: Re: Re:  proof-reader
  2464. Cc: ralph@arizona.edu, icon-group@arizona.edu, shafto@nprdc.arpa
  2465. Errors-To: icon-group-request
  2466. Status: RO
  2467.  
  2468.  
  2469.  
  2470. There's a lot of interest in applied text-processing research
  2471. at the Navy Personnel R&D Center, San Diego.
  2472.  
  2473. A good contact person, and old-time SNOBOLler, is
  2474. Dr. Wallace Wulfeck
  2475. wulfeck@NPRDC.ARPA
  2476.  
  2477.  
  2478. From icon-group-request  Wed Mar 11 16:44:22 1987
  2479. From: shafto@nprdc.arpa
  2480. Reply-To: shafto@nprdc.arpa
  2481. To: icon@arizona.edu
  2482. Subject: Re: Re:  proof-reader
  2483. Cc: gudeman@arizona.edu, icon-group@arizona.edu, shafto@nprdc.arpa
  2484. Errors-To: icon-group-request
  2485. Status: RO
  2486.  
  2487.  
  2488.  
  2489. Here are two people with relevant knowledge:
  2490.  
  2491. Dr. Fred Chang
  2492. Pacific Bell
  2493. pdsfac!ptsfa!tricep!ptsrat!frc@sdcsvax
  2494.  
  2495. Dr. George Miller
  2496. Princeton University
  2497. princeton!mind!geo@seismo.CSS.GOV
  2498.  
  2499.  
  2500. From icon-group-request  Sat Mar 21 08:50:34 1987
  2501. From: "Ralph Griswold" <ralph>
  2502. To: icon-group
  2503. Subject: pattern words
  2504. Errors-To: icon-group-request
  2505. Status: RO
  2506.  
  2507. Here is a simple problem in string manipulation that you might try
  2508. to program in Icon.
  2509.  
  2510. The "pattern" for a word (take a word to be a string of letters
  2511. for simplicity) displays its structure by representing all
  2512. occurrences of the first letter of the word by "a", all the
  2513. occurrences of the second letter of the word by "b", and so on.
  2514. Thus, the pattern of "proposals" is "abcacdefd".
  2515.  
  2516. The problem is to write a procedure whose argument is a word and
  2517. whose value is the corresponding pattern.  Assume the argument
  2518. consists of letters if you wish, although the problem clearly
  2519. generalizes to any string of characters.  For simplicity,
  2520. assume that upper- and lowercase letters are distinct. You can
  2521. assume that no more that 26 distinct characters occur in the word,
  2522. corresponding to the pattern characters "a", "b", ..., "z", although
  2523. there again are obvious generalizations.
  2524.  
  2525. Aim for clarity and the best use of the features of Icon, but don't
  2526. ignore efficiency (imagine your procedure is going to be used on a
  2527. large word list).
  2528.  
  2529. Lest you think this problem is totally frivilous, two books of
  2530. pattern words are currently being offered by the Aegean Park Press,
  2531. a company that sells a large selection of works on cryptography.
  2532.  
  2533.  
  2534. From icon-group-request  Tue Mar 24 12:27:28 1987
  2535. From: shafto@nprdc.arpa
  2536. Reply-To: shafto@nprdc.arpa
  2537. To: icon-group@arizona.edu
  2538. Subject: an object of ridicule for group amusement
  2539. Errors-To: icon-group-request
  2540. Status: RO
  2541.  
  2542.  
  2543.  
  2544. I'll bite.  Here's my response to Ralph Griswold's
  2545. problem of 21 March:
  2546.  
  2547.  
  2548. procedure pattern(x)
  2549.     static letters,cletters,rep,corep
  2550.     initial {
  2551.         letters := &lcase || &ucase
  2552.         cletters := cset(letters)
  2553.         rep := &cset[0-:*letters]
  2554.         corep := create !rep
  2555.         }
  2556.     corep := ^corep
  2557.     while x := map(x, x[upto(cletters,x)], @corep)
  2558.     return map(x, rep, letters)
  2559. end
  2560.  
  2561.  
  2562. From icon-group-request  Tue Mar 24 12:28:08 1987
  2563. From: vijay <Vijay.Saraswat@C.CS.CMU.EDU>
  2564. Subject: Re: pattern words
  2565. To: ralph@arizona.edu
  2566. Cc: icon-group@arizona.edu, Vijay.Saraswat@C.CS.CMU.EDU
  2567. In-Reply-To: <8703211550.AA00459@megaron.arizona.edu>
  2568. Errors-To: icon-group-request
  2569. Status: RO
  2570.  
  2571. There is considerable similarity in the elegance, economy of concepts, 
  2572. the use of generators, pattern matching driven control structures etc 
  2573. in ICON and in logic programming languages. Perhaps some of you may be 
  2574. interested in a simple solution to Prof. Griswold's little programming exercise
  2575. in Prolog --- no specific features of Prolog are used, and with very minor
  2576. modifications the program is a valid CP(!,|) (which is a concurrent logic
  2577. programming language) program in which considerable use of pipelining 
  2578. is made. 
  2579.  
  2580. The basic idea is to use a symbol table to identify repetitions of chars in
  2581. the input word. In detail, with every character C[i] (say, 1 =< i =< n) 
  2582. in the input word, we associate a distinct variable V[i], which is initially
  2583. unbound, but will ultimately be bound to the translation of C[i], i.e.
  2584. the pattern of the input word will be V[i] (1 =< i =< n).
  2585.  
  2586. Having initially created a list V of n unbound variables, 
  2587. we need to do two things: first we need to unify 
  2588. two variables V[i] and V[j] iff C[i] and C[j] are the same character; and then
  2589. we need to pair off the variables V[i] with the list of
  2590. the alphabet letters, unifying V[i] with the next available alphabet if V[i] 
  2591. is not already bound, and doing nothing if V[i] is already bound. 
  2592.  
  2593. For example, consider the word C='proposals'. We create V as the list
  2594. [V1, V2, V3, V4, V5, V6, V7, V8, V9] (9 distinct variables). Now, because
  2595. C[1]=C4], we unify V1 with V4. Similarly we unify V3 with V5 and V6 with V9.
  2596. This causes the list V to become [V1, V2, V3, V1, V3, V6, V7, V8, V6].
  2597. Now we pair up the elements in V1 with the list [a, b, c, ... z]. V1 pairs
  2598. up with a, V2 with b, V3 with c. V4 is already unified with V1, which is
  2599. already unified with a. Hence we skip it and look at V5, which is bound to
  2600. V3, which is bound to c, and is also skipped. V6 next becomes bound to d, and
  2601. so on, causing V to become 'abcacdefd'. 
  2602.  
  2603. There remains the question of figuring out the values of i and j such that 
  2604. C[i]=C[j].  For this we use a symbol table. For every character C[i], we insert
  2605. the pair alpha(C[i], V[i]) in the symbol table. If subsequently, the pair
  2606. alpha(C[j], V[j]) is inserted such that C[i]=C[j], V[i] and V[j] will be
  2607. automatically unified. 
  2608.  
  2609. Here is the program: we iterate down the characters in Word, pairing 
  2610. each with a fresh variable (the list of fresh variables is Pattern), inserting
  2611. the pair alpha(Char, Out_Char) in Sym_Table producing  New_Sym_Table, and 
  2612. having done this for all the characters in the input word, alphabetizing
  2613. the list Pattern. 
  2614.  
  2615. pattern(Word, Pattern):- 
  2616.   pattern(Word, Null_Sym_Table, Pattern), alphabetize(Pattern).
  2617. pattern([Char | Word], Sym_Table, [Out_char | Pattern]):- 
  2618.   insert(alpha(Char, Out_char), Sym_Table, New_Sym_Table),  
  2619.   pattern(Word, New_Sym_Table, Pattern).
  2620. pattern([], Sym_Table, []).
  2621.  
  2622. To alphabetize List, we pick up A (the list of alphabets), and pair List with
  2623. A. The pairing operation consists of taking the next 'variable' in List and
  2624. unifying it with the next letter in A. If this succeeds then continue with the
  2625. tail of the two lists. Else, skip the variable in List becuase it already has a
  2626. value. Continue until there are no more 'variables' left in List. 
  2627.  
  2628. alphabetize(List):- alphabet(A), pair(List, A).
  2629. pair([],A).
  2630. pair([Char | List], [Letter | Alphabets]):- pair(List, Alphabets).
  2631. pair([Char | List], [Letter | Alphabets]):- 
  2632.  Char \== Letter, pair(List, [Letter | Alphabets]).
  2633.  
  2634. alphabet([a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z]).
  2635.  
  2636. It remains to define the insert operation on the symbol-table. The best 
  2637. way to implement a symbol table in Prolog (that I know of) is to use the
  2638. Sleator and Tarjan splay trees. For those of you interested in details,
  2639. I am posting the (simple!) program  on the Prolog Digest. For this example
  2640. it will suffice to use a simple list as a symbol table:
  2641.  
  2642. insert(alpha(Char, OutChar), Table, Table):- 
  2643.   Table = [alpha(Char, OutChar) | Rest].
  2644. insert(alpha(Char, OutChar), Table, Table):- 
  2645.   Table = [alpha(Char_1, Out1) | Rest]
  2646.   Char \== Char_1, insert(alpha(Char, OutChar), Rest,).
  2647.  
  2648.  
  2649. This is the entire program: it will run on any Dec-10/20  Prolog system.
  2650.  
  2651. Vijay Saraswat.
  2652.  
  2653. -------
  2654.  
  2655. From icon-group-request  Tue Mar 24 14:18:54 1987
  2656. From: shafto@nprdc.arpa
  2657. Reply-To: shafto@nprdc.arpa
  2658. To: icon-group@arizona.edu
  2659. Subject: somewhat faster pattern procedure
  2660. Errors-To: icon-group-request
  2661. Status: RO
  2662.  
  2663.  
  2664.  
  2665. I believe this is 25-30% faster than my earlier effort.
  2666.  
  2667. procedure pattern(x)
  2668.     local rep
  2669.     static letters
  2670.     initial letters := &lcase || &ucase
  2671.  
  2672.     if *x = 0 then return ""
  2673.     rep := ""
  2674.     while rep ||:= x[upto(~rep,x)]
  2675.     return map(x, rep, letters[1+:*rep])
  2676. end
  2677.  
  2678. From icon-group-request  Tue Mar 24 14:44:36 1987
  2679. From: "Ralph Griswold" <ralph>
  2680. To: icon-group
  2681. Subject: pattern words
  2682. Errors-To: icon-group-request
  2683. Status: RO
  2684.  
  2685. Here is a solution that came to me personally from a member of icon-group
  2686. who prefers to be anonymous:
  2687.  
  2688.     To: ralph@arizona.edu
  2689.     Subject: word patterns
  2690.     Status: R
  2691.     
  2692.     How about: ?
  2693.     
  2694.     procedure pat(x)
  2695.       z:=reverse(x)
  2696.       z:=map(z,z,reverse(&ascii)[1:*z + 1])
  2697.       cz:=cset(z)
  2698.       return reverse(map(z,cz,map(cz,cz,&lcase[1:*cz + 1])))
  2699.     end
  2700.  
  2701. From icon-group-request  Wed Mar 25 07:39:31 1987
  2702. From: shafto@nprdc.arpa
  2703. Reply-To: shafto@nprdc.arpa
  2704. To: icon-group-request@arizona.edu
  2705. Subject: Re: Re: pattern words
  2706. Cc: ralph@arizona.edu, icon-group@arizona.edu, Vijay.Saraswat@C.CS.CMU.EDU,
  2707.         shafto@nprdc.arpa
  2708. Errors-To: icon-group-request
  2709. Status: RO
  2710.  
  2711.  
  2712.  
  2713. Does it run or walk?
  2714.  
  2715.  
  2716. From icon-group-request  Wed Apr  1 03:20:34 1987
  2717. Return-Path: <kinner@wsu>
  2718. From: Bill Kinnersley  <kinner%wsu.csnet@RELAY.CS.NET>
  2719. To: icon-group@arizona.edu
  2720. Errors-To: icon-group-request
  2721. Status: RO
  2722.  
  2723.     Here are some more observations and opinions about Icon.  I
  2724. have no qualifications except a) an intense interest in the
  2725. language and b) being a newcomer.  A newcomer may sometimes focus
  2726. on inconsistencies that an expert has already come to accept. 
  2727. (And a cat may look at a king.)  Also, expressing controversial
  2728. opinions is a good way to encourage others to straighten you out!
  2729.  
  2730.     It seems to me that much of the Icon philosophy is a
  2731. duality: two levels of flow control.  In addition to the
  2732. conventional explicit flow: if-then-else, while-do and call-
  2733. return, Icon has added an implicit flow control: suspend, resume,
  2734. iterate and backtrack.  They parallel one another, and to some
  2735. extent they're interchangeable.  For example
  2736.  
  2737.     (A & B) | C
  2738.  
  2739. may be used (with qualifications) instead of
  2740.  
  2741.     if A then B else C
  2742.  
  2743. The parallelism is what makes the scheme logical and consistent,
  2744. while the qualifications are what make it worth having both.
  2745.  
  2746.     But there's something missing from the language that I'd
  2747. like to put back in.  Real, honest-to-gosh Booleans.  (No,
  2748. seriously.)  This is the one place where the two parallel tracks
  2749. have been allowed to intersect.  I think the important concept of
  2750. success-failure needs to be kept distinct from the even more
  2751. fundamental idea of true and false.  It's neat that they can be
  2752. treated as one, but we really need both.
  2753.  
  2754.     Booleans are everywhere in Computer Science.  There are
  2755. Boolean flags, Boolean arrays, Boolean matrices, and don't forget
  2756. some people use bit fields.  Hey, I might even want to generate a
  2757. result sequence of Booleans.  Should a modern language like Icon
  2758. really force us to simulate Booleans with integer 0's and 1's? 
  2759. Or strings "0" and "1"?  Or "true" and "false"?  Did you ever try
  2760. to XOR "01001" with "11100"?
  2761.  
  2762.     Implicit flow control is useful in a restricted class of
  2763. programming problems, but where it does apply, it is very useful. 
  2764. On the other hand it can be tricky to get right, and this is
  2765. where being a novice comes in.
  2766.  
  2767.     A problem I repeatedly run up against is the rule delimiting
  2768. resumption.  In Icon, backtracking is limited to an expression. 
  2769. The result is that expressions are sometimes forced to become
  2770. overly complex.  This distorts the appearance of our programs and
  2771. makes their intended action quite subtle.  We may need to cram as
  2772. much as possible into one poor expression.  (And it can't even be
  2773. compound.)
  2774.  
  2775. Exhibit A:
  2776.  
  2777.     "If a procedure fails, its arguments are resumed", so we
  2778. write C(B(A())) and claim it's because we *like* to be concise!
  2779.  
  2780. Exhibit B:
  2781.  
  2782.     Instead of {A(); B(); C()} we may need to write A() & B() &
  2783. C().  I guess this is not too bad if you think of the & as a sort
  2784. of "reversible semicolon".  
  2785.  
  2786. Exhibit C:
  2787.  
  2788.     When a procedure is resumed, the resumption starts with the
  2789. expression following the suspend.  In order to make use of data
  2790. backtracking therefore, much of your procedure may have to be
  2791. written in that single expression:
  2792.  
  2793.     suspend(A <- B & C <- D & E <- F & G <- H)
  2794.  
  2795.     The issue here is not one of style.  Not even clarity.  The
  2796. issue is designing the language to let the power come through
  2797. without forcing your program to stand on its head.  The cleaner
  2798. it looks, the more people will use it.  Any suggestions?
  2799.  
  2800.     Here are some minor wishes:
  2801.  
  2802. 1) Empty if-then-else clauses.  We can say
  2803.  
  2804.     break ;                 # empty, producing &null
  2805.  
  2806. and
  2807.  
  2808.     return ;        # empty, producing &null
  2809.  
  2810. We should be able (currently illegal) to say
  2811.  
  2812.     if A then B else ;        # if A fails, produces &null
  2813.  
  2814.     if A then ; else B        # similarly
  2815.  
  2816. 2) Tables.
  2817.  
  2818.     !t generates the entries of a table.  There needs to be a
  2819. way of generating the *keys*.  As it is, I use sort() to produce
  2820. a list of pairs, then pick the keys out of that by hand.  (Since
  2821. tables are in principle unordered, perhaps the keys in a table
  2822. should be made available as a set.)
  2823.  
  2824. 3) Built-in functions
  2825.  
  2826.     I still say we need:
  2827.  
  2828. a)    all P(1 to n)        # P(1) & P(2) & ... & P(n)
  2829.  
  2830. and
  2831.  
  2832. b)    any P(1 to n)        # P(1) | P(2) | ... | P(n)
  2833.  
  2834. I've tried simulating them with procedures, and come close, but
  2835. only close.  
  2836.  
  2837.  
  2838.  
  2839. From icon-group-request  Wed Apr  1 15:53:55 1987
  2840. From: "David Gudeman" <gudeman>
  2841. To: icon-group@arizona.edu
  2842. In-Reply-To: Bill Kinnersley's message of Tue, 31 Mar 87 11:39:55 PST
  2843. Subject: Suggestions for Icon
  2844. Errors-To: icon-group-request
  2845. Status: RO
  2846.  
  2847.    Date: Tue, 31 Mar 87 11:39:55 PST
  2848.    From: Bill Kinnersley  <kinner%wsu.csnet@RELAY.CS.NET>
  2849.    Errors-To: icon-group-request
  2850.  
  2851.        It seems to me that much of the Icon philosophy is a
  2852.    duality: two levels of flow control.  In addition to the
  2853.    conventional explicit flow: if-then-else, while-do and call-
  2854.    return, Icon has added an implicit flow control: suspend, resume,
  2855.    iterate and backtrack.
  2856.  
  2857. That's an interesting point, it corresonds to my idea that Icon
  2858. contains two different "paradigms": the procedural paradigm and the
  2859. goal-directed paradigm.  Icon also incorporates the functional
  2860. paradigm, in the sense that expressions return values.  (This may seem
  2861. like a peculiar way to define the functional paradigm, but notice that
  2862. pure procedural languages, pure goal-directed languages, pure logic
  2863. languages, etc. _don't_ have expressions that return values.)
  2864.  
  2865.        But there's something missing from the language that I'd
  2866.    like to put back in.  Real, honest-to-gosh Booleans.  (No,
  2867.    seriously.)  This is the one place where the two parallel tracks
  2868.    have been allowed to intersect.  I think the important concept of
  2869.    success-failure needs to be kept distinct from the even more
  2870.    fundamental idea of true and false.  It's neat that they can be
  2871.    treated as one, but we really need both.
  2872.  
  2873. Actually, success/failure is not meant to take the place of the
  2874. boolean data type.  It's just that it's not obvious that control
  2875. structures should be driven by booleans rather than something else.
  2876. Lisp uses null/`any other value', C uses 0/`any other value', Pascal
  2877. uses True/False.  The Pascal solution is actually the _least_ useful,
  2878. and was chosen more for security than for expressiveness.  The Icon
  2879. solution has its disadvantages, but it seems to fit the language very
  2880. well.
  2881.  
  2882. If I need a boolean that will be used to drive control structures, I
  2883. usually use &null for false and "" for true.  Then if x is the
  2884. variable containing one of these two values, I can write
  2885.  
  2886.     if \x then ...
  2887.  
  2888. When I do this a lot, I even get to the point where I can remember
  2889. which of the unary \ and / operators does what.  Here is how I would
  2890. add booleans to Icon: add the keyword &true, which returns a unique
  2891. object like &null.  Add the keyword &false which is identical to
  2892. &null.  Add the function boolean(x) which returns x if it is &null or
  2893. &true, and fails otherwise.  Would that be sufficient?
  2894.  
  2895.        A problem I repeatedly run up against is the rule delimiting
  2896.    resumption.  In Icon, backtracking is limited to an expression. 
  2897.    The result is that expressions are sometimes forced to become
  2898.    overly complex.  This distorts the appearance of our programs and
  2899.    makes their intended action quite subtle.  We may need to cram as
  2900.    much as possible into one poor expression.  (And it can't even be
  2901.    compound.)
  2902.  
  2903. Try using the mutual-evaluation operator ",".  It has to occur inside
  2904. parentheses, but otherwise it does pretty much what you seem to want.
  2905. It would be possible to take make _all_ Icon expressions backtrack
  2906. into previous expressions, but this would make programs much more
  2907. interconected and much harder to understand.
  2908.  
  2909.        Here are some minor wishes:
  2910.  
  2911.    1) Empty if-then-else clauses.  We can say
  2912.    We should be able (currently illegal) to say
  2913.  
  2914.        if A then B else ;        # if A fails, produces &null
  2915.  
  2916.        if A then ; else B        # similarly
  2917.  
  2918.    2) Tables.
  2919.  
  2920.        !t generates the entries of a table.  There needs to be a
  2921.    way of generating the *keys*.
  2922.  
  2923. Ditto for me, I think we need both of these.
  2924.  
  2925.    3) Built-in functions
  2926.  
  2927.    b)    any P(1 to n)        # P(1) | P(2) | ... | P(n)
  2928.  
  2929. Will (i := 1 to n, P(i)) work?
  2930.  
  2931. We also need a control structure:
  2932.  
  2933.     E1 reduce E2
  2934.  
  2935. where E1 returns a binary function, and the results of E2 are combined
  2936. pairwise with the function.  For example
  2937.  
  2938.     "+" reduce !"123"  ==>  "+"("+"("1","2"),"3")  ==> 1+2+3  ==> 6
  2939.     "||" reduce 1 to 3  ==> "||"("||"(1,2),3) ==> 1 || 2 || 3 ==> "123"
  2940.  
  2941. From icon-group-request  Wed Apr  1 16:00:24 1987
  2942. From: "Ralph Griswold" <ralph>
  2943. To: icon-group
  2944. Subject: control structures
  2945. Errors-To: icon-group-request
  2946. Status: RO
  2947.  
  2948.  
  2949. A small comment:  the result sequence for P(1 to n) is the same as
  2950. the result sequence for P(1) | P(2) | ... | P(n) (assuming no bizzare
  2951. side effects).
  2952.  
  2953. Result sequences, which represent the *capability* of expressions to
  2954. produce results, are very useful in understanding generative control
  2955. structures and how to formulate programs using generators.  We have
  2956. a technical report that discusses them (TR 85-25, Programming with
  2957. Generators).  We'll be happy to send a copy to anyone who does not
  2958. already have it -- just mail your *postal* address to me.
  2959.  
  2960.     ralph@arizona.edu
  2961.  
  2962.     Ralph Griswold
  2963.  
  2964. From icon-group-request  Thu Apr  2 11:39:33 1987
  2965. From: "Kenneth Walker" <kwalker>
  2966. To: icon-group
  2967. Subject: Suggestions for Icon
  2968. Errors-To: icon-group-request
  2969. Status: RO
  2970.  
  2971.     Date: Tue, 31 Mar 87 11:39:55 PST
  2972.     From: Bill Kinnersley  <kinner%wsu.csnet@RELAY.CS.NET>
  2973.     
  2974.         It seems to me that much of the Icon philosophy is a
  2975.     duality: two levels of flow control.  In addition to the
  2976.     conventional explicit flow: if-then-else, while-do and call-
  2977.     return, Icon has added an implicit flow control: suspend, resume,
  2978.     iterate and backtrack.
  2979.  
  2980. I tend to view sequential execution with backtracking as the underlying
  2981. control mechanism of Icon. The various control structures: ";",
  2982. if-then-else, while-do, etc. are added on top of this underlying
  2983. mechanism to give added control over it and to add to the expressive
  2984. power of the language. Most of these control structures were inspired
  2985. by counter parts in traditional languages, but if you look closely at
  2986. what there are doing, they are different - indeed, in the presence of
  2987. backtracking they must be.
  2988.     
  2989.     
  2990.         But there's something missing from the language that I'd
  2991.     like to put back in.  Real, honest-to-gosh Booleans.  (No,
  2992.     seriously.)  This is the one place where the two parallel tracks
  2993.     have been allowed to intersect.  I think the important concept of
  2994.     success-failure needs to be kept distinct from the even more
  2995.     fundamental idea of true and false.  It's neat that they can be
  2996.     treated as one, but we really need both.
  2997.     
  2998. I have used Dave Gudeman's solution to the lack of Booleans by using
  2999. &null, with the operators / and \, but I find it inelegant. A nicer,
  3000. though less efficeint solution would be to capture success and failure
  3001. in a procedure or co-expression and use these to represent true and
  3002. false:
  3003.  
  3004.         procedure true()
  3005.            return
  3006.         end
  3007.         
  3008.         procedure false()
  3009.            fail
  3010.         end
  3011.         
  3012.         procedure main()
  3013.            local x, y
  3014.            x := true
  3015.            y := false
  3016.            if x() then write("true") else write("false")
  3017.            if y() then write("true") else write("false")
  3018.         end
  3019.  
  3020. or
  3021.  
  3022.        global true, false
  3023.        
  3024.        procedure main()
  3025.           local x, y
  3026.           true := create |&null
  3027.           false := create &fail
  3028.           x := true
  3029.           y := false
  3030.           if @x then write("true") else write("false")
  3031.           if @y then write("true") else write("false")
  3032.        end
  3033.             
  3034. prehaps there should be keywords &true and &false which use one of these
  3035. two schemes.
  3036.     
  3037.     1) Empty if-then-else clauses.
  3038.     
  3039.         if A then B else ;        # if A fails, produces &null
  3040.     
  3041.         if A then ; else B        # similarly
  3042.  
  3043. You can say
  3044.  
  3045.     if A then {} else B
  3046.  
  3047. you should be able to say
  3048.  
  3049.     if A then B else {}
  3050.  
  3051. but there seems to be a bug in the compiler so that it gets translated into
  3052.  
  3053.     if A then B
  3054.  
  3055. Note that {} can also be used in a case expression:
  3056.  
  3057.     case A of {
  3058.         B: C
  3059.         D: {}
  3060.         default: E
  3061.         }
  3062.  
  3063. also (rambling on) another useful programming technique with the case
  3064. expression is to use | to create the effect of multiple ``case labels''
  3065. on one expression:
  3066.  
  3067.    case A of {
  3068.         B | C | D: E
  3069.         F: G
  3070.         }
  3071.  
  3072.     2) Tables.
  3073.     
  3074.         !t generates the entries of a table.  There needs to be a
  3075.     way of generating the *keys*.  As it is, I use sort() to produce
  3076.     a list of pairs, then pick the keys out of that by hand.  (Since
  3077.     tables are in principle unordered, perhaps the keys in a table
  3078.     should be made available as a set.)
  3079.  
  3080. I agree that there is a deficiency here.
  3081.     
  3082.     3) Built-in functions
  3083.     
  3084.         I still say we need:
  3085.     
  3086.     a)    all P(1 to n)        # P(1) & P(2) & ... & P(n)
  3087.     
  3088. Problems arise with the interpretation of all when an expression contains
  3089. more than one generator. Suppose we have two procedures, p and q, where
  3090. q(1) generates i1, i2, ..., im. Does
  3091.  
  3092.    all p(q(1 to n))
  3093.  
  3094. mean
  3095.  
  3096.    p(q(1)) & p(q(2)) & ... & p(q(n))
  3097.  
  3098. or
  3099.  
  3100.    p(i1) & p(i2) & ... & p(im) 
  3101.  
  3102. or something else and why? What happens if p is also a generator?
  3103.  
  3104. From icon-group-request  Thu Apr  2 13:32:36 1987
  3105. From: naucse!sbw (Steve Wampler)
  3106. To: arizona!gudeman
  3107. Subject: Re:  Suggestions for Icon
  3108. Cc: icon-group@arizona.edu
  3109. Errors-To: icon-group-request
  3110. Status: RO
  3111.  
  3112.        <Bill Kinnersley writes...>
  3113.        But there's something missing from the language that I'd
  3114.        like to put back in.  Real, honest-to-gosh Booleans.  (No,...
  3115.     
  3116.     <Dave Gudeman writes...>
  3117.     If I need a boolean that will be used to drive control structures, I
  3118.     ...
  3119.     add booleans to Icon: add the keyword &true, which returns a unique
  3120.     object like &null.  Add the keyword &false which is identical to
  3121.     &null.  Add the function boolean(x) which returns x if it is &null or
  3122.     &true, and fails otherwise.  Would that be sufficient?
  3123.  
  3124. I suspect Bill is not interested in booleans so much for control flow, as
  3125. as data objects (bitmaps, etc.).  Csets give a limited form of bitmap,
  3126. but is limited by the size of &cset.  For example, I would love to run
  3127. (personally) some graphics simulations in Icon, and being able to twiddle
  3128. bits would be nice.  However, I'm also not sure if that should be
  3129. considered within the domain of Icon.
  3130.     
  3131.     
  3132.        1) Empty if-then-else clauses.  We can say
  3133.        We should be able (currently illegal) to say
  3134.     
  3135.            if A then B else ;        # if A fails, produces &null
  3136.     
  3137.            if A then ; else B        # similarly
  3138.     
  3139. Why doesn't this work?  Aren't null statements legal in such places?
  3140. Sigh.  Bill is correct, though one could argue that is it 'clearer'
  3141. to write:
  3142.  
  3143.            if A then B else &null
  3144.            if A then &null else B
  3145.  
  3146. (see, Icon really *is* police state programming!)
  3147.  
  3148.        2) Tables.
  3149.     
  3150.            !t generates the entries of a table.  There needs to be a
  3151.        way of generating the *keys*.
  3152.     
  3153. Ditto for me, I think we need both of these.
  3154. I'd really like a way to generate the table elements, and
  3155. then pull either(both) the key and entry values from each element.
  3156.     
  3157.        3) Built-in functions
  3158.     
  3159.        b)    any P(1 to n)        # P(1) | P(2) | ... | P(n)
  3160.     
  3161.     Will (i := 1 to n, P(i)) work?
  3162.  
  3163. This *is* just P(1 to n), and 'all P(1 to n)' is almost 'every P(1 to n)'.
  3164. I suspect what Bill means by 'all P(1 to n)' is the ability to
  3165. spread results of an expression out (into a list?).
  3166.     
  3167.     We also need a control structure:
  3168.     
  3169.         E1 reduce E2
  3170.     
  3171.     where E1 returns a binary function, and the results of E2 are combined
  3172.     pairwise with the function.  For example
  3173.     
  3174.         "+" reduce !"123"  ==>  "+"("+"("1","2"),"3")  ==> 1+2+3  ==> 6
  3175.         "||" reduce 1 to 3  ==> "||"("||"(1,2),3) ==> 1 || 2 || 3 ==> "123"
  3176.     
  3177. This is fairly simple to model with PDCO (programmer-defined control
  3178. operations), and in fact, makes a good homework exercise on the
  3179. subject.  Of course, using a PDCO has its drawbacks.
  3180.  
  3181. By the way, assignment is a binary operator,  could one 
  3182. ":=" reduce (x|y|z)?  (Why not? - maybe there should be a 'reduceleft'
  3183. and a 'reduceright'.)
  3184.  
  3185. From icon-group-request  Sat Apr  4 12:16:11 1987
  3186. From: boba@iscuva.ISCS.COM (Bob Alexander)
  3187. To: cheyenne@arizona.edu
  3188. Subject: Re:  MS-DOS Icon suggestion
  3189. Cc: icon-group@arizona.edu
  3190. Errors-To: icon-group-request
  3191. Status: RO
  3192.  
  3193. Cheyenne -- I'm going to copy this message to icon-group, since the
  3194. ideas presented might be of general interest.
  3195.  
  3196. Icon-groupies -- for background:  this is a discussion of a technique
  3197. for making icode files executable as commands on non-UNIX machines.
  3198. The method is to place shell commands into the header portion of the
  3199. icode file that invoke iconx with the icode file as parameter.  This
  3200. technique is currently used in the Macintosh MPW version, and is being
  3201. suggested for the MS-DOS version.
  3202.  
  3203. ----------------------------------
  3204.  
  3205. Speaking of the perils of possibly rewriting edited icode files ... let
  3206. me mention an idea I had but never did anything with.
  3207.  
  3208. Since my MPW icode headers are text commands, maybe they could actually
  3209. be user-modifiable.  Additional stuff could be put in there
  3210. (occasionally); in particular manipulation of environment variables.
  3211. Wouldn't it be nice it the memory region sizes could be properties of
  3212. the programs themselves, rather than part of a global environment.  Of
  3213. course, there are other ways to do this, but I can't think of any where
  3214. the parameters would be integral to the program file.
  3215.  
  3216. Users couldn't be allowed to just edit the icode files though, because
  3217. the size of the header would have to be prevented from changing.  A
  3218. utility would have to be provided to help them out.
  3219.  
  3220. Since the environment changes would occur in a sub-shell, the global
  3221. environment would not be affected.
  3222.  
  3223. I went as far as leaving extra space in the header for MPW, but never
  3224. provided the utility.
  3225.  
  3226. On a different subject, but still related to executable icode files,
  3227. the MPW version of Icon gets its iconx path info from an environment
  3228. variable instead of having it "hard-coded" into the header.  I think
  3229. that feature would be useful in all versions of Icon.  It makes it much
  3230. easier for someone to copy a personal copy of Icon to his machine
  3231. (which doesn't already have Icon installed globally) , into his own
  3232. area of the file system.  As it is, he would usually have to either
  3233. talk to a system administrator to put it into /usr, or build his own
  3234. Icon (difficult for many users who aren't allowed to consume the amount
  3235. of file space required to build Icon).  And it just seems like a good
  3236. idea that makes life easier all around.  It could default to a
  3237. hard-coded path if the environment variable is missing.
  3238.  
  3239. In the case of MPW, where the ability to build Icon is currently not
  3240. provided, specification of the iconx path by environment variable is
  3241. the only way to allow users to choose where they want to locate Icon.
  3242.  
  3243. From icon-group-request  Mon Apr  6 12:14:40 1987
  3244. From: "Ralph Griswold" <ralph>
  3245. To: icon-group
  3246. Errors-To: icon-group-request
  3247. Status: RO
  3248.  
  3249. A couple of weeks ago I posed the following Icon programming problem:
  3250.  
  3251.    The "pattern" for a word ... displays its structure by representing all
  3252.    occurrences of the first letter of the word by "a", all the occurrences
  3253.    of the second letter of the word by "b", and so on.  Thus, the pattern
  3254.    of "proposals" is "abcacdefd".
  3255.    
  3256.    The problem is to write a procedure whose argument is a word and
  3257.    whose value is the corresponding pattern ... .
  3258.    
  3259.    Aim for clarity and the best use of the features of Icon, but don't
  3260.    ignore efficiency ... .
  3261.  
  3262. Experienced Icon programmers naturally turn to map(s1,s2,s3) when there
  3263. is a hint of character substitution or rearrangement in the air.  The
  3264. problem above is a natural for map -- the difficulty is finding the
  3265. unique characters on which to base a substitution.
  3266.  
  3267. Most solutions we received (not all of which were posted to icon-group) were
  3268. based on removing duplicate characters in the word by "conventional"
  3269. string processing, followed by a straightforward use of map.  These
  3270. solutions had the following form:
  3271.  
  3272. procedure patternword(s)        # Solution 1
  3273.    static letters            #   based on program by Gregg Townsend
  3274.  
  3275.    initial letters := string(&lcase)
  3276.  
  3277.    out := ""
  3278.    every c := !s do
  3279.     if not find(c,out) then
  3280.         out ||:= c
  3281.    return map (s, out, letters[1+:*out]))
  3282. end
  3283.  
  3284. The static identifier is used to avoid cset-to-string conversion every time
  3285. the function is called.  This makes a noticeable difference, as does the
  3286. use of find() instead of upto() -- the latter requires a string-to-cset
  3287. conversion in the loop.
  3288.  
  3289. Ardent Icon programmers try to find a way to do it entirely with map --
  3290. both because of the challenge and because of the knowledge that map operates
  3291. on all characters of its arguments in each call, avoiding loops over the
  3292. characters at the source level.
  3293.  
  3294. Here is such a solution:
  3295.  
  3296. procedure patternword(s)        # Solution 2
  3297.                     #   based on program by Ken Walker
  3298.     local numbering, orderS, orderset, patlbls
  3299.     static labels, revnum
  3300.  
  3301.     initial {
  3302.     labels := &lcase || &lcase
  3303.     revnum := reverse(&cset)
  3304.     }
  3305.  
  3306.     # 1: Map each character of s into another character, such that the
  3307.     #    the new characters are in increasing order left to right (note
  3308.     #    that the map function chooses the rightmost character of its second
  3309.     #    argument so things must be reversed).
  3310.     # 2: Map each of these new characters into contiguous letters.
  3311.  
  3312.     (numbering := revnum[1 : *s + 1]) | stop("word too long")
  3313.     orderS := map(s, reverse(s), numbering)
  3314.     orderset := string(cset(orderS))
  3315.     (patlbls := labels[1 : *orderset + 1]) | stop("too many characters")
  3316.     return map(orderS, orderset, patlbls)
  3317. end
  3318.  
  3319. Yet another all-map solution is:
  3320.  
  3321. procedure patternword(s)        # Solution 3
  3322.    static backwards, letters
  3323.  
  3324.    initial {
  3325.       backwards := reverse(&ascii)
  3326.       letters := string(&lcase)
  3327.       }
  3328.  
  3329.    z := reverse(s)
  3330.    z := map(z,z,backwards[1:*z + 1])
  3331.    cz := cset(z)
  3332.    return reverse(map(z,cz,map(cz,cz,letters[1:*cz + 1])))
  3333. end
  3334.  
  3335. I'll leave you to figure it out.
  3336.  
  3337. The concept of "good style" is more controversial in Icon than in many
  3338. other programming languages.  I personally prefer the first solution
  3339. for clarity and the second for cleverness.  Timing is more objective.
  3340. Solution 2 is fastest.  Here are comparative timings from processing
  3341. 10,000 words from the word list from Webster's 2nd. The results are
  3342. normalized to Solution 2:
  3343.  
  3344.     Solution 1    1.15
  3345.     Solution 2    1.00
  3346.     Solution 3    1.51
  3347.  
  3348. It's worth noting that the timing is very sensitive to the method
  3349. used. Solutions that use table-lookup instead of mapping typically
  3350. are in the 3 - 5 times range compared to Solution 1.  Even putting
  3351. the cset-to-string conversion in the body of the procedure in
  3352. Solution 1 adds about 20% to its running time.
  3353.  
  3354.  
  3355.  
  3356.  
  3357. From icon-group-request  Tue Apr  7 17:40:23 1987
  3358. From: Gus Fernandez <gus@shasta.stanford.edu>
  3359. Subject: comments from a skeptic
  3360. To: icon-group@arizona.edu, ralph@arizona.edu
  3361. Errors-To: icon-group-request
  3362. Status: RO
  3363.  
  3364. Having seen the responses over the past few weeks regarding the string
  3365. mapping problem, I begin to question the true power of the language
  3366.  
  3367. Given that a problem is needed to be solved, one must set forth certain
  3368. measures regarding the effectiveness of the solution. The best measure
  3369. I know of is some linear combination of the speed of the resulting code
  3370. and the speed with which the programmer implemented the solution. (code
  3371. readability, and monetary cost may be other factors but I won't go into
  3372. those here.) One must also note how these factors change as the complexity 
  3373. of the problem increases.
  3374.  
  3375. Icon is generally considered a slow language, certainly slower than
  3376. equivalent code written in C. Icon thus loses on this ground.
  3377.  
  3378. Speed of implementation is my main bone of contention. 
  3379. The fact that a "simple" problem was stated and it raised the curiosity
  3380. of several to implement either "standard" or "clever" solutions leads me
  3381. to believe that too much effort is required to come up with such "simple"
  3382. solutions over and above that which is needed to implement them in a
  3383. conventional language. Moreover, the resulting code would probably be faster.
  3384.  
  3385. Problems such as these are reminiscent of the same sorts of things I saw
  3386. being done years ago with APL. We have a programming model quite different
  3387. from that with which we are used to and are challenged to see how we can
  3388. apply it in clever ways to problems which we used to solve with conventional
  3389. languages.
  3390.  
  3391. To a certain extent, this is good, especially when first learning how to
  3392. program, and discovering the similarities and differences in syntax and
  3393. semantics between different languages. If this sort of thing goes on for
  3394. too long, however, we must question whether any language is an effective
  3395. tool for the job.
  3396.  
  3397. I consider a language to be "useful" only when I can sit down at a keyboard
  3398. and hammer out a working algorithm to a simple problem without much 
  3399. forethought and have it work more or less the first time without any glaring
  3400. logical errors.
  3401.  
  3402. Certainly, one is not "proud" of this sort of code. It is something you
  3403. needed to do to get the job done. If one thinks for a minute that this is
  3404. any sort of accomplishment, then I would like to see this person tackle
  3405. a much more complex job.
  3406.  
  3407. So far, I have only seen fairly trivial examples of ICON code. Certainly
  3408. they do well to illustrate some of the interesting features of the language,
  3409. but if I cannot rely on it to help me substantially when writing larger
  3410. systems, I see little reason to invest the time and effort required to
  3411. master a complex language such as ICON.
  3412.  
  3413. Perhaps, I am too used to the Von Neuman model to see the "obvious" advantage
  3414. of using alternative models. I can certainly see where certain "kernels" of
  3415. programs could be implemented quite effectively in languages such as ICON,
  3416. SNOBOL4, APL, or PROLOG, but when 99% of the rest of the problem requires
  3417. little more than what we already have in C, Pascal, or LISP, we are tempted
  3418. to move toward homogeneity.
  3419.  
  3420. Perhaps certain languages are best suited to proving that certain key
  3421. algorithms work, which are required in a larger system. This is a legitimate
  3422. use for specialized languages, as long as the programmer is prepared to
  3423. either re-write his code in a conventional language for speed or
  3424. compatibility, or suffer the consequences of slow code or clumsy and error
  3425. prone interfaces.
  3426.  
  3427. I believe that this is the main reason that I read about so many people
  3428. "interested in learning" about ICON, but fewer actually making effective
  3429. use of it. I would like to hear from anyone who thinks otherwise.
  3430.  
  3431.                         Gustavo A. Fernandez
  3432.  
  3433.  
  3434. From icon-group-request  Tue Apr  7 18:45:49 1987
  3435. From: "Ralph Griswold" <ralph>
  3436. To: icon-group@arizona.edu
  3437. Subject: in reponse to "comments from a skeptic"
  3438. Errors-To: icon-group-request
  3439. Status: RO
  3440.  
  3441.  
  3442. The problem posed was designed to encourage persons interested in Icon
  3443. to think about some of its features as they apply to certain kinds of
  3444. programming problems.
  3445.  
  3446. I tried it out on local folks first to see what kind of reactions I'd
  3447. get.  Most produced something corresponding to "Solution #1" from
  3448. my recent mail without any noticeable difficulty; in fact, I got back
  3449. one solution almost instantly.  So I do not think there is anything
  3450. particularly difficult or arcane about the problem to programmers
  3451. who are reasonably familiar with Icon.
  3452.  
  3453. I don't see any connection between this kind of exercise, which admittedly
  3454. is of interest mostly as a puzzler, and the use of Icon for "real"
  3455. programming problems.  There certainly are plenty of the latter, although
  3456. as for any programming language, persons usually don't publish their
  3457. programs.  We know of very successful production uses of Icon for rapid
  3458. prototyping in industry, and the regular use of Icon at many sites for all
  3459. kinds of utilities, including things like one-of-a-kind data transformations
  3460. and text generation.
  3461.  
  3462. In fact, I've been surprised to learn in recent months that some Icon sites
  3463. we didn't even know about are using the language regularly for certain kinds
  3464. of tasks.  In many cases these are commercial organizations that use languages
  3465. like C also, so I presume they feel that Icon offers economy in the balance
  3466. between program development time and programmer costs versus execution
  3467. efficiency.
  3468.  
  3469. Results from a reader survey taken last fall show all kinds of applications.
  3470. We haven't tabulated them yet, but my impression is that the bulk are
  3471. in natural language applications and prototyping.  When these are tabulated,
  3472. we'll post the results.
  3473.  
  3474. From icon-group-request  Tue Apr  7 23:09:09 1987
  3475. From: "David Gudeman" <gudeman>
  3476. To: icon-group
  3477. In-Reply-To: Gus Fernandez's message of Tue, 7 Apr 87 17:13:36 PST
  3478. Subject: Re: comments from a skeptic
  3479. Errors-To: icon-group-request
  3480. Status: RO
  3481.  
  3482. The statement that Icon is too slow is not a valid critism of Icon, it
  3483. is a critism of a particular implementation.  A lot of people once
  3484. criticized Lisp on the same grounds (some uninformed people still do)
  3485. but today there are Lisp compilers comparable to C compilers in
  3486. efficiency.
  3487.  
  3488. It took me less than 10 minutes to code the solution to the puzzle
  3489. (with complete error checking), and I am a fairly slow programmer.  If
  3490. the puzzle were supposed to be solved in C I would not have even tried
  3491. it, it would not have been worth the time and effort.  By this
  3492. measurement, Icon is superior to C.
  3493.  
  3494. Of course, if you are considering which language to use for a
  3495. particular project, you have to take into acount the implemenations
  3496. available.  But in this case, you are not judging a "language", you
  3497. are judging a program (the translator).  There are still a lot of C
  3498. programmers writing Fortran code because Fortran has better optimizing
  3499. compilers on certain machines.
  3500.  
  3501. From icon-group-request  Wed Apr  8 14:18:26 1987
  3502. From: ks26#@andrew.cmu.edu (Kenneth Sykes)
  3503. To: icon-group@arizona.edu
  3504. Subject: Re: comments from a skeptic
  3505. Errors-To: icon-group-request
  3506. Status: RO
  3507.  
  3508.  
  3509. Like many other people said, the program was a puzzle, the type of thing a
  3510. group of people come up with during coffee break.  So the time needed to
  3511. write the most efficient version is irrelevant.
  3512.  
  3513. As to real applications in ICON, I am writing a Pascal to C translator in
  3514. ICON
  3515. as a semester project.  I would consider this a "real" application.  I have
  3516. written
  3517. a simplified YACC compiler, and am currently working on a LEX compiler.  Both
  3518. programs are small, compact and easy to read.  Development time was
  3519. considerably
  3520. less than a C version, despite the fact that I am proficient in C.
  3521.  
  3522. This leads me to a question:  I would like to simulate regular expressions in
  3523. ICON,
  3524. and would be glad to hear suggestions anyone has.  I have a copy of Mr.
  3525. Griswold's
  3526. book, which gave me a starting point.  The problem is I would *ideally* like
  3527. to pass
  3528. either a matching expression or a matching procedure to a function, say
  3529. arbno, to
  3530. simulate regular expression operators.   I have not figured out a way to
  3531. invoke
  3532. a code fragment in a string, although I do know how to invoke a procedure
  3533. stored in
  3534. a string (i.e. "write"("hello")).  An Eval() primitive would be ideal for
  3535. this...
  3536.  
  3537. Any help would be appreciated.  ICON is a slick language (esp. on a VAX!);
  3538. keep up
  3539. the good work!
  3540.  
  3541. Sincerely,
  3542.  
  3543. Ken Sykes
  3544.  
  3545. From icon-group-request  Wed Apr  8 15:43:39 1987
  3546. From: ihnp4!iwsam!orf
  3547. Postmark: fonorow,owen r 60045184-5 iw1z261 3129797173 iwsam!orf
  3548. To: arizona!icon-group
  3549. Cc: arizona!ralph
  3550. Subject: Re: comments from a skeptic
  3551. Errors-To: icon-group-request
  3552. Status: RO
  3553.  
  3554. My "on-the-fly" response..
  3555.  
  3556. >Given that a problem is needed to be solved, one must set forth certain
  3557. >measures regarding the effectiveness of the solution. The best measure
  3558. >I know of is some linear combination of the speed of the resulting code
  3559. >and the speed with which the programmer implemented the solution. 
  3560. Yes, empirical evidence would be nice. My intuition, having used Icon
  3561. for about 1 1/2 years in my "real" work here at AT&T, is that it is
  3562. easy for experienced programmers to learn, and few languages would
  3563. be able to better it -- using your limited criteria.
  3564.  
  3565. >
  3566. >Icon is generally considered a slow language, certainly slower than
  3567. >equivalent code written in C. Icon thus loses on this ground.
  3568. Slower than what??? Slower than UNIX shell? Slower than Lisp?
  3569. Slower than prolog?? 
  3570.  
  3571. I don't consider it a "slow" language (although it is true that its
  3572. speed is sensitive to the experience and ability of the programmer).
  3573. We used it to prototype a complex system. We gave the prototype to our
  3574. customers less than 2 months after we started programming. We iterated
  3575. through 5 prototype releases trying to "please" our customers. There
  3576. were remarkably few (if any) concerns or issues raised about system
  3577. performance. Our departments UNIX shell based tools (scripts), of which
  3578. there are many "because they were easier to implement than C" are a
  3579. constant source of customer complaints about performance. I don't see
  3580. any difference, on our UNIX systems, between Icon and C in user interfaces.
  3581.  
  3582. I also recommend you try Icon on an Amdahl 580 (3081 equivalent) running
  3583. pure System V - You will never think speed is an issue or important in
  3584. regard to Icon again. The hardware technology today is lightyears
  3585. past the software technology.
  3586. >
  3587. >Speed of implementation is my main bone of contention. 
  3588. I think the main "niche" Icon will find is providing quick "models" of
  3589. proposed software.  Icon's speed is not an important factor as far as 
  3590. I am concerned in my work. What kind of system are you using it on?
  3591. A PC???
  3592.  
  3593. >The fact that a "simple" problem was stated and it raised the curiosity
  3594. >of several to implement either "standard" or "clever" solutions leads me
  3595. >to believe that too much effort is required to come up with such "simple"
  3596. >solutions over and above that which is needed to implement them in a
  3597. >conventional language. Moreover, the resulting code would probably be faster.
  3598. Icon, in general, is the easiest language I've ever used.  It is the only 
  3599. language I have used that over %50 of my programs run the first time - and 
  3600. I no longer even consider that surprising.
  3601.  
  3602. I (we) have experience with large "real" programs. The most interesting
  3603. aspect is that by following a "mild" discipline (trying to make the code
  3604. look like psuedo code, declaring all variables, etc.) people who came on
  3605. board in the middle of the project had no problem understanding and adapting
  3606. the Icon programs. No such thing can be said about the C programs after the
  3607. conversions. Our management is convinced that Icon is easier to maintain,
  3608. and depending on the application, not a performance dog (much better than
  3609. shell). Their primary concern now is support for the language.
  3610. >
  3611. >Problems such as these are reminiscent of the same sorts of things I saw
  3612. >being done years ago with APL. We have a programming model quite different
  3613. >from that with which we are used to and are challenged to see how we can
  3614. >apply it in clever ways to problems which we used to solve with conventional
  3615. >languages.
  3616. I will steal this line from Joe Hall (AT&T Bell Labs): "The difference 
  3617. between a language like APL and a language like Icon is that nothing you
  3618. can do can make an APL program readable."  
  3619.  
  3620. In my opinion, Icon is the most readable language (potentially) available.
  3621. >
  3622. >To a certain extent, this is good, especially when first learning how to
  3623. >program, and discovering the similarities and differences in syntax and
  3624. >semantics between different languages. If this sort of thing goes on for
  3625. >too long, however, we must question whether any language is an effective
  3626. >tool for the job.
  3627. I can understand your "concern" if the only experience you have with the
  3628. language are these esoteric solutions that came across the net. Again,
  3629. there is a certain intellectual pleasure in "breaking new ground" and
  3630. thinking in new ways, but that doesn't diminish the general usefulness
  3631. of the language.
  3632. >
  3633. >I consider a language to be "useful" only when I can sit down at a keyboard
  3634. >and hammer out a working algorithm to a simple problem without much 
  3635. >forethought and have it work more or less the first time without any glaring
  3636. >logical errors.
  3637. Bingo!  I'll match Icon against any language you care to name in this
  3638. regard. SNOBOL4 was close - in my estimation...
  3639.  
  3640. >
  3641. >Certainly, one is not "proud" of this sort of code. It is something you
  3642. >needed to do to get the job done. If one thinks for a minute that this is
  3643. >any sort of accomplishment, then I would like to see this person tackle
  3644. >a much more complex job.
  3645. The reason Icon can succeed here is that it is capable of giving a "high
  3646. level" - yet efficient - representation of the solution to a given problem.
  3647. In any case, these "one-shot" programs can be extremely valuable.
  3648. >
  3649. >So far, I have only seen fairly trivial examples of ICON code. Certainly
  3650. >they do well to illustrate some of the interesting features of the language,
  3651. >but if I cannot rely on it to help me substantially when writing larger
  3652. >systems, I see little reason to invest the time and effort required to
  3653. >master a complex language such as ICON.
  3654. Suit yourself. This is a "technology transfer" problem. You are not much
  3655. different that a lot of people who generally feel "overloaded" with too
  3656. many languages and tools... In my case, not having Icon (when I first got
  3657. here) was like having to go back to "ed" after learning "vi", or going
  3658. back to "sh" after using "ksh", etc...  Any environment without it seems
  3659. primitive to me..
  3660. >
  3661. >Perhaps, I am too used to the Von Neuman model to see the "obvious" advantage
  3662. >of using alternative models. I can certainly see where certain "kernels" of
  3663. >programs could be implemented quite effectively in languages such as ICON,
  3664. >SNOBOL4, APL, or PROLOG, but when 99% of the rest of the problem requires
  3665. >little more than what we already have in C, Pascal, or LISP, we are tempted
  3666. >to move toward homogeneity.
  3667. Not to "nit-pick" but we have "everything we need in assembly language"...
  3668.  
  3669. >
  3670. >Perhaps certain languages are best suited to proving that certain key
  3671. >algorithms work, which are required in a larger system. This is a legitimate
  3672. >use for specialized languages, as long as the programmer is prepared to
  3673. >either re-write his code in a conventional language for speed or
  3674. >compatibility, or suffer the consequences of slow code or clumsy and error
  3675. >prone interfaces.
  3676. I suppose. But prototyping is a very valuable tool in the area of software
  3677. development. Don't slight it.
  3678. >
  3679. >I believe that this is the main reason that I read about so many people
  3680. >"interested in learning" about ICON, but fewer actually making effective
  3681. >use of it. I would like to hear from anyone who thinks otherwise.
  3682. >
  3683. >                        Gustavo A. Fernandez
  3684. >
  3685. I can't give any more specifics other than we spent 9 months and iterated
  3686. through 5 Icon releases of a prototype automated testing system. The system
  3687. is quite large now, probably because it seemed so "easy" that we were willing
  3688. to tackle more. It definitely was easier to maintain in Icon - and I was
  3689. the only person originally who knew the language. Now my entire group knows
  3690. it. When we turned (most) of it into "C", that effort alone spanned 6 months. 
  3691. We are not nearly so "happy" now, and looking for something else to prototype..
  3692.  
  3693. O. R. Fonorow
  3694. AT&T Informat Systems
  3695. Software Technology Department
  3696. IW 1Z-261
  3697. ihnp4!iwsam!orf
  3698.  
  3699.  
  3700.  
  3701. From icon-group-request  Wed Apr  8 15:52:11 1987
  3702. From: "David Gudeman" <gudeman>
  3703. To: icon-group
  3704. In-Reply-To: ks26#@andrew.cmu.edu's message of Wed,  8 Apr 87 16:12:05 est
  3705. Subject: comments from a skeptic
  3706. Errors-To: icon-group-request
  3707. Status: RO
  3708.  
  3709.    Date: Wed,  8 Apr 87 16:12:05 est
  3710.    From: ks26#@andrew.cmu.edu (Kenneth Sykes)
  3711.  
  3712.    ...  I have written a simplified YACC compiler, and am currently
  3713.    working on a LEX compiler...
  3714.  
  3715. Well don't keep us in suspense.  Do they compile to Icon or C?  Are
  3716. you willing to post them?
  3717.  
  3718. If they compile to Icon, they would be great to include in the Icon
  3719. program library.
  3720.  
  3721. From icon-group-request  Wed Apr  8 21:20:06 1987
  3722. From: "Kenneth Walker" <kwalker>
  3723. To: icon-group
  3724. Subject: regular expressions
  3725. Errors-To: icon-group-request
  3726. Status: RO
  3727.  
  3728.     Date: Wed,  8 Apr 87 16:12:05 est
  3729.     From: ks26#@andrew.cmu.edu (Kenneth Sykes)
  3730.     Subject: Re: comments from a skeptic
  3731.  
  3732.     ...
  3733.     
  3734.     This leads me to a question:  I would like to simulate regular expressions
  3735.     in ICON,
  3736.     and would be glad to hear suggestions anyone has.  I have a copy of Mr.
  3737.     Griswold's
  3738.     book, which gave me a starting point.  The problem is I would *ideally* like
  3739.     to pass
  3740.     either a matching expression or a matching procedure to a function, say
  3741.     arbno, to
  3742.     simulate regular expression operators.
  3743.     
  3744. I have simulated regular expressions, but I used an experimental feature
  3745. of Icon (described in "TR86-20  An Expression Data Type for Icon") and the
  3746. feature probably will not be incorporated in a release of Icon in the
  3747. immediate future. It is possible to simulate most aspects of the feature
  3748. with co-expressions, but it is not elegant. Recursive "patterns" like
  3749. those created by an arbno procedure are particularly ugly to implement. The
  3750. simulation with co-expressions is not particularly difficult, but it is
  3751. **not** pretty. If you really think you want to see it, I can give you
  3752. details.
  3753.  
  3754. The only other approach that comes to mind is the standard set of 
  3755. transformations:
  3756.    regular expression
  3757.      -->  non-deterministic finite state autamata (NFA) with epsilon moves
  3758.      -->  NFA without epsilon moves
  3759.      -->  deterministic finite state autamata (DFA)
  3760.      -->  minimal DFA
  3761. then interpret the DFA. Of course, you can stop with the NFA and interpret
  3762. it. I haven't thought much about it, but interpreting an NFA in Icon
  3763. is probably easy because of goal directed evaluation. The question is
  3764. do you want a simple construction routine or a fast regular expression.
  3765. By the way, the co-expression approach is  non-deterministic , i.e. it
  3766. uses backtracking, and is probably significantly slower, in general, than
  3767. interpreting a minimal DFA.
  3768.  
  3769. The performance of a DFA or NFA interpreter will of course depend on your
  3770. representation of the the autamata. You will probably want to use strings
  3771. rather than individual characters as symbols.
  3772.  
  3773. From icon-group-request  Thu Apr  9 09:10:24 1987
  3774. From: ks26#@andrew.cmu.edu (Kenneth Sykes)
  3775. To: icon-group@arizona.edu
  3776. Subject: YACC/LEX in ICON
  3777. Errors-To: icon-group-request
  3778. Status: RO
  3779.  
  3780.  
  3781. The YACC compiler I mentioned in my previous post generates ICON code.
  3782. I would be more than happy to submit it to your program library - all I need
  3783. is instructions on how to do it.  I would rather wait a couple weeks until I
  3784. finish
  3785. my project before I submit it, however.  By then I will have finished the LEX
  3786. compiler (which will also generate ICON code), grammars for a Pascal to C
  3787. translator, and documentation.
  3788.  
  3789. -- Ken
  3790.  
  3791. P.S.  Thanks for the reply regarding regular expressions.  I have considered
  3792. converting the RE to a FSM, but I was hoping to exploit ICONs string features
  3793. if at all possible.  If it's not too much trouble, I would like to see how
  3794. you would
  3795. use co-expressions to simulate REs.
  3796.  
  3797. From icon-group-request  Thu Apr  9 11:16:09 1987
  3798. From: shafto@nprdc.arpa
  3799. Reply-To: shafto@nprdc.arpa
  3800. To: icon-group-request@arizona.edu
  3801. Subject: Re: comments from a skeptic
  3802. Cc: icon-group@arizona.edu, ralph@arizona.edu, shafto@nprdc.arpa
  3803. Errors-To: icon-group-request
  3804. Status: RO
  3805.  
  3806.  
  3807. -----
  3808. Without rebroadcasting Gustavo's courageous -- foolhardy?? --
  3809. message yet again, I do want to respond to a few snippets.  The
  3810. reason I think my two cents' worth might be worth two cents is
  3811. that I represent a certain class of computer user:  I have been
  3812. programming since 1968, starting with Fortran II on an IBM 1620
  3813. BCD machine.  I've used mainframes, minis, & micros; languages
  3814. ranging from assembler to C & Pascal, SNOBOL4, PL/1, and a
  3815. whole bouquet of LISP dialects -- including Interlisp on a
  3816. Xerox 1109, in case anyone thinks I can't stand up to
  3817. serious self-flagellation.  But I'm NOT a professional
  3818. programmer, much less a computer scientist.  I started programming
  3819. because it was fun & continued because programming became an
  3820. indispensible day-to-day tool.
  3821.  
  3822. I must admit that I got a bit hostile when I saw the all-map
  3823. solution.  map was the first thing I thought of, and I even
  3824. got some fragments of the all-map solution, e.g., I realized
  3825. that reverse would have to in there somewhere; but I couldn't see
  3826. how to put it all together.
  3827.  
  3828. Given that I did see the "standard" solution pretty fast, I guess
  3829. I wouldn't leap to the conclusion that Icon is slow and/or
  3830. obscure.  It's a bit like faulting Fortran because it isn't
  3831. immediately obvious how to write Quickersort.
  3832. -----
  3833.  
  3834.  
  3835.  ...  some linear combination of the speed of the resulting code
  3836. and the speed with which the programmer implemented the solution ... 
  3837.   ... readability & monetary cost ...
  3838.   ... complexity of the problem ...
  3839.   ... speed of execution ...
  3840. Speed of implementation is my main bone of contention. 
  3841.  ... comparison with APL ...
  3842.  
  3843. -----
  3844. Icon is a winner according to any of the above criteria
  3845. except perhaps sheer execution speed.  Conclusion:  Don't
  3846. use Icon if sheer execution speed is your sole performance
  3847. criterion.  But how many of us fit that description?
  3848. The comparison with APL is a complete bum rap; Icon code is
  3849. so clear that people can read and understand Icon
  3850. code even when they don't know Icon at all.
  3851. -----
  3852.  
  3853.  
  3854. I consider a language to be "useful" only when I can sit down at a keyboard
  3855. and hammer out a working algorithm to a simple problem without much 
  3856. forethought and have it work more or less the first time without any glaring
  3857. logical errors.
  3858.  
  3859. -----
  3860. The above is exactly my criterion.  That's why I now program
  3861. exclusively in Icon unless (a) I need very precise timing
  3862. [use Turbo Pascal] or (b) I need to enter SNOBOL4 patterns
  3863. as parts of commands at run-time [use SNOBOL4].  For fast
  3864. working code that you can go back to six months later and
  3865. still comprehend, Icon wins over any other language.  For my
  3866. money (i.e., $15), it beats C, Pascal, LISP, and everything
  3867. else for a combination of reasons, but NOT primarily because 
  3868. of its unique, nonstandard features.  The particular things I
  3869. like for sheer usability are:  standardization -- unsurpassed;
  3870. link directive -- write it and forget it libraries; telescoping
  3871. code -- algebraic, C-looking stuff can be telescoped down to
  3872. Lisp-looking stuff, sometimes actually improving clarity (and
  3873. the reverse can be done if THAT improves clarity); I find it
  3874. a much more "write as you think" language than any other; 
  3875. finally, most importantly, it supports the datatypes and data
  3876. structures I find most useful, especially list/arrays, tables,
  3877. and true sets (and of course strings).  To me, this is what a
  3878. high-level programming language should be:  C and Pascal do not
  3879. qualify as high-level languages because they don't support a useful
  3880. range of high-level data structures.
  3881. My criteria relate mainly to this central theme:  I want a
  3882. language that DOES work, not one that MAKES work.
  3883. -----
  3884.  
  3885.  
  3886. little more than what we already have in C, Pascal, or LISP, we are tempted
  3887. to move toward homogeneity.
  3888.  
  3889. -----
  3890. Yes, I am awe-struck at the homogeneity of LISP.
  3891. -----
  3892.  
  3893. From: "Ralph Griswold" <ralph@arizona.edu>
  3894.  
  3895. In fact, I've been surprised to learn in recent months that some Icon sites
  3896. we didn't even know about are using the language regularly for certain kinds
  3897. of tasks.  In many cases these are commercial organizations that use languages
  3898. like C also, so I presume they feel that Icon offers economy in the balance
  3899. between program development time and programmer costs versus execution
  3900. efficiency.
  3901.  
  3902. -----
  3903. This has been my experience.  I've used Icon for a range
  3904. of tasks from experiments with text analysis to maintaining
  3905. mailing lists and budgetary databases.  Not only does Icon have
  3906. a very favorable programming+execution time (winning on very
  3907. short programming-debugging time), but I think it is very easy to
  3908. learn, given its usefulness.  Of course, I already knew a lot of
  3909. languages, but could Icon be much harder to learn as a first
  3910. language than, say, Pascal?
  3911. -----
  3912.  
  3913.  
  3914. From: "David Gudeman" <gudeman@arizona.edu>
  3915.  
  3916. Of course, if you are considering which language to use for a
  3917. particular project, you have to take into acount the implemenations
  3918. available.  But in this case, you are not judging a "language", you
  3919. are judging a program (the translator).  There are still a lot of C
  3920. programmers writing Fortran code because Fortran has better optimizing
  3921. compilers on certain machines.
  3922.  
  3923. -----
  3924. Carefully choosing a language for an application is only a concern
  3925. for certain kinds of applications.  For do-it-yourselfers like
  3926. me, it is very useful to have one language that "satisfices,"
  3927. using Herb Simon's term, for almost all applications.  That's where
  3928. Icon is a winner:  it's acceptably good for a wide range of tasks,
  3929. even though some other language might be better on a given task,
  3930. especially if execution speed is extremely important and 
  3931. development and maintenance time aren't.
  3932. -----
  3933.  
  3934.  
  3935. From: ihnp4!iwsam!orf@arizona.edu
  3936. Postmark: fonorow,owen r 60045184-5 iw1z261 3129797173 iwsam!orf
  3937.  
  3938. >I consider a language to be "useful" only when I can sit down at a keyboard
  3939. >and hammer out a working algorithm to a simple problem without much 
  3940. >forethought and have it work more or less the first time without any glaring
  3941. >logical errors.
  3942. Bingo!  I'll match Icon against any language you care to name in this
  3943. regard. SNOBOL4 was close - in my estimation...
  3944.  
  3945. -----
  3946. I completely agree with all of orf's comments down to this point,
  3947. which is why I deleted them.
  3948. But I must inject a word of disagreement here:
  3949. I am certainly a SNOBOL4 fan; in fact, I think the
  3950. continued survival of LISP disproves the principle of
  3951. natural selection.  BUT -- let's be honest.  There are trade-offs;
  3952. you can simply DO things in SNOBOL4 that you can't do in
  3953. Icon.  That is granted.  But SNOBOL4 is highly idiosyncratic and opaque
  3954. compared with Icon.  I don't think this is debatable, since two
  3955. of SNOBOL4's best advocates, Griswold and Gimpel, are on record also
  3956. as its ablest critics.
  3957. SNOBOL4, like PROLOG and LISP, are high-level languages, but for
  3958. practical purposes I refuse to consider them general-purpose
  3959. programming languages, nor is APL.  Icon rules as the
  3960. highest-level, generalest-purpose language available.  PL/1
  3961. is disqualified on grounds of ugliness.
  3962. -----
  3963.  
  3964.  
  3965. From icon-group-request  Thu Apr  9 12:01:07 1987
  3966. From: "Kenneth Walker" <kwalker>
  3967. To: icon-group
  3968. Subject: co-expressions & REs
  3969. Errors-To: icon-group-request
  3970. Status: RO
  3971.  
  3972. The basic idea for simulating regular expressions is capture matching
  3973. expressions in co-expressions. For example
  3974.  
  3975.    p := create ="hi"
  3976.    "high" ? write(@p)
  3977.  
  3978. There are two problems. One is that the co-expression must be refreshed
  3979. between uses and the other is that it must be forced to produce all
  3980. alternatives during backtracking. This can be acomplished by invoking
  3981. it with the following procedure.
  3982.    
  3983.    procedure eval(e)
  3984.       e := ^e
  3985.       suspend |@e
  3986.    end
  3987.  
  3988. for example
  3989.  
  3990.    p := create =("hi" | "low")
  3991.    "low" ? every  write(eval(p))
  3992.    "hi" ? every  write(eval(p))
  3993.  
  3994. The procedure eval is circumventing most of what makes a co-expression a
  3995. co-expression.
  3996.  
  3997. If you look at what is going on in the run-time system, stacks are being
  3998. allocated and execution is switching back and forth between stacks. None of
  3999. this is needed for this problem; the stack of the caller would could be
  4000. used for all evaluation (see TR86-20).
  4001.  
  4002. To see how to create more complex matching co-expressions from simpler
  4003. ones, recall that a co-expression gets a copy of all local variables,
  4004. including parameters. The following procedure constructs the alternation
  4005. of two co-expressions.
  4006.  
  4007.    procedure alt(e1, e2)
  4008.      return create eval(e1) | eval(e2)
  4009.    end
  4010.  
  4011. The following co-expression is functionally equivalent to the one given
  4012. above.
  4013.  
  4014.    p := alt(create ="hi", create ="low")
  4015.  
  4016. In order to take a Kleene closure you needed to be able to do something
  4017. like
  4018.  
  4019.    p := arbno(create ="hi")
  4020.  
  4021. This can be done by creating a recursive co-expression, but the following
  4022. will not work
  4023.  
  4024.    arbe := create "" | (eval(e) || eval(arbe))  # WRONG
  4025.  
  4026. The idea is basically right: an arbitrary number of applications of e
  4027. is either no application (the null string) or one application followed by
  4028. and arbitrary number of applications. The problem is that the co-expression
  4029. gets a **copy** of arbe before the assignment and thus it contains the null
  4030. value not the co-expression. The following solution is better than the
  4031. one I had come up with before - it is not quite as ugly. The  idea here
  4032. is to make use of the pointer semantics of Icon records. arbe is assigned
  4033. a record. The co-expression gets a copy of arbe and thus a reference to
  4034. the record. The co-expression is then assigned to the field of the
  4035. record.
  4036.  
  4037. record r(a)
  4038.  
  4039. procedure arbno(e)
  4040.    local arbe
  4041.  
  4042.    arbe := r()
  4043.    arbe.a := create "" | (eval(e) || eval(arbe.a))
  4044.    return arbe.a
  4045. end
  4046.  
  4047. You also need a procedure to implement concatination and prabably one
  4048. to convert a string to the corrosponding matching co-expression. They
  4049. are easy once you see what is going on. I will leave them as an
  4050. exercise.
  4051.  
  4052. From icon-group-request  Thu Apr  9 12:41:48 1987
  4053. From: "David Gudeman" <gudeman>
  4054. To: icon-group
  4055. In-Reply-To: "Kenneth Walker"'s message of Thu, 9 Apr 87 12:01:07 MST
  4056. Subject: co-expressions & REs
  4057. Errors-To: icon-group-request
  4058. Status: RO
  4059.  
  4060. Ken's solution to regular expressions in Icon (using co-expressions)
  4061. is rather elegant, but it really eats up memory.  You might be able to
  4062. reduce this problem considerably by careful choice of co-expression
  4063. stack size since presumably the stacks needed for these co-expression
  4064. will be quite small.  The size of co-expression stacks can be set by
  4065. the environment variable COEXPSIZE.
  4066.  
  4067. Be careful that the stack is large enough for any possible execution
  4068. of the program, because stack overflow checking is not perfect in
  4069. Icon.  Also, you will want to avoid any recursive co-expressions or
  4070. any co-expressions that can make recursive function calls.  For arbno
  4071. try:
  4072.  
  4073.     procedure arbno(e)
  4074.     return create |eval(e)
  4075.     end
  4076.  
  4077. (no guarantees on this, I havn't tried it.)
  4078.  
  4079. From icon-group-request  Thu Apr  9 13:17:43 1987
  4080. From: "Kenneth Walker" <kwalker>
  4081. To: icon-group
  4082. Subject: Re:  co-expressions & REs
  4083. Errors-To: icon-group-request
  4084. Status: RO
  4085.  
  4086.     Date: Thu, 9 Apr 87 12:41:48 MST
  4087.     From: "David Gudeman" <gudeman>
  4088.     
  4089.     Ken's solution to regular expressions in Icon (using co-expressions)
  4090.     is rather elegant, but it really eats up memory.  You might be able to
  4091.     reduce this problem considerably by careful choice of co-expression
  4092.     stack size since presumably the stacks needed for these co-expression
  4093.     will be quite small.  The size of co-expression stacks can be set by
  4094.     the environment variable COEXPSIZE.
  4095.     
  4096.     Be careful that the stack is large enough for any possible execution
  4097.     of the program, because stack overflow checking is not perfect in
  4098.     Icon. 
  4099.  
  4100. Note that COEXPSIZE does not affect the main stack.
  4101.  
  4102.     Also, you will want to avoid any recursive co-expressions or
  4103.     any co-expressions that can make recursive function calls.
  4104.  
  4105. Calling recursive functions from co-expressions could certainly cause
  4106. problems, but recursive co-expressions should be ok. Each recursion gets
  4107. its own stack, so lots of small stacks are needed.
  4108.  
  4109.     For arbno try:
  4110.     
  4111.         procedure arbno(e)
  4112.         return create |eval(e)
  4113.         end
  4114.     
  4115.     (no guarantees on this, I havn't tried it.)
  4116.     
  4117. I don't think this will work for "matching co-expressions" because &pos will
  4118. be reset during the backtracking that occurs between repetitions.
  4119.  
  4120. From icon-group-request  Fri Apr 10 13:19:51 1987
  4121. From: ks26#@andrew.cmu.edu (Kenneth Sykes)
  4122. To: icon-group@arizona.edu
  4123. Subject: Re:  co-expressions & REs
  4124. Errors-To: icon-group-request
  4125. Status: RO
  4126.  
  4127.  
  4128. I have a couple of questions concerning Ken's post on REs:
  4129.    1) Is the use of every in the main code (i.e. "low" ? every
  4130. write(eval(p)))
  4131.        used to get at the alternatives of p (i.e. "hi", "low") or is it used
  4132. for
  4133.        some reason relating to the co-expressions?
  4134.  
  4135.    2) Is the correct way to use arbno
  4136.  
  4137.                   p := arbno(create ="hi")
  4138.                   "hihihi there!" ? every write(eval(p))
  4139.                              or
  4140.                   "hihihi there!" ? write(eval(p))
  4141.                              or something completely different?
  4142.  
  4143.         None of the above ways works - one gives me the null string and
  4144.         the other runs out of memory.  I'm really not sure how the arbno()
  4145.         code could work:
  4146.  
  4147. record r(a)
  4148.  
  4149. procedure arbno(e)
  4150.    local arbe
  4151.  
  4152.    arbe := r()
  4153.    arbe.a := create "" | (eval(e) || eval(arbe.a))
  4154.    return arbe.a
  4155. end
  4156.  
  4157. how can you run eval(arbe.a) when arbe.a is not defined on entry?  Does
  4158. it make use of &null somehow?
  4159.  
  4160.      3)  I tried to write a concat() procedure, to simulate an RE of the form
  4161.           A B:
  4162.  
  4163. procedure concat(e1, e2)
  4164.       return create eval(e1) || eval(e2)
  4165. end
  4166.  
  4167. this seems like a logical way to me, but it does not work (another out of
  4168. memory
  4169. error).
  4170.  
  4171.  
  4172. I have not tried the COEXPSIZE variable yet, which may help here.  I am
  4173. running
  4174. the Large model version of ICON on a PC with 448k of memory.
  4175.  
  4176. Again, any help would be appreciated.
  4177.  
  4178. -- Ken
  4179.  
  4180. P.S.  More explanation of co-expressions in the ICON book would be nice
  4181. (hint)
  4182.         
  4183.  
  4184. From icon-group-request  Fri Apr 10 14:46:04 1987
  4185. From: "Ralph Griswold" <ralph>
  4186. To: icon-group
  4187. Subject: re: co-expressions & REs
  4188. Errors-To: icon-group-request
  4189. Status: RO
  4190.  
  4191.  
  4192. Co-expressions were added to Icon rather late in its initial
  4193. design.  In fact, theey almost were left out of the Icon book
  4194. and the chapter on them was put in near the end of all the writing.
  4195.  
  4196. Since that time, we've developed a better understanding of how
  4197. co-expressions can be used in the context of Icon's kind of expression
  4198. evaluation, and co-expression features have been added (programmer-defined
  4199. control operation syntax).
  4200.  
  4201. I'm presently writing (slowly) a technical report on co-expressions
  4202. to fill in what's lacking in the present literature.
  4203.  
  4204. In the process, I've added co-expression tracing and the keyword ¤t,
  4205. whose value is the current co-expression (so you can tell who you are,
  4206. as it were).  Bill Mitchell is fixing a "hole" in the implementation
  4207. with respect to return points.  Out of all of this, we hope to have
  4208. a  more robust, better documented, and easier to use facility.
  4209. Unfortunately, it's going to take another release of the implementation
  4210. to bring things into sync.
  4211.  
  4212. From icon-group-request  Sat Apr 11 08:44:22 1987
  4213. From: "Kenneth Walker" <kwalker>
  4214. To: icon-group
  4215. Subject: Re:  co-expressions & REs
  4216. Errors-To: icon-group-request
  4217. Status: RO
  4218.  
  4219.     Date: Fri, 10 Apr 87 15:19:40 est
  4220.     From: ks26#@andrew.cmu.edu (Kenneth Sykes)
  4221.     Subject: Re:  co-expressions & REs
  4222.     
  4223.     
  4224.     I have a couple of questions concerning Ken's post on REs:
  4225.        1) Is the use of every in the main code (i.e. "low" ? every
  4226.     write(eval(p)))
  4227.            used to get at the alternatives of p (i.e. "hi", "low") or is it used
  4228.     for
  4229.            some reason relating to the co-expressions?
  4230.  
  4231. oops, I borrowed the code from another test. The every interates over all
  4232. matches, but in this case there is only one match.
  4233.     
  4234.        2) Is the correct way to use arbno
  4235.     
  4236.                       p := arbno(create ="hi")
  4237.                       "hihihi there!" ? every write(eval(p))
  4238.                                  or
  4239.                       "hihihi there!" ? write(eval(p))
  4240.                                  or something completely different?
  4241.     
  4242.             None of the above ways works - one gives me the null string and
  4243.             the other runs out of memory.
  4244.  
  4245. The first result should be the null string - it is the result of zero
  4246. matches. every should iterate over all the solutions:
  4247. ""
  4248. "hi"
  4249. "hihi"
  4250. "hihihi"
  4251. I have no problems running these examples here on a VAX. Here are some
  4252. suggestions for environment variables which should help your out of memory
  4253. problems:
  4254. COEXPRSIZE 1000
  4255. STRSIZE    5000
  4256. HEAPSIZE   5000
  4257. MSTKSIZE   3000
  4258. If they don't help let us know.
  4259.  
  4260.             I'm really not sure how the arbno() code could work:
  4261.     
  4262.     record r(a)
  4263.     
  4264.     procedure arbno(e)
  4265.        local arbe
  4266.     
  4267.        arbe := r()
  4268.        arbe.a := create "" | (eval(e) || eval(arbe.a))
  4269.        return arbe.a
  4270.     end
  4271.     
  4272.     how can you run eval(arbe.a) when arbe.a is not defined on entry?  Does
  4273.     it make use of &null somehow?
  4274.  
  4275. The create is just capturing the code, eval(arge.a) is not executed until
  4276. the result returned by arbno is evaluated by eval. By that time arbe.a
  4277. has been assigned the co-expression.
  4278.     
  4279.          3)  I tried to write a concat() procedure, to simulate an RE of the form
  4280.               A B:
  4281.     
  4282.     procedure concat(e1, e2)
  4283.           return create eval(e1) || eval(e2)
  4284.     end
  4285.     
  4286.     this seems like a logical way to me, but it does not work (another out of
  4287.     memory error).
  4288.  
  4289. That is the correct. I ran it here without any problems.
  4290.  
  4291. From icon-group-request  Sat Apr 11 10:36:29 1987
  4292. From: "Ralph Griswold" <ralph>
  4293. To: icon-group
  4294. Subject: solitaire program
  4295. Errors-To: icon-group-request
  4296. Status: RO
  4297.  
  4298. An Icon program for playing solitaire (s.icn) showed up in our
  4299. uucp area a few days ago -- but with no origin or indication
  4300. of authorship.  Will anyone acknowledge it?
  4301.  
  4302. From icon-group-request  Mon Apr 13 23:12:51 1987
  4303. From: ihnp4!ihuxy!nowlin
  4304. Message-Version: 2
  4305. >To: /addr=iwsam!orf, /addr=ihnp4!arizona!icon-group
  4306. Message-Service: Mail
  4307. Message-Protocol: EMail
  4308. End-Of-Header: 
  4309. Email-Version: 2
  4310. X-Postmark: jerry.d.nowlin attbl ix1c461 55621 3129790441 ihuxy!nowlin
  4311. To: arizona!icon-group
  4312. Subject: Re: pattern words
  4313. Ua-Message-Id: <post.nowlin.Mon, 13 Apr 1987 10:23 CDT>
  4314. End-Of-Protocol: 
  4315. Errors-To: icon-group-request
  4316. Status: RO
  4317.  
  4318.  > Here is a simple problem in string manipulation that you might try
  4319.  > to program in Icon.
  4320.  
  4321.  > The "pattern" for a word (take a word to be a string of letters
  4322.  > for simplicity) displays its structure by representing all
  4323.  > occurrences of the first letter of the word by "a", all the
  4324.  > occurrences of the second letter of the word by "b", and so on.
  4325.  > Thus, the pattern of "proposals" is "abcacdefd".
  4326.  .
  4327.  .
  4328.  .
  4329.  > Aim for clarity and the best use of the features of Icon, but don't
  4330.  > ignore efficiency (imagine your procedure is going to be used on a
  4331.  > large word list).
  4332.  
  4333. I had to try this.  Especially after seeing some solutions fly by with
  4334. co-expressions in them.  One of the criteria was supposed to be "clarity"
  4335. and another "efficiency".  This is about as straight forward as you can
  4336. get.  It just assumes a knowledge of the test for null (/).  After trying
  4337. this and the other solutions I received with a list of 23739 words it
  4338. seems to be about as fast as the others.
  4339.  
  4340. procedure change(word)
  4341.  
  4342.     ctab := table()
  4343.     pattern := ""
  4344.  
  4345.     every c := !word do {
  4346.         /ctab[c] := &lcase[*ctab+1]
  4347.         pattern ||:= ctab[c]
  4348.     }
  4349.  
  4350.     return pattern
  4351. end
  4352.  
  4353. It could be made more efficient by putting a dummy value in the ctab table
  4354. before generating characters.  That way the addition in the calculation of
  4355. an index into &lcase could be avoided.  For long lists of long words it
  4356. would be worth doing.
  4357.  
  4358. Jerry Nowlin
  4359. (...!ihnp4!ihuxy!nowlin)
  4360.  
  4361. From icon-group-request  Tue Apr 14 13:41:37 1987
  4362. From: "Bill Mitchell" <whm>
  4363. To: icon-group
  4364. Subject: Re: comments from a skeptic
  4365. Errors-To: icon-group-request
  4366. Status: RO
  4367.  
  4368. Forwarded message follows...
  4369.  
  4370.    From ihnp4!ihuxy!nowlin  Thu Apr  9 14:52:19 1987
  4371.    >To: /addr=ihnp4!arizona!icon-group-request
  4372.    X-Postmark: jerry.d.nowlin attbl ix1c461 55621 3129790441 ihuxy!nowlin
  4373.    To: arizona!icon-group-request
  4374.    Subject: Re: comments from a skeptic
  4375.    
  4376.    I just had to respond to this message.  It was too much for me to take.
  4377.    
  4378.     > Having seen the responses over the past few weeks regarding the string
  4379.     > mapping problem, I begin to question the true power of the language.
  4380.     > ...
  4381.     > Icon is generally considered a slow language, certainly slower than
  4382.     > equivalent code written in C. Icon thus loses on this ground.
  4383.    
  4384.    Nobody I know will argue the point that Icon is slower than good C but I
  4385.    wouldn't generalize and call Icon a slow language.  It can't compare with C
  4386.    and assembler but it flys by any shell scripts I've ever seen and passes
  4387.    BASIC on the PC like it was standing still.
  4388.    
  4389.     > Speed of implementation is my main bone of contention. 
  4390.     > The fact that a "simple" problem was stated and it raised the curiosity
  4391.     > of several to implement either "standard" or "clever" solutions leads me
  4392.     > to believe that too much effort is required to come up with such "simple"
  4393.     > solutions over and above that which is needed to implement them in a
  4394.     > conventional language. Moreover, the resulting code would probably be
  4395.     > faster.
  4396.    
  4397.    Your previous comments lead me to believe you've never bothered to learn
  4398.    Icon at even a rudimentary level.  Don't argue religion if you can't read
  4399.    the bible.  Most of the time shell won't do what I want I resort to Icon. 
  4400.    It's much faster to solve little problems in it than in C.  For example, I
  4401.    wanted to add carriage returns to the end of each line in ascii files so I
  4402.    could transfer some files to an MS-DOS machine and be able to use them.  A
  4403.    three line Icon program that took about 30 seconds to type in and translate
  4404.    did the trick.
  4405.    
  4406.        procedure main()
  4407.            while write(read(),"\r")
  4408.        end
  4409.    
  4410.    I then invoked the program from a shell script that looped and fixed a
  4411.    whole batch of files.  To do the same program in shell would be cumbersome
  4412.    to say the least.  It's also incredibly slow!  To do the same in C would
  4413.    take more time and be more prone to error.  Icon is the best solution for
  4414.    these kinds of problems.  It's exactly the speed of implementation that
  4415.    makes Icon so useful for small problems like this.
  4416.    
  4417.     > Problems such as these are reminiscent of the same sorts of things I saw
  4418.     > being done years ago with APL. We have a programming model quite different
  4419.     > from that with which we are used to and are challenged to see how we can
  4420.     > apply it in clever ways to problems which we used to solve with conventional
  4421.     > languages.
  4422.     >
  4423.     > To a certain extent, this is good, especially when first learning how to
  4424.     > program, and discovering the similarities and differences in syntax and
  4425.     > semantics between different languages. If this sort of thing goes on for
  4426.     > too long, however, we must question whether any language is an effective
  4427.     > tool for the job.
  4428.    
  4429.    Once again your naivete is showing.  I've been using C for a long time and
  4430.    I still enjoy trying to do "clever" thing with it from time to time.  Don't
  4431.    hold a language responsible if novice programmers (or even experienced
  4432.    ones) want to experiment from time to time.  Would you consider C an
  4433.    ineffective tool just because some people try to push it to the limits? 
  4434.    One of the nice things about Icon is that it can be used in a purely
  4435.    conventional style if that's what you want.  If you want to take the time
  4436.    to learn some of the more advanced features of the language you can program
  4437.    circles, in terms of implementation speed, around C for lots of applications.
  4438.    
  4439.     > I consider a language to be "useful" only when I can sit down at a keyboard
  4440.     > and hammer out a working algorithm to a simple problem without much 
  4441.     > forethought and have it work more or less the first time without any glaring
  4442.     > logical errors.
  4443.     > 
  4444.     > Certainly, one is not "proud" of this sort of code. It is something you
  4445.     > needed to do to get the job done. If one thinks for a minute that this is
  4446.     > any sort of accomplishment, then I would like to see this person tackle
  4447.     > a much more complex job.
  4448.     > 
  4449.     > So far, I have only seen fairly trivial examples of ICON code. Certainly
  4450.     > they do well to illustrate some of the interesting features of the language,
  4451.     > but if I cannot rely on it to help me substantially when writing larger
  4452.     > systems, I see little reason to invest the time and effort required to
  4453.     > master a complex language such as ICON.
  4454.    
  4455.    I work at AT&T Bell Labs and there are lots of trivial program that you can
  4456.    quickly become dependent on in this and many other programming
  4457.    environments.  I wouldn't discard a programming language out of hand just
  4458.    because it does a whiz bang job on trivial programs.  Icon also does very
  4459.    well at large programs.
  4460.    
  4461.    I'll give you an example.  The area I work in develops very large databases
  4462.    that change on a regular basis.  There's a system of C programs that check
  4463.    the integrity of the database after changes are made.  The process of
  4464.    running this system on a medium sized database took almost half a day and
  4465.    generated a error report that only identified tuples that were bad.  One of
  4466.    the engineers working on the database tools wrote an Icon program to do the
  4467.    same task.  His main goal was to generate a more detailed error report so
  4468.    that the database could be fixed.  His program prints the bad records in
  4469.    each bad tupple and exactly what's wrong with them.  This Icon program took
  4470.    several hours to do the same task that took the C programs six to eight
  4471.    hours.  He programmed his tool using standard procedural programming
  4472.    techniques so when it was slower than he liked came to me to see if I could
  4473.    speed up his code a little.  When we were done his tool could check the
  4474.    same database in about 15 minutes.  He not only improved the reports
  4475.    generated, he speeded up the process by more than a factor of 20.  Icon is
  4476.    NOT a trivial language.
  4477.    
  4478.     > Perhaps, I am too used to the Von Neuman model to see the "obvious" advantage
  4479.     > of using alternative models.
  4480.    
  4481.    Perhaps you're too comfortable with what you already know and it's easier
  4482.    to argue against new languages and programming techniques than it is to
  4483.    learn them.
  4484.    
  4485.     >                         Gustavo A. Fernandez
  4486.    
  4487.    Jerry Nowlin
  4488.    (...!ihnp4!ihuxy!nowlin)
  4489.    
  4490.    
  4491.  
  4492. From icon-group-request  Thu Apr 16 13:33:14 1987
  4493. From: boba@iscuva.ISCS.COM (Bob Alexander)
  4494. To: icon-group@arizona.edu
  4495. Subject: Icon close() function
  4496. Errors-To: icon-group-request
  4497. Status: RO
  4498.  
  4499. I've been doing a fair amount of shell script type stuff in Icon
  4500. recently (under UNIX), and there is a "shortcoming" that is rather
  4501. bothersome sometimes.
  4502.  
  4503. Background
  4504. ----------
  4505.  
  4506. In UNIX versions of Icon, using open() with the "p" option invokes the
  4507. C function popen(). Popen(command,<read or write>) allows execution of
  4508. any UNIX command, with the popen caller either providing "standard
  4509. input" to the command, or receiving its "standard output", depending on
  4510. whether the "command" wass opened for write or read.  (Bear with me if
  4511. you're a UNIX/Icon whiz and already know this stuff.  I thought I was,
  4512. and I only recently discovered this powerful capability!)
  4513.  
  4514. The Icon system() function invokes a UNIX command, and returns the
  4515. command's exit status value to the system() function's caller.  That's
  4516. nice, because it is sometimes necessary to check that value.
  4517.  
  4518. However, when using open() with the "p" option (invoking popen()),
  4519. there is no way to check the command's exit status.  In C, the status
  4520. is returned by the corresponding pclose().  In Icon, close() always
  4521. returns the "file" that was closed.  Open(...,"p") is an extremely
  4522. useful facility with a nasty limitation that it can't be used if one
  4523. needs to know the exit status of the command.
  4524.  
  4525. Proposal
  4526. --------
  4527.  
  4528.     It would be more useful if a close() corresponding to an
  4529.     open(...,"p") would return the command's exit value as an
  4530.     integer, (similar to system()), rather than the file.
  4531.  
  4532. Of course, that would create an inconsistency (sort of) in the close()
  4533. function (unless all Icon closes returned integers, but that wouldn't
  4534. make much sense for files).  But I contend that open(...,"p")/close()
  4535. is really more parallel to system() than it is to
  4536. open(<file>)/close().  (And I've never found much useful to do with the
  4537. file returned by close() anyway).
  4538.  
  4539. I'd be interested in hearing comments or debate on this matter.
  4540.  
  4541. From icon-group-request  Thu Apr 16 14:00:11 1987
  4542. From: boba@iscuva.ISCS.COM (Bob Alexander)
  4543. To: icon-group@arizona.edu
  4544. Subject: More on Icon for shell script applications
  4545. Errors-To: icon-group-request
  4546. Status: RO
  4547.  
  4548. Oh yeah, I just remembered another limitation I bumped up against while
  4549. using Icon for shell script type applications.
  4550.  
  4551. The string length limit of 256 (MacCvtLen) for the system() function is
  4552. too short for some uses.  In particular, there are times when it is
  4553. desirable to build long parameter lists consisting of many file names.
  4554. In such cases I was able to work around the limitation by repetitive
  4555. calls to the command, a much less efficient alternative.  There are
  4556. other cases where it could prevent a desired operation from being
  4557. performed at all.
  4558.  
  4559. UNIX generally allows command strings to be much longer than 256
  4560. characters; into the tens of thousands, I think.
  4561.  
  4562. Icon's philosophy is to be free of any size limits that one would
  4563. really ever run up against.  It seems contrary to the spirit of Icon to
  4564. have such a limit on the lengths of commands passed to the operating
  4565. system.
  4566.  
  4567. I propose that the string length limit be removed for system() and
  4568. open() calls (open(...,"p") in particular).
  4569.  
  4570. From icon-group-request  Thu Apr 16 14:37:26 1987
  4571. From: "David Gudeman" <gudeman>
  4572. To: icon-group
  4573. In-Reply-To: boba@iscuva.ISCS.COM's message of Thu, 16 Apr 87 13:29:37 pst
  4574. Subject: Icon close() function
  4575. Errors-To: icon-group-request
  4576. Status: RO
  4577.  
  4578. Another thing that would be nice for the system() and open(...,"p")
  4579. functions is a way to specify a direct execution instead of execution
  4580. through the shell.  That is, system(s) starts a shell process and
  4581. passes s to it as input.  I would like to write system(s,s1,...,sn)
  4582. where s is the name of a program that is executed, and s1 to sn are
  4583. arguments passed to the program.  This would in general be much faster
  4584. than starting a shell.
  4585.  
  4586. From icon-group-request  Fri Apr 17 11:54:36 1987
  4587. From: ihnp4!iwsam!orf
  4588. Postmark: fonorow,owen r 60045184-5 iw1z261 3129797173 iwsam!orf
  4589. To: arizona!icon-group
  4590. Subject: Implementation
  4591. Errors-To: icon-group-request
  4592. Status: RO
  4593.  
  4594.  
  4595. One thing I forget to add to my preview message. I am now reading
  4596. Griswolds' Implementation book -- and enjoying it thoroughly! I
  4597. highly recommend it to anyone considering changes to the present
  4598. implementation, or wondering about various idiosyncracies..
  4599.  
  4600. orf
  4601.  
  4602.  
  4603.  
  4604. From icon-group-request  Fri Apr 17 11:54:32 1987
  4605. From: ihnp4!iwsam!orf
  4606. Postmark: fonorow,owen r 60045184-5 iw1z261 3129797173 iwsam!orf
  4607. To: arizona!icon-group
  4608. Cc: ihcup!pax, ihuxy!nowlin
  4609. Subject: Internal Limits
  4610. Errors-To: icon-group-request
  4611. Status: RO
  4612.  
  4613. And the litany goes on... Another "limitation" many of you may not be 
  4614. aware of is that there is an internal limit on the read() function.
  4615.  
  4616. We "discovered" the read() limit while using Icon programs as "front-ends"
  4617. to a DBMS. The database may contain records of 4096 chars. I don't 
  4618. remember exactly, but the "delivered" Icon internal buffer limit for the read 
  4619. function is about 2200 chars.
  4620.  
  4621. Because of this limit, the aforementioned system() limit and a few limitations 
  4622. I will mention in a moment, we simply wound up using a personal Icon interpreter
  4623. and increased the limits as necessary.  Remember, you have the source and 
  4624. can control these limits at your site - with or without resorting to a PI.
  4625.  
  4626. By the way, as an aside, our first attempt was simply to increase MaxCvtLen to
  4627. 512. I don't remember exactly what happened, but we started hitting the process
  4628. ulimit on a 3B2, i.e. MaxCvtLen is used in a *lot* of places. So we finally
  4629. just hard-coded 512 into the buffer declaration for the system() function.
  4630. Also, I don't know what internal UNIX limits there are - but command lines
  4631. are not (at least under System 5) allowed to be "10s of thousands of chars..."
  4632. I think the limit is probably 1024 (see xargs(1)).
  4633.  
  4634. As far as returning "useable" values with the close() function, I don't
  4635. see a problem (other than existing documentation) with that idea.  We also
  4636. ran into problems in that the UNIX write/close/flush would fail - and there is 
  4637. currently no way to detect this in Icon.  (Under certain circumstances when 
  4638. there is no more space on a device, (under system V) the only way to detect
  4639. whether or not the write failed is if the C close() library routine returns 
  4640. an error value.)
  4641.  
  4642. I guess my "requirement" is that if a write() or close() fails - that
  4643. a run-time error be issued. (So we don't have to always check
  4644. for failure in our programs). I'd also like to see a run-time error
  4645. if the internal read() buffer (or any for that matter) over-flows.
  4646.  
  4647. As far as returning the return code from open(..,"p")  through close()
  4648. .. sounds reasonable.  Keep in mind that with popen() or system() 
  4649. something like:
  4650.  
  4651.     open("sort <JuNk | uniq | tr ","p") 
  4652.  
  4653. where "JuNk" doesn't exist will return 0. That is, the return code of
  4654. the "tr" command is returned even though the entire pipe didn't do what 
  4655. you expected... (i.e. sort returned 1) 
  4656.  
  4657. Finally, I oppose changing the semantics of "system()" (to be more like an
  4658. "exec()") because of the parallel to the C system() function.  Sounds like
  4659. a good design for a PI function however! 
  4660.  
  4661. O. R. Fonorow
  4662. IW 1Z-261 x7173
  4663. iwsam!orf
  4664.  
  4665.  
  4666.  
  4667. From icon-group-request  Sun Apr 19 23:19:32 1987
  4668. Return-Path: <kinner@wsu>
  4669. From: Bill Kinnersley  <kinner%wsu.csnet@RELAY.CS.NET>
  4670. To: icon-group@arizona.edu
  4671. Errors-To: icon-group-request
  4672. Status: RO
  4673.  
  4674.  
  4675.     Regarding the question of whether Icon is easy or hard to 
  4676. learn, I would say easy to learn, hard to master.  In my 
  4677. Programming Languages course, I teach Icon as the first "new" 
  4678. language, right after surveys of Fortran and Pascal.  It is 
  4679. presented at first as a dialect of Pascal with high-level data 
  4680. types: lists, strings, etc.  (Records aren't mentioned--these 
  4681. Pascalers would use them and nothing else.)  The students write 
  4682. their first programs, and build up confidence.  THEN we kick the 
  4683. props out! *-) 
  4684.  
  4685.     Someone mentioned confusion between the two null-testing
  4686. operators / and \.  Here's a way to remember which is which. 
  4687. Associate them with the crossbar appearing in their names.  \
  4688. stands for Notnull and / stands for iZnull.
  4689.  
  4690.     Has anyone noticed the striking similarity between Icon and 
  4691. this other language called Lucid?  Lucid has a totally different 
  4692. ancestry, but it wound up with many of the same features.  In 
  4693. Lucid, the idea of a result sequence is even more pervasive than
  4694. in Icon.  Every variable has a "history" of values.  In Icon, an
  4695. ordinary variable produces one result, say 2.  In Lucid, it would
  4696. produce <2, 2, 2...>  Every expression automatically resumes the
  4697. variables appearing in it.  Histories may be terminated with the
  4698. symbol eod ("end-of-deck"), which corresponds to our failure. 
  4699.     Other special symbols found in Lucid are true, false, nil,
  4700. and error.  An inappropriate calculation results in the error
  4701. object.  Thus, the Icon concept of failure has been split into
  4702. three: false, eod, and error.
  4703.     Once result sequences like <true, false, true, ...> are
  4704. available, it is possible to have one sequence control another. 
  4705. Operators asa ("as-soon-as") and wvr ("whenever") let you select
  4706. values from result sequence A depending on the Boolean values in
  4707. sequence B.  Wouldn't something like this be useful in Icon?
  4708.  
  4709. ----
  4710. "If at first you do not fail, try try again."
  4711.                                       --Bill Kinnersley
  4712.     USENET: ...!ucbvax!ucdavis!egg-id!ui3!wsucshp!kinner
  4713.     INTERNET: kinner%wsu.csnet@RELAY.CS.NET
  4714.     CSNET: kinner@wsu
  4715.     MAIL: CS Dept, Washington State Univ, Pullman WA 99164-1210
  4716.     PHONE: (509)332-3340
  4717.  
  4718.  
  4719. From icon-group-request  Mon Apr 20 18:32:45 1987
  4720. From: boba@iscuva.ISCS.COM (Bob Alexander)
  4721. To: icon-group@arizona.edu
  4722. Subject: Re: Internal Limits
  4723. Errors-To: icon-group-request
  4724. Status: RO
  4725.  
  4726. Oops, I guess I did exaggerate a bit when I said the shell could handle
  4727. command lines in the tens of thousands of characters.  I did some
  4728. experimentation, though, and found that our Ultrix (DEC Berkeley UNIX)
  4729. maxes out at just under 10,000 characters, considerably more than the
  4730. System V limit (according to orf) of 1024.  It wouldn't surprise me if
  4731. that's a "sysgenable" parameter that varies from installation to
  4732. installation.  In any case, 256 is a rather uncomfortable limit that
  4733. apparently a few of you have run up against.
  4734.  
  4735. I didn't know about the read() limit.  Again, some experimentation
  4736. showed this to be 2049 -- and a look at the code confirmed it
  4737. (MaxReadStr).
  4738.  
  4739. I've mounted an attack on some of these limits, and my version of Icon
  4740. currently supports:
  4741.  
  4742.     Infinitely long strings for:
  4743.         open() first argument (mainly for open(...,"p")
  4744.         system() argument
  4745.         result of read()
  4746.  
  4747.     Close of a file opened by open(...,"p") returns the integer
  4748.     status of the command, just like system() does.  Close of a
  4749.     regular file still returns the file.
  4750.  
  4751. The long string changes were done not by increasing any internal buffer
  4752. sizes, but by modifying the algorithms to build their strings in
  4753. dynamic string space if necessary.  I've mailed my code changes to
  4754. R.G., so maybe we'll see these limits lifted in standard Icon in the
  4755. near future.
  4756.  
  4757. I agree with the suggestions that run-time errors for write() and
  4758. close() would be desirable.  Currently there doesn't appear to be any
  4759. error detection at all for write errors.
  4760.  
  4761. I also support the statement that a way to invoke processes without
  4762. going through a shell is a nice idea, but is a little too UNIXy to be a
  4763. standard Icon function.  A good candidate for the Icon Program Library
  4764. for PIs, or for the "fxtra.c" collection.  Then the next thing we'll
  4765. want is a popen() equivalent that calls processes directly, etc.,
  4766. etc. ...
  4767.  
  4768. From icon-group-request  Wed May 13 12:03:11 1987
  4769. From: naucse!sbw (Steve Wampler)
  4770. To: arizona!whm
  4771. Subject: Re:  more co-expression questions...
  4772. Cc: arizona!icon-group
  4773. Errors-To: icon-group-request
  4774. Status: RO
  4775.  
  4776.     From arizona!whm Wed May 13 07:06:42 1987
  4777.     Received: by arizona.arizona.edu; Tue, 12 May 87 17:13:59 MST
  4778.     Date: Tue, 12 May 87 17:13:50 MST
  4779.     From: "Bill Mitchell" <arizona!whm>
  4780.     Message-Id: <8705130013.AA12659@megaron.arizona.edu>
  4781.     Received: by megaron.arizona.edu; Tue, 12 May 87 17:13:50 MST
  4782.     To: naucse!sbw
  4783.     Subject: Re:  more co-expression questions...
  4784.     Cc: icon-project
  4785.     
  4786.     Assuming that you're talking about co-expressions...
  4787.     
  4788.     This program:
  4789.     
  4790.     global A,B,C
  4791.     procedure main()
  4792.         A := create write(@B)
  4793.         B := create @C
  4794.         C := create "foo"@A
  4795.         @A
  4796.     end
  4797.     
  4798.     prints "foo" when run under the development version of Version 6.
  4799.  
  4800. good, that makes sense...
  4801.     
  4802.     Ditto for:
  4803.     
  4804.     global A,B,C
  4805.     procedure main()
  4806.         A := create @C & @B & @B & write(@B)
  4807.         B := create @A & @C & @C & @B & @C
  4808.         C := create @C & @A & @B & @A & "foo"@A
  4809.         @A
  4810.     end
  4811.     
  4812. wow! what a great exam question.  note that both these still work
  4813. under the lrao model....
  4814.  
  4815. an internal ADT is one where the user of the ADT sees only the
  4816. operations on the ADT (in an external ADT, the operations and
  4817. the data structure are visible.)  if there is an expression
  4818. data type that executes in the environment of definition, and
  4819. if such expressions can share the same environment (hence the
  4820. restriction that they not be co-expressions, then the following
  4821. is a sketch of a internal ADT 'stack':
  4822.  
  4823.     procedure makestack()
  4824.         local stkstore
  4825.  
  4826.        stkstore := []
  4827.  
  4828.        suspend {expression for push on stkstore}
  4829.        suspend {expression for pop on stkstore}
  4830.  
  4831.         # sorry, i don't know the syntax for the above
  4832.     end
  4833.  
  4834.     .
  4835.     .
  4836.     .
  4837.     getstack := create |makestack()
  4838.  
  4839.     every (spush1|spop1) := @getstack
  4840.     every (spush2|spop2) := @getstack
  4841.     .
  4842.     .
  4843.     .
  4844.     5 @ spush1
  4845.     write( @spop1)
  4846.  
  4847. it occurs to me that, since i haven't kept up on your organization of
  4848. all this, that my view is probably a bit off.
  4849.  
  4850. my view of the world (feel free to trash):
  4851.  
  4852.     @ --> activates either an expression data type or
  4853.         a co-expression, either as unary or binary
  4854.  
  4855.     x := coexpression(e)
  4856.  
  4857.         converts an expression data type into a co-expression
  4858.  
  4859. (i'm not comfortable with the automatic conversion of an expression
  4860. into a co-expression on activation - just doesn't seem orthogonal.)
  4861.  
  4862. i do not know very much about c-expressions.  perhaps they permit this.
  4863.  
  4864. From icon-group-request  Thu May 21 16:17:53 1987
  4865. From: shafto@nprdc.arpa
  4866. Reply-To: shafto@nprdc.arpa
  4867. To: icon-group@arizona.edu
  4868. Errors-To: icon-group-request
  4869. Status: RO
  4870.  
  4871.  
  4872. From MAILER-DAEMON@arizona.edu Thu May 21 14:28:03 1987
  4873. From: "Mail Delivery Subsystem" <MAILER-DAEMON@arizona.edu>
  4874. Subject: Returned mail: Service unavailable
  4875. To: <shafto>
  4876. Status: RO
  4877.  
  4878.    ----- Transcript of session follows -----
  4879. >>> HELO arizona.arizona.edu
  4880. <<< 553 arizona.arizona.edu I refuse to talk to myself
  4881. 554 <arizona!icon-group@arizona.edu>... Service unavailable: Bad file number
  4882.  
  4883.    ----- Unsent message follows -----
  4884. Received: by arizona.arizona.edu; Thu, 21 May 87 14:23:25 MST
  4885. Received: by nprdc.arpa (5.54/ 1.1)
  4886.     id AA25008; Thu, 21 May 87 14:23:32 PDT
  4887. Message-Id: <8705212123.AA25008@nprdc.arpa>
  4888. Date: 21 May 1987 1423-PDT (Thursday)
  4889. From: shafto@nprdc.arpa
  4890. Reply-To: shafto@nprdc.arpa
  4891. To: arizona!icon-group@arizona.edu
  4892. Subject: net address change
  4893.  
  4894.  
  4895.  
  4896. I'm not sure whether I'm sending this request to the
  4897. right address but ...
  4898.  
  4899. Please change my net address to
  4900.  
  4901. shafto@AMES-AURORA.ARPA
  4902.  
  4903. my phone number to
  4904.  
  4905. 415/694-6170
  4906.  
  4907. and my snail-mail address to
  4908.  
  4909. Dr. Michael G.  Shafto
  4910. NASA-Ames Research Center
  4911. Aerospace Human Factors Lab
  4912. Mail Stop 239-1
  4913. Moffett Field, CA   94035
  4914.  
  4915. Thanks.
  4916.  
  4917.  
  4918.  
  4919. From icon-group-request  Tue Jun 23 09:29:18 1987
  4920. From: jl42+@andrew.cmu.edu (Jay Mathew Libove)
  4921. To: icon-group@arizona.edu
  4922. Subject: Icon source for Xenix
  4923. Cc: 
  4924. Errors-To: icon-group-request
  4925. Status: RO
  4926.  
  4927. Hi - I have an IBM PC/AT running Santa Cruz Operation (SCO) Xenix System V
  4928. release 2 kernel 2.1.3 on which I would like to run Icon. Is there an
  4929. ARPAnet / Internet FTPable site from which I can get the sources to Icon?
  4930. Is there a version specific to Xenix that will be pretty much guaranteed
  4931. to compile?
  4932. Thanks for any and all help!
  4933.  
  4934.  
  4935. Jay Libove
  4936. Arpa:   jl42@andrew.cmu.edu    Bitnet: jl42@drycas.bitnet
  4937. UUCP:   ...!{seismo, ucbvax, harvard}!andrew.cmu.edu!jl42
  4938. UUCP:   ...!{pitt | bellcore} !darth!libove!libove
  4939.  
  4940. Disclaimer: My employers really don't care what I say...
  4941.  
  4942. From icon-group-request  Tue Jun 23 09:33:41 1987
  4943. From: "Ralph Griswold" <ralph>
  4944. To: icon-group@arizona.edu, jl42+@andrew.cmu.edu
  4945. Subject: Re:  Icon source for Xenix
  4946. In-Reply-To: <QUreeSy00WARUaU05X@andrew.cmu.edu>
  4947. Errors-To: icon-group-request
  4948. Status: RO
  4949.  
  4950. Our FTPable UNIX distribution contains configuration information for
  4951. SCO XENIX.  It runs here, both SMM and LMM.  Do an anonymous FTP from
  4952. arizona.edu.  cd to icon and get README -- it tells what is available.
  4953. You want one of UNIX distribution files (it comes in several forms).
  4954. Documentation is included.  Check out v6/setup/pc_xenix_smm and
  4955. v6/setup/pc_xenix_lmm, which contains the configuration.
  4956.  
  4957. From icon-group-request  Tue Jun 23 10:55:20 1987
  4958. From: jl42+@andrew.cmu.edu (Jay Mathew Libove)
  4959. To: icon-group@arizona.edu
  4960. Subject: Message of 23-Jun-87 09:59:07
  4961. Errors-To: icon-group-request
  4962. Status: RO
  4963.  
  4964. Someone has a mail forwarding address that isn't working. Here's the
  4965. returned stuff.
  4966. -Jay
  4967.  
  4968. Forwarded message follows:
  4969. Return-path: <Mailer@ECLA.USC.EDU>
  4970. X-Andrew-Authenticated-as: UID422
  4971. Received: FROM andrew.cmu.edu VIA trymail
  4972.           ID </cmu/math/jl42/Mailbox/andrew.cmu.edu.1872.0.0>;
  4973.           Tue, 23 Jun 87 13:05:10 edt
  4974. Received: by andrew.cmu.edu (5.54/3.15) id <AA01866> for jl42+; Tue, 23 Jun 87 13:04:33 EDT
  4975. Date: Tue 23 Jun 87 10:01:55-PDT
  4976. From: The Mailer Daemon <Mailer@ECLA.USC.EDU>
  4977. To: jl42+@ANDREW.CMU.EDU
  4978. Subject: Message of 23-Jun-87 09:59:07
  4979.  
  4980. Message failed for the following:
  4981. jbrookshire@ECLA.USC.EDU.#Internet: No such mailbox
  4982.         ------------
  4983. Received: from ARIZONA.EDU (for arizona.arizona.edu) by ECLA.USC.EDU; Tue 23 Jun 87 09:59:17-PDT
  4984. Received: by arizona.arizona.edu; Tue, 23 Jun 87 09:31:47 MST
  4985. Received: by megaron.arizona.edu; Tue, 23 Jun 87 09:29:20 MST
  4986. Received: by megaron.arizona.edu; Tue, 23 Jun 87 09:29:18 MST
  4987. Received: by arizona.arizona.edu; Tue, 23 Jun 87 09:25:07 MST
  4988. Received: by po5.andrew.cmu.edu (5.54/3.15) id <AA00707> for icon-group@arizona.edu; Tue, 23 Jun 87 12:21:50 EDT
  4989. Received: via switchmail; Tue, 23 Jun 87 12:21:47 edt
  4990. Received: FROM stewartstown VIA queuemail
  4991.           ID </cmu/common/mailqs/q007/QF.stewartstown.20deaaa3.6a>;
  4992.           Tue, 23 Jun 87 12:19:49 edt
  4993. Received: FROM stewartstown VIA qmail
  4994.           ID </cmu/math/jl42/.Outgoing/QF.stewartstown.20deaa9f.4695268>;
  4995.           Tue, 23 Jun 87 12:19:44 edt
  4996. Received: from stewartstown by MS.3.32 via sun3; Tue, 23 Jun 87 12:19:42 edt
  4997. Message-Id: <QUreeSy00WARUaU05X@andrew.cmu.edu>
  4998. Date: Tue, 23 Jun 87 12:19:42 edt
  4999. From: jl42+@andrew.cmu.edu (Jay Mathew Libove)
  5000. To: icon-group@arizona.edu
  5001. Subject: Icon source for Xenix
  5002. Cc: 
  5003. Errors-To: icon-group-request@arizona.edu
  5004.  
  5005. Hi - I have an IBM PC/AT running Santa Cruz Operation (SCO) Xenix System V
  5006. release 2 kernel 2.1.3 on which I would like to run Icon. Is there an
  5007. ARPAnet / Internet FTPable site from which I can get the sources to Icon?
  5008. Is there a version specific to Xenix that will be pretty much guaranteed
  5009. to compile?
  5010. Thanks for any and all help!
  5011.  
  5012.  
  5013. Jay Libove
  5014. Arpa:   jl42@andrew.cmu.edu    Bitnet: jl42@drycas.bitnet
  5015. UUCP:   ...!{seismo, ucbvax, harvard}!andrew.cmu.edu!jl42
  5016. UUCP:   ...!{pitt | bellcore} !darth!libove!libove
  5017.  
  5018. Disclaimer: My employers really don't care what I say...
  5019. -------
  5020.  
  5021. From icon-group-request  Tue Jun 23 12:53:57 1987
  5022. To: Jay Mathew Libove <jl42+@andrew.cmu.edu>
  5023. Cc: icon-group@arizona.edu
  5024. Subject: Re: Message of 23-Jun-87 09:59:07 
  5025. In-Reply-To: Your message of Tue, 23 Jun 87 13:18:26 -0400.
  5026.              <4UrfVWy00WARJ3s0D9@andrew.cmu.edu> 
  5027. From: Dave Farber <farber@UDEL.EDU>
  5028. Errors-To: icon-group-request
  5029. Status: RO
  5030.  
  5031. I am slowly VERY slowly ftping the SCO Xenix version of icon.
  5032. I suggest that you all wait till I get it and I will then announce
  5033.  
  5034. From icon-group-request  Tue Jun 23 15:56:50 1987
  5035. From: wbm%mdc14.uucp@RELAY.CS.NET
  5036. To: icon-group@arizona.edu
  5037. Errors-To: icon-group-request
  5038. Status: RO
  5039.  
  5040. Icon mailing list
  5041.  
  5042. Dear icon-group:
  5043.     Please add me to your mailing list.
  5044.  
  5045.         Thank you,
  5046.  
  5047. --------
  5048. William B. McCormick
  5049. uucp: !{decvax,hplabs,ihnp4,linus,rutgers,seismo}!gatech!mdc14!wbm
  5050.  
  5051.  
  5052. From icon-group-request  Wed Jun 24 01:27:41 1987
  5053. From: jl42+@andrew.cmu.edu (Jay Mathew Libove)
  5054. To: icon-group@arizona.edu
  5055. Subject: Icon source for Xenix
  5056. Errors-To: icon-group-request
  5057. Status: RO
  5058.  
  5059. Hi - I have an IBM PC/AT running Santa Cruz Operation (SCO) Xenix System V
  5060. release 2 kernel 2.1.3 on which I would like to run Icon. Is there an
  5061. ARPAnet / Internet FTPable site from which I can get the sources to Icon?
  5062. Is there a version specific to Xenix that will be pretty much guaranteed
  5063. to compile?
  5064. Thanks for any and all help!
  5065.  
  5066.  
  5067. Jay Libove
  5068. Arpa:   jl42@andrew.cmu.edu    Bitnet: jl42@drycas.bitnet
  5069. UUCP:   ...!{seismo, ucbvax, harvard}!andrew.cmu.edu!jl42
  5070. UUCP:   ...!{pitt | bellcore} !darth!libove!libove
  5071.  
  5072. Disclaimer: My employers really don't care what I say...
  5073.  
  5074. From icon-group-request  Thu Jun 25 13:24:05 1987
  5075. From: R301JL42%CMCCVB.BITNET@wiscvm.wisc.edu
  5076. Subject: FTPing Xenix sources to Icon
  5077. To: icon-group@arizona.edu
  5078. X-Vms-To: IN%"icon-group@arizona.edu"
  5079. Errors-To: icon-group-request
  5080. Status: RO
  5081.  
  5082. [ This may be a repost, if so, please forgive- our mailers (whole network)
  5083. had a serious problem yesterday...]
  5084. I FTP'd to arizona.edu and went looking for the v6/ directory and the
  5085. xenix sources to icon, but the directory wasn't there, and the sources
  5086. for xenix (in fact sources at all) didn't seem to exist.
  5087. Could someone please mail me back and tell me where they are?
  5088. Mail addresses to use: R301JL42@CMCCVB.bitnet JL42@ANDREW.CMU.EDU arpanet.
  5089. Thanks very much
  5090. -Jay Libove
  5091.  
  5092. From icon-group-request  Thu Jun 25 14:42:59 1987
  5093. From: "Kelvin Nilsen" <kelvin>
  5094. In-Reply-To: <QUreeSy00WARUaU05X@andrew.cmu.edu>
  5095. To: icon-group@arizona.edu, jl42+@andrew.cmu.edu
  5096. Subject: Re:  Icon source for Xenix
  5097. Errors-To: icon-group-request
  5098. Status: RO
  5099.  
  5100. you can ftp icon materials from arizona.edu using anonymous login.
  5101.  
  5102. cd to icon, and get README before proceeding.  source code configurable
  5103. for SCO Xenix is available in v6.cpio (or the tar and compressed versions
  5104. of the same).  we haven't emphasized the availability of Xenix source
  5105. because we had to work around some compiler bugs to make it work, and
  5106. weren't sure we wanted to even distribute the code as it currently stands.
  5107.  
  5108. Xenix has compiled for release 2.1.3 of the kernel.  i believe we 
  5109. are currently using release G of the development system.  let me know
  5110. if you have any problems with this.
  5111.  
  5112.  
  5113. From icon-group-request  Thu Jun 25 14:45:43 1987
  5114. From: "Kelvin Nilsen" <kelvin>
  5115. In-Reply-To: <8706252022.AA14741@arizona.arizona.edu>
  5116. To: R301JL42%CMCCVB.BITNET@wiscvm.wisc.edu, icon-group@arizona.edu
  5117. Subject: Re:  FTPing Xenix sources to Icon
  5118. Errors-To: icon-group-request
  5119. Status: RO
  5120.  
  5121. try cd icon, get README.  source code configurable for xenix is found in
  5122. v6.cpio|tar[.Z]
  5123.  
  5124.  
  5125. From icon-group-request  Thu Jun 25 18:18:24 1987
  5126. From: jl42+@andrew.cmu.edu (Jay Mathew Libove)
  5127. To: icon-group@arizona.edu
  5128. Subject: apologies
  5129. Errors-To: icon-group-request
  5130. Status: RO
  5131.  
  5132. My apologies for sending too many posts to too many places of late in
  5133. reference to getting icon sources. I didn't realize that the v6/
  5134. directory was actually just the v6.* files - and we had some trouble
  5135. with the systems on campus here so I wasn't sure what was getting
  5136. where when etc..... Anyway, I am currently FTPing... slowly... and I
  5137. hope I will be able to post a message soon saying "I got it, it
  5138. works!"
  5139.  
  5140. Thanks for all the support I have received!
  5141.  
  5142. Jay Libove
  5143. Arpa:   jl42@andrew.cmu.edu    Bitnet: jl42@drycas.bitnet
  5144. UUCP:   ...!{seismo, ucbvax, harvard}!andrew.cmu.edu!jl42
  5145. UUCP:   ...!{pitt | bellcore} !darth!libove!libove
  5146.  
  5147. Disclaimer: My employers really don't care what I say...
  5148.  
  5149. From icon-group-request  Thu Jun 25 18:42:44 1987
  5150. From: jl42+@andrew.cmu.edu (Jay Mathew Libove)
  5151. To: icon-group@arizona.edu
  5152. Subject: No such luck
  5153. Cc: 
  5154. Errors-To: icon-group-request
  5155. Status: RO
  5156.  
  5157. Well, I said in my last post that I hoped I could soon send a post
  5158. saying "I got it and it works!" but I can not. I have tried and failed
  5159. three FTP attempts so far. It would be extremely helpful if the files
  5160. in question here (specifically the rather large tar and cpio files) were
  5161. broken down in to smaller pieces, of say 50 to 100K each. FTPing a 900K
  5162. files (or a 2meg file!) over a connection like arizona.edu's is an almost
  5163. hopeless adventure...
  5164.  
  5165.  
  5166. Jay Libove
  5167. Arpa:   jl42@andrew.cmu.edu    Bitnet: jl42@drycas.bitnet
  5168. UUCP:   ...!{seismo, ucbvax, harvard}!andrew.cmu.edu!jl42
  5169. UUCP:   ...!{pitt | bellcore} !darth!libove!libove
  5170.  
  5171. Disclaimer: My employers really don't care what I say...
  5172.  
  5173. From icon-group-request  Fri Jun 26 08:24:11 1987
  5174. From: David Farber <farber@UDEL.EDU>
  5175. Subject: Re:  Icon source for Xenix
  5176. To: kelvin%arizona.edu@UDEL.EDU
  5177. Cc: icon-group%arizona.edu@UDEL.EDU
  5178. In-Reply-To: Your message of Thu, 25 Jun 87 14:42:59 MST
  5179. Errors-To: icon-group-request
  5180. Status: RO
  5181.  
  5182. I would recommend you ftp from Udel. The effective rate via the arizona
  5183. link is about 1 bit per year. Ask Cranor@udel.edu where the stuff is.
  5184. We brought it over to help.
  5185.  
  5186.  
  5187. From icon-group-request  Fri Jun 26 09:05:31 1987
  5188. From: shafto@nprdc.arpa
  5189. Reply-To: shafto@nprdc.arpa
  5190. To: icon-group@arizona.edu
  5191. Subject: distribution list revision request
  5192. Errors-To: icon-group-request
  5193. Status: RO
  5194.  
  5195.  
  5196.  
  5197. It occurred to me after I sent my previous
  5198. net-note that I'm probably getting Icon
  5199. e-mail at NPRDC because I'm on a local
  5200. redistribution list.
  5201.  
  5202. If so, I'll handle that at NPRDC.
  5203.  
  5204. Mike S
  5205.  
  5206. From icon-group-request  Fri Jun 26 12:25:14 1987
  5207. From: "Bill Mitchell" <whm>
  5208. To: icon-group
  5209. Subject: Re:  Icon source for Xenix
  5210. Errors-To: icon-group-request
  5211. Status: RO
  5212.  
  5213. I hesitate to contribute to this overblown discussion of FTPing Icon, but
  5214. if you have trouble with 192.12.69.1, try 128.196.6.1.
  5215.  
  5216. From icon-group-request  Tue Jun 30 21:23:51 1987
  5217. From: Michael Shafto <shafto@AMES-AURORA.ARPA>
  5218. Organization: NASA Ames Research Center, Mt. View, Ca.
  5219. Subject: Help requested re GC strategy
  5220. Sender: icon-group-request%arizona.CSNET@RELAY.CS.NET
  5221. To: icon-group%arizona.CSNET@RELAY.CS.NET
  5222. Errors-To: icon-group-request
  5223. Status: RO
  5224.  
  5225. I'm forwarding this from the lisp bb.  I know Icon
  5226. incorporates some careful thinking about garbage
  5227. collection.
  5228.  
  5229. From seismo.css.gov!reed.UUCP!keith Mon Jun 29 00:34:42 1987
  5230. Path: aurora!ames!ll-xn!husc6!mit-eddie!uw-beaver!tektronix!reed!keith
  5231. From: keith@reed.UUCP (Keith Packard)
  5232. Newsgroups: comp.lang.lisp
  5233. Subject: when to garbage collect
  5234. Keywords: mark-sweep, non-incremental
  5235. Organization: Reed College, Portland OR
  5236. Lines: 17
  5237. Status: RO
  5238.  
  5239. I am looking for references on algorithms for deciding when to garbage
  5240. collect a non-incremental mark/sweep lisp interpreter.  I expect this sort
  5241. of thing has been well hashed out by many designers of memory management
  5242. software, but I've been unable to locate any reasonable discussion of the
  5243. basics.  
  5244.  
  5245. I don't know how important the architecture of the system is, but it's
  5246. designed for a VM system but doesn't pack memory upon completion so this
  5247. question is rather important.  If memory isn't swept often enough, large
  5248. gaps will in general exist with the resultant loss of locality-of-reference.
  5249. But, because the system is not incremental, the cost of calling the
  5250. garbage-collector is rather substantial.  So the obvious solution is a
  5251. clever algorithm to decide when to GC.
  5252.  
  5253.  
  5254. keith packard
  5255. tektronix!reed!keith
  5256.  
  5257. From icon-group-request  Sat Jul  4 17:57:59 1987
  5258. From: naucse!sbw (Steve Wampler)
  5259. To: arizona!icon-group
  5260. Subject: failing memory...
  5261. Cc: arizona!icon-project, arizona!ralph
  5262. Errors-To: icon-group-request
  5263. Status: RO
  5264.  
  5265.  
  5266. I was wondering what people thought the best way was to handle
  5267. the following problem:
  5268.  
  5269.    I have a a series of book title,author,publisher, etc... sequences
  5270.     that I'd like to sort by title, or author, or publisher.  What
  5271.     is the best way to handle this multi-keyed sort.  One solution,
  5272.     to put records of the information into a table keyed by the
  5273.     sort field, fails pretty miserably.  I suppose that one
  5274.     could build a list of lists (ideally a list of book records),
  5275.     but I've forgotten if any of the new options to sort() allow
  5276.     one to sort a list of lists (or records) by any field.
  5277.  
  5278.    Any suggestions on how to proceed?  Of course, it would also be
  5279.    nice to be able to do a multikeyed sort (all books, sorted by
  5280.    title within author within publisher [say]), but as it stands
  5281.    now, sort() is not guaranteed to be stable.
  5282.  
  5283.    I'd rather not do my own sort procedure...
  5284.  
  5285.     -Thanks, responses to Icon-group, please
  5286.  
  5287. From icon-group-request  Sun Jul 26 13:42:22 1987
  5288. From: olson <olson@TCGOULD.TN.CORNELL.EDU>
  5289. Organization: Cornell Theory Center, Cornell University, Ithaca NY
  5290. Subject: Icon on Sun3
  5291. Sender: icon-group-request%arizona.CSNET@RELAY.CS.NET
  5292. To: icon-group%arizona.CSNET@RELAY.CS.NET
  5293. Errors-To: icon-group-request
  5294. Status: RO
  5295.  
  5296.  
  5297. (Sorry to bother you, but my addresses seem to be out of date.)
  5298.  
  5299. Is there a version of Icon that runs on Sun3 workstations?
  5300. Who do I contact?
  5301.  
  5302. Thanks,
  5303. Todd Olson
  5304.  
  5305. ARPA: olson@lasspvax.tn.cornell.edu
  5306. UUCP: {ihnp4,allegra,...}!cornell!lasspvax!olson
  5307. US Mail: Dept Physics, Clark Hall, Cornell University,
  5308.      Ithaca, New York 14853-2501
  5309.  
  5310. From icon-group-request  Fri Oct  2 16:38:55 1987
  5311. From: Ken Yap <ken@CS.ROCHESTER.EDU>
  5312. Organization: U of Rochester, CS Dept, Rochester, NY
  5313. Subject: Re: Seeking Humanities Programming Texts (Pascal Preferred)
  5314. References: <21261XBQ@PSUVM>
  5315. Sender: icon-group-request%arizona.CSNET@RELAY.CS.NET
  5316. To: icon-group%arizona.CSNET@RELAY.CS.NET
  5317. Errors-To: icon-group-request
  5318. Status: O
  5319.  
  5320. This appeared in comp.lang.pascal so you Iconers should have a go
  5321. at disabusing this person's misconceptions.
  5322.  
  5323. In article <21261XBQ@PSUVM> XBQ@PSUVM.BITNET (Ed Winograd) writes:
  5324. |I'm looking for a good beginning programming text for my students
  5325. |in Liberal Arts 482 at Penn State.  The course focuses on TEXT PROCESSING
  5326. |rather than on number crunching and is designed for humanities majors
  5327. |who have no previous programming experience.
  5328. |     
  5329. |I'm currently teaching my class PL/C, a somewhat stripped-down version
  5330. |of PL/1.  However, since this language is generally available only on
  5331. |IBM mainframe systems, it's not the optimal language to use.  Although
  5332. |I know that Digital Research puts out a PL/1 for IBM PC's, it's very
  5333. |expensive, and I have never seen ANY references to it (if anyone has
  5334. |used it, what's it like?  Is it compatible with mainframe PL/1?).
  5335. |     
  5336. |I realize that SNOBOL and ICON are widely used for text processing,
  5337. |but SNOBOL is so radically different from any other language that
  5338. |I hesitate to use it (but am willing to be convinced otherwise, if
  5339. |there's a good TEXT to go with it -- the Green Book is MUCH too
  5340. |hard for beginners).  And I'm a little hesitant to use ICON, since
  5341. |so many of the implementations seem to be public domain ones of
  5342. |unknown quality and robustness.
  5343. |     
  5344. |The best language to teach seems to be Pascal, since it's a structured
  5345. |language which is widely available, and not as dangerous as C for
  5346. |beginning programmers.  But the lack of string primitives in ISO
  5347. |Standard Pascal is a major problem.
  5348. |     
  5349. |So, my main question is if anyone knows of a Pascal text for
  5350. |humanities programming that uses a version such as UCSD Pascal or Turbo
  5351. |Pascal.  If so, I'd very much like to hear from you.  Otherwise,
  5352. |I'm open to considering other languages if there's a GOOD text for them
  5353. |that my beginners/humanities students could use.  The machines available
  5354. |to me are an IBM mainframe using VM/CMS, IBM PC's, and Macintoshes.
  5355. |     
  5356.  
  5357. Icon of dubious quality and not robust? Nonsense. Most of the
  5358. implementations are of U of Arizona descent, and are written in C.
  5359. Works real well.  There are IBM PC and Mac versions. I don't know about
  5360. those implementations but I'm very happy with the Unix implementation.
  5361. I can prototype an application faster than in Pascal or C. And I don't
  5362. mean text processing only, I test out search algorithms with Icon.
  5363.  
  5364.     Ken
  5365.  
  5366. From icon-group-request  Fri Oct  2 19:55:09 1987
  5367. From: Adam Beguelin <sunybcs!boulder!adamb@RUTGERS.EDU>
  5368. Organization: University of Colorado, Boulder
  5369. Subject: What is Icon Anyway?
  5370. Sender: icon-group-request%arizona.CSNET@RELAY.CS.NET
  5371. To: icon-group%arizona.CSNET@RELAY.CS.NET
  5372. Errors-To: icon-group-request
  5373. Status: O
  5374.  
  5375. So what is Icon anyway?  Is it a graphical programming language?  
  5376. I just subscribed to this group but from the one article I read there
  5377. are public domain versions out for unix, ibm-pcs and macs.  Could
  5378. someone fill me in on what icon is and maybe even point me to a 
  5379. public domain unix or mac version?
  5380.  
  5381. Thanks in advance for the education.
  5382.  
  5383. Adam Beguelin
  5384. adamb@boulder.colorado.edu
  5385. University of Colorado 
  5386. Boulder, CO
  5387.  
  5388. From icon-group-request  Fri Oct  2 23:02:08 1987
  5389. From: "Richard L. Goerwitz III" <goer@SPHINX.UCHICAGO.EDU>
  5390. Organization: U Chicago Computation Center
  5391. Subject: Speeding up Icon prgms.
  5392. Sender: icon-group-request%arizona.CSNET@RELAY.CS.NET
  5393. To: icon-group%arizona.CSNET@RELAY.CS.NET
  5394. Errors-To: icon-group-request
  5395. Status: O
  5396.  
  5397. I always hate to post my code, since it's usually not very good (I strive for
  5398. readability more than anything else).
  5399.  
  5400. What I'd like to know is whether there is somewhere in this program that I
  5401. might have written things in such a way as to get increased speed.  I'm not an
  5402. experienced Icon programmer, so any ideas would be welcome.
  5403.  
  5404. What this procedure does is split up texts formatted according to the standards
  5405. followed in the Thesaurus Linguae Graecae.  Works are marked by ~a"title", 
  5406. books by ~c"bookname", chapters by ~x and verses by ~y.  A typical header looks
  5407. like this:  ~a"Bible"b"Hebrew"c"genesis".  Subsequent chapters and verses are
  5408. marked with ~x and ~y, respectively (on a line of its own).
  5409.  
  5410. A typical text has:
  5411. ~a"Bible"b"Hebrew"c"Genesis"
  5412. GENESIS
  5413. M7493K987XCKN2892(093K2309832K 09KSKLJXC98U4KLS 9832KKXZCKJS
  5414. ~x
  5415. PQOIWEUR 039854 V0-9834()LKWLJ23J $OKSLKXCPKL
  5416. etc.
  5417.  
  5418. The next book will begin:
  5419. ~c"Exodus"
  5420. EXODUS
  5421. etc.
  5422.  
  5423. What I am trying to do is splitup the chapters into individual files, naming
  5424. each file after the title contained in the expression c"chapter".
  5425.  
  5426.  
  5427. procedure main()
  5428.  
  5429.   y := 0
  5430.  
  5431.   if not (outtext2 := open("junkfile","w"))
  5432.   then stop("cannot open chapter output file")
  5433.  
  5434.   write("input filename\:")
  5435.   if not (intext2 := open(read()))
  5436.   then stop("cannot open input file")
  5437.  
  5438.   write("finding first chapter")
  5439.   while line2 := reads(intext2,80) do
  5440.       {if find("\~",line2) then
  5441.           {if find("c\"",line2) then
  5442.               {close(outtext2)
  5443.               chapter := (line2[find("c\"",line2) + 2:0] ? move(upto("\"") - 1))
  5444.               outtext2 := open(chapter,"w")
  5445.               write(y +:= 1," chapters")
  5446.               }
  5447.           }
  5448.       line2 := line2[1+:find("  ",line)]
  5449.       write(outtext2,line2)
  5450.       }
  5451. end
  5452.  
  5453. NB:  Usually I get these things off tape, so that I need to strip trailing
  5454. blanks off of the 80 character records the files are usually arranges in.
  5455. That explains the need for "reads(intext2,80)" and at the end "line2[1+:find
  5456. ..."
  5457.  
  5458. As I said above, my concern is for speed.  I want to write some programs to
  5459. do more complex things to these texts, among them go to specific points in
  5460. given files, and then reverse the string, so as to present natural Hebrew
  5461. left-to-right order (I use special escape sequences to signal font changes
  5462. to my terminal - a PC with a Hercules Plus card).  But anyway, I'm concerned
  5463. with questions like, "Which is faster, find or match, or upto?"  How does one
  5464. get to a specific point in a file in the least amount of time?
  5465.  
  5466. Thanks to whoever might answer.
  5467.  
  5468.                               !ihnp4!gargoyle!sphinx!goer
  5469.                               goer@sphinx.uchicago.edu
  5470.  
  5471.                              -Richard Goerwitz
  5472.  
  5473.   
  5474.  
  5475. From icon-group-request  Mon Oct  5 13:13:12 1987
  5476. From: sunuk!nuksun!stevie!steveh@Sun.COM (Steve Holden - TSE)
  5477. To: sunuk!sun!arizona.edu!icon-group@Sun.COM
  5478. Subject: Re: Speeding up Icon prgms.
  5479. Errors-To: icon-group-request
  5480. Status: O
  5481.  
  5482. [ Caveat:  I am new to this mailgroup, and so my Icon has been self-taught.
  5483.    I'll be asking my own, similar, questions about my programs soon! ]
  5484.  
  5485. "Richard L. Goerwitz III"  wrote in <2348@sphinx.uchicago.edu>:
  5486.  
  5487. > What I'd like to know is whether there is somewhere in this program
  5488. > that I might have written things in such a way as to get increased
  5489. > speed.  I'm not an experienced Icon programmer, so any ideas would be
  5490. > welcome.
  5491.  
  5492. First of all, have I understood the text format correctly?  I presume what
  5493. you want is to find a line beginning with a tilde "~" and a chapter name, extract the
  5494. chapter name from it, then to copy that header line and all remaining lines
  5495. up to but not including the next such line.
  5496.  
  5497. One problem with the existing program is it might fail on a line such as
  5498.  
  5499. ~a"Book"b"Generic"
  5500.                 ^^
  5501. because the "c\"" will be thought to refer to a chapter, so we'll try
  5502. and fix that as a by-product.
  5503.  
  5504. Trimming spaces is most easily done on input, using the trim() function.
  5505.  
  5506. I presume your junkfile only exists to throw away stuff before the first
  5507. chapter heading;  you could do this either by writing to /dev/null (on a
  5508. U**X system) , or by re-structuring the program to simply not copy that
  5509. first section.
  5510.  
  5511. Let's suppose we have a procedure which will identify one of the "magic
  5512. lines" and return the chapter name.  The guts of the program could then 
  5513. be:
  5514.  
  5515.     procedure main()
  5516.  
  5517.     line := trim(read()) | stop("Empty input")
  5518.     
  5519.     until chapter := magicline(line) do
  5520.         line := trim(read()) | stop("No chapters")
  5521.     #
  5522.     #    chapter now has chapter name in it
  5523.     #
  5524.     repeat {
  5525.         outtext2 := open(chapter,"w")
  5526.         write(outtext2,line)
  5527.         while line := (trim(read()) | break break) do
  5528.             if chapter := magicline(line) then break
  5529.             else write(outtext2,line)
  5530.         close(outtext2)    
  5531.     }
  5532.     close(outtext2)            # 
  5533.  
  5534. end
  5535.  
  5536. The loop structure seems horrible, but I haven't written any Icon in a while.
  5537. That takes care of the main problem.  Now what about the magic lines?
  5538. Remembering that every line is checked for magicness this test needs to
  5539. be reasonably quick, but I see no way around some fairly complex checks
  5540. on the syntax to avoid the problem I outlined above:
  5541.  
  5542.     procedure magicline(l)
  5543.     static namechars
  5544.     initial namechars := &ucase ++ &lcase    # assumes letters only
  5545.     l ? {
  5546.         if ="~" then {            # can't be magic without "~" 
  5547.         while move(1) ~== "c" do    # other bits ignored
  5548.             ( move(1) & tab(many(namechars)) & move(1) ) | fail
  5549.             ( c := (="c\"" & write("++",tab(many(namechars))))) | fail
  5550.         return c
  5551.         }
  5552.     }
  5553.     end
  5554.  
  5555. I tried this on some simple test data:
  5556.  
  5557. ~a"Bible"b"Hebrew"c"Genesis"
  5558. GENESIS
  5559. M7493K987XCKN2892(093K2309832K 09KSKLJXC98U4KLS 9832KKXZCKJS
  5560. ~x
  5561. PQOIWEUR 039854 V0-9834()LKWLJ23J $OKSLKXCPKL
  5562. ~c"Exodus"
  5563. EXODUS
  5564.  
  5565. and got the following files:
  5566.  
  5567. Genesis:
  5568. ~a"Bible"b"Hebrew"c"Genesis"
  5569. GENESIS
  5570. M7493K987XCKN2892(093K2309832K 09KSKLJXC98U4KLS 9832KKXZCKJS
  5571. ~x
  5572. PQOIWEUR 039854 V0-9834()LKWLJ23J $OKSLKXCPKL
  5573.  
  5574. Exodus:
  5575. ~c"Exodus"
  5576. EXODUS
  5577. which seems to be what you wanted.  As to whether it's any quicker or
  5578. better-structured, I leave that to you to decide.  These are the sorts
  5579. of things I'm hoping the group will help me with!
  5580.  
  5581. Steve
  5582.  
  5583. From icon-group-request  Mon Oct  5 15:14:41 1987
  5584. From: Michael Shafto <shafto@AMES-AURORA.ARPA>
  5585. To: icon-group%arizona.CSNET@RELAY.CS.NET, sunybcs!boulder!adamb@RUTGERS.EDU
  5586. Subject: Re:  What is Icon Anyway?
  5587. Cc: shafto@AMES-AURORA.ARPA
  5588. Errors-To: icon-group-request
  5589. Status: O
  5590.  
  5591. Let me know if the experts at Arizona don't reply.
  5592.  
  5593. Mike Shafto
  5594.  
  5595. From icon-group-request  Mon Oct  5 15:20:59 1987
  5596. From: Michael Shafto <shafto@AMES-AURORA.ARPA>
  5597. To: goer@SPHINX.UCHICAGO.EDU, icon-group%arizona.CSNET@RELAY.CS.NET
  5598. Subject: Re:  Speeding up Icon prgms.
  5599. Cc: shafto@AMES-AURORA.ARPA
  5600. Errors-To: icon-group-request
  5601. Status: O
  5602.  
  5603. Richard --
  5604.  
  5605. For a kindred text-processing spirit, call Jim Nye at the Regenstein
  5606. Library, 312/962-8430
  5607.  
  5608. Mike Shafto
  5609.  
  5610. From icon-group-request  Tue Oct  6 15:09:17 1987
  5611. From: ihnp4!ihlpe!orf
  5612. Message-Version: 2
  5613. >To: /addr=ihnp4!gargoyle!sphinx!goer, /addr=ihnp4!arizona!icon-group
  5614. End-Of-Header: 
  5615. Email-Version: 2
  5616. X-Postmark: owen.r.fonorow attis iw1z261 xmpi4000 3129797173 ihlpe!orf
  5617. To: arizona!icon-group, gargoyle!sphinx!goer
  5618. Subject: Re: Speeding Up Icon Programs
  5619. Ua-Message-Id: <post.orf.Tue 06 Oct 1987 16:29 CDT>
  5620. End-Of-Protocol: 
  5621. Content-Length: 2003
  5622. Errors-To: icon-group-request
  5623. Status: O
  5624.  
  5625. Richard,
  5626.  
  5627. You asked for some guidelines about improving the performance of Icon programs.
  5628. The following rules of thumb seem to apply to the small program you sent:
  5629.  
  5630. --------------------------------------------------------------------------
  5631.  
  5632.   o match() is in a sense an "anchored" find() - so if you don't need
  5633.     to look through the entire string (i.e. you know the sequence will 
  5634.     be the first two characters) then use match().  If your data is
  5635.     representative then:
  5636.  
  5637.       {if find("\~",line2) then
  5638.           {if find("c\"",line2) then
  5639.  
  5640.     can be replaced by:
  5641.  
  5642.       {if match("~c",line2) then
  5643.  
  5644.    This should avoid *many* unnecssary string comparisons.
  5645.  
  5646.   o Use correct "types" in built-in functions. Since upto() expects a
  5647.     cset, then upto("\"") is better replaced by upto('"')
  5648.  
  5649.   o Subscripting is expensive. Avoid it.
  5650.  
  5651.     This implies that the following lines need to be changed:
  5652.  
  5653.               chapter := (line2[find("c\"",line2) + 2:0] ? move(upto("\"") - 1))
  5654.       line2 := line2[1+:find("  ",line)]
  5655.  
  5656.  
  5657.     One way is to set up a string scanning expression with line2 like this:
  5658.    
  5659.          while line2 := reads(intext2,80) do
  5660.          line2 ? {
  5661.              if match("~c") then
  5662.                   {close(outtext2)
  5663.                    move(3) &     # Assumes ~c"  sequence....
  5664.                    chapter :=  move(upto('\"') 
  5665.                    outtext2 := open(chapter,"w")
  5666.                    write(y +:= 1," chapters")
  5667.                    }
  5668.               }
  5669.           write(outtext2,trim(line2))
  5670.           }
  5671.        end
  5672.  
  5673. --------------------------------------------------------------------------
  5674.  
  5675. Again, This may not work with your data. My intent was to answer your
  5676. question. There may be issue of getting information after the chapter
  5677. name on a ~c"  line.  To summarize:
  5678.  
  5679.    o Use match() if appropriate to limit string comparisons
  5680.    o Use correctly typed arguments to built-in functions
  5681.    o Avoid subscripting.
  5682.  
  5683. How this helps...
  5684.  
  5685. O. Rick Fonorow
  5686. ihnp4!ihlpe!orf
  5687. (312) 979-7173
  5688.  
  5689. From icon-group-request  Wed Oct  7 06:17:37 1987
  5690. From: sunuk!nuksun!stevie!steveh@Sun.COM (Steve Holden - TSE)
  5691. To: sunuk!sun!arizona.edu!icon-group@Sun.COM
  5692. Subject: Re:  Speeding up Icon prgms.
  5693. Errors-To: icon-group-request
  5694. Status: O
  5695.  
  5696. Ahem.  I suppose we all have our off-days.  I looked at the code I
  5697. produced and decided it just wouldn't do (my hacking days came back
  5698. to haunt me).  Here is a re-write, more in keeping with the spirit of
  5699. the Icon language.  Thanks to the group for not taking me to task (or
  5700. is no-one listening?)  The output is tha same as for the previous one.
  5701.  
  5702. procedure main()
  5703.  
  5704.     outtext2 := open("/dev/null","w") | stop("Cannot open /dev/null!!")
  5705.     
  5706.     while line := read() do
  5707.     line ? {
  5708.         if ="~" then            # it's text if no "~"
  5709.         while c := move(1) &        # parse a heading bit
  5710.             ="\"" & (chap := tab(many(~'"'))) & ="\"" do
  5711.         if c == "c" then {        # new chapter found
  5712.             close(outtext2)        # so open new file    
  5713.             outtext2 := newchapter(chap)
  5714.             break            # stop parsing
  5715.         }
  5716.         write(outtext2,line)        # write to chapter file
  5717.     }
  5718.     close(outtext2)
  5719.  
  5720. end
  5721.  
  5722. procedure newchapter(chapname)
  5723.     return open(chapname,"w") | stop("Cannot create chapter ",chapname)
  5724. end
  5725.  
  5726. regards
  5727.  
  5728. Steve
  5729.  
  5730. From icon-group-request  Wed Oct  7 15:21:22 1987
  5731. From: "Mr. nEtural" <matt@ODDJOB.UCHICAGO.EDU>
  5732. Organization: Up against the wall of SCIENCE
  5733. Subject: Re:  Speeding up Icon prgms.
  5734. References: <8710052136.AA02391@ames-aurora.arpa>
  5735. Sender: icon-group-request%arizona.CSNET@RELAY.CS.NET
  5736. To: icon-group%arizona.CSNET@RELAY.CS.NET
  5737. Errors-To: icon-group-request
  5738. Status: O
  5739.  
  5740. ) Richard --
  5741. ) For a kindred text-processing spirit, call Jim Nye at the Regenstein
  5742. ) Library, 312/962-8430
  5743. ) Mike Shafto
  5744.  
  5745. Note:  The prefix here has changed from 962 to 702.  James Nye's
  5746. number is now 312-702-8430.
  5747.  
  5748. From icon-group-request  Wed Oct  7 17:47:20 1987
  5749. From: Ralph Griswold <ralph%arizona.edu@RELAY.CS.NET>
  5750. Organization: U of Arizona CS Dept, Tucson
  5751. Subject: What is Icon?
  5752. Sender: icon-group-request%arizona.CSNET@RELAY.CS.NET
  5753. To: icon-group%arizona.CSNET@RELAY.CS.NET
  5754. Errors-To: icon-group-request
  5755. Status: O
  5756.  
  5757.  
  5758. For persons who may not be familiar with the Icon programming
  5759. language, here's a brief description and a pointer to more
  5760. information.
  5761.  
  5762. Icon is a high-level, general-purpose programming language that is
  5763. well-suited for nonnumerical applications.
  5764.  
  5765. Icon supports several data types, including variable-length strings,
  5766. sets, lists with flexible access methods, and tables with associative
  5767. lookup. Storage management is automatic.
  5768.  
  5769. Icon has a goal-directed evaluation mechanism that allows concise
  5770. solutions of many programming tasks to be formulated easily.
  5771. Its string scanning facility is comparable to pattern matching in
  5772. SNOBOL4, but Icon allows all language operations to be used in the
  5773. analysis and synthesis of strings.
  5774.  
  5775. Icon is available for a wide range of computers, including most UNIX
  5776. systems, MS-DOS, VAX/VMS, the Atari ST, the Amiga, and the Macintosh
  5777. (under MPW). These implementations are in the public domain and
  5778. are available at a nominal cost from the Icon Project at the University
  5779. of Arizona. For more information, contact:
  5780.  
  5781.     Icon Project
  5782.     Department of Computer Science
  5783.     Gould-Simpson Building
  5784.     The University of Arizona
  5785.     Tucson, AZ   85721
  5786.  
  5787.     (602) 621-2018
  5788.  
  5789.     icon-project@arizona.edu
  5790.     ... {ihnp4, allegra, noao}!arizona!icon-project
  5791.  
  5792. Incidentally, the the name "Icon" has nothing to do with graphic images used
  5793. to identify files on computer screens. The name was chosen before the latter
  5794. use of the word came into vogue. The confusion is unfortunately, but it's too
  5795. late to do anything about it.
  5796.  
  5797. From icon-group-request  Sun Oct 11 06:46:02 1987
  5798. From: Abrahams@MIT-Multics.ARPA
  5799. Subject:  New language features for Icon 7?
  5800. To: icon-group@arizona.edu
  5801. Errors-To: icon-group-request
  5802. Status: O
  5803.  
  5804. I have a couple of suggestions for additions to Icon.  Perhaps it's not too
  5805. late to get them into Version 7, if you like them.
  5806.  
  5807. (1) There ought to be a notation for procedures with a variable number of
  5808. arguments, such as "write".  I propose that the argument list be put in square
  5809. brackets, just like any other list (with the restriction that there be only
  5810. one argument).  Here's how to do "write" very elegantly in this notation:
  5811.  
  5812. procedure write[args]
  5813.     local a, f
  5814.  
  5815.     f := &output
  5816.     every a := !args do
  5817.         if type(a) == "file" then
  5818.             f := a
  5819.         else
  5820.             write1(f, a)    # write1(f, v) writes the value v to the file f
  5821.     write1(f, "\n")
  5822. end
  5823.  
  5824. (2) The Icon scoping mechanism is very weak, and is also almost independent of
  5825. the other aspects of the language.   As my programs get large, I need some way
  5826. of restricting the scope of global variables without eliminating them
  5827. altogether.  I would like to see a "package" mechanism, where a package simply
  5828. groups a set of global declarations (including procedures) and specifies which
  5829. ones are exported to the surrounding environment.  For simplicity, a package
  5830. inherits anything known in the environment that surrounds it.  For example:
  5831.  
  5832. package P1 exports write_line, write_page, page_number
  5833. global current_line, page_number
  5834. record page_image(...)
  5835. procedure write_page(...); ... ; end
  5836. procedure insert_header(...); ... ; end
  5837. procedure write_line(...); ... ; end
  5838. procedure justify_line(...); ... ; end
  5839. end P1   # or perhaps "end package" or even just "end"
  5840.  
  5841. Although a multi-level package mechanism would be best, even a one-level
  5842. version of it would be very useful.
  5843.  
  5844. Paul Abrahams
  5845.  
  5846. From icon-group-request  Mon Oct 12 02:50:27 1987
  5847. From: sunuk!nuksun!stevie!steveh@Sun.COM (Steve Holden - TSE)
  5848. To: sunuk!sun!arizona.edu!icon-group@Sun.COM
  5849. Subject: Re: New language features for Icon 7?
  5850. Errors-To: icon-group-request
  5851. Status: O
  5852.  
  5853. 1. Variable # of arguments:
  5854.    Seems reasonable if it's not too hard to incorporate.
  5855.  
  5856. 2. The Icon scoping mechanism.
  5857.    I agree.  The worst feature of things as presently set up is that on
  5858.    those odd occasions when you *have* to use a global variable in a package
  5859.    there is no protection against some other (possibly imported in ucode)
  5860.    package declaring the same global and using it.  I would suggest a simpler
  5861.    syntax:
  5862.    
  5863.    private var1, var2, var2
  5864.    
  5865.    should make the named variables globally available *only* within the scope
  5866.    of the current source file.
  5867.    
  5868.    Steve
  5869.  
  5870. From icon-group-request  Mon Oct 12 08:25:36 1987
  5871. From: Abrahams@MIT-Multics.ARPA
  5872. Subject:  Packages for Icon?
  5873. To: icon-group@arizona.edu
  5874. Errors-To: icon-group-request
  5875. Status: O
  5876.  
  5877. I hope that any package mechanism for Icon won't adopt what I consider to be
  5878. the insane C rule that associates scopes with file structure.
  5879.  
  5880. Steve Holden also raises an interesting question with his proposal for
  5881. "private": should the default be public or private.  I think it should be
  5882. private; things should only be public if so declared.   It would also be
  5883. useful to have an outermost global level, both to provide compatibility with
  5884. Icon as it is and to avoid any requirement that packages be used.
  5885.  
  5886. I believe that all this is a translation-time and link-time issue, with little
  5887. or no impact on the Icon compiler, which is the most difficult part of the
  5888. Icon implementation.  Am I right?
  5889.  
  5890. Paul Abrahams
  5891.  
  5892. From icon-group-request  Mon Oct 12 12:22:18 1987
  5893. From: Mr Binary <rhesus!bin%unix.macc.wisc.edu@RELAY.CS.NET>
  5894. Organization: UW-Madison Primate Center
  5895. Subject: Re: What is Icon?
  5896. References: <2341@megaron.arizona.edu>
  5897. Sender: icon-group-request%arizona.CSNET@RELAY.CS.NET
  5898. To: icon-group%arizona.CSNET@RELAY.CS.NET
  5899. Errors-To: icon-group-request
  5900. Status: O
  5901.  
  5902. Ralph Griswold gave the mail and e-mail addresses for more info
  5903. on Icon.  If you want, you can just ftp anonymously from arizona.edu.
  5904. That's how I got mine.  It took a while, though, if I remember correctly.
  5905.  
  5906. ---
  5907. Paul DuBois     UUCP: {allegra,ihnp4,seismo}!uwvax!rhesus!dubois    |
  5908.                 ARPA: dubois@rhesus.primate.wisc.edu              --+--
  5909.                                                                     |
  5910. "Suffering is the finger exercising of the spirit." - Mr. Theo      |
  5911.  
  5912. From icon-group-request  Mon Oct 12 18:41:31 1987
  5913. From: Abrahams@MIT-Multics.ARPA
  5914. Subject:  Generating a list
  5915. To: icon-group@arizona.edu
  5916. Errors-To: icon-group-request
  5917. Status: O
  5918.  
  5919. Is there an elegant way to generate a list containing the result sequence of a
  5920. given expression?  I can write the following procedure that does it (I think),
  5921. but perhaps there's a way to do it better:
  5922.  
  5923. # listgen(a,n) returns a list whose elements are the result sequence of a.
  5924. # If n is specified, then the length of the list is limited to n.
  5925.  
  5926. procedure listgen{a}
  5927.     local e, retval
  5928.     retval := []
  5929.     if integer(n) then
  5930.         every |(e := @a) \ n do put(retval, e)
  5931.     else
  5932.         while e := @a put(retval, e)
  5933.     return retval
  5934. end
  5935.  
  5936. Paul Abrahams
  5937.  
  5938. From icon-group-request  Thu Dec 31 11:48:51 1987
  5939. From: "David Gudeman" <gudeman>
  5940. To: icon-group
  5941. In-Reply-To: <871013012245.836237@MIT-Multics.ARPA>
  5942. Subject: Generating a list
  5943. Errors-To: icon-group-request
  5944. Status: O
  5945.  
  5946.    Date:  Mon, 12 Oct 87 21:22 EDT
  5947.    From: Abrahams@MIT-Multics.ARPA
  5948.  
  5949.    Is there an elegant way to generate a list containing the result
  5950.    sequence of a given expression? ...
  5951.  
  5952. I usually use the following idiom, where expr is the expression for
  5953. which you want the result sequence.
  5954.  
  5955.     ls := []
  5956.     every put(ls, !expr)
  5957.  
  5958. From icon-group-request  Tue Oct 13 18:43:42 1987
  5959. From: "Kenneth Walker" <kwalker>
  5960. To: icon-group
  5961. Subject: variable args and packages
  5962. Errors-To: icon-group-request
  5963. Status: O
  5964.  
  5965.  
  5966.     Date:  Sun, 11 Oct 87 09:42 EDT
  5967.     From: Abrahams@MIT-Multics.ARPA
  5968.     
  5969.     (1) There ought to be a notation for procedures with a variable number of
  5970.     arguments, such as "write".
  5971.  
  5972. Version 7 of Icon (which we expect to release in a few months) will have
  5973. a mechanism for handling a variable number of arguments. It will allow you
  5974. to indicate that the last parameter should be list of the remaining
  5975. arguments. The procedure declaration will look like:
  5976.  
  5977.    procedure p(a, b, c[])
  5978.  
  5979. If this is called with
  5980.  
  5981.    p(1, 2, 3, 4, 5)
  5982.  
  5983. you will have
  5984.  
  5985.    a === 1
  5986.    b === 2
  5987.    c === [3, 4, 5]
  5988.  
  5989. If this is called with
  5990.  
  5991.    p(1)
  5992.  
  5993. you will have
  5994.  
  5995.    a === 1
  5996.    b === &null
  5997.    c === []
  5998.     
  5999.  
  6000.     (2) The Icon scoping mechanism is very weak ...
  6001.     I would like to see a "package" mechanism, where a package simply
  6002.     groups a set of global declarations (including procedures) and specifies
  6003.     which ones are exported to the surrounding environment.
  6004.     
  6005. Some of the current research here at the U of A is aimed at developing
  6006. an optimizing compiler (if this progresses to distribution, it certainly
  6007. won't be with version 7). In order to do a reasonable job of optimization
  6008. the compiler will have to know which variables are local to the
  6009. compilation unit (that is, the file), which are exported and which are
  6010. imported; so we will at least need to develop a simple "package" mechanism
  6011. at the file level. This is what C does and seems to provide adaquate
  6012. modularization for many programs. Does a more complex mechanism give enough
  6013. benifit to justify the complexity?
  6014.  
  6015. From icon-group-request  Fri Oct 16 02:07:52 1987
  6016. From: "J. A. \"Biep\" Durieux" <mcvax!botter!klipper!biep@uunet.uu.net>
  6017. Organization: VU Informatica, Amsterdam
  6018. Subject: Re: What is Icon?
  6019. References: <2341@megaron.arizona.edu>
  6020. Sender: icon-group-request%arizona.CSNET@RELAY.CS.NET
  6021. To: icon-group%arizona.CSNET@RELAY.CS.NET
  6022. Errors-To: icon-group-request
  6023. Status: O
  6024.  
  6025. If I read&remember well, the name Icon was chosen because the group considered
  6026. itself rather iconoclastic. Somewhat of an amazing behaviour, for an
  6027. icono*clastic* group to call a thing they love and care *Icon*.
  6028.  
  6029. The world is full of wonders.
  6030. -- 
  6031.                         Biep.  (biep@cs.vu.nl via mcvax)
  6032.     Warning: this life is only an alpha test release, and will probably
  6033.     not be bug-free. No responsibility is taken for any damage that may
  6034.     result from the use of this life.  Send any bug reports or enhance-
  6035.  
  6036. From icon-group-request  Fri Oct 16 10:34:03 1987
  6037. From: Abrahams@MIT-Multics.ARPA
  6038. Subject:  Arglists and packages
  6039. To: icon-group@arizona.edu
  6040. Errors-To: icon-group-request
  6041. Status: O
  6042.  
  6043. This is a reply to Ken Walker's comments on my proposals.
  6044.  
  6045. (1) The notation
  6046.     procedure p(a,b,c[])
  6047. is quite elegant, and more general that what I had proposed.  But why not
  6048. allow the form
  6049.     procedure[a]
  6050. as a synonym for
  6051.     procedure(a[])
  6052.  
  6053. (2) I'd be quite happy with a package mechanism that would provide only for
  6054. exporting procedures and not variables.  That would avoid the need to deal
  6055. with any difficulties in optimization, because the whole problem would become
  6056. very static.  That is, packages would have variables declared internal to
  6057. them, and would inherit all variables in their enclosing packages.  The
  6058. optimization problems are then no different than those we now have with global
  6059. versus local.
  6060.  
  6061. With this kind of packaging mechanism, the translator and compiler would not
  6062. have much more work to do; the linker would bear the brunt of the task.
  6063. The only tricky run-time issue is what the "proc" function does.  But this
  6064. could be solved by conceptually associating a run-time symbol table with every
  6065. procedure; the name in the "proc" call would be looked up in that table.
  6066. In practice, the symbol tables could be combined.
  6067.  
  6068. I dislike the C approach to scoping because it forces every package to reside
  6069. in a separate file and thus leads to the proliferation of files.  It also
  6070. leads to additional complications in resolving the different sets of externs,
  6071. a problem that has led to incompatibilities among C compilers.  Finally, it
  6072. excludes the possibility of nested packages, which in fact are not at all hard
  6073. to do.  (Nested procedures are a different story, and I'm not advocating
  6074. them.) Please don't do it that way.
  6075.  
  6076. Paul Abrahams
  6077.  
  6078. From icon-group-request  Fri Oct 16 13:15:35 1987
  6079. From: "David Gudeman" <gudeman>
  6080. To: icon-group
  6081. In-Reply-To: <871016172837.628350@MIT-Multics.ARPA>
  6082. Subject: Arglists and packages
  6083. Errors-To: icon-group-request
  6084. Status: O
  6085.  
  6086. I rather like the package idea, but any new scoping mechanism should
  6087. be a superset of the existing mechanism.  This is necessary to insure
  6088. backward (forward, upward, downward) compatibility with previous
  6089. versions of Icon.  It may come as a surprise to those who think of
  6090. Icon as a teaching language, or a language for small one-shot
  6091. programs, but there are actually large Icon programs out there in
  6092. regular use.  It would be unkind to obsolete all of these programs by
  6093. not supporting their scoping mechanism in v7 of Icon.
  6094.  
  6095. As a reminder, Paul Abrahams suggested a scheme where packages are
  6096. defined by declarations of the form:
  6097.  
  6098.     package <name> exports <name>, <name>, ...
  6099.     <global declaration>
  6100.     <global declaration>
  6101.     ...
  6102.     end
  6103.  
  6104. where the <global declaration>s are local to the package unless they
  6105. appear in the export part of the declaration.  This can easily be made
  6106. a superset of the current scheme by defining all declarations that
  6107. don't occur in a package as members of package global, which exports
  6108. everything.  (Maybe Paul Abrahams had this in mind, I couldn't tell.)
  6109.  
  6110. Another suggestion is to make "export" a separate declaration from
  6111. package.  This allows an orthogonal "import" declaration, for packages
  6112. that want to restrict the visible name space.  For backward
  6113. compatibility, all modules would automatically import everything from
  6114. the global package.
  6115.  
  6116. From icon-group-request  Sat Oct 17 15:30:12 1987
  6117. From: ihnp4!ihuxy!nowlin
  6118. Message-Version: 2
  6119. >To: /addr=ihnp4!arizona!icon-group
  6120. End-Of-Header: 
  6121. Email-Version: 2
  6122. X-Postmark: jerry.d.nowlin attbl ix1c461 55621 3129790441 ihuxy!nowlin
  6123. To: arizona!icon-group
  6124. Subject: Re: variable args and packages
  6125. Ua-Message-Id: <post.nowlin.Fri 16 Oct 1987 07:01 CDT>
  6126. End-Of-Protocol: 
  6127. Content-Length: 3872
  6128. Errors-To: icon-group-request
  6129. Status: O
  6130.  
  6131.  
  6132. > Version 7 of Icon (which we expect to release in a few months) will have
  6133. > a mechanism for handling a variable number of arguments. It will allow you
  6134. > to indicate that the last parameter should be list of the remaining
  6135. > arguments. The procedure declaration will look like:
  6136. >    procedure p(a, b, c[])
  6137. > If this is called with
  6138. >    p(1, 2, 3, 4, 5)
  6139. > you will have
  6140. >    a === 1
  6141. >    b === 2
  6142. >    c === [3, 4, 5]
  6143. > If this is called with
  6144. >    p(1)
  6145. > you will have
  6146. >    a === 1
  6147. >    b === &null
  6148. >    c === []
  6149.  
  6150. Why not pass all the arguments as a list (like the command line arguments
  6151. in the main procedure) instead of having any formally declared arguments? 
  6152. This isn't a purely rhetorical question.  It only seems natural to pass a
  6153. list to a procedure if you want a variable number of arguments.  The Icon
  6154. printf() procedure I've seen worked this way.
  6155.  
  6156. If the expression with which a procedure is called is forced to use a
  6157. notation indicating a variable number of arguments it will make for more
  6158. readable code.  One of the trickier things to explain to novice C users is
  6159. the concept of a variable number of arguments to the family of printf()
  6160. system calls.  The biggest reason is that the syntax of a calling
  6161. expression does nothing to indicate that there's a variable number of
  6162. arguments.  On the other hand take the exec() family of system calls.  The
  6163. syntax of these functions makes it clear that there is a variable number of
  6164. arguments.  (Never mind that novice C programmers never figure out how to
  6165. set them up.)
  6166.  
  6167. Icon already has a simple mechanism for passing a list to a procedure and
  6168. it seems like a waste of resources to make it more formal.  If you want to
  6169. call p(), from the above example, with a variable number of arguments and
  6170. there are only three formal arguments in the declaration call it like this:
  6171.  
  6172.    p(1, 2, [ 3, 4, 5 ])
  6173.  
  6174. You end up with the same kind of parsing work in the procedure itself that
  6175. exists with the proposed formal mechanism, but with this syntax what's
  6176. happening is clear from the calling expression.  It also has the advantage
  6177. that the missing third argument is &null instead of an empty list, if only
  6178. one argument is used.  That follows the current Icon missing argument
  6179. convention.
  6180.  
  6181. What you currently have is the need for some documentation explaining how
  6182. to use Icon in this way.  Not the need for a more formal mechanism to
  6183. provide a variable number of arguments.
  6184.     
  6185.  
  6186.  
  6187. >     (2) The Icon scoping mechanism is very weak ...
  6188. >     I would like to see a "package" mechanism, where a package simply
  6189. >     groups a set of global declarations (including procedures) and specifies
  6190. >     which ones are exported to the surrounding environment.
  6191. >     
  6192. > Some of the current research here at the U of A is aimed at developing
  6193. > an optimizing compiler (if this progresses to distribution, it certainly
  6194. > won't be with version 7). In order to do a reasonable job of optimization
  6195. > the compiler will have to know which variables are local to the
  6196. > compilation unit (that is, the file), which are exported and which are
  6197. > imported; so we will at least need to develop a simple "package" mechanism
  6198. > at the file level. This is what C does and seems to provide adaquate
  6199. > modularization for many programs. Does a more complex mechanism give enough
  6200. > benifit to justify the complexity?
  6201.  
  6202. The C mechanism of scoping "static global" variables to the source file in
  6203. which they're declared is a handy thing to have.  If Icon were to provide
  6204. this type of scoping it would be useful.  A more complex scoping scheme
  6205. would be overkill.  PLEASE, don't use "static global" like C.  The
  6206. difference between "static global" and "static local" variables is another
  6207. one of those things that you're never really sure you've gotten across to
  6208. new C programmers.  Use any keyword but "static"!
  6209.  
  6210. Jerry Nowlin
  6211. (...!ihnp4!ihuxy!nowlin)
  6212.  
  6213. From icon-group-request  Sat Oct 17 15:31:57 1987
  6214. From: ihnp4!ihlpe!orf
  6215. Message-Version: 2
  6216. >To: /addr=ihnp4!arizona!icon-group
  6217. End-Of-Header: 
  6218. Email-Version: 2
  6219. X-Postmark: owen.r.fonorow attis iw1z261 xmpi4000 3129797173 ihlpe!orf
  6220. To: arizona!icon-group
  6221. Subject: Variable Scoping
  6222. Ua-Message-Id: <post.orf.Fri 16 Oct 1987 15:49 CDT>
  6223. End-Of-Protocol: 
  6224. Content-Length: 1184
  6225. Errors-To: icon-group-request
  6226. Status: O
  6227.  
  6228. To: ihnp4!arizona!icon-group
  6229. Subject: Re: variable args and packages
  6230.  
  6231. >    (2) The Icon scoping mechanism is very weak ...
  6232. >    I would like to see a "package" mechanism, where a package simply
  6233. >    groups a set of global declarations (including procedures) and specifies
  6234. >    which ones are exported to the surrounding environment.
  6235. >   
  6236. > >This is what C does and seems to provide adaquate
  6237. > >modularization for many programs. Does a more complex mechanism give enough
  6238. > >benifit to justify the complexity?
  6239.  
  6240.  
  6241. I'd just like to point out that in the case here where Icon was used to
  6242. implement a large applications program, we had from 3 to 5 developers working 
  6243. on a system that ended up being about 20,000 NCLC before being translated to C.
  6244. We didn't realize there was a problem with weak scoping. That is there were 
  6245. few - if any - software bugs that resulted from incorrect scoping (i.e. using 
  6246. an unintended variable with the same name). 
  6247.  
  6248. We did have to be careful about undeclared local identifiers in shared
  6249. ucode libraries, but we made it a practice to always translate with
  6250. -u flag to icont. 
  6251.  
  6252. Rick Fonorow
  6253.  
  6254. p.s. Icon group: my new address is ihnp4!ihlpe!orf  (not iwsam!orf)
  6255.  
  6256. From icon-group-request  Sun Oct 18 14:22:35 1987
  6257. From: "Kenneth Walker" <kwalker>
  6258. To: icon-group
  6259. Subject: variable args
  6260. Errors-To: icon-group-request
  6261. Status: O
  6262.  
  6263. >   Date:  Fri, 16 Oct 87 13:28 EDT
  6264. >   From: Abrahams@MIT-Multics.ARPA
  6265. >   
  6266. >   (1) The notation
  6267. >       procedure p(a,b,c[])
  6268. >   is quite elegant, and more general that what I had proposed.  But why
  6269. >   not allow the form
  6270. >       procedure[a]
  6271. >   as a synonym for
  6272. >       procedure(a[])
  6273.  
  6274. I agree that your form for the case of one argument looks nicer than
  6275. that of the general form, but I don't feel that the additional syntax
  6276. is justified when you only save 2 key strokes and the feature is not
  6277. likely to be used much.
  6278.  
  6279. >   From: ihnp4!ihuxy!nowlin
  6280. >   Date: Fri 16 Oct 1987 07:11 CDT
  6281. >   
  6282. >   Why not pass all the arguments as a list (like the command line
  6283. >   arguments in the main procedure) instead of having any formally
  6284. >   declared arguments? 
  6285.  
  6286. The motivation for adding variable argument lists to Icon is that
  6287. any language which has built-in functions which take a variable
  6288. number of arguments (write, writes, and stop) but does not allow
  6289. user defined procedures to take a variable number of arguments is
  6290. incomplete. This argument has been around for a long time, but it
  6291. is only recently that someone (Bill Mitchell and Dave Gudeman) has
  6292. actually implemented a variable argument feature in Icon.
  6293.  
  6294. From icon-group-request  Sun Oct 18 15:14:06 1987
  6295. From: "Kenneth Walker" <kwalker>
  6296. To: icon-group
  6297. Subject: packages
  6298. Errors-To: icon-group-request
  6299. Status: O
  6300.  
  6301. >  Date:  Fri, 16 Oct 87 13:28 EDT
  6302. >  From: Abrahams@MIT-Multics.ARPA
  6303. >  
  6304. >  (2) I'd be quite happy with a package mechanism that would provide only for
  6305. >  exporting procedures and not variables.  That would avoid the need to deal
  6306. >  with any difficulties in optimization, because the whole problem would become
  6307. >  very static.  That is, packages would have variables declared internal to
  6308. >  them, and would inherit all variables in their enclosing packages.  The
  6309. >  optimization problems are then no different than those we now have with
  6310. >  global versus local.
  6311.  
  6312. The optimizations that I am interested in are based on type inference and
  6313. I want to be able to do them without looking outside the compilation
  6314. unit. I can accept the "outside world" sharing variables with the
  6315. compilation unit, but I want to know which ones are actually shared.
  6316. I have no way of knowing what affect an outside procedure will have
  6317. on shared variables and must assume the worst. If I can limit the
  6318. affect to a few variables I can do a better job of type inference.
  6319.  
  6320. >  From: ihnp4!ihlpe!orf
  6321. >  Date: Fri 16 Oct 1987 15:50 CDT
  6322. >  
  6323. >  I'd just like to point out that in the case here where Icon was used to
  6324. >  implement a large applications program, we had from 3 to 5 developers working
  6325. >  on a system that ended up being about 20,000 NCLC before being translated to
  6326. >  C. We didn't realize there was a problem with weak scoping. That is there
  6327. >  were few - if any - software bugs that resulted from incorrect scoping
  6328. >  (i.e. using an unintended variable with the same name). 
  6329.  
  6330. It seems to me that a big advantage of some kind of packaging mechanism
  6331. would be in program maintenance. It is often a good idea to look to see
  6332. how a variable or procedure is used before changing code that will
  6333. affect it (just in case you are making some false assumptions). If you
  6334. cannot limit the scope of the name, you have to look in all program
  6335. files. Even with reasonable tools, this search is a pain when more than
  6336. one file is involved.
  6337.  
  6338. From icon-group-request  Sun Oct 18 15:27:04 1987
  6339. From: "David Gudeman" <gudeman>
  6340. To: icon-group
  6341. In-Reply-To: <8710172230.AA27538@megaron.arizona.edu>
  6342. Subject: variable args and packages
  6343. Errors-To: icon-group-request
  6344. Status: O
  6345.  
  6346.    From: ihnp4!ihuxy!nowlin
  6347.    Date: Fri 16 Oct 1987 07:11 CDT
  6348.  
  6349.    Why not pass all the arguments as a list (like the command line
  6350.    arguments in the main procedure) instead of having any formally
  6351.    declared arguments? ....  The Icon printf() procedure I've seen
  6352.    worked this way.
  6353.  
  6354. The Icon printf() procedure had to work that way because there was no
  6355. more elegant way to do it.  There is a conceptual difference between
  6356. printf([...]) and printf(...).  In the first, a single parameter is
  6357. being passed to printf() as a list, in the second an arbitrary number
  6358. of parameters is being passed.  The printf() procedure may have to
  6359. treat the cases the same, but to the caller they are different cases.
  6360.  
  6361.    If the expression with which a procedure is called is forced to use
  6362.    a notation indicating a variable number of arguments it will make
  6363.    for more readable code.
  6364.  
  6365. I would say just the opposite.
  6366.  
  6367.    One of the trickier things to explain to novice C users is the
  6368.    concept of a variable number of arguments to the family of printf()
  6369.    system calls.  The biggest reason is that the syntax of a calling
  6370.    expression does nothing to indicate that there's a variable number
  6371.    of arguments.
  6372.  
  6373. I suspect that the hard thing to explain is that arguments following
  6374. the format depend on the format.  I never had any trouble explaining
  6375. to complete novices how Pascal i/o procedures work.  These procedures
  6376. take a variable number of arguments also.
  6377.  
  6378.    ....  If you want to call p(), from the above example, with a
  6379.    variable number of arguments and there are only three formal
  6380.    arguments in the declaration call it like this:
  6381.  
  6382.       p(1, 2, [ 3, 4, 5 ])
  6383.  
  6384.    ... with this syntax what's happening is clear from the calling
  6385.    expression.  
  6386.  
  6387. But we don't want what's happening to be clear from the calling
  6388. expression.  The whole point of procedure abstraction is to make it so
  6389. the calling procedure doesn't know what goes on in the called
  6390. procedure, only what the affect is.  The fact that the called
  6391. procedure has to make a list of its arguments (to handle a variable
  6392. number) should be opaque to the calling procedure.
  6393.  
  6394.    It also has the advantage that the missing third argument is &null
  6395.    instead of an empty list, if only one argument is used.
  6396.  
  6397. This ``advantage'' was decided to be a peculiar and surprising affect,
  6398. so we took deliberate steps to make a missing list argument be an
  6399. empty list instead of &null.  This lets the programmer loop directly
  6400. on the list without first checking whether it is &null or not.
  6401. Presumably, if the list is empty, then the loop will never be
  6402. executed.
  6403.  
  6404.    .... PLEASE, don't use "static global" like C.
  6405.  
  6406. Little chance of that.  Actually, there is little chance of any change
  6407. in Icon's scoping mechanism because the change would be both
  6408. non-trivial and uninteresting (from the point of view of language
  6409. research).  Of course, if someone else wanted to implement a better
  6410. scoping mechanism for Icon, I'm sure Ralph Griswold would be glad to
  6411. consider putting it in the distributed version of Icon...
  6412.  
  6413. From icon-group-request  Sun Oct 18 17:56:59 1987
  6414. From: Abrahams@MIT-Multics.ARPA
  6415. Subject:  Variable number of args (again)
  6416. To: icon-group@arizona.edu
  6417. Errors-To: icon-group-request
  6418. Status: O
  6419.  
  6420. In response to Ken Walker's remark on my p[a] notation:  I realized
  6421. afterwards that p[a,b,c] is a nicer way to write what would be
  6422. p(a,b,c[]) in the other notation.  Another advantage is that it doesn't
  6423. have similar forms that are illegal, such as p(a,b[],c) or p(a[],b,c[])
  6424. (or do those indeed have a meaning)?
  6425.  
  6426. I agree that whatever the notation, it should be used in the procedure
  6427. definition rather than at the point of call.
  6428.  
  6429. Paul Abrahams
  6430.  
  6431. From icon-group-request  Mon Oct 19 11:37:55 1987
  6432. From: "Kenneth Walker" <kwalker>
  6433. In-Reply-To: <871019005326.141703@MIT-Multics.ARPA>
  6434. To: Abrahams@MIT-Multics.ARPA, icon-group@arizona.edu
  6435. Subject: Re:  Variable number of args (again)
  6436. Errors-To: icon-group-request
  6437. Status: O
  6438.  
  6439. >  Date:  Sun, 18 Oct 87 20:53 EDT
  6440. >  From: Abrahams@MIT-Multics.ARPA
  6441. >  
  6442. >  In response to Ken Walker's remark on my p[a] notation:  I realized
  6443. >  afterwards that p[a,b,c] is a nicer way to write what would be
  6444. >  p(a,b,c[]) in the other notation.  Another advantage is that it doesn't
  6445. >  have similar forms that are illegal, such as p(a,b[],c) or p(a[],b,c[])
  6446. >  (or do those indeed have a meaning)?
  6447.  
  6448. Your notation is more compact, but I like the fact that p(a,b,c[])
  6449. emphasizes the asymmetry of argument handling. As for p(a,b[],c), I
  6450. suggested at one point that we allow the list to go anywhere among
  6451. the paramters with the interpretation that if there were
  6452. enough arguments, it would take up the slack in the middle so the
  6453. last parameter would get the last argument. The suggestion got
  6454. shot down however. As I recall, the reasoning was that the parameters
  6455. could always be rearranged to put the list at the end. It seems
  6456. to me that p(a[],b,c[]) is inherently ambiguous. I suppose we could
  6457. **generate** a sequence of calls, one for each valid arrangement of
  6458. arguments into the lists (however, its not clear to me that this would
  6459. be useful).
  6460.  
  6461. From icon-group-request  Mon Oct 19 15:42:32 1987
  6462. From: "Bill Mitchell" <whm>
  6463. To: icon-group
  6464. Subject: Re:  Variable number of args (again)
  6465. Errors-To: icon-group-request
  6466. Status: O
  6467.  
  6468. Having thought about this for some time, I think that what I like the best
  6469. is
  6470.  
  6471.     procedure p[x]
  6472.  
  6473. to indicate that x is a list of all the arguments.  Although I was involved
  6474. with the hacks for p(a,b,c[]), the ability to type stuff like p(a[],b,c) seems
  6475. like an indication that a better idea is required.  The above notation seems
  6476. fairly clean in contrast, but there is the possibility of typing p[x,y,z].
  6477.  
  6478. From icon-group-request  Tue Oct 20 04:01:24 1987
  6479. From: rosevax!ems!dayton!umn-cs!amit@uunet.uu.net  (Neta Amit)
  6480. Organization: University of Minnesota
  6481. Subject: Re: Arglists and packages
  6482. References: <871016172837.628350@MIT-Multics.ARPA>
  6483. Sender: icon-group-request@arizona.edu
  6484. To: icon-group@arizona.edu
  6485. Errors-To: icon-group-request
  6486. Status: O
  6487.  
  6488. In article <871016172837.628350@MIT-Multics.ARPA> Abrahams@MIT-MULTICS.ARPA writes:
  6489. >This is a reply to Ken Walker's comments on my proposals.
  6490. >
  6491. >(1) The notation
  6492. >    procedure p(a,b,c[])
  6493. >is quite elegant, and more general than what I had proposed.  
  6494.  
  6495. For elegance and generality, consider the solution that has been available
  6496. in many Lisp/Scheme dialects for many years:
  6497.  
  6498.      (define foo (a b c &optional d e &rest f) ...)
  6499.  
  6500. At least three args must be provided and are bound to a, b and c.
  6501. The next two args, if any, are bound to d and e.
  6502. Any additional args form a list which is bound to f.
  6503. If d, e or f args are not provided, those vars are assigned ().
  6504. -- 
  6505.   Neta Amit 
  6506.   U of Minnesota CSci
  6507.   Arpanet: amit@umn-cs.cs.umn.edu
  6508.  
  6509. From icon-group-request  Tue Oct 20 05:20:22 1987
  6510. From: "David Gudeman" <gudeman>
  6511. To: icon-group
  6512. In-Reply-To: <2393@umn-cs.UUCP>
  6513. Subject: Arglists and packages
  6514. Errors-To: icon-group-request
  6515. Status: O
  6516.  
  6517.    Date: 17 Oct 87 21:33:40 GMT
  6518.    From: rosevax!ems!dayton!umn-cs!amit@uunet.uu.net  (Neta Amit)
  6519.    ...
  6520.    For elegance and generality, consider the solution that has been available
  6521.    in many Lisp/Scheme dialects for many years:
  6522.  
  6523.     (define foo (a b c &optional d e &rest f) ...)
  6524.  
  6525. This essentially what the notation
  6526.  
  6527.     procedure foo(a, b, c, d, e, f[])
  6528.  
  6529. gives you.  The only differences being that (1) _all_ the arguments
  6530. are optional (the &optional keyword would be spurious in Icon), and
  6531. (2) Only the list argument f is replaced with an empty list if it is
  6532. missing, other missing arguments are replaced with the special value
  6533. &null.
  6534.  
  6535. From icon-group-request  Wed Oct 21 22:13:50 1987
  6536. From: stuart@gargoyle.uchicago.edu  (Stuart A. Kurtz)
  6537. Organization: Dept. of Comp. Sci., The University of Chicago
  6538. Subject: Re:  The future of icon.
  6539. Sender: icon-group-request@arizona.edu
  6540. To: icon-group@arizona.edu
  6541. Errors-To: icon-group-request
  6542. Status: O
  6543.  
  6544. A few random thoughts.
  6545.  
  6546. 1) Re: scoping.  Most of the suggestions about controlling the scope
  6547.    of variables has been to use C style scoping.  I.e., scope at the
  6548.    file level only, and "protect" names by explicit static declarations.
  6549.    I would prefer (although it may be too late ...) to require explicit
  6550.    export statements, i.e., the default is not to export.
  6551.      Pro:
  6552.     This is better software engineering.  Define an interface, and
  6553.         then stick with it.  I envision a style with all of the export's
  6554.         at the top of the program, documented to describe the interface.
  6555.     Static variables (i.e., variables declared as "global") would then
  6556.     not contribute by default (and silently) to the interface.
  6557.      Con:
  6558.     Existing icon programs would be invalidated.  At the very least,
  6559.     implementation of this suggestion would require adding another
  6560.     flag to icont "make all declarations external".
  6561.  
  6562. 2) Re: varargs.  
  6563.    I suspect that the syntax "procedure p[a]" is most reasonable.  There 
  6564.    is comparatively little reason to have "procedure p(a,b,[c])" or whatever,
  6565.    as icon permits fewer actual parameters than formal ones.  Thus,
  6566.    "p(a,b,[c])", or its ilk, in no way "enforces" at least two parameters,
  6567.    which was the point behind the C varargs structure.
  6568.  
  6569.  
  6570. Stu
  6571.  
  6572. Stuart A. Kurtz
  6573. Dept Computer Science
  6574. The University of Chicago
  6575.  
  6576. From icon-group-request  Thu Oct 29 01:17:55 1987
  6577. From: clyde!burl!codas!mtune!lzaz!bds@rutgers.edu  (BRUCE SZABLAK)
  6578. Organization: AT&T ISL Middletown NJ USA
  6579. Subject: Re: The future of icon.
  6580. References: <779@gargoyle.UChicago.EDU>
  6581. Sender: icon-group-request@arizona.edu
  6582. To: icon-group@arizona.edu
  6583. Errors-To: icon-group-request
  6584. Status: O
  6585.  
  6586.  
  6587. Is there a symbolic debugger available for Icon? If not, there should
  6588. be (or at least a true interpreter).
  6589.  
  6590. From icon-group-request  Mon Nov  9 11:36:32 1987
  6591. From: naucse!sbw (Steve Wampler)
  6592. To: arizona!icon-group
  6593. Subject: Not A Contest, but IconTest!
  6594. Errors-To: icon-group-request
  6595. Status: O
  6596.  
  6597.  
  6598. While proctoring part of the ACM Mountain Regional Programming Contest,
  6599. it struck me how well suited Icon was for the majority of the contest
  6600. problems.  "Hmmm," I say to myself...
  6601.  
  6602. Announcing:
  6603.     The First Annual Great Icon Programming Test
  6604.     (IconTest for short)
  6605.  
  6606. Problems will be chosen from the 1987 ACM Mountain Regional Programming
  6607. Contest, and will be presented one at a time to the Icon programming
  6608. community.
  6609.  
  6610. Rules: Solve the problems using Icon, and mail the source to:
  6611.  
  6612.     Email: Steve Wampler
  6613.         {....!arizona!naucse!sbw}
  6614.     USmail: Steve Wampler
  6615.         College of Engineering and Technology
  6616.         Box 15600
  6617.         Northern Arizona University
  6618.         Flagstaff,  AZ  86011
  6619.  
  6620.        Solutions must show the version of Icon used and any special
  6621.     options.  (Don't just have the source print &version and
  6622.     &option - that isn't going to do much when I try it out on
  6623.     my end.)
  6624.     
  6625.        Judging will be entirely subjective, and based upon such
  6626.     abstract criteria as:
  6627.  
  6628.         (1) Correctness
  6629.         (2) Suitability of solution to Icon
  6630.         (3) Appropriate use of Icon language features.
  6631.         (4) Readability  (note: Pascal-style Icon is not
  6632.             a priori more readable than other styles!)
  6633.  
  6634.         The decision of the judge(s) is final, though icon-project may
  6635.     be consulted during the judging to resolve sticky points.
  6636.  
  6637.        Duration:  Each problem will remain open until a "winning" entry
  6638.     is found.  Since mail times differ around the icon-group, there
  6639.     is a built-in hysteresis.  All programs collected in a two week
  6640.     period will be judged as simultaneous arrivals.
  6641.  
  6642.        The "winning" programs will be posted back to icon-group.
  6643.  
  6644.        Eligibility:  The contest is restricted to Icon programmers.
  6645.     Members of icon-project are encouraged to compete, but
  6646.     cannot win except by default (sorry, folks, life is tough).
  6647.  
  6648.        Prizes:  Absolutely none, unless someone *else* wants to foot
  6649.     the bill.
  6650.  
  6651. Now, a few comments.  Some of the problems are particularly easy in Icon,
  6652.     occasionally requiring little more than consultation of the "Icon
  6653.     Programming Language" by Griswold and Griswold.  Others might take
  6654.     a bit more design to find an appropriate solution approach for Icon.
  6655.     None are identified as being easy or hard.
  6656.  
  6657.     At least one of the problems is not necessarily well-formed in the
  6658.     problem statement.  Sorry, I didn't write them.  Make sure any
  6659.     assumptions you make are clearly specified - if they're incorrect
  6660.     assumptions, too bad.  Where I've made typographical changes, the
  6661.     change is enclosed in square brackets ('[' and ']').
  6662.  
  6663.     By the way, at the ACM contests, the programs must behave exactly
  6664.     to specs - no deviation from the specified output format is allowed.
  6665.     Just for grins, let's do that here as well.  [ A^B for you Icon]
  6666.  
  6667. Okay, let the games begin!
  6668.  
  6669. From icon-group-request  Mon Nov  9 11:39:44 1987
  6670. From: naucse!sbw (Steve Wampler)
  6671. To: arizona!icon-group
  6672. Subject: IconTest Problem #1 Statement
  6673. Cc: cjh@mv2.arizona.edu, cst@mv2.arizona.edu, ewh@mv2.arizona.edu,
  6674.         gce@mv1.arizona.edu, igc@mv2.arizona.edu, jap@mv2.arizona.edu,
  6675.         jjt@mv1.arizona.edu, jmm@mv2.arizona.edu, jwse@mv2.arizona.edu,
  6676.         kds@mv2.arizona.edu, mer@mv2.arizona.edu, mjm@mv2.arizona.edu,
  6677.         pab@mv1.arizona.edu, pfr@mv2.arizona.edu, ptj@mv2.arizona.edu,
  6678.         rjb@mv1.arizona.edu, scc@mv2.arizona.edu, scs@mv1.arizona.edu,
  6679.         tgj@mv1.arizona.edu, wen@mv2.arizona.edu
  6680. Errors-To: icon-group-request
  6681. Status: O
  6682.  
  6683.  
  6684.  
  6685. -----------------------------------------------------------------------------
  6686. IconTest Problem #1: The Big Powers:
  6687.  
  6688. Your task is to read in pairs of positive numbers, A and B.  They will be
  6689. contained in two right justified fields of length and type integer.  You
  6690. are to then calculate the value of A raised to the power B,  [ A^B ] for
  6691. you [Icon] types.  The output should be of the format:
  6692.  
  6693.     A = ddddd
  6694.     B = ddddd
  6695.  
  6696.     ddddd ddddd ddddd ddddd ddddd ddddd ddddd ddddd ddddd ddddd
  6697.     ddddd ddddd ddddd ddddd ddddd ddddd ddddd ddddd ddddd ddddd
  6698.             .
  6699.             .
  6700.             .
  6701.     ddddd ddddd ddddd ddddd ddddd ddddd ddddd ddddd ddddd ddddd
  6702.     ddddd ddddd ddddd .....
  6703.  
  6704.     The number should be padded on the left with leading zeros to
  6705.     ensure that the number of digits printed is divisible by 5.
  6706.     Digits are printed in groups of five, with an intervening blank
  6707.     between groups, and ten groups per line with the exception of
  6708.     the last line which may have between one and ten groups.
  6709.  
  6710.     The output will be 5,000 digits or less in length.
  6711.  
  6712. -----------------------------------------------------------------------------
  6713.  
  6714.     Mail source code for solution to:
  6715.  
  6716.     -Steve Wampler
  6717.      College of Engineering and Technology
  6718.      Box 15600
  6719.      NAU, Flagstaff, AZ 86011
  6720.  
  6721.     -{....!arizona!naucse!sbw}
  6722.  
  6723. From icon-group-request  Thu Nov 12 21:59:32 1987
  6724. Return-Path: <goer@sphinx.uchicago.edu>
  6725. From: Richard L. Goerwitz III <goer@sphinx.uchicago.edu>
  6726. To: icon-group@arizona.edu
  6727. Subject: stripping
  6728. Errors-To: icon-group-request
  6729. Status: O
  6730.  
  6731.  
  6732. I know it's a bit late now.  But I've been wanting for some time now to see
  6733. a strip command.  Whether it be incorporated into map, or set up as a separate
  6734. command, I don't really care.
  6735.  
  6736. I assume that such a command has not been included in releases to date for some
  6737. logical reason.  I wonder what that reason is.  And if it still holds (i.e. a
  6738. primitive strip command will not be implemented), I wonder whether anyone could
  6739. advise me as to what the best way of accomplishing a quick strip is.  So far,
  6740. I've been using:
  6741.  
  6742.                      map(string,repl((char := !string),*string))
  6743.                      while i := upto(char,string)
  6744.                      do string[i:many(char,string,i)] := ""
  6745.  
  6746. Yuck!  What a time-waster.  A major slowup in my programs.  Any better ideas?
  6747.  
  6748.                                                    -Richard Goerwitz
  6749.                                                    goer@sphinx.uchicago.edu
  6750.  
  6751. From icon-group-request  Fri Nov 13 23:59:06 1987
  6752. Return-Path: <goer>
  6753. From: Richard L. Goerwitz III <goer@sphinx.uchicago.edu>
  6754. To: icon-group@arizona.edu
  6755. Subject: stripping
  6756. Errors-To: icon-group-request
  6757. Status: O
  6758.  
  6759.  
  6760. Okay, okay.  I'm thoroughly chastened.  In the letter I wrote about strippint,
  6761. I asked a question:  Why no primitive strip function?  I also asked, how can
  6762. I do a strip as quickly as possible, given the present tools?
  6763.  
  6764. Unfortunately, I posted some code.  That was silly.  I used a reserved word
  6765. where I shouldn't have, and then forgot to assign any variable to what was
  6766. produced by map(str,...).  Silly, silly, silly.  And confusing.
  6767.  
  6768. All I really wanted to know was what the fastest way to accomplish in icon
  6769. what I accomplish in UNIX with "tr -d."
  6770.  
  6771. This is a blanket response to all the justifiably confused people who wrote
  6772. to me either telling me I was nuts, or thinking they were!
  6773.  
  6774. The questions still, stand, though.  Any thoughts?             -Richard
  6775.  
  6776. From icon-group-request  Sat Nov 14 06:23:18 1987
  6777. From: "Ralph Griswold" <ralph>
  6778. To: goer@sphinx.uchicago.edu, icon-group@arizona.edu
  6779. Subject: Re:  stripping
  6780. In-Reply-To: <8711140039.AA09415@sphinx.uchicago.edu>
  6781. Errors-To: icon-group-request
  6782. Status: O
  6783.  
  6784.    From icon-group-request Fri Nov 13 23:59:19 1987
  6785.    Return-Path: <goer>
  6786.    From: Richard L. Goerwitz III <goer@sphinx.uchicago.edu>
  6787.    To: icon-group@arizona.edu
  6788.    Subject: stripping
  6789.    Errors-To: icon-group-request
  6790.    Status: R
  6791.    
  6792.    
  6793.    Okay, okay.  I'm thoroughly chastened.  In the letter I wrote about strippint,
  6794.    I asked a question:  Why no primitive strip function?  I also asked, how can
  6795.    I do a strip as quickly as possible, given the present tools?
  6796.    
  6797.    Unfortunately, I posted some code.  That was silly.  I used a reserved word
  6798.    where I shouldn't have, and then forgot to assign any variable to what was
  6799.    produced by map(str,...).  Silly, silly, silly.  And confusing.
  6800.    
  6801.    All I really wanted to know was what the fastest way to accomplish in icon
  6802.    what I accomplish in UNIX with "tr -d."
  6803.    
  6804.    This is a blanket response to all the justifiably confused people who wrote
  6805.    to me either telling me I was nuts, or thinking they were!
  6806.    
  6807.    The questions still, stand, though.  Any thoughts?             -Richard
  6808.    
  6809.  
  6810. The answer to your question as to why a "stripping" function is not
  6811. included in the built-in repertoire of Icon is simply that there is
  6812. not enough need for such a function to justify it.  Every function that
  6813. is added to the repertoire of a programming language increases the
  6814. size of the language. If a function is widely useful or cannot be
  6815. written as a procedure in the language, then having it built-in is
  6816. important.  But if it is relatively special-purpose and can be written
  6817. as a procedure, then having it built-in can be a disadvantage -- it
  6818. inceases the size of the implementation, the vocabulary programmers
  6819. need to learn, the size of the documentation, and the maintenance
  6820. load.
  6821.  
  6822. Obviously, decisions like these are not clear cut.  They depend on
  6823. the philisophy of the design of the language, the opinions, style,
  6824. and taste of the authors, and so on.
  6825.  
  6826. Some folks think Icon should have a lot more built-in functions than
  6827. it does.  Others think it has many too many.
  6828.  
  6829. The "stripping" operation is easy to write as a procedure in Icon.
  6830. See the solution to Exercise 4.7 in the Icon Programming Language book.
  6831. Of course, it's not as efficient as a built-in function; that's part
  6832. of the trade-off. 
  6833.  
  6834. Icon also makes it fairly easy to add to its built-in repertoire by adding
  6835. functions written in C.  Source code for Icon is in the public domain and
  6836. documentation on modifying it is extensive.  So, if you want to, you
  6837. can make a personalized version of Icon that has the built-in repertoire
  6838. you want.
  6839.  
  6840.  
  6841. From icon-group-request  Wed Nov 18 08:06:24 1987
  6842. From: J65%TAUNIVM.BITNET@wiscvm.wisc.edu
  6843. To: icon-group@arizona.edu
  6844. Errors-To: icon-group-request
  6845. Status: O
  6846.  
  6847. sorry for bothering you all. pl. remove me from the mailing list. thanx.
  6848.  
  6849. From icon-group-request  Mon Dec 14 14:12:05 1987
  6850. To: <icon-group@arizona.edu>
  6851. From: <lecarme%FRCICG71.BITNET@WISCVM.WISC.EDU>
  6852. Subject:  no mail?
  6853. Errors-To: icon-group-request
  6854. Status: O
  6855.  
  6856. I did not receive any mail from the Icon group since November 19. Have all
  6857. members of the group become dumb, or is there any problem in email
  6858. communications ?
  6859.  
  6860.  
  6861. From icon-group-request  Mon Dec 14 17:01:28 1987
  6862. From: Kee Hinckley <umix!apollo!nazgul@RUTGERS.EDU>
  6863. Subject: Re: no mail?
  6864. To: lecarme%frcicg71.bitnet@rutgers.EDU
  6865. Cc: icon-group@arizona.edu, icon-group@arizona.edu
  6866. In-Reply-To: lecarme%FRCICG71.BITNET@WISCVM.WISC.EDU, mon, 14 dec 87 17:10:20
  6867. Errors-To: icon-group-request
  6868. Status: O
  6869.  
  6870.     I did not receive any mail from the Icon group since November 19. Have all
  6871.     members of the group become dumb, or is there any problem in email
  6872.     communications ?
  6873.     
  6874. Well, I tried just recently but I can't seem to get through via
  6875. 'icon-group@arizona.edu' anymore.
  6876.  
  6877.                                                 -kee
  6878.  
  6879. ### {mit-erl,yale,uw-beaver}!apollo!nazgul ###   (Apple ][e ProLine BBS)    ###
  6880. ###      apollo!nazgul@eddie.mit.edu       ###  nazgul@pro-angmar.cts.com   ###
  6881. ###            nazgul@apollo.com           ### (617) 641-3722 300/1200/2400 ###
  6882. I'm not sure which upsets me more; that people are so unwilling to accept       responsibility for their own actions, or that they are so eager to regulate     everyone else's.
  6883. -------
  6884.  
  6885. From icon-group-request  Tue Dec 15 01:12:28 1987
  6886. From: goer%sophist@gargoyle.uchicago.edu (Richard Goerwitz)
  6887. To: icon-group@arizona.edu
  6888. Subject: superficial equivalencies
  6889. Errors-To: icon-group-request
  6890. Status: O
  6891.  
  6892.  
  6893. In a letter sent out several months ago, I noticed someone remarking on how
  6894. the expression "if expr then expr else expr" is equivalent to (expr & expr) |
  6895. expr.  Perhaps the writer knew that this was not correct, strictly speaking.
  6896. However, since it has proven a source of problems for me, and for other no-
  6897. vices I have rubbed shoulders with, the exact facts of the matter are worth
  6898. relating.
  6899.  
  6900. Alternation does not imply any mutual exclusivity.  The result sequence gen-
  6901. erated by expr1 | expr2 is the sequence of results for expr1 followed by
  6902. those for expr2.  So if one executes
  6903.  
  6904.        every write(("a" & "b") | "c")
  6905.  
  6906. one gets "b\nc" (b newline c).  However, if one executes
  6907.  
  6908.        every write(if "a" then "b" else "c")
  6909.  
  6910. one simply gets "b."
  6911.  
  6912. The confusion here is caused by the fact that the two following lines are
  6913. equivalent:
  6914.  
  6915.         write(("a" & "b") | "c")
  6916.         write(if "a" then "b" else "c")
  6917.  
  6918. Both will simply write the first result produced by the expression or con-
  6919. trol structure contained in parentheses.  In both cases, this is simply "b."
  6920. Likewise, in both cases, if "a" were to fail (impossible here), then we'd
  6921. get "c."  At first glance, therefore, the two seem to be equivalent.  As I
  6922. mentioned above, the difference only appears when write is preceded by
  6923. every, since then we see that the result sequence produced by the top
  6924. example has two members.  The if...then...else structure produces only one
  6925. result, "b" and "c" being mutually exclusive.
  6926.  
  6927. Note that the if..then...else structure in fact produces a result.  In contrast,
  6928.  
  6929.         write(every ...)
  6930.  
  6931. writes nothing to the terminal.  This is because while...do and every...do
  6932. loops always continue until failing, at which point they terminate.  So, in
  6933. effect, they never produce a result.
  6934.  
  6935. I realize that many of the more experienced ICON programmers will see this
  6936. as rather basic.  My aim here, however, is to help anyone who is still
  6937. plodding through Griswold's ICON PROGRAMMING LANGUAGE to avoid some pitfalls
  6938. that inexperienced programmers like me can easily fall into....
  6939.  
  6940.                                                            -Richard Goerwitz
  6941.  
  6942.  
  6943. From icon-group-request  Tue Dec 15 13:02:56 1987
  6944. From: "David Gudeman" <gudeman>
  6945. To: icon-group
  6946. In-Reply-To: Richard Goerwitz's message of Tue, 15 Dec 87 02:07:57 CST <8712150807.AA01759@sophist.uchicago.edu>
  6947. Subject: superficial equivalencies
  6948. Errors-To: icon-group-request
  6949. Status: O
  6950.  
  6951. I thought I would add something to the note about the similarity of
  6952.  
  6953.     (expr1 & expr2) | expr3
  6954.  
  6955. and
  6956.  
  6957.     if expr1 then expr2 else expr3
  6958.  
  6959. Another difference not mentioned in the note is that in the first
  6960. expression, expr3 is evaluated if either expr1 or expr2 fails.  In the
  6961. second expresion, expr3 is only evaluated if expr1 fails.  So the
  6962. expression
  6963.  
  6964.     write(("a" & &fail) | "c")
  6965.  
  6966. writes out a "c", while the expression
  6967.  
  6968.     write(if "a" then &fail else "c")
  6969.  
  6970. doesn't write anything, it fails.
  6971.  
  6972.  
  6973. From icon-group-request  Wed Dec 16 20:36:40 1987
  6974. From: goer%sophist@gargoyle.uchicago.edu (Richard Goerwitz)
  6975. To: icon-group@arizona.edu
  6976. Subject: regular expressions
  6977. Errors-To: icon-group-request
  6978. Status: O
  6979.  
  6980.  
  6981. Just wondered if anyone has attempted to write any ICON procedures that
  6982. implement regular expression-ish pattern-matching, or if anyone has extended
  6983. the interpreter to handle this sort of thing.
  6984.  
  6985.                                                 -Richard Goerwitz
  6986.  
  6987.                                                 !ihnp4!gargoyle!sophist!goer
  6988.                                                 goer@sophist.uchicago.edu
  6989.  
  6990. From icon-group-request  Mon Dec 21 09:38:18 1987
  6991. From: NETWORK@FRSAC11.BITNET
  6992. Subject: Benchmark needed.
  6993. To: icon-group@arizona.edu
  6994. Errors-To: icon-group-request
  6995. Status: O
  6996.  
  6997. Date: 21 December 1987, 16:44:54 GMT
  6998. From: NETWORK  at FRSAC11
  6999. To:   ICON-GROUP at ARIZONA
  7000.      
  7001. Who can send me some Icon sources to be used as benchmark ?
  7002. I mean a/several pieces of software that exercise widely the language,
  7003. to check the implementation speed on a particular hardware.
  7004. The dhrystone of Icon ... With strings, generator, numbers, etc...
  7005. I would prefer a single file, but a serie would be OK.
  7006. (The time lo load, etc is more of a problem on several than on a single
  7007. file.)
  7008. I want to check the speed, not the implementation.
  7009. I can measure wall clock time, not CPU.
  7010. I do not have the complete port set for the current Icon (6.5), but
  7011. I may have the one in BSD 4.3 sources (A 5.x Icon if I remember well)
  7012.      
  7013. I have the greatest difficulty with the FTP access to megaron.arizona,
  7014. very slow, response time in the minute range, etc. I call around
  7015. 1 am PST, until 6 am PST, it should be easy then. I have tried twice today
  7016. to retreive a file, and quit after 5 hours, for a 200K file.
  7017. The FTP is issued from sumex-aim.stanford.edu.
  7018. Can you check with your local network guru why am I having so much troubles ?
  7019.      
  7020. Regards,
  7021.      
  7022. Jean-Pierre H. Dumas
  7023.      
  7024. network@frsac11 (bitnet)
  7025. network%frsac11.bitnet@mitvma.mit.edu (arpanet)
  7026. dumas@sumex-aim.stanford.edu (arpanet)
  7027.  
  7028. From icon-group-request  Mon Dec 21 15:32:24 1987
  7029. From: goer%sophist@gargoyle.uchicago.edu (Richard Goerwitz)
  7030. To: icon-group@arizona.edu
  7031. Subject: variables
  7032. Errors-To: icon-group-request
  7033. Status: O
  7034.  
  7035. Re:  Sets of ICON variables
  7036.  
  7037. Seeing as variables are passed by value and not reference, it is difficult to
  7038. perform the same operation on a series of variables with any degree of elegance
  7039. or economy.  I often end up doing things like
  7040.  
  7041.         a := doito(a)
  7042.         b := doito(b)
  7043.         c := doito(c)
  7044.         etc...
  7045.  
  7046. I wonder if it would eventually be possible to include some mechanism in ICON
  7047. for manipulating variables themselves (and not just their values).
  7048.  
  7049. Or is there some basic problem with doing things this way...?
  7050.  
  7051.                                                                -Richard Goerwitz
  7052.  
  7053. From icon-group-request  Mon Dec 21 15:49:51 1987
  7054. From: "Ralph Griswold" <ralph>
  7055. To: icon-group
  7056. Subject: Suggestions for new language features for Icon
  7057. Errors-To: icon-group-request
  7058. Status: O
  7059.  
  7060. There have been a number of suggestions for new Icon language features
  7061. in recent mail. The lack of response from us doesn't mean we didn't get
  7062. the mail or are insensitive to the ideas. It's more a matter of being
  7063. backlogged and short-handed -- not to mention the holiday season.
  7064.  
  7065. It's virtually impossible for us to respond intelligently to every
  7066. suggestion that is made in a prompt manner (there are a lot more of
  7067. you than there are of us, for one thing).
  7068.  
  7069. At the moment, we're working hard to get Version 7 of Icon completed.
  7070. While it won't answer all the questions and suggestions, it's the
  7071. place to start.
  7072.  
  7073. If you have questions about Icon and don't get the Icon Newsletter, send
  7074. us a *postal* mailing address; we'll put you on our (free) subscription
  7075. list and send you the last issue. You'll find a lot of your questions
  7076. answered in the Newsletter and you'll also see what our resources are
  7077. and why we can't do everything everyone wants us to do.
  7078.  
  7079. From icon-group-request  Mon Dec 21 16:00:29 1987
  7080. From: berry%jhereg.s1.gov@mordor.s1.gov
  7081. To: ralph@arizona.edu
  7082. Cc: icon-group@arizona.edu
  7083. In-Reply-To: "Ralph Griswold"'s message of Mon, 21 Dec 87 15:49:49 MST <8712212249.AA08653@megaron.arizona.edu>
  7084. Subject: Suggestions for new language features for Icon
  7085. Errors-To: icon-group-request
  7086. Status: O
  7087.  
  7088. My subscription to the Icon newsletter seems not to have followed me
  7089. to the Lab.  here is my address now:
  7090.  
  7091.     Berry Kercheval
  7092.     Lawrence Livermore National Laboratory
  7093.     P.O. Box 808, L-270
  7094.     Livermore, CA 94550
  7095.  
  7096.     (415) 422-7387
  7097.  
  7098.  
  7099. Thanks!
  7100.  
  7101.   --berry
  7102.  
  7103. From icon-group-request  Mon Dec 21 17:14:04 1987
  7104. From: "Ralph Griswold" <ralph>
  7105. To: icon-group
  7106. Subject: e-mail about Icon
  7107. Errors-To: icon-group-request
  7108. Status: O
  7109.  
  7110. I should have mentioned that mail to icon-group@arizona.edu is
  7111. redistributed automatically to a fairly large group of persons interested
  7112. in Icon. That mail address is appropriate for matters of general interest
  7113. about Icon.
  7114.  
  7115. If you have a request about icon-group (such as to be added, your address
  7116. changed, or to be deleted), mail to icon-group-request@arizona.edu.  Such
  7117. mail is not redistributed.
  7118.  
  7119. For other specific matters (such as being added to the Newsletter mailing list),
  7120. send mail to icon-project@arizona.edu.  That will assure it gets handled
  7121. here but will not result in redistribution to other sites.
  7122.  
  7123. If you want to restrict your message to an individual here, send to
  7124. that person, not icon-project, which goes to several persons. E.g.,
  7125. if you want to give me a piece of your mind, deliver it to ralph@arizona.edu.
  7126.  
  7127. From icon-group-request  Tue Dec 22 02:04:48 1987
  7128. From: "David Gudeman" <gudeman>
  7129. To: goer%sophist@gargoyle.uchicago.edu
  7130. Cc: icon-group@arizona.edu
  7131. In-Reply-To: Richard Goerwitz's message of Mon, 21 Dec 87 16:29:03 CST <8712212229.AA08679@sophist.uchicago.edu>
  7132. Subject: variables
  7133. Errors-To: icon-group-request
  7134. Status: O
  7135.  
  7136.    Date: Mon, 21 Dec 87 16:29:03 CST
  7137.    From: goer%sophist@gargoyle.uchicago.edu (Richard Goerwitz)
  7138.    ...
  7139.    I wonder if it would eventually be possible to include some
  7140.    mechanism in ICON for manipulating variables themselves (and not
  7141.    just their values).
  7142.  
  7143.    Or is there some basic problem with doing things this way...?
  7144.  
  7145.                           -Richard Goerwitz
  7146.  
  7147. Offhand I would say that this is not a problem in concept or in
  7148. implementation, but it might cause problems with efficiency.  We get a
  7149. _lot_ of suggestions for additions to Icon, and many of them are
  7150. interesting and/or useful.  I would classify your suggestion as both.
  7151.  
  7152. Obviously we cannot implement every useful suggestion, (or even most),
  7153. since Icon is already a large language (maybe too large), and because
  7154. it has a large user community that expects continuity between
  7155. versions.  However Icon is also a vehicle for research into
  7156. programming languages, and we are always interested in how users feel
  7157. about Icon and where they feel it needs improvement.
  7158.  
  7159. For a more direct answer to your question: I doubt very much that such
  7160. a feature will appear in the near future, as current research is
  7161. moving in other directions.  I like to think of our research as a
  7162. traversal through a hugely branching tree of possible programming
  7163. languages, searching for the Perfect Programming Language.  It's not
  7164. at all clear that the tree is finite.
  7165.  
  7166.                     David Gudeman
  7167.  
  7168.                         Department of Computer Science
  7169. gudeman@arizona.edu                Gould-Simpson Science Building
  7170. {allegra,cmcl2,ihnp4,noao}!arizona!gudeman  The University of Arizona
  7171. 602-621-2858                    Tucson, AZ 85721
  7172.  
  7173. From icon-group-request  Tue Dec 22 06:29:13 1987
  7174. From: "Ralph Griswold" <ralph>
  7175. To: gudeman
  7176. Subject: Re:  variables
  7177. Cc: icon-group
  7178. In-Reply-To: <8712220904.AA27710@megaron.arizona.edu>
  7179. Errors-To: icon-group-request
  7180. Status: O
  7181.  
  7182. Very nicely put.
  7183.  
  7184. My only disagreement with you is that language research is a search
  7185. through some existing structure.  I see is as an endless architectural
  7186. endeavor, deciding what to build next and what it should look like.
  7187.  
  7188. From icon-group-request  Tue Dec 22 12:33:59 1987
  7189. From: ihnp4!ihuxy!nowlin
  7190. Message-Version: 2
  7191. >To: /addr=ihnp4!arizona!icon-group
  7192. End-Of-Header: 
  7193. Email-Version: 2
  7194. X-Postmark: jerry.d.nowlin attbl ix1c461 55621 3129790441 ihuxy!nowlin
  7195. To: arizona!icon-group
  7196. Subject: Re: variables
  7197. Ua-Message-Id: <post.nowlin.Tue 22 Dec 1987 08:57 CST>
  7198. End-Of-Protocol: 
  7199. Content-Length: 2005
  7200. Errors-To: icon-group-request
  7201. Status: O
  7202.  
  7203. > Seeing as variables are passed by value and not reference, it is difficult
  7204. > to perform the same operation on a series of variables with any degree of
  7205. > elegance or economy.  I often end up doing things like
  7206. >         a := doito(a)
  7207. >         b := doito(b)
  7208. >         c := doito(c)
  7209. >         etc...
  7210. > I wonder if it would eventually be possible to include some mechanism in
  7211. > ICON for manipulating variables themselves (and not just their values).
  7212. > Or is there some basic problem with doing things this way...?
  7213. >                                                        -Richard Goerwitz
  7214.  
  7215. It's easy to have doito() perform it's operation on a list of variables and
  7216. return a new list with modified variables.  I'd call that fairly elegant. 
  7217. You could call doito() with an already defined list:
  7218.  
  7219.     l1 := [a,b,c]
  7220.     l2 := doito(l1)
  7221.  
  7222. or just pass the list of variables as a constant:
  7223.  
  7224.     l2 := doito([a,b,c])
  7225.  
  7226. or go even further and make doito() a generator:
  7227.  
  7228.     every i := doito([a,b,c]) do ...
  7229.  
  7230. It sounds like what you want is procedures with side effects instead
  7231. of procedures that act like functions, kind of like subroutines in
  7232. FORTRAN.  This is possible but the way that data structures like lists
  7233. are normally operated on in Icon creates new copies of the list.
  7234.  
  7235. The following procedure modifies the contents of a list and the
  7236. modifications stay in effect in the main procedure.  In order to avoid
  7237. making a copy of the list during the processing you have to use
  7238. subscripts. YECH!
  7239.  
  7240.     procedure main (args)
  7241.         dub(args)
  7242.         every write(!args)
  7243.     end
  7244.     procedure dub(lst)
  7245.         every i := 1 to *lst do
  7246.             lst[i] *:= 2
  7247.     end
  7248.  
  7249. The normal way I'd do this in Icon would be:
  7250.  
  7251.     procedure main (args)
  7252.         every write(dub(args))
  7253.     end
  7254.     procedure dub(lst)
  7255.         every suspend !lst *:= 2
  7256.     end
  7257.  
  7258. This is elegant to me.
  7259.  
  7260. Jerry Nowlin
  7261. (...!ihnp4!ihuxy!nowlin)
  7262.  
  7263. P.S. I tried to reply to the message about regular expressions last week
  7264.      but it didn't get out correctly.  I have a grep written in Icon if
  7265.      anyone is interested.
  7266.  
  7267. From icon-group-request  Tue Dec 22 12:37:57 1987
  7268. From: "Janalee O'Bagy" <janalee>
  7269. In-Reply-To: <8712211638.AA18226@megaron.arizona.edu>
  7270. To: NETWORK@FRSAC11.BITNET
  7271. Subject: Re:  Benchmark needed.
  7272. Cc: icon-group
  7273. Errors-To: icon-group-request
  7274. Status: O
  7275.  
  7276.  
  7277.  
  7278. We don't have what you need here at the Icon Project.
  7279. The test suite that we use and distribute with source
  7280. code is designed to verify proper functioning of all the 
  7281. language features--this suite would be inadequate for
  7282. testing execution time.
  7283.  
  7284. Maybe someone in the user community (i.e., icon-group) has
  7285. developed such a collection of programs.
  7286.  
  7287. I'll bring your troubles with FTP to the attention of our
  7288. local expert.
  7289.  
  7290. Janalee O'Bagy
  7291.  
  7292. From icon-group-request  Tue Dec 22 14:41:13 1987
  7293. From: ihnp4!ihuxy!nowlin
  7294. Message-Version: 2
  7295. >To: /addr=ihnp4!arizona!icon-group
  7296. End-Of-Header: 
  7297. Email-Version: 2
  7298. X-Postmark: jerry.d.nowlin attbl ix1c461 55621 3129790441 ihuxy!nowlin
  7299. To: arizona!icon-group
  7300. Subject: Re: variables
  7301. Ua-Message-Id: <post.nowlin.Tue 22 Dec 1987 15:04 CST>
  7302. End-Of-Protocol: 
  7303. Content-Length: 2006
  7304. Errors-To: icon-group-request
  7305. Status: O
  7306.  
  7307. > Seeing as variables are passed by value and not reference, it is difficult
  7308. > to perform the same operation on a series of variables with any degree of
  7309. > elegance or economy.  I often end up doing things like
  7310. >         a := doito(a)
  7311. >         b := doito(b)
  7312. >         c := doito(c)
  7313. >         etc...
  7314. > I wonder if it would eventually be possible to include some mechanism in
  7315. > ICON for manipulating variables themselves (and not just their values).
  7316. > Or is there some basic problem with doing things this way...?
  7317. >                                                        -Richard Goerwitz
  7318.  
  7319. It's easy to have doito() perform it's operation on a list of variables and
  7320. return a new list with modified variables.  I'd call that fairly elegant. 
  7321. You could call doito() with an already defined list:
  7322.  
  7323.     l1 := [a,b,c]
  7324.     l2 := doito(l1)
  7325.  
  7326. or just pass the list of variables as a constant:
  7327.  
  7328.     l2 := doito([a,b,c])
  7329.  
  7330. or go even further and make doito() a generator:
  7331.  
  7332.     every i := doito([a,b,c]) do ...
  7333.  
  7334. It sounds like what you want is procedures with side effects instead
  7335. of procedures that act like functions, kind of like subroutines in
  7336. FORTRAN.  This is possible but the way that data structures like lists
  7337. are normally operated on in Icon creates new copies of the list.
  7338.  
  7339. The following procedure modifies the contents of a list and the
  7340. modifications stay in effect in the main procedure.  In order to avoid
  7341. making a copy of the list during the processing you have to use
  7342. subscripts. YECH!
  7343.  
  7344.     procedure main (args)
  7345.         dub(args)
  7346.         every write(!args)
  7347.     end
  7348.     procedure dub(lst)
  7349.         every i := 1 to *lst do
  7350.             lst[i] *:= 2
  7351.     end
  7352.  
  7353. The normal way I'd do this in Icon would be:
  7354.  
  7355.     procedure main (args)
  7356.         every write(dub(args))
  7357.     end
  7358.     procedure dub(lst)
  7359.         every suspend !lst *:= 2
  7360.     end
  7361.  
  7362. This is elegant to me.
  7363.  
  7364. Jerry Nowlin
  7365. (...!ihnp4!ihuxy!nowlin)
  7366.  
  7367. P.S. I tried to reply to the message about regular expressions last week
  7368.      but it didn't get out correctly.  I have a grep written in Icon if
  7369.      anyone is interested.
  7370.  
  7371.  
  7372. From icon-group-request  Wed Dec 23 06:53:02 1987
  7373. From: "Ralph Griswold" <ralph>
  7374. To: icon-group
  7375. Subject: This is a test.
  7376. Errors-To: icon-group-request
  7377. Status: O
  7378.  
  7379.  
  7380.  
  7381. From icon-group-request  Thu Dec 24 19:46:44 1987
  7382. From: steinmetz!ge-dab!codas!killer!nansonp@itsgw.rpi.edu  (Paul Nanson)
  7383. Organization: The Unix(R) Connection, Dallas, Texas
  7384. Subject: dial-up
  7385. Sender: icon-group-request@arizona.edu
  7386. To: icon-group@arizona.edu
  7387. Errors-To: icon-group-request
  7388. Status: O
  7389.  
  7390.  
  7391. I heard there is a dial system associated with the ICON project.
  7392. The number given was (602) 621-2883. The settings were 300/1200/2400-E71,
  7393. and login was guest. Is such a system in existence, and if so, are 
  7394. these the correct settings, etc?
  7395.  
  7396. Paul Nanson
  7397.  
  7398. From icon-group-request  Thu Dec 24 20:44:57 1987
  7399. From: ihnp4!ihuxy!lied@ucbvax.Berkeley.EDU  (Bob Lied)
  7400. Organization: AT&T Bell Laboratories - Naperville, Illinois
  7401. Subject: Substring positions
  7402. Sender: icon-group-request@arizona.edu
  7403. To: icon-group@arizona.edu
  7404. Errors-To: icon-group-request
  7405. Status: O
  7406.  
  7407. I've finally gotten enough spare time to take a
  7408. look at ICON, and I have a novice question (please
  7409. don't hit me).  In an example and a solution in
  7410. chapter 5 of the book (I assume you know the book
  7411. I refer to), the size of a substring is calculated
  7412. with
  7413.     *line[i:j]
  7414. where I would intuitively expect to use
  7415.     i-j
  7416.  
  7417. I am inferring from this that string positions are
  7418. like other languages' pointers in that their numerical
  7419. values are not to be trusted, and I should limit their
  7420. use to assignments, comparisons, and defined operations
  7421. like subscripting.  Am I right?
  7422.  
  7423.     Bob Lied    ihnp4!ihuxy!lied
  7424.     AT&T Bell Laboratories
  7425.  
  7426. From icon-group-request  Tue Dec 29 20:49:57 1987
  7427. From: ihnp4!ihlpf!nevin1@ucbvax.Berkeley.EDU  (00704A-Liber)
  7428. Organization: AT&T Bell Laboratories - Naperville, Illinois
  7429. Subject: Transmission of results to Co-expressions (need help)
  7430. Sender: icon-group-request@arizona.edu
  7431. To: icon-group@arizona.edu
  7432. Errors-To: icon-group-request
  7433. Status: O
  7434.  
  7435. HELP!!  How does one transmit results of expressions to co-expressions?  I know
  7436. that the example in the Icon book section 13.4.2 no longer works (I think I
  7437. read about that in the Version 6 docs) and I tried the example given in
  7438. technical report TR 87-6 (Programming in Icon; Part II --  Programming with
  7439. Co-Expressions), but when I try to execute it I get run-time error 214 --
  7440. recursive co-expression activation.  I could probably use a global variable but
  7441. somehow that doesn't seem elegant.  Please e-mail me any sample programs or
  7442. explanations and I will summarize and post to the net.  I am using Version 6.3
  7443. under MS-DOS with the LMM/FR executable; I have also tried it under Unix (Icon
  7444. version 6.0) with the same error message.
  7445.  
  7446. BTW, does anyone know what's coming up in Version 7?? :-)
  7447.  
  7448. Here is a copy of the program found in TR 87-6 pp 10-11:
  7449.  
  7450.  
  7451. global words, lines, writer
  7452.  
  7453. procedure main()
  7454.  
  7455.     words := create word()
  7456.     lines := create reader()
  7457.     writer := create output()
  7458.     @writer
  7459.  
  7460. end
  7461.  
  7462. procedure word()
  7463.     static letters
  7464.  
  7465.     initial letters := &lcase || &ucase
  7466.  
  7467.     while line := @lines do
  7468.         line ? while tab(upto(letters)) do
  7469.             tab(many(&lcase)) @ writer
  7470.  
  7471. end
  7472.  
  7473. procedure reader()
  7474.  
  7475.     while read() @ words
  7476.  
  7477. end
  7478.  
  7479. procedure output()
  7480.  
  7481.     while write(@words)
  7482.     @&main
  7483.  
  7484. end
  7485.  
  7486.  
  7487. Thanks (in advance)!!
  7488. -- 
  7489.  _ __            NEVIN J. LIBER    ..!ihnp4!ihlpf!nevin1    (312) 510-6194
  7490. ' )  )                "The secret compartment of my ring I fill
  7491.  /  / _ , __o  ____         with an Underdog super-energy pill."
  7492. /  (_</_\/ <__/ / <_    These are solely MY opinions, not AT&T's, blah blah blah
  7493.  
  7494. From icon-group-request  Wed Dec 30 05:27:59 1987
  7495. From: "Ralph Griswold" <ralph>
  7496. To: icon-group
  7497. Subject: Co-Expression Transmission and Version 7
  7498. Errors-To: icon-group-request
  7499. Status: O
  7500.  
  7501. Co-expression transmission cannot be made to work in a useful
  7502. way in the distributed Version 6 of Icon.
  7503.  
  7504. We have the problem corrected, and the results will be available in
  7505. Version 7.  We presently expect Version 7 to be available for
  7506. UNIX systems late in January and for MS-DOS systems a couple of weeks
  7507. later.
  7508.  
  7509. The release of Version 7 will be annnounced via icon-group.
  7510.  
  7511. From icon-group-request  Wed Dec 30 16:19:19 1987
  7512. From: "David Gudeman" <gudeman>
  7513. To: ihnp4!ihuxy!lied@ucbvax.Berkeley.EDU, icon-group
  7514. In-Reply-To: (Bob Lied's message of 25 Dec 87 00:31:22 GMT <2321@ihuxy.ATT.COM>
  7515. Subject: Substring positions
  7516. Errors-To: icon-group-request
  7517. Status: O
  7518.  
  7519.    From: ihnp4!ihuxy!lied@ucbvax.Berkeley.EDU  (Bob Lied)
  7520.  
  7521.    ....  In an example and a solution in chapter 5 of the book (I
  7522.    assume you know the book I refer to), the size of a substring is
  7523.    calculated with
  7524.  
  7525.        *line[i:j]
  7526.    where I would intuitively expect to use
  7527.        i-j
  7528.  
  7529.    I am inferring from this that string positions are
  7530.    like other languages' pointers in that their numerical
  7531.    values are not to be trusted, and I should limit their
  7532.    use to assignments, comparisons, and defined operations
  7533.    like subscripting.  Am I right?
  7534.  
  7535. Well, not really.  String positions are integer positions _between_
  7536. the characters of the string, where 1 is the position at the beginning
  7537. of the string.  However, non-positive integers are also valid string
  7538. positions (with 0 at the end of the string).  So if i or j is
  7539. non-positive, it is not true that "*line[i:j] = j-i" (I assume you
  7540. meant "j-i" rather than "i-j").
  7541.  
  7542. In the example in the book, both i and j are guaranteed to be
  7543. positive, so "j-i" works.  Notice though, that in most languages the
  7544. positive integers refer to character positions, so the correct formula
  7545. for the length of a substring from i to j is "j-i+1".  Perhaps the
  7546. authors wanted to avoid confusing readers with this subtlety.
  7547.  
  7548. From icon-group-request  Thu Dec 31 09:06:28 1987
  7549. To: arizona!icon-group-request, arizona!icon-group, arizona!icon-project
  7550. Subject: Sample programs and subscription
  7551. From: noao!rutgers!gatech!rebel!dkstar!n8emr!uncle!jbm@hao.UCAR.EDU (John B. Milton)
  7552. Errors-To: icon-group-request
  7553. Status: O
  7554.  
  7555.  
  7556. Please add my name to the newsletter distribution and the discussion group.
  7557.  
  7558. Also: I am trying to get a grip on this language and what I need next is
  7559. some sample programs that are of decent size, that are not in the book.
  7560.  
  7561. Thank you very much
  7562. John
  7563. --
  7564. John Bly Milton IV, jbm@uncle.UUCP, {ihnp4|cbosgd}!n8emr!uncle!jbm
  7565. home: (614) 294-4823, work: (614) 459-7644, FLAME via email :)
  7566.  
  7567.  
  7568. From icon-group-request  Thu Dec 31 11:53:09 1987
  7569. From: Michael Shafto <shafto@ames-aurora.arpa>
  7570. To: gudeman@arizona.edu, icon-group@arizona.edu,
  7571.         ihnp4!ihuxy!lied@ucbvax.Berkeley.EDU
  7572. Subject: Re:  Substring positions
  7573. Cc: shafto@AMES-AURORA.ARPA
  7574. Errors-To: icon-group-request
  7575. Status: RO
  7576.  
  7577. For what it's worth:  When I first started using Icon, I thought
  7578. the string/list subscripting conventions were extremely
  7579. counter-intuitive and confusing; and, in fact, they caused me
  7580. to make a number of annoying errors.  E.g., even if you know
  7581. better, a := el[1:3] looks like a good way to pick off the
  7582. first three elements of a list.
  7583.  
  7584. Now it seems to me that these conventions are unusual, but
  7585. worth getting used to.  Once you get the hang of them, they
  7586. seem pretty neat.
  7587.  
  7588. Mike
  7589.  
  7590.