CoNarrative / precept

A declarative programming framework
MIT License
657 stars 33 forks source link

Expression with accumulator does not parse variable binding on attribute #85

Closed alex-dixon closed 7 years ago

alex-dixon commented 7 years ago

Fails because our tuple spec requires the attribute slot to be a keyword. Have a fix that changes the spec to any?.

Once merged we should be able to do:

(rule dynamic-type
  [[_ :some-type-name ?attr]]
  [?x <- (acc/all) :from [_ ?attr]]
  =>
  (println "I don't work in 0.3.0-alpha but will in 0.3.0-alpha2" ?x)))

Note this is parsing correctly and works as expected:

(rule dynamic-type
  [[_ :some-type-name ?attr]]
  [[_ ?attr]]
  =>
  (println "I work" ?attr)))