Hi Kriangkrai,

> 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

As I said, not without modification of the low-level error handler.
Execution is not continued after the error is caught, as the 'catch' is
in 'mydefs' and not on the lowest level.

Why would you need that? If you want a mechanism just to load a certain
set of functions on the fly (like those with a colon for the built-in
dlopen/dlsym mechanism), you could do something like:

In a file "foo.l":

   (de foo (X Y)
      (+ X (* Y Y)) )

and then define those functions like

   (de on-the-fly (@Fun @File)
      (def @Fun
         (curry (@Fun @File) @
            (undef '@Fun)
            (load @File)
            (pass @Fun) ) ) )

   (on-the-fly 'foo "foo.l")
   (on-the-fly 'bar "bar.l")

then, 'foo' looks initially like

   : foo
   -> (@ (undef 'foo) (load "foo.l") (pass foo))

Now if you execute it

   : (foo 3 4)
   -> 19

it will be redefined

   : foo      
   -> ((X Y) (+ X (* Y Y)))



> Is PicoLisp64 just a 64-bit version of PicoLisp? Or it will have
> more/different features? (I would request floating-point support ;-)

It will be (I hope) totally compatible. Floating point support is not an
option (perhaps you might want to look in the archive of this list, we
had a discussion about that). The additional tag bit received by the
extension to 64 bits is better used for a short integer, and doing
otherwise would break some fundamental assumptions. Also, floating point
calculations are better done separately (there are C functions for that)
or - recommended - in scaled fixpoint arithmetics (a good example for
that is the flight simulator).

Cheers,
- Alex
-- 
UNSUBSCRIBE: mailto:picol...@software-lab.de?subject=unsubscribe

Reply via email to