Yorick Namor <
yorick@nam.or> writes:
Just curious.
At least neural AI can help you with Lisp today! Me:
|How do I write a program in Common Lisp to do the following
|things: In an endless loop, repeatedly "read a string, then
|store the first character of the string in the variable a,
|then store the rest of the string in the variable b, then
|print both a and b"?
. AI system:
|(loop
| (let* ((input (read-line)) ; Read a line of input
| (a (char input 0)) ; Store first character in variable a
| (b (subseq input 1)) ; Store rest of the string in variable b
| )
| (format t "a: ~a, b: ~a~%" a b) ; Print both a and b
| )
| )
. Then I asked about "subseq" and used that to change "char
input 0" into "subseq input 0 1". The chatbot gave me a good
start with the small Common Lisp program I want to write.
--- SoupGate-Win32 v1.05
* Origin: fsxNet Usenet Gateway (21:1/5)