Hello,

I'm currently working on an embedding of the miniKanren logic programming
language in Pharo (http://minikanren.org/) and I have run into an issue
with the method compilation internals I was hoping someone could shed some
light on:

miniKanren has an operator, fresh, that basically evaluates a block and
returns a logic variable. My current syntax for a conjunction of logic
variables is:

var1 and: var2

When I try to use the same syntax for fresh:

var1 and: [ :var2 | var2 ]

Compilation fails with "Warning: and: (or:) takes zero-arg block" which
seems on first glance to come from the compiler attempting to inline my
and: call. If I add an auxiliary method andFresh: that evaluates the block
and and:'s the result in 2 steps, my tests pass.

What I'd like to know is:
1) Is there a work around to let me use the and: syntax here?
2) Might my overriding of and: and or: for normal logic variables cause
other problems I'm not thinking of?

Obviously this is not a critical issue, but my code's aesthetics are at
stake, and if we can't have pretty code, then what can we have?

Thanks,
Evan

Reply via email to