4 ms·
> loop would support application-defined clauses. lisp loop is a macro, can be modified to support above request. > * in the area of pathnames, I would have t
by sargstuff 4y ago
> loop would support application-defined clauses.
lisp loop is a macro, can be modified to support above request.
> * in the area of pathnames, I would have the language specify precisely how POSIX and Windows paths correspond to pathname objects.
Elang/elixir approach where (pathname <file stats parameter>) provides a standard way to access file/path without having to know what the underlying file system is (unless check atrributes)
> * structs and CLOS would be integrated together; conditions would be CLOS instances.
strucs are just segmented arrays or multi-values in (). (condit ()) is a 'clos instance'.
The way python sets up it's class/object system is similar to lisps, just not using lisp ().
> ... we don't know whether the f binding is resolved before or after the arguments. ...
whats order in a tree/heap, other than way tree/heap traversed.
why not make use of setq/quote if binding order is important?
> * redefine "binding" as being an association between a symbol and a location.
first item in () s-expression is the symbol/location association. Doesn't # provide a way to get at what the symbol/location association is?
> ... I'd fix that as being tear-down-as-you-go. ...
Traditional lisp, nothing is garbaged reclaimed until exit REPL.
- kazinator 4y agoA CL implementation's loop macro cannot be modified without modifying the implementation, but your application can carry its own loop macro. Possibly, such a loop macro can generate code written in the standard loop macro, so that (enhanced-loop <standard-clauses...>) just emits (loop <standard-clauses...>) but if it detects nonstandard clauses, it expands them into standard clauses. Lisp being what it is, you are rarely at the mercy of the implementation, when it comes to a language feature, unless the feature has to do with accessing some semantics deep in the implementation, and the problem is with that semantics and not the porcelain. It is still undesirable for programmers to bring their ehanced-loop to the table. Because Bob has bob-loop, and Amy has amy-loop and they would like to combine their code where both bob-loop and amy-loop features are used not just in the same code but in the same loop. That just turns into a PITA. If they are lucky, amy-loop has some awkward syntax for specifying that a given invocation should generate code for some loop other than cl:loop, so they write (amy-loop :target bob-loop ...). Then amy-loop transforms all the amy-loop clauses it sees, leaves alone anything it doesn't understands and spits out bob-loop syntax. (This is not easy; skipping unfamiliar, non-standard loop syntax is going to involve guesswork because the clauses aren't nicely parenthesized!) That would all be simpler if they could just write custom clauses for standard loop. Bob would write his in the bob-lib package; Amy in amy-lib. Everything works together out of the box; if you have bob-lib and amy-lib, you can use loop with bob-loop and amy-loop clauses. I don't substantially understand the rest of your remarks, except to the extent that certain key words in my remarks serve as their prompts. The holidays being over, you should be able to get a medication refill now.
- sargstuff 4y ago> ... The holidays being over, you should be able to get a medication refill now. to much line spacing is a python thing, lisp is to parenthetical.
- sargstuff 4y agoNot explicitly noted in original message was, reply to remarks were about examples of how that already exists in lisp without need to modify lisp. 'basic' loop in lisp is tree/heap traversal from initial outer (). The standard loop macro just provides appropriate way/window dressing to quickly comprehend what's being done (aka while, counter loop, do while, repeat, etc). What's refered to as generators in other languages, is implicit in how lisp traverses (). per return a struct and not a list: Generator approach would 'store the list of values' and return a single struct every time called until no more structs from 'original turn'. traversal of () is the 'generic loop' in lisp. (clos or not) set/quote discussion also left out the needed eval command. stated 'rebinding' is already implicet in s-expressions used in lisp. request as given is an lvalue = rvalue(s) interpretation (m-expression). s-expressions are core of lisp. convertion lisp to use m-expressions instead of s-expressions would mean creating a new language.
- kazinator 4y ago> basic' loop in lisp is tree/heap traversal from initial outer (). That's completely false, except that loops can be used to code a tree traversal. Looping is a control construct centered around a backward branch, updates to iteration variables and termination testing. Loops can compile code that has nothing to do with the heap.
- sargstuff 4y agoWhy prefer a non-functional construct over a functional construct in a functional language? The lisp loop macro simplifies the s-expression tree/heap traversal for benifit of coder/reader. The lisp loop macro is implilmented based on s-expression tree traversal. Trees are used with closures. Heaps are used with objects. (lisp & non-lisp) In lisp can debate what's an 'object', but multiple thunks are managed through a heap structure. Tree (or heap form of tree) order traversals are forms of binary backward branching. Tree traversal can be structured so 'iteration variables' are not needed. Default lisp termination is 'NIL' If only returning a single struc (with no memory management), then heap not required. If returning multiple strucs in a list/tree (aka multiple s-expressions), then the s-expression 'thunks' will be managed via heap.