shallow flat in scheme -
shallow flat in scheme -
there function "shallow flat"? mean, function flatten 1 () each look in list
for example:
(shallow flat '((1) (2) ( ( 4 5) 6))) return
'(1 2 (4 5) 6)) thanks
(apply append '((1) (2) ((4 5) 6))) ;=> (1 2 (4 5) 6)) (apply append '((1) (2) (((4) 5) 6))) ;=> (1 2 ((4) 5) 6)
you can create procedure, ie:
(define (shallow-flatten lst) (apply append lst)) scheme
Comments
Post a Comment