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

Popular posts from this blog

javascript - mongodb won't find my schema method in nested container -

How do you set up a perforce server to work over the internet? -

ios - Lagging ScrollView with UIWebview inside -