Thank you for your answer, Henry. The output is not obvious from input, since it is the result of a chain of several closures and I doubt anyone would want to take the time to dissect the whole thing. However, everything works as expected and my problem is just how to provide better syntax. In short:
I have right now: 5 equivalent (call empty_state) (fresh empty_state) which syntactically amounts to the following, where "equivalent" is a conjunction: u equivalent (monadic_verb_a y) (monadic_verb_b y) I would like a semantically identical sentence, but avoiding the repetition of y. Is that possible? Raoul On Sun, Dec 29, 2019 at 3:15 AM Henry Rich <henryhr...@gmail.com> wrote: > I would like to help, but I don't get what is called for. Maybe there > are Scheme users who will pipe up. > > If not, can you describe what the desired input and output are? > > Henry Rich > > On 12/28/2019 8:51 PM, Raoul Schorer wrote: > > Hi, > > > > I am trying to implement minikanren <http://www.minikanren.org> in J. I > > have it almost working, but I am stuck in the last part of the core > > implementation > > <https://github.com/jasonhemann/microKanren/blob/master/microKanren.scm>. > I > > do not understand how to write "call/fresh" from the scheme code: > > > > In J, where "empty_state" is a list of 2 boxes emulating "s/c": > > (call empty_state) (equivalent 5) (fresh empty_state) > > which as a first step evaluates to: > > (1$0) (equivalent 5) ('',.@;1) > > > > In the above working code, "empty_state" is repeated, and that is what I > > want to avoid. "equivalent" is a conjunction, and "call" and "fresh" are > > both monadic verbs applied to the noun "empty_state". In the scheme > version > > "call" and "fresh" are united in "call/fresh", but this would require me > to > > pass the "equivalent" conjunction as argument to "call/fresh". > > > > Can you help me write the scheme "call/fresh" equivalent, please? > > my code is at https://github.com/Rscho314/new_kanren > > > > Thanks, > > Raoul > > ---------------------------------------------------------------------- > > For information about J forums see http://www.jsoftware.com/forums.htm > > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm > ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm