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

argument of with_key doesn't parse correctly #53

Open

Description

@jeisner

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"])=?]).

Activity

  1. timvieira commented on Jul 17, 2013

    @timvieira
    Collaborator

    See also discussion on #15

  2. timvieira commented on Jul 17, 2013

    @timvieira
    Collaborator

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

  3. ghost assigned on Jul 17, 2013
  4. jeisner commented on Jul 18, 2013

    @jeisner
    CollaboratorAuthor

    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.

  5. nwf commented on Jul 18, 2013

    @nwf
    Owner

    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.

  6. jeisner commented on Jul 18, 2013

    @jeisner
    CollaboratorAuthor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions