Never been to DZone Snippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

« Newer Snippets
Older Snippets »
Showing 1-1 of 1 total  RSS 

Localizing a dialect with ALIAS

; Localizing a dialect; obviously just a basic idea.

alias 'who   "welche"
alias 'where "wo"
alias 'when  "wann"

rule: [
    some [
        'who   set persons [word! | block!] |
        'where set place string! |
        'when  set time time!
    ]
    to end
]

time: place: persons: none
parse [
    who   Fred
    where "Your house"
    when  9:30
] rule
print [time place persons]

time: place: persons: none
parse [
    welche Karl
    wo     "Euer Haus"
    wann   11:30
] rule
print [time place persons]
« Newer Snippets
Older Snippets »
Showing 1-1 of 1 total  RSS