183 days ago · Tech · hide · Fediverse post

Implementation of SIGNAL and ERROR in CLRHack In CLRHack, the condition signaling system is implemented in the Lisp.HandlerControl class within the LispBase library. It leverages .NET's [ThreadStatic] storage to maintain a per-thread dynamic stack of active condition handlers. SIGNAL Implementation The Signal(object condition) method performs the following logic: Retrieval: It fetches the activeHandlers list for the current thread. This list is a chain of [LispBase]Lisp.Handler objects maintained by handler-bind. Iteration: It iterates linearly through the list from the most recently bound handler to the oldest. Type Matching: For each handler, it calls IsType(condition, handler.ConditionType). If the condition is a symbol, it checks for symbol equality (supporting simple symbol-based conditions). If the condition is a .NET object, it checks if the handler's type is assignable from the condition's runtime type (supporting interop with system exceptions). It treats the symbols T or…

Commenting on Bubbles has been removed. Why? If you want to talk about this post, write to the author, use the comments on their blog if it has them, or reply with a "RE:" post on your own blog. Suggestions? feedback@bubbles.town