Ludii Forum
{} v. () - Printable Version

+- Ludii Forum (
+-- Forum: Questions (
+--- Forum: About the Ludii Grammar (
+--- Thread: {} v. () (/showthread.php?tid=10)

{} v. () - unhandyandy - 11-30-2019

When does one use {} rather than ()?

RE: {} v. () - Eric Piette - 12-01-2019

{} is to describe an array. For example {1 2 3} is an array of size 3 with the values 1, 2 and 3.

() is just to know what are the parameters of a ludeme.
For example for
(slide along:(in (step) (empty)))

The ludemes "step" and "empty" have no parameter. The ludeme "in" has the ludemes "step" and "empty" for parameters.
And the ludeme "slide" has the ludeme "in" for the parameter corresponding to "along".

Again all of that will be describe in our future version of the documentation in January for the release.

RE: {} v. () - unhandyandy - 12-01-2019

One thing that confuses me is that

(and (isPiece (to) "Jarl2") (in (to) (expand origin:(middle) 1 Orthogonal)))


(or {(isFriend (who (step))) (in (step) (corners)) (and (in (step) (centre)) (isZero (what (step))))})

Are the {} really necessary with "or"?

RE: {} v. () - Eric Piette - 12-01-2019

If you have only two elements in an Or or an And, no they are not necessary. If this is more, the ludeme is applied to an array, so yes there are necessary in this case because you have three ludemes on it.