Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.milw.wisc.edu!cs.utexas.edu!uunet!mcvax!ukc!etive!aiai!ken From: ken@aiai.ed.ac.uk (Ken Johnson) Newsgroups: comp.edu Subject: Re: Which language to teach first? Message-ID: <670@skye.ed.ac.uk> Date: 3 Aug 89 10:28:48 GMT References: <3876@shlump.nac.dec.com> <5407@ficc.uu.net> Reply-To: ken@aiai.UUCP (Ken Johnson) Organization: AIAI, University of Edinburgh, Scotland Lines: 40 In article <5407@ficc.uu.net> peter@ficc.uu.net (Peter da Silva) writes: >Some people swear by LOGO or some other very high level language. I think >a wide variety of such languages should be presented to students, but >only after they're familiar with conventional data and control structures. I think this depends on what you are training the students to do. There is nothing you can do with conventional control structures that you can't do with recursion: for example, printing numbers from 1 to N can be done with to print_them :n if :n = 0 [stop] print_them :n - 1 print :n end On the other hand if you really want a WHILE statement you could define to while :condition :command if run :condition [run :command while :condition :command] end and then use that definition in a procedure: to print_them :n local "i make "i 1 while [:i <= :n] [print :i make "i :i + 1] end I happen to think the first print_them has a grace and beauty that the looping version lacks, but that's my taste. -- Ken Johnson, AI Applications Institute, 80 South Bridge, Edinburgh EH1 1HN E-mail ken@aiai.ed.ac.uk, phone 031-225 4464 extension 212 `I have read your article, Mr. Johnson, and I am no wiser than when I started.' -- `Possibly not, sir, but far better informed.'