uLisp support for CH32 EVT Boards?


#21

There were three things going wrong there:

  1. uLisp makes any variable starting with ‘:’ evaluate to itself, so:
> :integer
:integer 

I’m not sure why yours is evaluating to 0, but perhaps you can fix it with defvar.

  1. The correct command to compile your fib function is:
(compile 'fib)
  1. In the version of the RISC-V compiler on the website I had inadvertently called the compile function “compiler”. I’ve fixed it now (or you can just type compiler).

Then it should work!


#22

David, thank you very much !

I added :integer and :boolean in lines :

(defvar :boolean ':boolean)
(defvar :integer ':integer)

The (compiler …) call is working.

27802> (defun fib (n)
  (if (< n 3) 1
    (+ (fib (- n 1)) (fib (- n 2)))))
fib

27771> (compiler 'fib)
fib

27510> (time (fib 27))
196418
Time: 93 ms

27510> 

This is fantastic!
I’m impressed with both uLisp assembler and compiler. They’re very effective tools.