On Dec 11, 12:39 pm, TNeste <tomi.ne...@gmail.com> wrote:
> On Dec 10, 2:15 pm, Simon Brooke <still...@googlemail.com> wrote:
>
> > I note people seem mainly to be using Emacs as an editing/development
> > environment for Clojure. But as people keep pointing out, Clojure is
> > homoiconic; the canonical source of a function is not a stream of
> > bytes read from a file, but is a structure in core.
>
> > Now, in-core editing does raise some issues - there needs to be some
> > means of associating the structure which is the canonical source of a
> > function with the function itself, so that when the user invokes (edit
> > froboz) (or (edit 'froboz), or whatever), the source structure for
> > froboz is displayed in the editor. But in-core structure editors are
> > extremely powerful and useful when editing homoiconic languages, so...
> > is anyone working on an in-core editor for Clojure?
>
> Do you mean structured editing combined with image based development?
> I haven't really looked that closely at the old Interlisp documents
> but I suppose the source code is managed the same way it is in most
> Smalltalk systems but I have always been a bit puzzled about how that
> works with Lisp.
>
> In Smalltalk it is fairly straightforward since there is an obvious
> mapping from classes and methods to source code. With lisp it is not
> that simple as there is no limit to the syntactic forms that the user
> might want to query and edit in different forms. For example, if I
> have (define-foo my-foo ...) macro that is used to define some complex
> function named my-foo what happens when I do (edit 'my-foo)? Do I get
> the original define-foo form or the macroexpansion? What about when
> define-foo does something more complex like defines a bunch of methods
> and datastructures or binds my-foo to a closure? There needs to be
> mechanism that associates evaluated forms with the name(s) of the
> resulting object(s) and it probably couldn't, in general, be done
> automatically.

Depends. Using a decent lisp environment nowadays, the lisp will
remember the files and line numbers for all the forms it has read, so
you can get those back pretty easily, as long as you don't turn that
feature off, and as long as you have those text files. If you don't
have the original text, but only the data produced from it by the
reader and compiler, then the best you can usually do is some
plausible lisp forms that correspond to what's in memory--generally a
bunch of fully-expanded s-expressions that don't look all that much
like code a human would write. It'll be accurate, but not necessarily
congenial.

In older Lisp systems, like Interlisp and Genera, the systems
remembered absolutely everything about how a given hunk of data was
created, including versions of everything, including mouse-and-window
direct-manipulation operations, so you could view the contents of a
structure editor in any form you found convenient.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To post to this group, send email to clojure@googlegroups.com
To unsubscribe from this group, send email to 
clojure+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to