Hi, Mark H Weaver <m...@netris.org> writes:
> I've been considering writing a python compiler for guile. For python > (and others) there are several values considered to be false, such as > 0 and various empty collections, and so a different approach will have > to be taken to this problem. [...] > So how about having elisp `if' and `cond' compile not to scheme `if' > and `cond', but rather to scheme `elisp-if' and `elisp-cond'? Or > perhaps compile `(if c a b)' to `(if (elisp-true? c) a b)'. I concur (but I haven't followed the elisp discussion closely). Regardless of which approach the elisp front-end takes, this is something other languages can already do. This is something the ECMAScript front-end does: see how `if' is handled in `language/ecmascript/compile-ghil.scm' and the definition of `->boolean' in `language/ecmascript/base.scm'. Thanks, Ludo'.