Skip to content
This repository has been archived by the owner on Jul 11, 2021. It is now read-only.

argument of with_key doesn't parse correctly #53

Open
jeisner opened this issue Jul 17, 2013 · 5 comments
Open

argument of with_key doesn't parse correctly #53

jeisner opened this issue Jul 17, 2013 · 5 comments
Assignees

Comments

@jeisner
Copy link
Collaborator

jeisner commented Jul 17, 2013

Syntactic bug in implementation of #29.
This works:

pathto(start) min= 0                     with_key [start].
pathto(V)     min= pathto(U) + edge(U,V) with_key [V | bestpath(U)].
bestpath(U) = $key(pathto(U)).

But this doesn't:

pathto(start) min= 0                     with_key [start].
pathto(V)     min= pathto(U) + edge(U,V) with_key [V | $key(pathto(U))].

In the second case, the second rule never seems to fire. It may be misparsing the | as "or" rather than list syntax. (To understand the message below, note that the vertices in this graph are 5-letter words such as "black" and "blank".)

Error(s) in rule: <repl>

    pathto(V)     min= pathto(U) + edge(U,V) with_key [V | $key(pathto(U))].

  TypeError:
    when `$key(pathto("black"))` = ["black"]


      pathto(V="blank") min= &with_key((pathto(U="black")=? + edge(U="black", V="blank")=10)=?, [(V="blank" | $key(&pathto(U="black"))=["black"])=?]).
@timvieira
Copy link
Collaborator

See also discussion on #15

@timvieira
Copy link
Collaborator

Btw, In the mean time you use single quotes '$key' to side-step the bug.

@ghost ghost assigned nwf Jul 17, 2013
@jeisner
Copy link
Collaborator Author

jeisner commented Jul 18, 2013

See also discussion on #15

Ah yes, problem already reported and diagnosed there. But you closed that ticket so I guess the issue will live on here.

@nwf
Copy link
Owner

nwf commented Jul 18, 2013

Er, wait, wasn't this fixed by ddb1042? Jason, can you tell me which version of dyna you're using? "(cd which dyna; git describe --always)" is probably the best way to do that right now.

@jeisner
Copy link
Collaborator Author

jeisner commented Jul 18, 2013

f4d6dd0

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants