CLRHack: Multiple return values 0 ▲ Abstract Heresies 187 days ago · Tech · hide · Fediverse post Multiple Return Value Implementation in CLRHack The CLRHack compiler implements Multiple Return Values (MRV) by extending the single-value limitation of the .NET Common Intermediate Language (CIL) stack through a thread-local side-channel. This allows Lisp forms to communicate multiple values (up to 64) across function boundaries. 1. The Side-Channel Storage Because a CIL method can only return a single object on the stack, CLRHack utilizes a static class [LispBase]Lisp.Values. This class contains [ThreadStatic] fields that act as a secondary communication channel: Primary Value: Always resides on the CIL evaluation stack. ReturnCount: An int32 field indicating the total number of values returned (including the primary one). Value1 through Value63: Object fields that store the second through sixty-fourth return values. 2. Producing Multiple Values (The Staging Logic) To prevent corruption during evaluation, the values form uses a Stage-and-Commit strategy. This is necessary because… 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