Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New uniqCond verbs #114

Open
hgiesel opened this issue Dec 5, 2019 · 1 comment
Open

New uniqCond verbs #114

hgiesel opened this issue Dec 5, 2019 · 1 comment

Comments

@hgiesel
Copy link
Owner

hgiesel commented Dec 5, 2019

Verbs with arity 3:

CATEGORY 1: Verbs applicable to a [vs, op, uniqSet] -> bool.

["$_:1:0", "in", "uc:foo"] // "includes" with reversed arguments, includes is deprecated
["$$", "notIn", "uc:uniq1"] // "!includes" with reversed arguments, !includes is deprecated

CATEGORY 2: Verbs applicable to [string, op, string] -> bool

["name", "eq", "c1"]
["name", "notEq", "c1"]
["name", "match", "^c.*$"]
["name", "notMatch", "^c.*$"]

CATEGORY 3: Verbs applicable to [number, op, number, maybe_number] -> bool

[1, "=", 0]
[1, "!=", 1]
[1, "<=", 2]
[1, "<", 0]
[1, ">=", 5]
[1, ">", 0]
[1, "%", 2, 1] // fourth argument defaults to 0
[1, "within", 2, 3] // in [3-2, 3+2], fourth argument required
[1, "range", 2, 3] // in [2, 3], fourth argument required

CATEGORY 4: Verbs with arity 2:

["name", "$$"] -> string | star
["sub", "$$"] -> number | star
["pos", "$_"] -> number | star
["idx", "$_"] -> number | star | false
["length", "uc:bar"] -> number
["length", "$c1"] -> number
@hgiesel
Copy link
Owner Author

hgiesel commented Dec 6, 2019

CATEGORY 5: Predicates

["forall", "x", "uc:foo", (proposition)]
["exists", "x", "uc:foo", (proposition)]
["!exists", "x", "uc:foo", (proposition)]

... e.g.
["exists", "x", "uc:clozeRef", [["idx", "$$"], "within", 2, ["idx", "ref:x"]]]
translates to: ∃x ∈ uc:clozeRef. x.idx ∈ [$$.idx - 2, $$.idx + 2]

["forall", "y", "uc:test", [["name", "ref:y"], "matches", "^c"]]
translates to: ∀y ∈ uc:test. y.name `matches` /^c/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant