freenode/lisp - IRC Chatlog
Search
10:55:51
makomo
flip214: i opened a new MR for alexandria. i saw the discussion on issue 8 -- i could take up that offer of yours if you want :-)
11:47:16
phoe
makomo: https://gitlab.common-lisp.net/alexandria/alexandria/merge_requests/15/diffs ?
12:01:46
dmiles
i have some code tyhat works on linux but not yet complete for windows.. whake sort of condition should i throw?
12:37:23
beach
dmiles: Conditions are not "thrown" in Common Lisp. They are "signaled". THROW is a Common Lisp function that does something entirely different.
14:46:57
MichaelRaskin
Will it be compatible with all parts of ASDF that people actually know how to use (which are less numerous than the _other_ ones…)
14:47:51
jackdaniel
(i.e it is good enough to fool quicklisp and load systems which doesn't abuse asdf method specializations)
14:48:13
MichaelRaskin
Maybe if it doesn't work for complicated cases, we can finally get the dependency graph between definitions to become acyclic
14:51:13
jackdaniel
speaking of gross ends of asdf: when I load system with cffi-libffi in dependencies it is not properly cached for the first time
14:51:40
jackdaniel
second load makes it load fine. at least on ecl, I would guess that it works fine on sbcl
16:11:52
skidd0
I have a question regarding hash-tables and setf. Here is a paste: https://pastebin.com/jeSMZxRJ
16:12:29
skidd0
i'm trying to understand why I cannot use setf on a symbol i've defined in a let scope
16:16:00
makomo
i'm assuming the problem is that the value within the hash table itself isn't updated
16:18:12
phoe
skidd0: if you understand what SYMBOL-MACROLET is, replace LET with SYMBOL-MACROLET and your code will work again
16:18:31
White_Flame
a "place" is a syntactic construct, so a "place" of (gethash key table) when written will update the table. A "place" of VALUE will set the variable VALUE
16:19:40
White_Flame
skidd0: in the 2nd case, you ar setting the "variable". That's what (setf value foo) does
16:21:31
skidd0
i see. I had thought setf set the 'place' the variable value 'came from'. I'm not sure why I thought that
16:22:38
phoe
SYMBOL-MACROLET would just replace VALUE with the proper form, in this case, (GETHASH ... ...)
16:22:55
White_Flame
macros in general can let you pass around "places" because they deal with source code constructs, whose shape define the place
16:23:39
phoe
oh right, places aren't first class constructs in Lisp, since you cannot pass them to functions or return them from functions or operate on them
16:23:56
phoe
there is a workaround called a locative - it is an object that can get the value from a place and set the value to a place
16:24:04
pjb
phoe: however, you can make first class objects to let you manipulate places: closures!
16:26:26
phoe
this returns you a pair of functions - one, zero-arg, is a getter, the other, one-arg, is a setter
16:27:16
phoe
a traditional CLOS reader is one-arg, as it requires an instance, and a writer is two-arg as it needs an instance and a newval.
16:27:42
White_Flame
(list (lambda () (aref *array* 14)) (lambda (val) (setf (aref *array* 14) val)))
16:27:46
phoe
locatives don't require instance arguments; whatever instances are required are baked into the locative at the moment it is created.
16:28:49
White_Flame
hardware locatives were generally a 1-word slot in memory, like a pointer. But a getter/setter lambda pair could do things like access bits packed in an integer or other non-word sized values
18:30:10
makomo
flip214: it's mainly because of the examples i think. i could remove one of them, but i think both are good demonstrations
18:31:35
flip214
well, I'm afraid that this huge text block won't be read - or that people stop reading after the first 3 lines, or that people only read the last few lines. pick your poison ;/
18:32:10
makomo
well, should that really matter? those who want to understand what once-only does will read it :-)
18:32:43
makomo
hm, maybe i could remove the first example, since the second one showcases the most general usage?
18:41:17
makomo
or rather, https://gitlab.common-lisp.net/alexandria/alexandria/blob/master/macros.lisp#L27
18:46:53
tfb
makomo: I think that so long as the first few lines gives some kind of clue about what the thing does the doc string can be as long as you like within some kind of sanity limit (don't make the machine page...)
18:49:06
tfb
makomo: so, in particular I find the new docstring confusing in its first few lines (sorry)
18:50:33
makomo
tfb: take a look at the previous version https://gitlab.common-lisp.net/alexandria/alexandria/blob/e8fbeb9bc62f78efd8a5fe6bd044be32a8b84c88/macros.lisp#L27
18:52:06
makomo
in particular, it doesn't accurately distinguish between evaluating an INITFORM and the corresponding EXPR-i (which happens within the expansion)
18:52:44
tfb
makomo: OK, so I'm too tired to make a detailed comment, but I prefer the first two lines of the old version but probably not the remainder of it, on the grounds that the first two lines (really first paragraph) is what I would read to remind myself what it did.