You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Let keywords name methods, follow '.', and label parameters (record, after, public, private, …) #508
A keyword can't name a method, can't follow ., and can't be a parameter name, even where nothing else could be meant:
record Insert do
row : {String: Any} = {}
end
make Insert do
let record(value: Any) -> Insert = this
end
main do
Insert {}.record(1)
end
error: `record` is a reserved keyword in Kex, so it cannot name a function — rename it
error: Expected method or module name after '.'
error: Expected record name, got (
The same thing happens with after as a parameter name (foul rebuilding(before: Column, after: Column) fails with "Expected parameter"), and with public, private, next and type wherever a word reads best.
Proposal: read a keyword as a plain name where it names a make-block method, follows ., or labels a parameter or named argument. In those places it can't start the construct the keyword stands for. Kotlin's soft keywords and Swift's backticked identifiers are two ways other languages do this.
Where it bit
Each of these was renamed to a weaker word (Slick's docs/kex-findings.md, "Names to change back"):
Harmat's Insert.record(…) is valuesOf(…).
A migration's before/after columns are prior/changed.
Activity