Hacker News new | ask | show | jobs
by dreamcompiler 1258 days ago
They also don't cons. Structs do.
2 comments

Wrapping the multivalue return using decorators / generators would provide the 'struct' equivalent without rewriting to 'single' struct.

lisp approach to dectorators / generators disucssion. https://stackoverflow.com/questions/32956033/is-there-a-stra...

lisp -> 1-n; s-expression 1st element ins () is the "memory index"

structs -> n * M; "m-expression" 1st element outside of () is the "memory index".

cons struc vs. cons lisp () is apples/oranages comparison.

if convert both the 'cons struc' and the cons lisp () to same byte vector/stack or equivalent byte tree/heap, then yes, both 'cons' functions are equivalent.

higher order equivalent of mealy state machine vs. moore state machine. [1]

side note: ( 1 - n ) vs (n * m) is context reference to ploting base 2 log(x).

(1 - n ) can never exceed 1.

N * M, relative to (1 - n) is unbounded.

=====

[1] : https://www.geeksforgeeks.org/difference-between-mealy-machi...