laurelang icon indicating copy to clipboard operation
laurelang copied to clipboard

Feature: predicate determinators & Goal type

Open timoniq opened this issue 2 years ago • 0 comments

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);

timoniq avatar Jan 12 '23 14:01 timoniq