[racket-dev] flatten-begin

From: Asumu Takikawa (asumu at ccs.neu.edu)
Date: Thu Jul 17 22:58:44 EDT 2014

Hi all,

I was wondering what people think about a potential API addition to the
`syntax/flatten-begin` library.

Something like `flatten-begin*` (or a less terrible name) that would
recursively flatten `begin` expressions like the `flatten` function does
for plain lists.

i.e.,
  (flatten-begin* #'(begin (begin 1 2) 3 4)) => (list #'1 #'2 #'3 #'4)

as opposed to
  (flatten-begin #'(begin (begin 1 2) 3 4))  => (list #'(begin 1 2) #'3 #'4)

Would that be useful? I keep finding myself writing functions like this.

Cheers,
Asumu

Posted on the dev mailing list.