laurelang
laurelang copied to clipboard
Feature: predicate determinators & Goal type
Predicate determinators
Sometimes predicate may have multiple meanings and an ability to set non-logical determinators when calling the predicate or constructing new bound predicate instance would be useful.
Goal
Queryset bound to logical names.
[ experimental proposed syntax: ]
!use <prime>.
-- `x` and `y` are meant to be bound names as predicate determinators
g ~ Goal{x, y};
g = {
int p = 1..15;
prime(p);
x sized_bagof p = y;
x >= 2;
};
g?;
message(
format("x = {g:x}, y = {g:y}")
);
inline version
Goal{x, y} {
...
}(a, b);