about define or lambda

17 views
Skip to first unread message

Minoru

unread,
Jun 22, 2026, 1:06:18 AM (8 days ago) Jun 22
to Extempore
Hi Ben,

It's a small thing though, I need to change the code to stop infinite loop functions ....

;; just loop func
(define ilp
  (lambda (b)
    (print 1 ':)
    (callback (*metro* (+ b (* .5 1))) 'ilp (+ b 1))
    ))

(ilp (*metro* 'get-beat 1))


(define ilp (lambda () ))
;; ok, stop without any warning in ver 0.8.9,  but ...
;; -> error, define: no body: (define ilp (lambda ()))
;; error ! it looks like that define can't work
;; so, ilp doesn't stop !

(define ilp (lambda () (+ 1)))
;;  -> stop, but warning .....
;;  ilp: too many arguments: ((lambda () ...) 1738) ....

(define ilp (lambda (b) (+ 1)))
;; -> ok, stop without any warning !


;; ther are more arguments ....
(define ilp2
  (lambda (b c d)
    (print 1 c d ':)
    (callback (*metro* (+ b (* .5 1))) 'ilp2 (+ b 1) c d)
    ))

(ilp2 (*metro* 'get-beat 1) 2 3)

(define ilp2 (lambda (b) (+ 1)))
;; -> stop but warning as above ....

(define ilp2 (lambda (b c d) (+ 1)))
;; ok! stop and no warning ..

(define ilp2 )
;; error, not stop
;; define: no value? (define ilp2)

(define ilp2 0)
;; stop but ...
;; attempt to apply an integer 0 in (0 (9538 2 3))?
;; (define ilp2)
;; (c d)
;; (define ilp)
;; ((+ b 1))
;; (define ilp)
;; ((+ b 1))

ilp2
;; -> 0,  ok though..


;; Or, the point is not define but lambda ???  or both ??

(lambda ())
;; error
;;lambda: no body? (lambda ())   ......

(lambda () (+ 1))
;; ok #<CLOSURE ...>

((lambda ()) )
;; error
;; lambda: no body? (lambda ())  .........

((lambda () (+ 1)) )
;; -> 1, ok


Of course, I accept it as it is though ...

Minoru

unread,
Jun 22, 2026, 1:18:40 AM (8 days ago) Jun 22
to Extempore
Hi Ben,

Anyway, it looks like that the syntax check is done stricter, I think that's good !

2026年6月22日月曜日 14:06:18 UTC+9 Minoru:

Minoru

unread,
Jun 22, 2026, 1:39:06 AM (8 days ago) Jun 22
to Extempore
sorry,  check is done more strictly....

2026年6月22日月曜日 14:18:40 UTC+9 Minoru:

Ben Swift

unread,
Jun 22, 2026, 1:57:13 AM (8 days ago) Jun 22
to extemp...@googlegroups.com, Extempore
Yep, we’re more compliant with the spec. There will be a bit of work to tidy up some things in people’s libraries, but worth it I reckon. 

Cheers
Ben

On 22 Jun 2026, at 3:18 pm, Minoru <mils...@gmail.com> wrote:

Hi Ben,
--
You received this message because you are subscribed to the Google Groups "Extempore" group.
To unsubscribe from this group and stop receiving emails from it, send an email to extemporelan...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/extemporelang/81f98ab1-efe5-4b2f-bb85-3545e04541ccn%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages