BayesianLogic / blog

The BLOG programming language
http://bayesianlogic.github.io/
BSD 4-Clause "Original" or "Old" License
98 stars 31 forks source link

Support if-then-else and case in fixed function body #204

Closed lileicc closed 10 years ago

lileicc commented 10 years ago

related to #198

cberzan commented 10 years ago

This works already:

fixed Real myabs(Real a) =
    if a >= 0 then a
    else -a;

query myabs(123);
query myabs(-456);

fixed Real foo(Integer a) =
    case a in {
        1 -> 100.0,
        2 -> 200.0
    };

query foo(1);
query foo(2);
query foo(3);