I'm editing the Hello-wiki code from Opa Documentation. I want a wiki-topic to have a list of the existing topics in the database. I have a function which is called on the default topic:
/**
* Collect all created topics from /wiki
* and present them in Markdown format
*/
function collect_topics(page) {
string collection = "#Available topics\n"
// Format as a list
Set.iter(function( topic ) {
collection = "{collection} *[{topic}](./{topic})\n"
}, [/wiki])
save_source(page, collection)
}
...
function start(url) {
match (url) {
case {path: [] ... } :
{ collect_topics("Topics") };
case {~path ... } :
{ display(String.capitalize(String.to_lower(String.concat("::", path)))) };
}
}
This raises a syntax error: "found a binding as condition", to my understanding because strings are immutable. Is there a way to change a created string? For example:
string x = "foo"
x = x ^ x
In case this is impossible, what would be a better approach?