|
You can just hardcode it like this.code:
For a more generic solution make your enum type make an instance of Bounded like so: code:
You can then use the minBound and maxBound to define the list of all enum elements: code:
code:
code:
code:
code:
Votlook fucked around with this message at 21:18 on Sep 28, 2015 |
# ¿ Sep 28, 2015 20:59 |
|
|
# ¿ Apr 29, 2024 07:10 |
|
Barnyard Protein posted:Does anyone know of a racket function/macro that does something like these clojure operators? There is no built in macro that does this in Racket, but I know at least one library that provides it, Rackjure http://www.greghendershott.com/rackjure/index.html#%28part._.Threading_macros%29
|
# ¿ Dec 19, 2015 10:12 |
|
Pollyanna posted:
Some hints: You can use the update and update-in functions to modify entries directly: Lisp code:
code:
|
# ¿ Feb 25, 2016 14:30 |
|
Shinku ABOOKEN posted:can someone motivate me to learn clojure? what can it do better? a demonstration would be nice. It will improve your Java stacktrace reading skills Seriously though, my main reason for learning Clojure was the interactive development style it allows, with the REPL you can inspect and incrementally change stuff in a running application, which is way more fun than the edit/compile/run cycle most languages offer. It also has nice datastructures that can be read & printed easily, which is super nice for debugging. The syntax is also awesome. The parentheses are weird at the beginning, some editors are capable of editing S-expressions directly, (im using Emacs with the paredit plugin) the learning curve is big, but once you get the hang of this, the parentheses are actually an advantage, as they give you a way to edit based on the structure of the code. See a demo here: https://www.youtube.com/watch?v=D6h5dFyyUX0
|
# ¿ Aug 30, 2017 22:09 |