mirror of
https://github.com/justinethier/cyclone.git
synced 2025-07-16 09:17:35 +02:00
Added (list-set!)
This commit is contained in:
parent
d722800131
commit
ce9061b7ce
2 changed files with 3 additions and 3 deletions
3
TODO
3
TODO
|
@ -1,8 +1,5 @@
|
|||
Working TODO list:
|
||||
|
||||
- Add (list-set!) from r7rs
|
||||
will likely require tweaks to GC similar to (set-car! / set-cdr!)
|
||||
|
||||
- Error handling
|
||||
need to perform much more error handling of input code. one of the biggest is to report if a function is passed the wrong number of arguments, as this will result in segfauls, bad transport errors, etc downstream if it is allowed.
|
||||
|
||||
|
|
|
@ -117,6 +117,9 @@
|
|||
lst
|
||||
(list-tail (cdr lst) (- k 1))))
|
||||
(define (list-ref lst k) (car (list-tail lst k)))
|
||||
(define (list-set! lst k obj)
|
||||
(let ((kth (list-tail lst k)))
|
||||
(set-car! kth obj)))
|
||||
(define (reverse lst) (foldl cons '() lst))
|
||||
(define (symbol=? sym1 sym2 . syms)
|
||||
(and
|
||||
|
|
Loading…
Add table
Reference in a new issue