Sep.27.2018 -- CAlive to add ((predicates))

7 views
Skip to first unread message

Rick C. Hodgin

unread,
Sep 27, 2018, 3:17:47 PM9/27/18
to CAlive Programming Language
CAlive will introduce the ability to create predicate statements using the ((expression)) syntax at the start of an expression normally terminated by a semicolon.

    function example
    | params f32 units, f32 price
    | returns f32 r
    {
        f32 qty = get_quantity();

        // Adjust for units if specified
        ((units > 1)) qty /= units;   // Equivalent of "if (units > 1) qty /= units;"

        // Store the result
        r = qty * price;
    }

-- 
Rick C. Hodgin

Reply all
Reply to author
Forward
0 new messages