hi - thanks to everyone who helped me with the function i needed - can anyone tell me some standard input/output functions - i want to get some keyboard input and i want to prompt the user for input - finally, is there a way to concatenate two atoms - for example:
| hi - thanks to everyone who helped me with the function i needed - can | anyone tell me some standard input/output functions - i want to get | some keyboard input and i want to prompt the user for input - finally, | is there a way to concatenate two atoms - for example: | | (myfunc 'a 'b) returns 'ab
please consult your friendly Lisp manual, and look for ways to search the help system. `apropos' is a useful command. also, you may find it useful to browse the entire friendly Lisp manual to see what is available and which names are used. applying `apropos' to "read" and "write" should help. the Lisp manual should have a section on Input and Output.
as to your second question, the following will do what you say you want, but you probably do not want what you say you want.
(intern (concatenate 'string (symbol-name 'a) (symbol-name 'b))) => AB (intern (format nil "~A~A" 'a 'b)) => AB
BTW, functions do not return quoted symbols. the quote is there to prevent the evaluator from evaluating the symbol.
(I have this recurring "homework feeling". please do not use the Net for homework. your teachers are paid to help you, and you are supposed to study on your own, anyway.)
> hi - thanks to everyone who helped me with the function i needed - > can anyone tell me some standard input/output functions - i want to > get some keyboard input and i want to prompt the user for input - > finally, is there a way to concatenate two atoms - for example:
> hi - thanks to everyone who helped me with the function i needed - > can anyone tell me some standard input/output functions - i want to > get some keyboard input and i want to prompt the user for input - > finally, is there a way to concatenate two atoms - for example: > > (myfunc 'a 'b) returns 'ab > > thanks again for your help, > kevin
However a slightly better and more ANSI version is
(defun myfunc (s1 s2) (declare (type symbol s1 s2)) (make-symbol (concatenate 'string (symbol-name s1) (symbol-name s2)))) -- Marco Antoniotti - Resistente Umano =========================================================================== ==== International Computer Science Institute | marc...@icsi.berkeley.edu 1947 Center STR, Suite 600 | tel. +1 (510) 643 9153 Berkeley, CA, 94704-1198, USA | +1 (510) 642 4274 x149 =========================================================================== ==== ...it is simplicity that is difficult to make. ...e` la semplicita` che e` difficile a farsi. Bertholdt Brecht
>| hi - thanks to everyone who helped me with the function i needed - can >| anyone tell me some standard input/output functions - i want to get >| some keyboard input and i want to prompt the user for input - finally, >| is there a way to concatenate two atoms - for example: >| >| (myfunc 'a 'b) returns 'ab
>please consult your friendly Lisp manual, and look for ways to search the >help system. `apropos' is a useful command. also, you may find it useful >to browse the entire friendly Lisp manual to see what is available and >which names are used. applying `apropos' to "read" and "write" should >help. the Lisp manual should have a section on Input and Output.
>as to your second question, the following will do what you say you want, >but you probably do not want what you say you want.
>(intern (concatenate 'string (symbol-name 'a) (symbol-name 'b))) => AB >(intern (format nil "~A~A" 'a 'b)) => AB
>BTW, functions do not return quoted symbols. the quote is there to prevent >the evaluator from evaluating the symbol.
>(I have this recurring "homework feeling". please do not use the Net for >homework. your teachers are paid to help you, and you are supposed to >study on your own, anyway.)
>#<Erik>
Well said, regarding the issue of homework. If everyone got their answers this way, there would be no "next generation" to pass the "baton" to, and we would all lose a great deal of expertise after the last "old-timer" passed on. Excuse the allusions - hopefully everyone gets the point (it takes hard work to develop expertise in any field).