technoblogy / ulisp

A version of the Lisp programming language for ATmega-based Arduino boards.
http://www.ulisp.com/
MIT License
377 stars 46 forks source link

I can't use with-output-to-string function #50

Closed roscoe-tw closed 1 year ago

roscoe-tw commented 2 years ago

I can't use with-output-to-string I installed on Arduino UNO and Arduino MEGA using uLisp 4.1a

(WITH-OUTPUT-TO-STRING (STR) (FORMAT STR "~A" "test")) Error: undefined: WITH-OUTPUT-TO-STRIN

Is this function name too long? In addition, when using (save-image), if the function name is more than three characters, after resetting and using (load-image), the program will not be defined.

technoblogy commented 2 years ago

Thanks for reporting this. The function with-output-to-string isn't defined in the AVR version of uLisp due to space limitations. This should have been documented in the Reference; sorry about that - I'll make sure it's added.

As a workaround you may be able to achieve what you want by outputting to a string from format.

In addition, when using (save-image), if the function name is more than three characters, after resetting and using (load-image), the program will not be defined.

I can't reproduce this. Can you give an example?

technoblogy commented 1 year ago

As of uLisp Release 4.4 with-output-to-string is included in all versions of uLisp, including the AVR versions.