@John:I suggested a tip on a working alternative to define literals in an expression. Please try
(load 'FF.SCM) for a change and see what happens. But the both alternatives should work in standard Scheme equally well.
@Rob:Hi,
(define (something something_else)) is not proper syntax for this LISP. Proper expressions would be
(define something something_else),
(define something (expression)), and
(define something (lambda (optional_arg) ... )). But I'll try to blend your suggestions to this LISP's syntax. In the meantime, please see below.
@Charles:Hi,
This is the best I could do so far. It is absolutely ugly but it works and it
is variadic. I will also try to abridge Rob's suggestions though he simply doesn't realise how far the intrinsic flexibility of standard Scheme's syntax is from the Spartan minimality of SB/FBSL LISP.
So here's the Average.lisp script. It's runnable in FBSL LISP and both reincarnations of SBLisp:
(define accum 0)
(define average
(lambda (input)
(for-each (lambda (x) (set! accum (+ accum x))) input)
(print (set! accum (/ accum (length input)))) (newline)
)
)
(define args (list 1 2 3 4 5))
(average args)
and below is a snapshot with its results. Comments are given directly in the picture because SB/FBSL LISP doesn't support embedded comments yet.
.