A Tour of Morfa

Quoting operator '

The most frequently used operation in the symbolic DSL would be referencing a given symbol. Since a symbol class is just a string, we would like to have a convenient way of putting lots of such "strings" in our code without cluttering it with "". When the ' quoting operator is in play, we do this by typing:

var an_expression = 'x * 'y;

and an_expression is a symbolic expression xy. It is important to point out that there are no x nor y variables in scope there.

To have this we need to define the ' operator, see here for some clarifications:

public operator '
    kind = prefix,
    precedence = max,
    quoting = right
public func '(s: text): symbol
    return new symbol(s); 
    // again, alternatively return symbol(s); if symbol is struct