Hi all,
> OK, thanks, It isn't worth trying to modify the reader. I'll just add the
> decimal point while processing the input.
It is not a good idea to use the Lisp reader in a GUI. Imagine what a malicious
user can do with read macros! She could enter things like
`(call "sh" "-c" "rm -r *").
So, yes, the input needs to be handled as strings. You could check what the
PicoLisp GUI does (also in PilBox apps on Android) in "@lib/form.l". The code
for a fixpoint input field is:
(class +FixField +numField)
(dm T (N . @)
(=: scl N)
(pass super) )
(dm txt> (Val)
(format Val (: scl) *Sep0 *Sep3) )
(dm set> (Val Dn)
(super (format Val (: scl) *Sep0 *Sep3) Dn) )
(dm val> ()
(let S (super)
(format
(or (sub? *Sep0 S) (pack S *Sep0))
(: scl)
*Sep0
*Sep3 ) ) )
The relevant line here is the 4th in the 'val>' method.
☺/ A!ex
--
UNSUBSCRIBE: mailto:[email protected]?subject=Unsubscribe