Hi Brian! > As a newcomer to Microkanren/Minikanren I'm puzzled by the use of the word > "fresh" for creating new logical variables. > > Could someone please explain to me, whether there is some deep reason for > this choice, instead of the seemingly much better, obvious, and more natural > word "leto"? > > "leto" would be in accordance with the appealing naming-convention used > everywhere else in the language, e.g., "conde", "appendo", just to name a few. > > "leto" would be a pleasing reference to "let", as it's known from so many > other languages, including the lisp/scheme family. Furthermore, "leto" is > shorter and easier to write, and is even feels more "fresh" and tasty - as a > language construct - than literally using the word "fresh".
The 'fresh' form introduces new logic variables that have no value assigned to them. We refer to such logic variables as "fresh", hence the name for the form. Syntactically, 'fresh' is closer to 'lambda' than to 'let'. 'let' introduces variable/expression pairs, and binds the variables to the values of those expressions before evaluating the body. The entire point of 'fresh' is that the logic variables introduced are "fresh", and are not associated with any value. For this reason, 'leto' would be a misleading name. > A different topic: > I have a minor "complaint", or rather a suggested improvement. > > In the official book source code found here...: > > https://github.com/TheReasonedSchemer2ndEd/CodeFromTheReasonedSchemer2ndEd/blob/master/trs2-impl.scm > > ... all places in the source code, where an empty stream is returned, the > expression "'()" is used. It would improve the code quality - making the code > more self-documenting - to use the expression "empty-s" which is defined at > the very beginning of the code. (Personally I'd prefer "empty-stream", but > that's a different story.) Ah--the problem here is that 'empty-s' refers to the empty substitution, not the empty stream! The '() expressions you see in the code are indeed empty streams, but not an empty-s. It would probably be better for us to define 'empty-subst' and 'empty-stream' both to be the empty list, and to use 'empty-stream' instead of '() in the definitions. Thanks for the observation! Cheers, --Will > -bd > > -- > You received this message because you are subscribed to the Google Groups > "minikanren" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at https://groups.google.com/group/minikanren. > For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "minikanren" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/minikanren. For more options, visit https://groups.google.com/d/optout.
