Details

Type: Enhancement

Status: Open

Priority: Minor

Resolution: Unresolved

Affects Version/s: None

Fix Version/s: None

Component/s: None

Labels:
Description
I think it may be useful to be able to tie multiple noms in one binder, with or without significant order.
A couple use cases I've thought of so far:
Lambdas in a noncurrying language. Here order matters.
(== (list 'fn (ties [x y] (list '+ x y))) (list 'fn (ties [z w] (list '+ z w)))
My original use case, free/quantified variables in logical formulas. Order doesn't matter (note the second body has its noms swapped).
(== (list '∀ (ties #{x y} (list '= (list '+ x y) (list '+ y x)))) (list '∀ (ties #{z w} (list '= (list '+ w z) (list '+ z w)))))
I have a draft implementation here: https://github.com/tomjack/core.logic/compare/ties
Possible issues with this implementation:
 Is it OK to reextend IWalkTerm to IPersistentSet?
 Should Tie and Ties present a uniform interface? (e.g. (tie? (ties #{x} x)))
Activity
Tom Jack
made changes 
Field  Original Value  New Value 

Description 
I think it may be useful to be able to tie multiple noms in one binder, with or without significant order.
A few use cases I've thought of so far: Lambdas in a noncurrying language. Here order matters. {code} (== (list 'fn (ties [x y] (list '+ x y))) (list 'fn (ties [z w] (list '+ z w))) {code} Choice in CSP. Order matters. {code} (== (list 'choice (ties [x y] {x (p a) y (q b)}) (list 'choice (ties [z w] {z (p z) w (q w)})) {code} My original use case, free/quantified variables in logical formulas. Order doesn't matter (note the second body has its noms swapped). {code} (== (list '∀ (ties #{x y} (list '= (list '+ x y) (list '+ y x)))) (list '∀ (ties #{z w} (list '= (list '+ w z) (list '+ z w))))) {code} I have a draft implementation here: https://github.com/tomjack/core.logic/compare/ties Possible issues with this implementation:  Is it OK to reextend IWalkTerm to IPersistentSet?  Should Tie and Ties present a uniform interface? (e.g. (tie? (ties #{x} x))) 
I think it may be useful to be able to tie multiple noms in one binder, with or without significant order.
A couple use cases I've thought of so far: Lambdas in a noncurrying language. Here order matters. {code} (== (list 'fn (ties [x y] (list '+ x y))) (list 'fn (ties [z w] (list '+ z w))) {code} My original use case, free/quantified variables in logical formulas. Order doesn't matter (note the second body has its noms swapped). {code} (== (list '∀ (ties #{x y} (list '= (list '+ x y) (list '+ y x)))) (list '∀ (ties #{z w} (list '= (list '+ w z) (list '+ z w))))) {code} I have a draft implementation here: https://github.com/tomjack/core.logic/compare/ties Possible issues with this implementation:  Is it OK to reextend IWalkTerm to IPersistentSet?  Should Tie and Ties present a uniform interface? (e.g. (tie? (ties #{x} x))) 
I really don't think the set bit is necessary, the vector syntax is fine. Also avoid needing to bring IWalkTerm back for sets. And yes, tie? should work in either case.