|
fart simpson posted:This is the best way I've ever seen this explained. You don't even need to know anything about anything, just read it as unknown symbols and you can see what that quote is getting at: Thanks, this is unironically helpful. At first it looks like a bunch of gibberish, but I've convinced myself that I understand it after staring at it for a bit.
|
# ¿ May 4, 2015 16:30 |
|
|
# ¿ Apr 28, 2024 14:45 |
|
Math articles on wikipedia read like they were written by someone jacking off to how much smarter they are than everyone else. I guess it is supposed to be a reference, not a text book, but Its hard to find math text books that aren't too advanced or too basic. I'm trying to relearn modern algebra, this book is excellent in terms of being fast paced without assuming too much about how much you already know. http://www.amazon.com/gp/product/0486474178
|
# ¿ May 4, 2015 16:53 |
|
Scheme question, what is the 'right' way to associate a unique function with an instance of a record type? I'm decoding opcodes. The process of decoding which instruction the opcode refers to has a regular structure for which I've defined a record type. My question refers to how to then parse the fields. My current solution is to add a lambda expression to the instance that is responsible for determining if a opcode can be decoded by that instruction and parsing out the fields. code:
code:
code:
code:
|
# ¿ Jun 18, 2015 16:12 |
|
Thanks for the response, I think what you're describing in the first part is what I'm doing, but I'm not sure I understand. I'll have to chew on this for a bit. Here's a more complete picture of what I'm doing. Decoding happens in two passes, the first pass find the instruction that returns #t from "is-it-one?", the 2nd pass yanks out the instruction fields. I arrived at this approach because I have an urge to keep all information about an instruction and its decoding in one place, but this doesn't even do that. The a-list returned by opcode->fields is a new object disassociated from the instruction. back to the drawing board! Lisp code:
|
# ¿ Jun 18, 2015 23:46 |
|
QuantumNinja posted:<<wisdom>> You're awesome, thank you, this is really helpful feedback.
|
# ¿ Jun 19, 2015 15:43 |
|
Does anyone know of a racket function/macro that does something like these clojure operators? http://clojuredocs.org/clojure.core/-%3E http://clojuredocs.org/clojure.core/-%3E%3E The clojure docs use the word "thread" to describe the behavior, which is a good word to use except for the fact that there is another more common thing that uses that same word so its hard to search for. Backing up a sec -- what I want to do is use (make-immutable-hash) as a data structure to represent the memory in an mcu emulator. I'm using the immutable hash-table because I want to force it to be ~functional~. The code that actually implements the emulator doesn't need this kind of operator, but it would be helpful in setting up data for testing the implementation. Here's what I can do with what i know now Here's what I think might save me some I suspect that the -> operators only exist in Clojure to aide the usage of chaining method calls from java APIs, so maybe -> is unracketish. Any advice? ----- edit: I've tried doing a typed/required decl for hash-set* but I couldn't figure it out. hash-set* does what I want to do but I don't know how to write the contract for it. ----- Update, I think I can write a macro to expand it to this, Lisp code:
Solved it with a plain old function. Posting it here for anyone who is interested, including myself 4 weeks from now when i forget what i was thinking. Lisp code:
Jerry Bindle fucked around with this message at 21:10 on Dec 17, 2015 |
# ¿ Dec 17, 2015 18:06 |
|
Your Elm posts always make me want to do more with Elm. I've done a little, but not enough.
|
# ¿ Dec 17, 2015 18:09 |
|
Votlook posted:There is no built in macro that does this in Racket, but I know at least one library that provides it, Rackjure Awesome, thank you!
|
# ¿ Dec 20, 2015 06:32 |
|
Barnyard Protein posted:Does anyone know of a racket function/macro that does something like these clojure operators? Update: I've finally learned enough racket to be able to write the macro without thinking about it to hard.. Then I remembered I posted here about it, posting in case someone else is interested. Racket is cool. (I used the thread-last operator from clojure as to implement thread first, forgot which was which) Lisp code:
Lisp code:
Lisp code:
|
# ¿ Sep 8, 2016 21:59 |
|
|
# ¿ Apr 28, 2024 14:45 |
|
re: dependent types, https://coq.inria.fr the coq proof assistant is really cool, it uses dependent types.
|
# ¿ Dec 2, 2016 04:50 |