Hello again:<br>You can convert between string and other types reading from memory:<br><br>(defun string2data ( str )<br> "Converts a string to the data type that the lisp reader could read on It."<br> (with-input-from-string ( stream str )
<br> (read stream )))<br><br>Maybe I've forgotten some parenthesis, I can't run my sbcl now, but that works for me.<br><br><br><div><span class="gmail_quote">2006/11/23, Bernhard Graf <<a href="mailto:bgraf@adartis.de">
bgraf@adartis.de</a>>:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">I made it !!! :-)<br><br>(defun scaler ()<br> (with-ltk ()
<br> (let* ((frm (make-instance 'frame))<br> (lab (make-instance 'label :master frm :text "Enter Name: "))<br> (ent (make-instance 'entry :master frm))<br> (age 0)<br> (textarea (make-instance 'frame))
<br> (txt (make-instance 'scrolled-text :master textarea))<br> (scl (make-instance 'scale :label "Age:" :digits 1 :from 10 :to<br>50 :tickinterval 10))<br> (but (make-instance 'button :master textarea :text "Push Me"
<br> :command (lambda () (append-text txt<br>(concatenate 'string "Hello, " (text ent ) (format nil ", you are ~D<br>years old" (value scl))<br> )))))
<br> )<br> (pack lab :side :left)<br> (pack ent :side :left)<br> (pack frm)<br> (pack scl)<br> (pack but)<br> (pack txt)<br> (pack textarea)<br>
)))<br><br>Actually, while programming this seemingly simple example, I<br>recognized that LISP has 1001 arithmetic functions, but when it comes<br>to string-to-number-and-back conversion, it looks pretty bad.<br><br>Is that so or am I just only looking at the wrong places ?
<br>I found a parse-number library from Matthew Danish and use format to<br>convert from numbers back to strings, but the latter seems rather<br>ugly compared to actual "functions" that I know from Turbo Pascal and
<br>the former is quite good, but still not completely universal.<br><br>Greetings,<br>Bernhard<br><br>Am 23.11.2006 um 13:04 schrieb Peter Herth:<br><br>> Or just (value myscale) if myscale is the scale widget....<br>
><br>> Peter<br>> _______________________________________________<br>> ltk-user site list<br>> <a href="mailto:ltk-user@common-lisp.net">ltk-user@common-lisp.net</a><br>> <a href="http://common-lisp.net/mailman/listinfo/ltk-user">
http://common-lisp.net/mailman/listinfo/ltk-user</a><br><br><br>_______________________________________________<br>ltk-user site list<br><a href="mailto:ltk-user@common-lisp.net">ltk-user@common-lisp.net</a><br><a href="http://common-lisp.net/mailman/listinfo/ltk-user">
http://common-lisp.net/mailman/listinfo/ltk-user</a><br></blockquote></div><br><br clear="all"><br>-- <br>Felip Alàez Nadal