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 |
|
|
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 |
|
|
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 |
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 |
|
|
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 |
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. |