I tried making a LET block but for some reason I keep getting this error
Here is the definition
what it’s ment to do is declare variables with preset values and then run the script using said variables. But it keeps saying the variable doesn’t exist
My guess is that the lambda function is somehow still kind of evaluating its input (enough to throw an error) but before the “let” commands are evaluated. But the rings should on,y evaluate once called, and they are called BEFORE the action with the variables in it
This could also somehow be a some mettaprogramming shenanigans but I don’t see why
I can now confirm after some test with rings, I believe the issue is that the “a” variable in the second input is Unringed causing it to get called before the rest of the block runs
Anyone know a way to stop that from happening that will still keep it as a ring?
IMAO you've been making this way too complicated.
Why not use ... ?
It works fine in the following script:
The only drawback is that a will persist throughout the remainder of the script, so it's existence is not confined to the action specified in the let-block. The only way to avoid that is make a separate function and create a inside the function definition. So I'm not sure if you need a let () be in () block is actually useful. You can create any variable at first use.(I'm beginning to question if what I wrote just now is not actually valid within a purely functional context)
... well, anyway, the whole let thing is just "syntactic sugar", as experts call it - you don't really need it.
I wanted it like that, however I wanted the “be” blocks to have rings for clarity of what is ment to go there
The scope shouldn’t be limited to just that block either
It’s intended for purely functional use cases, the only exception would be IGNORE
It doesn’t need to have the reporters in a ring but it would be inconsistent with everything else and lacks clarity in isolation without the other blocks that are consistent with that rule
A ringified expression can "capture" or see only variables visible in its parent script.
But (Let...) is not a parent but rather a sibling of (action).
If you use the applicative order of evaluation, i.e., regular parameters, the upvar is created in the parent context of the (action) and is accessible.