Elektrine lite

← Feed

@kasdeya@cryptid.cafe

Post #2352668

2026-05-06 19:59 UTC

omg wait this also means that macros would have access to every single namespace (that is visible from within the T-expression that they’re being called inside of) if they wanted that access! that’s actually really cool - macros could redefine whatever variable they wanted, at whatever level of scope they wanted. obviously that’s an extremely dangerous thing to be able to do, but it makes macros even more powerful than in most Lisps. I’m all for giving people as much power as possible, even if it’s dangerous, and trusting them to not break anything the reason why that would work is because I want to create a special variable for accessing parent namespaces (which unfortunately will require a small amount of magic): [variable 666] (let ([variable 667]) (let ([variable 668]) (print variable) ; -> 668 (print _P.variable) ; -> 667 (print _P._P.variable))) ; -> 666

Replies (1)

  • @kasdeya@cryptid.cafe 2026-05-06 20:23

    wait omgg this literally means that the most primitive way to define a function could be to give it its own form as a table. that’s fucking incredible actually?? it could even recurse without having any name in any namespace because a reference to itself would be contained in the form holy shit ((primitive-function (print _args.0) ; -> «the function itself» (print _args.1) ; -> 666 (print _args.foo) 668) ; -> 667 666 [:foo 667]) ; -> 668 this is actually genius what the fuck. there is no way that this is actually as good of an idea as I think it is. there must be some reason why this won’t work

    Open ##2352669