Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>You should have invented your own symbols, even just for the example.</p> <p>It looks like you're trying to do variable references that dynamically change as the scope definition requires. That is a very subtle technique and I don't know any language that does it. Most languages require you to do this explicitly although I can see similarities with closures, generators and back-tracking. </p> <p>Could you explain the context driving this unusual method? Your blog link was not very helpful. And the term 'continuous programming' is not defined or explained, either.</p> <p><strong>Update:</strong></p> <p>Okay, looking at your edited example, I can point to Icon as having something similar. It is not quite what you think you're asking for, and it is not common, but it seems close and it much better defined. It is called Goal-Directed Evaluation. </p> <p>Many language elements provide or allow you to construct a generator which can give a number of alternatives if asked. The main difference between your example and Icon you have to provide a context for the language to keep trying alternatives. Assignment doesn't do it, but a comparison will. Once a generator runs out of values it can supply, it <em>fails</em>. This is also how ordinary comparison works and the whole feature integrates nicely into the wider language. (I sometimes describe this as being like miniature exceptions.)</p> <p>Python and Ruby have a <code>yield</code> mechanism which is very similar and arguably influenced by Icon's generators.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload