/[guile]/guile/guile-core/lang/elisp/README
ViewVC logotype

Diff of /guile/guile-core/lang/elisp/README

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.2 by ossau, Tue Jan 22 23:46:01 2002 UTC revision 1.3 by ossau, Fri Feb 8 11:50:51 2002 UTC
# Line 45  and try to bootstrap a complete Emacs en Line 45  and try to bootstrap a complete Emacs en
45    
46  * Status  * Status
47    
48  Please note that this is work in progress; the translator is  Please see the STATUS file for the full position.
 incomplete and not yet widely tested.  
49    
50  ** Trying to load a complete Emacs environment.  ** Trying to load a complete Emacs environment.
51    
# Line 163  transform Elisp variable references afte Line 162  transform Elisp variable references afte
162    
163  *** Truth value stuff  *** Truth value stuff
164    
165  Lots of stuff to do with providing the special self-evaluating `nil'  Following extensive discussions on the Guile mailing list between
166  and `t' symbols, and macros that convert between Scheme and Elisp  September 2001 and January 2002, we decided to go with Jim Blandy's
167  truth values, and so on.  proposal.  See devel/translation/lisp-and-scheme.text for details.
168    
169  I'm hoping that most of this will go away, but I need to show that  - The Elisp nil value is a new immediate SCM_MAKIFLAG, eq?-distinct
170  it's feasible first.  from both #f and '() (and of course any other Scheme value).  It can
171    be accessed via the (guile) binding `%nil', and prints as `#nil'.
172    
173    - All Elisp primitives treat #nil, #f and '() as identical.
174    
175    - Scheme truth-testing primitives have been modified so that they
176    treat #nil the same as #f.
177    
178    - Scheme list-manipulating primitives have been modified so that they
179    treat #nil the same as '().
180    
181    - The Elisp t value is the same as #t.
182    
183  ** Emacs editing primitives  ** Emacs editing primitives
184    
# Line 191  that Ken Raeburn has been doing on the E Line 201  that Ken Raeburn has been doing on the E
201    
202  Elisp is close enough to Scheme that it's convenient to coopt the  Elisp is close enough to Scheme that it's convenient to coopt the
203  existing Guile reader rather than to write a new one from scratch, but  existing Guile reader rather than to write a new one from scratch, but
204  there are a few syntactic differences that will require adding Elisp  there are a few syntactic differences that will require changes in
205  support to the reader.  reading and printing.  None of the following changes has yet been
206    implemented.
207    
208  - Character syntax is `?a' rather than `#\a'.  (Not done.  More  - Character syntax is `?a' rather than `#\a'.  (Not done.  More
209    precisely, `?a' in Elisp isn't character syntax but an alternative    precisely, `?a' in Elisp isn't character syntax but an alternative
# Line 204  support to the reader. Line 215  support to the reader.
215    
216    and so on.)    and so on.)
217    
218  - `nil' and `t' should be read (I think) as #f and #t.  (Done.)  - Vector syntax is `[1 2 3]' rather than `#(1 2 3)'.
219    
220  - Vector syntax is `[1 2 3]' rather than `#(1 2 3)'.  (Not done.)  - When in an Elisp environment, #nil and #t should print as `nil' and
221      `t'.
 Correspondingly, when printing, #f and '() should be written as  
 `nil'.  (Not done.)  
222    
223  ** The Elisp evaluation module (lang elisp base)  ** The Elisp evaluation module (lang elisp base)
224    
# Line 272  worry about adding unexec support to Gui Line 281  worry about adding unexec support to Gui
281  currently results from calling `(load-emacs)', see above in the Status  currently results from calling `(load-emacs)', see above in the Status
282  section.  section.
283    
 * nil, #f and '()  
   
 For Jim Blandy's notes on this, see the reference at the bottom of  
 this file.  Currently I'm investigating a different approach, which is  
 better IMO than Jim's proposal because it avoids requiring multiple  
 false values in the Scheme world.  
   
 According to my approach...  
   
 - `nil' and `t' are read (when in Elisp mode) as #f and #t.  
   
 - `(if x ...)', `(while x ...)' etc. are translated to something  
   like `(if (and x (not (null? x))) ...)'.  
   
 - Functions which interpret an argument as a list --  
   `cons', `setcdr', `memq', etc. -- either convert #f to '(), or  
   handle the #f case specially.  
   
 - `eq' treats #f and '() as the same.  
   
 - Optionally, functions which produce '() values -- i.e. the reader  
   and `cdr' -- could convert those immediately to #f.  This shouldn't  
   affect the validity of any Elisp code, but it alters the balance of  
   #f and '() values swimming around in that code and so affects what  
   happens if two such values are returned to the Scheme world and then  
   compared.  However, since you can never completely solve this  
   problem (unless you are prepared to convert arbitrarily deep  
   structures on entry to the Elisp world, which would kill performance),  
   I'm inclined not to try to solve it at all.  
   
284  * Resources  * Resources
285    
286  ** Ken Raeburn's Guile Emacs page  ** Ken Raeburn's Guile Emacs page
# Line 316  http://gemacs.sourceforge.net Line 295  http://gemacs.sourceforge.net
295    
296  http://sanpietro.red-bean.com/guile/guile/old/3114.html  http://sanpietro.red-bean.com/guile/guile/old/3114.html
297    
298    Also now stored as guile-core/devel/translation/lisp-and-scheme.text
299    in Guile CVS.
300    
301  ** Mikael Djurfeldt's notes on translation  ** Mikael Djurfeldt's notes on translation
302    
303  See file guile-cvs/devel/translation/langtools.text in Guile CVS.  See file guile-core/devel/translation/langtools.text in Guile CVS.

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26