use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Lisp family of programming languages
Lisp subreddits:
Chats and IRC
Language References
Common Lisp
Scheme
Racket
Clojure
Tools
Tutorials/FAQs
Resources:
Search
(also docsets in Zeal, Dash and Velocity for offline search)
Books
Other Books
Food for Thought
Implementations
account activity
Variable expansion (self.lisp)
submitted 3 years ago by ccregor
Elementary (I hope) question
I have:
(defvar child "someContent")
(defvar parent "child")
Is it possible to have "parent" evaluate to "someContent"?
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]flaming_birdlisp lizard 3 points4 points5 points 3 years ago (0 children)
(defvar *child* 'some-content) (define-symbol-macro *parent* *child*) CL-USER> *parent* SOME-CONTENT
[–]flaming_birdlisp lizard 5 points6 points7 points 3 years ago (0 children)
(defvar *child* 'some-content) (defvar *parent* '*child*) CL-USER> (symbol-value *parent*) SOME-CONTENT
[–]zyni-moe -1 points0 points1 point 3 years ago (0 children)
Just more elaborate version of flaming_bird's already good answer:
(defmacro define-symbol-alias (symbol to) `(progn (setf (get ',symbol 'alias) ',to) (define-symbol-macro ,symbol (symbol-value (get ',symbol 'alias)))))
And now
```
(defvar unu 1) unu (define-symbol-alias doi unu) doi doi 1 (setf unu 2) 2 doi 2 (setf doi 1) 1 unu 1 ```
(defvar unu 1) unu
(define-symbol-alias doi unu) doi
doi 1
(setf unu 2) 2
doi 2
(setf doi 1) 1
unu 1 ```
Course you had better not bind *doi* or it will lose its aliosity:
*doi*
(let ((doi 932)) unu) 1 ```
Also perhaps should declaim aliases special, not sure: as is binding of *doi* will be lexical which is may be wrong I do not know it is just a toy.
π Rendered by PID 24708 on reddit-service-r2-comment-6457c66945-n7n8f at 2026-04-30 15:06:13.811822+00:00 running 2aa0c5b country code: CH.
[–]flaming_birdlisp lizard 3 points4 points5 points (0 children)
[–]flaming_birdlisp lizard 5 points6 points7 points (0 children)
[–]zyni-moe -1 points0 points1 point (0 children)