Skip to content

Commit

Permalink
Oncreate for named keywords
Browse files Browse the repository at this point in the history
Added back oncreate signature for named keyword (thanks to Ke)
  • Loading branch information
johansolve committed Jun 8, 2016
1 parent e986ef2 commit 67f2e75
Showing 1 changed file with 18 additions and 5 deletions.
23 changes: 18 additions & 5 deletions knop9/knoplibs/knop_lang.lasso
Expand Up @@ -13,6 +13,7 @@ define knop_lang => type {
/*
CHANGE NOTES
2016-06-08 JS Added back oncreate signature for named keyword (thanks to Ke)
2014-01-09 JC Removed the keyword signatur oncreate since it collided with Lasso 9.2.7
2013-04-02 JC Add log_critical for keys that wasn't found and if the -always flag is set
2013-01-29 JC Minor cleanup. Should mean an ever so small speed gain.
Expand All @@ -31,7 +32,7 @@ define knop_lang => type {
*/
data public version = '2014-01-09'
data public version = '2016-06-08'
data public strings::map = map
data public fallback::boolean
Expand All @@ -46,16 +47,28 @@ define knop_lang => type {
-default (optional) Default language.
-fallback (optional) If specified, falls back to default language if key is missing.
**/
public onCreate(
default::string = string,
fallback::boolean = false
) => {
// Primary signature with named keywords
public onCreate(
-default::string = string,
-fallback::boolean = false
) => {
.defaultlanguage = #default
.fallback = #fallback
}
// Secondary signature with unnamed parameters
public onCreate(
default::string,
fallback::boolean
) => .oncreate(
-default = #default,
-fallback = #fallback
)
public onConvert() => (self -> listmethods)
/**!
Expand Down

0 comments on commit 67f2e75

Please sign in to comment.