Yes, you can add that word and use deftech
Or use index
, which doesn’t require that reservoir
shows up in the text.
Is there a way to get recent value in Racket’s REPL? For example, in common lisp, we can do this in REPL: CL-USER> (+ 1 2)
3
CL-USER> *
3
If you use the REPL in the command-line, yes. See https://docs.racket-lang.org/xrepl/index.html#%28part._past-vals%29
It’s not supported in DrRacket though.
For some reason I thought xrepl didn’t do that.
@sorawee Thanks.
After some experiments, I got this version. And I’m quite satisfied. (require math/number-theory
data/collection
threading fancy-app)
(~>> (in-naturals 1)
(map sqr)
(filter (divides? 4 _))
(take 5)
(for-each displayln))
Then I found sweet-exp
, which allows me to strip nearly all parentheses and form the code into a tree structure, just like markdown syntax. It’s visually cleaner. ~>>
in-naturals 1
map sqr
filter (divides? 4 _)
take 5
for-each displayln