czan
u/czan
I've been playing around with MOP stuff lately, and I've been running into a problem that feels like it should have a good solution, but I haven't been able to find it yet. I'm going to provide details about my motivation, but this is as much an exercise in learning about the MOP as it is about solving this specific problem.
Mito and self-references
Using Mito, one can define a class that corresponds to a table in a database. Instances of this class then correspond to rows in the database, allowing you to work with data in the database through a CLOS interface. (This is pretty standard ORM stuff.)
One issue that I ran into when using Mito is th
Hi there!
I've been trying to debug something strange that seems to be happening when I use slime-compile-file along with reader macros. The issue only seems to come up when SBCL signals a warning. I've managed to reduce my failing case to this:
(eval-when (:compile-toplevel :load-toplevel :execute)
(defun printing-reader (stream char)
(declare (ignore char))
(print (read stream t nil t)))
(set-macro-character #\! #'printing-reader))
(defun test (a b)
!a)
If I save this into a .lisp file and then run slime-compile-file in Emacs I see the following output:
A
NIL
A
; in: DEFUN TEST
; (DEFUN TEST (A B) A)
I've been playing around a little bit with Common Lisp lately, and I've found the interactive restarts to be pretty amazing. So, I've implemented something similar to them in Clojure/Cider!
https://github.com/czan/dont-give-up
I don't really know my way around nrepl/Cider, but I managed to hack something together that works! If you know anything about nrepl middleware or writing extensions to Cider I would really appreciate your help!
Here's an example of what it looks like (taken from the readme):
(require '[dont-give-up.core :refer (with-restarts with-handlers read-unevaluated-value use-restart)])
(defn div [n d]
(with-restarts [(:use-value [value]
[ANN] stateful-check 0.4.0 - test stateful systems with test.check (now with race condition testing!)
groups.google.com/d/msg/clojure/1sFVmq2dpXo/9...You've reached the end of this feed.