Search found 4 matches
- Thu Jul 16, 2009 7:37 am
- Forum: Common Lisp
- Topic: Perl's qw as a macro
- Replies: 10
- Views: 14603
Re: Perl's qw as a macro
It was an exercise, true, but I actually have a use for it in mind. As a learning exercise, this was good. As a path to making a portion of my program easier to read, not so much! Thanks to all who provided guidance. I appreciate your taking the time.
- Thu Jul 16, 2009 4:42 am
- Forum: Common Lisp
- Topic: Perl's qw as a macro
- Replies: 10
- Views: 14603
Re: Perl's qw as a macro
Ah, that makes sense. Thanks much.
- Wed Jul 15, 2009 6:35 am
- Forum: Common Lisp
- Topic: Perl's qw as a macro
- Replies: 10
- Views: 14603
Re: Perl's qw as a macro
Here's what I have so far: (defmacro qw (&rest r) "Mimic perl's qw function" (cons 'list (iter (for s in r) (collect (string s))))) The only problem with that is it upcases the string, and I don't want that. Symbols are always uppercase, so maybe this is unavoidable, but I keep thinkin...
- Tue Jul 14, 2009 10:06 am
- Forum: Common Lisp
- Topic: Perl's qw as a macro
- Replies: 10
- Views: 14603
Perl's qw as a macro
I am trying (again) to wrap my head around macros. As an exercise, I am trying to write Perl's qw function as a macro. (qw this is a test) should expand to '("this" "is" "a" "test") Unfortunately, I'm having difficulty getting at the words in the form. Lisp ke...