Open mechtaev opened 2 years ago
A related thought: maybe we can solve the user error problem by making sure that we have clear error messages. When I tried a :- b()
or a :- b::c()
by mistake (not knowing this was not allowed) the error message did not provide any useful information. Maybe we should have a special case for this - check if there is ()
following a predicate, and specifically say something like "parenthesis should be omitted for nullary predicates"...?
I am in favour of enforcing parentheses for nullary predicates. Although I don't mind the other options.
I think the relational algebra operators would all work the same way, just that we'd be working on {()}
or {}
. So to be consistent, enforce p()
.
Regardless, it would improve readability if we just stuck to one (instead of making it optional).
Just my personal opinion... but I actually prefer no parenthesis if we have to enforce either one or the other, since being able to just write thing :- other_thing
is quite satisfying :smile:
Currently, nullary predicates are denoted as identifiers without parentheses, e.g.
a :- b, c
. @maowtm suggested to consider using the syntax with()
, e.g.a() :- b(), c()
. The parentheses can also be optional. Here are my thoughts about this:Without parentheses
With parentheses
ubuntu
might be more intuitive thanubuntu()
, since it is just a reference to an image, and not a callWith optional parentheses
a :- b(), c
is the same asa() :- b, c()
@barr , @thevirtuoso1973 , what are your thoughts about it?