r/lisp • u/alex-manool • Jun 13 '20
Non-referential (by-value) or copy-on-write semantics in imperative programming languages
/r/ProgrammingLanguages/comments/gwxy89/nonreferential_byvalue_or_copyonwrite_semantics/
2
Upvotes
View all comments
Show parent comment
1
u/alex-manool Jun 16 '20
Very interesting. Common Lisp is quite unique and powerful! Not even Scheme would normally support that notation, at least out of the box... Unfortunately, I do not know much about CL. You have motivated me :-)
But... that's not copy-on-write, right?
Ohh, now I recall one more thing. MANOOL supports input/output argument passing too with true value (COW under the hood) semantics. The syntactic sugar applies there too:
-- Uses the
Reploperation and mutates only temporary variables under the hood and no references with shared semantics are passed around (of course, the complexity in general is amortized O(1), and above it's guaranteed to be O(1)).COW aside, and how would you express in CL
A[1][1] = 1in a way so compact as you've demonstrated?