core.logic

no way to unify the first of a seq to one lvar and the rest to another

Details

  • Type: Enhancement Enhancement
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Completed
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None

Description

would be nice to be able to do stuff like

(cond-m foo
(cons ?a nil) (println a))

where foo is some value, and (cons ?a nil) is pattern to match and (println a) is code to execute if it matches. (cons ?a nil) would match a sequence with one element, with ?a matching that one element.

you can sort of do this by modifying replace-lvar to turn (cons a b) into (lcons a b) this works for some cases but fails for the one given above, not sure why

Activity

Kevin Downey made changes -
Field Original Value New Value
Status Open [ 1 ] Resolved [ 5 ]
Resolution Completed [ 1 ]
David Nolen made changes -
Status Resolved [ 5 ] Closed [ 6 ]

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: