Hi Alex,

>> OK. Can the "Undefined error handling" be defined/extended/overridden
>> at Lisp (not C) level? Something like Ruby's const_missing() and
>> method_missing()?
>
> You can achieve something similar by catching the error, and then
> defining the function on the fly. For example
>
>    (put 'foo 'mydef '((X Y) (+ X (* Y Y))))
>
>    (de mydefs Prg
>       (let Res (catch '("Undefined") (run Prg 1))
>          (nond
>             ((== Res "Undefined") Res)
>             ((get (car ^) 'mydef)
>                (quit Res (car ^)) )
>             (NIL
>                (def (car ^) @)
>                (eval ^ 1) ) ) ) )
>
> If you call it as
>
>    : foo                         # 'foo' is undefined
>    -> NIL
>    : (mydefs (foo 3 4))          # Call it
>    -> 19
>    : foo                         # Now 'foo' is defined
>    -> ((X Y) (+ X (* Y Y)))
>    : (mydefs (+ 1 2 3))          # Call something else
>    -> 6
>    : (mydefs (bar 3 4))          # 'bar' has not 'mydef'
>    bar -- Undefined
>    ?
>
> But, as I said, this is not so general, as the execution of a program
> will not be directly continued.

Is there a way, to make the code below works, the first time 'foo' is defined?
: foo
-> NIL
: (mydefs (+ 1 (foo 3 4)))   # should returns 20


> If you change the example in "project.l" so that you pass an expression
> to 'noButton'. Pressing "No" then will close both the alert and the
> parent dialog:
>
> 21c21
> <                      (noButton) ) )
> ---
>>                      (noButton '(act> (: home top 1 gui 3))) ) )
>
> (the 3 is there because the 'cancelButton' is the third GUI component in
> the dialog)

That works, thanks.


>> OK. By the way, is there a "reference-style" documentation for GUI
>> (e.g. +gui, +Chart) and Database (e.g. +Entity, +Relation), something
>
> Oh, I'm sorry. That's on my todo list (and also the debugging and Pilog
> functions) since a long time. I try currently to invest all my spare
> time in PicoLisp64, and even for that I don't find enough time :-(
>

It's good that it is on your todo list, so we (PicoLisp users) can use
PicoLisp at its full power!
Is PicoLisp64 just a 64-bit version of PicoLisp? Or it will have
more/different features? (I would request floating-point support ;-)


Best regards,
KS
-- 
UNSUBSCRIBE: mailto:picol...@software-lab.de?subject=unsubscribe

Reply via email to