freenode/lisp - IRC Chatlog
Search
5:24:11
clothespin
i'm trying to find out how people think exceptions and signals should work in a lisp implementation before i go "fix" something
5:27:17
clothespin
i discovered c++ exceptions in foreign code work fine in sbcl on mac but are masked out by an overzealous handler on windows
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