I'm working on a school project that includes LISP code examples. I've
found many examples in library books, but still need something.
Could someone send me a source code listing of a simple lisp database
program that I could adapt. The record structures would be similar to
an address book. I must have Name, address, age (integer) and ten
float numbers (for grades). I must enable the user to save to file,
retrieve and update the records. I must also sort them.
Any help would be appreciated.
Thank you,
Doug Edwards
I am trying to convert a complex list (list of lists) into a string. The list looks something like this:
((2 3) (3 4) (4 5))
I want it to look like this:
"((2 3) (3 4) (4 5))"
Does anyone know how this can be done with relative ease?
Any help would be appreciated.
Regards,
·····@engsoc.carleton.ca
········@nortel.ca
..all opinions are my own, etc. etc.
Bruce Voss wrote:
>
> I am trying to convert a complex list (list of lists) into a string. The list looks something like this:
>
> ((2 3) (3 4) (4 5))
>
> I want it to look like this:
>
> "((2 3) (3 4) (4 5))"
>
> Does anyone know how this can be done with relative ease?
>
(format nil "~a" '((2 3) (3 4) (4 5)))
=>
"((2 3) (3 4) (4 5))"
(stringp (format nil "~a" '((2 3) (3 4) (4 5))))
=>
T
(format nil "~s" '((2 3) (3 4) (4 5)))
=>
"((2 3) (3 4) (4 5))"
(stringp (format nil "~s" '((2 3) (3 4) (4 5))))
=>
T
--
Benjamin Shults Email: ·······@math.utexas.edu
Department of Mathematics Phone: (512) 471-7711 ext. 208
University of Texas at Austin WWW: http://www.ma.utexas.edu/users/bshults
Austin, TX 78712 USA FAX: (512) 471-9038 (attn: Benjamin Shults)
[Bruce Voss]
| I am trying to convert a complex list (list of lists) into a string.
| The list looks something like this:
|
| ((2 3) (3 4) (4 5))
|
| I want it to look like this:
|
| "((2 3) (3 4) (4 5))"
|
| Does anyone know how this can be done with relative ease?
see the section of the Lisp printer in your Lisp reference.
#\Erik
Bruce Voss wrote:
>
> I am trying to convert a complex list (list of lists) into a string. The list looks something like this:
>
> ((2 3) (3 4) (4 5))
>
> I want it to look like this:
>
> "((2 3) (3 4) (4 5))"
>
> Does anyone know how this can be done with relative ease?
>
> Any help would be appreciated.
>
> Regards,
>
> ·····@engsoc.carleton.ca
>
> ········@nortel.ca
>
> ..all opinions are my own, etc. etc.
Hmmm. How about (format t "~s" (format nil "~s" '((2 3) (4 5))))?
Not sure what happens when you get away from simple atoms like 2 and 3.
Cheers,
Ken
In article <·············@bway.net>, ····@qi-labs.com wrote:
> Bruce Voss wrote:
> >
> > I am trying to convert a complex list (list of lists) into a string.
The list looks something like this:
> >
> > ((2 3) (3 4) (4 5))
> >
> > I want it to look like this:
> >
> > "((2 3) (3 4) (4 5))"
> >
> > Does anyone know how this can be done with relative ease?
> >
> > Any help would be appreciated.
> >
> > Regards,
> >
> > ·····@engsoc.carleton.ca
(setq my-string (format nil "~A" '((2 3) (3 4) (4 5))))