Search found 6 matches

by churib
Mon Mar 21, 2011 7:04 am
Forum: Common Lisp
Topic: Switch package
Replies: 2
Views: 3379

Re: Switch package

Wow - your answer is eye-opening for me! Thanks!
by churib
Mon Mar 21, 2011 4:26 am
Forum: Common Lisp
Topic: Switch package
Replies: 2
Views: 3379

Switch package

Hi! I am trying to write a macro, which dynamically binds the current package: (defmacro with-in-package (package-designator &body body) `(let ((*package* (find-package ,package-designator))) ,@body)) which expands like this: (macroexpand-1 '(with-in-package :sb-cltl2 (variable-information '*pac...
by churib
Sun Mar 20, 2011 7:30 am
Forum: Common Lisp
Topic: a very simple function
Replies: 3
Views: 4774

Re: a very simple function

Another (non-destructive) solution:

Code: Select all

(append S (list N))
See http://www.lispworks.com/documentation/ ... append.htm
by churib
Sun Feb 13, 2011 4:25 am
Forum: Common Lisp
Topic: Macros: double backquote & unquote
Replies: 5
Views: 4953

Re: Macros: double backquote & unquote

Hi FAU! I found an other solution in "On LIsp" in chapter 16 "Macros-Defining Macros" on page 215, where Paul Graham explains the solution step by step. (defmacro with-partial-macro (name macro list-of-args &body body) `(macrolet ((,name (&rest more-args) `(,',macro ,@',l...
by churib
Sat Feb 12, 2011 7:36 am
Forum: Common Lisp
Topic: Macros: double backquote & unquote
Replies: 5
Views: 4953

Macros: double backquote & unquote

Hi! I am fairly new to CL and have problems with nested backquotes and unquotes. I am trying something like currying or "partial" (in Clojure) does for functions but here with macros - I want to partially bind macros with parameters in a MACROLET-environment: (defmacro with-partial-macro (...
by churib
Sat Feb 12, 2011 5:32 am
Forum: Common Lisp
Topic: Literal Lists
Replies: 19
Views: 17039

Re: Literal Lists

Mostly "LOL" is related to Land of Lisp :)

edit: the following refers to Let over Lambda
And yes, there is a warning in the book with the example calling this function twice:
(defun dangerous-use-of-bq ()
`(a ,.'(b c d) e))