Jump to content

Unicode variable names: Difference between revisions

Added AppleScript (ASObjC) solution.
(Added AppleScript (ASObjC) solution.)
Line 104:
 
''Russian/Soviet example: In English Algol68's reverent case statement reads '''case''' ~ '''in''' ~ '''out''' ~ '''esac''', in Cyrillic this reads '''выб''' ~ '''в''' ~ '''либо''' ~ '''быв'''.''
 
=={{header|AppleScript}}==
 
In AppleScript, "identifiers whose first and last characters are vertical bars (|) can contain any characters." The AppleScript Language Guide doesn't recommend their use as they can make scripts difficult to read, but they're perfectly legal.
 
<lang applescript>set |Δ| to 1
set |Δ| to |Δ| + 1
return |Δ|</lang>
 
{{output}}
<lang applescript>2</lang>
 
Vertical bars can also be used to differentiate between identifiers and reserved words should the need arise. The bars are just a signal to the compiler to accept what's between them as an identifier and aren't stored with the identifier itself. They may disappear once the code's compiled if the decompiler can't see a reason to include them. Or indeed they may be added if a script compiled on one machine is decompiled on another where one of the identifiers clashes with a term defined in a library or OSAX installed on that machine.
 
=={{header|Arturo}}==
557

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.