[pro] Lisp and DSLs

Pascal J. Bourguignon pjb at informatimago.com
Wed Jul 20 23:57:58 UTC 2011


Didier Verna <didier at lrde.epita.fr> writes:

>   Dear friends,

http://groups.google.com/group/comp.lang.lisp/browse_frm/thread/0245342429c61800/f7966bf3df9f716c#f7966bf3df9f716c

Notably, in this type of DSL, you'll note how you can mix Lisp
expressions with expressions in the new languages, at several levels.


@[Icals method:(pressPop:(:id)sender)   ;
        resultType:(:id)                ; objcl
        body:                           ;
        (declare (ignore sender))           ; 
        (loop                               ; lisp
           :for i :from 0 :below 3          ;
           :do [(aref (icals-stack self) i) setIntValue:[(aref (icals-stack self) (1+ i)) intValue]])]
               ^^                                       ^^ 
               ||                                       ||
               |+-- lisp                                |+--- lisp
               +--- objcl                               +---- objcl
                                    
It might be worthwhile comparing the sources of an early Objective-C
front-end such as POC (that includes only the parsing of Objective-C
syntax, and generation of the C code for the usual C compiler, and thus
is functionnaly equivalent to ObjCL),  with the lisp sources of ObjCL.

http://users.telenet.be/stes/compiler.html
(objc-3.2.11.tar.gz)


-- 
__Pascal Bourguignon__                     http://www.informatimago.com/
A bad day in () is better than a good day in {}.





More information about the pro mailing list