mirror of
https://github.com/justinethier/cyclone.git
synced 2025-07-15 16:57:35 +02:00
Added (length/obj)
This commit is contained in:
parent
2499f60730
commit
a710b35a0c
1 changed files with 19 additions and 0 deletions
|
@ -48,6 +48,7 @@
|
||||||
delete
|
delete
|
||||||
delete-duplicates
|
delete-duplicates
|
||||||
flatten
|
flatten
|
||||||
|
length/obj
|
||||||
list-index2
|
list-index2
|
||||||
list-insert-at!
|
list-insert-at!
|
||||||
list-prefix?
|
list-prefix?
|
||||||
|
@ -127,6 +128,24 @@
|
||||||
((list? args) args)
|
((list? args) args)
|
||||||
(else (pair->list args))))
|
(else (pair->list args))))
|
||||||
|
|
||||||
|
;; Take arguments for a lambda and pack them depending upon lambda type
|
||||||
|
;(define (pack-lambda-arguments formals args)
|
||||||
|
; (cond
|
||||||
|
; ((symbol? formals)
|
||||||
|
; (list args))
|
||||||
|
; ((list? formals)
|
||||||
|
; args)
|
||||||
|
; (else
|
||||||
|
(define (length/obj l)
|
||||||
|
(let loop ((lis l)
|
||||||
|
(len 0))
|
||||||
|
(cond
|
||||||
|
((pair? lis)
|
||||||
|
(loop (cdr lis) (+ len 1)))
|
||||||
|
(else
|
||||||
|
len))))
|
||||||
|
|
||||||
|
|
||||||
; char->natural : char -> natural
|
; char->natural : char -> natural
|
||||||
(define (char->natural c)
|
(define (char->natural c)
|
||||||
(let ((i (char->integer c)))
|
(let ((i (char->integer c)))
|
||||||
|
|
Loading…
Add table
Reference in a new issue