Newsgroups: comp.lang.scheme
Path: cantaloupe.srv.cs.cmu.edu!rochester!udel!news.mathworks.com!tank.news.pipex.net!pipex!demon!sunsite.doc.ic.ac.uk!lyra.csx.cam.ac.uk!peer-news.britain.eu.net!newsfeed.ed.ac.uk!edcogsci!jeff
From: jeff@cogsci.ed.ac.uk (Jeff Dalton)
Subject: Re: parens
Message-ID: <DL31FF.6vn.0.macbeth@cogsci.ed.ac.uk>
Organization: Centre for Cognitive Science, Edinburgh, UK
References: <qijg2dn775v.fsf@lambda.ai.mit.edu>
Date: Fri, 12 Jan 1996 19:14:02 GMT
Lines: 48

In article <qijg2dn775v.fsf@lambda.ai.mit.edu> shivers@ai.mit.edu writes:
>Oops. Sorry to disappoint, but I *don't* have any really irrefutable
>evidence. My point with Autocad and Emacs Lisp is that people who are not
>dyed-in-the-wool Lisp weenies have been quite willing to sit down and hack up
>lots of stuff in paren-oriented languages.

I have a curious story.

Here we have a tool that has an extension language.  People write
code in that language to manipulate diagrams and the like.

Suggesting a Lisp or Scheme for this purpose would have been _very_
controversial.  I probably would have been the only person in favor 
of it.  (Preliminary discussions made this fairly clear.)

Here is some code in the language actually chosen:

(deffunction setup-nodes (?card)
  (bind ?node-image (get-first-card-node-image ?card))
  (while (neq ?node-image -1)
    (bind ?node (get-object-from-image ?card ?node-image))
    (if (neq -1 ?node) then
      (bind ?node-type (get-object-string-attribute ?card ?node "type"))
      (if (type-define-node ?node-type ?card ?node-image ?node) then T 
          else
          (format 
           t "WARNING: could not make node-image %s type %s node %s card %s%n"
           (str-cat ?node-image) ?node-type (str-cat ?node) (str-cat ?card))))
    (bind ?node-image (get-next-card-node-image)))
)

...

(defrule plan-card-code
  ?current <- (current-card ?card)
  => (setup-nodes ?card)
     (setup-arcs ?card)
     (write-objects ?card Always)
     (if (neq ?*firstflag* "none") then (format hardy-doc ";%n"))
     (write-objects ?card Type)
     (if (neq ?*firstflag* "none") then (format hardy-doc ";%n"))
     (bind ?card-type (start-card ?card))
     (process-nodes ?card)
     (end-card ?card ?card-type)
     (retract ?current)
)

-- jeff
