Version 13 by komaz
on Nov 25, 2010 18:32.

compared with
Version 14 by komaz
on Nov 25, 2010 18:36.

Key
This line was removed.
This word was removed. This word was added.
This line was added.

Changes (2)

View Page History
regex := Regex<|\d+|> // regex has type Regex
{noformat}
However, it is not necessary - basically the DSL expression can be compiled to expression of any type - you can write a DSL plugin with return type depending on DSL str, like this:
{noformat}
foo := MyDSL<|1|> //resolves to Int at compile time
bar := MyDsl<|str|> //resolves to Str at compile time
{noformat}
However, it is not necessary - basically the DSL expression can be compiled to expression of any type - I don't know whether this is a bug or feature :)

The most obvious way to use DSL expressions is instantiation of some complex objects. For example, imagine we are writing a library for graph manipulation, so we define classes like {{Graph}}, {{Node}}, and {{Edge}}. See [^Graphs.fan]