freenode/#lisp - IRC Chatlog
Search
4:24:13
aeth
Does anyone else use a macro as the way to access things to avoid potentially dozens of exports in a package? What I've been doing is a with-foo-accessors that places the accessor symbols in the package specified at the definition of that macro and also can add a prefix (for the case of structs with conc-name not set to nil).
4:25:03
aeth
I find that this greatly simplifies things because then I only need to export the with-foo-accessors macro and/or a macro that indirectly uses that macro.
4:26:59
aeth
e.g. (with-foo-accessors ((foo foo)) foobar ...) would macroexpand to (with-accessors ((foo the-package-containing-foobar::foobar-foo)) foobar ...) in the most complicated case (where it's a struct with prefixed accessors)
4:44:08
aeth
My macro, in case anyone's curious: https://gitlab.com/zombie-raptor/zombie-raptor/blob/ec47910d88254d0c6a0e8c0a33aa33c7d4037513/util/util.lisp#L247-260
4:44:36
aeth
destructuring-lambda is just a lambda that does a destructuring bind on its one argument. It's surprisingly common. In fact, I just now noticed the pattern in define-accessor-macro
5:09:42
aeth
loke: Otherwise the macro will produce something whose API is (zombie-raptor/util/util::foo)
5:33:15
aeth
loke: I use #.(symbol-name ...) pretty much everywhere instead of hardcoding the symbol as a string of upper case characters
5:38:49
aeth
I know it's essentially pointless, but at least to me it feels better to not hardcode the assumption about the reader that will almost certainly be valid. Perhaps this could be turned into something more concise?
5:42:31
aeth
But... I suppose I should be using &environment env instead of assuming intern without that argument would work correctly
8:00:01
scymtym
shka: glad you like it. but i have to learn more CLIM or get somebody to help out to make it less horrible to use
14:21:38
jmercouris
an empty list has a value of NIL, but it is also sort of "indivisible", a smallest part, and therefore NIL
14:32:12
jmercouris
other than quickproject, is there something built into asdf to just dump a sample file?
14:51:29
Beepy
Was clhs 17.1.1 added to address the sequence functions that don't require proper sequences?
14:54:23
specbot
General Restrictions on Parameters that must be Sequences: http://www.lispworks.com/reference/HyperSpec/Body/17_aa.htm
14:55:14
Beepy
I wasn't sure becuase most sequence functions specify that they need a proper sequence while a small few just say sequence