Hey, isn't that "lispy" ? 
Author Message
 Hey, isn't that "lispy" ?

(setq vallist '("I " "Love " "This " "Game !"))
(eval (concatenate 'list '(concatenate 'string) vallist))

==>"I Love This Game !"



Fri, 26 Apr 2002 03:00:00 GMT  
 Hey, isn't that "lispy" ?

Quote:

>(setq vallist '("I " "Love " "This " "Game !"))
>(eval (concatenate 'list '(concatenate 'string) vallist))

>==>"I Love This Game !"

You don't need the EVAL.  You can use:

(apply #'concatenate 'string vallist)

You *would* need the EVAL if any elements of vallist were expressions that
needed to be evaluated, but since they're literals in your case that's
wasted effort that just makes your code harder to understand.

--

GTE Internetworking, Powered by BBN, Burlington, MA
*** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
Please DON'T copy followups to me -- I'll assume it wasn't posted to the group.



Fri, 26 Apr 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. '"""' and linefeed characters

2. Philosophical "Wars" and what is or isn't "error-prone"

3. string.join(["Tk 4.2p2", "Python 1.4", "Win32", "free"], "for")

4. BEGIN{want[]={"s1o", "s2o", "s2q", "s3q"}

5. "'Snakeymathtem'": Virus?

6. LabView 5.1.1, 'Failure: "linker.c", line 1825': Please Help

7. About ''"CooL": low-level macros considered useful

8. python -c "help('while')"

9. Parsing ""D""?

10. "Fifth", "Forth", zai nar?

11. Ruby "finalize", "__del__"

12. beginners "let"/"random" question

 

 
Powered by phpBB® Forum Software