Coder Social home page Coder Social logo

ulisp-arm's Introduction

ulisp-arm

A version of the Lisp programming language for boards based on the ARM processor:

  • Arduino Zero and MKRZero.
  • Arduino Uno R4 Minima and WiFi.
  • Adafruit ItsyBitsy M0, Feather M0, and Gemma M0.
  • Adafruit Metro M4, ItsyBitsy M4, Feather M4, and Grand Central M4.
  • Adafruit PyBadge and PyGamer.
  • Adafruit CLUE and ItsyBitsy nRF52840.
  • Raspberry Pi Pico and Raspberry Pi Pico W.
  • BBC Micro Bit.
  • Maxim MAX32620FTHR.
  • Teensy 4.0/4.1.

The "-comments" version is identical but includes comprehensive comments.

For more information see: http://www.ulisp.com/

ulisp-arm's People

Contributors

johnsondavies avatar technoblogy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ulisp-arm's Issues

uLisp: New target: Infineon XMC1100 bootkit

Hi David, greetings!

Many thanks for uLisp! I enjoyed reading the uLisp source code and its
references. I have an Infineon XMC1100 boot kit lying around. I wanted
to make a uLisp project for it and make it available. How do you think
I should proceed?

o) I notice that you have a ulisp-stm32 project available. Should I
make a ulisp-xmc for example?

o) OR would it be better to add the relevant conditional compilation
sections and add support for the core alongside your ulisp-arm
project?

Raman

Characters incorrectly converted to strings

If you convert a character to a string with the function string the resulting string may be corrupt.

For example:

>(defvar a (concatenate 'string "Hello" (string #\!)))
a

> a
"Hello!"

> (char a 5)
Error: 'char' index out of range

(lambda x x) loops forever

I think a more sensible behaviour is possible. Either error or do like in scheme (bind x to the list of arguments):

((lambda x x) 1 2 3))
=> (1 2 3)

Can't pass user-defined symbols to apply

The first argument to apply can't be something like:

(defun my (x y) (+ x y))
(defvar handlers '(my))
(apply (first handlers) '(0 1)) 
Error: not valid here: my

Note that it affects all platforms, and also affects other functions that take a function argument, such as funcall, mapc, mapcar, sort, etc.

Thanks to @jurov for reporting this.

Using return outside a block causes odd behaviour

Calling return outside loop, dotimes, or dolist causes subsequent loops to fail. For example:

(defun test ()
  (dotimes (x 6) (princ x))
  (return 67))

It works the first time but fails the second:

> (test)
012345
67

> (test)
0
67

Will be fixed next release. Thanks to Brian O'Dell for reporting this.

Sometimes a return statement never returns

If the expression in a return statement calls a function that itself uses a return statement, the first return statement never returns. For example:

(defun tst (x)
  (loop
   (return (fun x))))

(defun fun (y)
  (loop
   (return (car y))))

then calling:

(tst '(a b))

should return a, but instead hangs up.

A workaround is to assign the result to a temporary variable, and then return that:

(defun tst (x)
  (loop
   (let ((val (fun x)))
     (return val))))

(defun fun (y)
  (loop
   (return (car y))))

So now, as expected:

> (tst '(a b))
a

Variable undefined error

Under some circumstances uLisp 2.7 and 2.7b can give a "variable undefined" error while executing a program.

Function corrupted by 'makunbound'

If you define a function by reading it from a string and then eval it, and them remove it with makunbound, other functions get removed:

(defun test () (eval (read-from-string "(defun bob (y) (* y y))")))
(test)

> (globals)
(bob test)

> (makunbound 'bob)
bob

> (globals)
()

This only seems to happen if the function was defined by reading it from a string.

Thanks to Klaus Fuerth for reporting this.

Serious problem running on Grand Central

There is a mismatch between the workspace definition for the Adafruit Grand Central M4 Express on the one hand and the definitions used to detect which keywords should be included. Because the final entries in the lookup table are not included unconditionally, that means the reader can run right off the end of the lookup table, locking up the processor.

Fortunately, the fix seems to be simple - instead of defining CPU_ATSAMD51P20 for the Grand Central, define it with CPU_ATSAMD51. This is safe - the Adafruit SAMD core defines all the relevant constants regardless of the MCU being used.

I noticed this because a similar error caused a failure to build in my altered version.

Adafruit Feather M4 Express analog read range extension to 20 (A6)

Thank you for beautiful uLisp. Adafruit Feather M4 Express function analogread argument is limited from 14 (A0) to 19 (A5) ports. This range match external analog inputs for the board. But there is internal, not exposed A6 analog input which provides reading for battery voltage. This value is quite usable and it make sense to extend analogread function's range from 14 (A0) to 20 (A6).
SNC.

Cannot compile for BBC microbit

Following these instructions: http://www.ulisp.com/show?2672#example_programs
I get the following error at line 1197 when I try to upload the ulisp-arm code to my BBC microbit: 'else' without a previous 'if'
The error is in the definition of serialbegin, and I guess it is because _VARIANT_BBC_MICROBIT_ is defined, and ARDUINO_SAM_DUE is not defined, so the precompiler skips over the previous if statements.

FlashIAPBlockDevice.h: No such file or directory

Trying to compile in the Arduino IDE for Reaspbery Pi Pico. I'm running Arduino IDE 1.8.16 and have re-installed a couple times and looked for some mbed library that must not be included with the default install but can't find anything. Any ideas?
I've compiled this for Feather M4 Express with an SD Card but that case didn't encounter the need for this file/library.

Dotted pairs crash list functions

Many of the functions that take a list argument cause a crash if you provide a list ending in a dotted pair.

For example:

(length '(2 3 . 4))

Corruption using with-output-to-string

If a garbage collection occurs during execution of a with-output-to-string form the result string may be corrupted.

This will be fixed in the next release. Thanks to Max-Gerd Retzlaff for reporting this.

cond gives error if test clause omitted

Example:

(defun test (n)
  (cond
   ((oddp n) n)
   ((list n))))

(test 2) gives an error. Workaround: include a t for the final clause:

(defun test (n)
  (cond
   ((oddp n) n)
   (t (list n))))

Spurious character from serial port

On some platforms I'm getting a spurious character appearing in the Serial Monitor on starting uLisp; for example, on the Arduino Due:

screen shot 2018-05-24 at 16 55 56

This is generated by code which is effectively:

Serial.begin(9600);
Serial.println(PSTR("uLisp 2.2 "));

Can anyone suggest where the spurious character is coming from and how I can get rid of it?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.