3 ms·
I like Racket's second, third, fourth,... etc. [1] I don't think there's an equivalent to cddadr for example, but at that level of deconstruction you're better
by bhrgunatha 11y ago
I like Racket's second, third, fourth,... etc. [1]
I don't think there's an equivalent to cddadr for example, but at that level of deconstruction you're better off abstracting the data structure (maybe a struct [2]) or using some other mechanism like match [3]
[1] http://docs.racket-lang.org/reference/pairs.html?q=second#%28def._%28%28lib._racket%2Flist..rkt%29._second%29%29 http://docs.racket-lang.org/reference/pairs.html?q=second#%2...
[2] http://docs.racket-lang.org/reference/define-struct.html?q=struct#%28form._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._struct%29%29 http://docs.racket-lang.org/reference/define-struct.html?q=s...
[3] http://docs.racket-lang.org/reference/match.html?q=match#%28form._%28%28lib._racket%2Fmatch..rkt%29._match%29%29 http://docs.racket-lang.org/reference/match.html?q=match#%28...