User talk:Mbishop: Difference between revisions

m
→‎Algol language file: use html entities for algol characters
m (→‎Algol language file: use html entities for algol characters)
Line 12:
 
Actually it isn't to bad. There are several types of identifiers.
* BOLD - IF/THEN/ELSE/FI, CASE/IN/OUT/ESAC, FOR/Rev0OMFROM/BY/TO/DO/OD, MODEs and OPerators. Normally <b>bolded</b>.
* OPerators - can be special characters, see below.
* names - alphanumeric starting with alphabetic, spaces in the middle are ignored. Normally <i>italiced</i>.
Line 20:
There are 4 different main contexts.
* Code - BEGIN ~ END or ( ~ )
* A COmment - either CO ~ CO or COMMENT ~ COMMENT or ¢&cent; ~ ¢&cent; (two cents worth)
* A PRagmat - either PR ~ PR or PRAGMAT ~ PRAGMAT.
* STRINGs - "double quotes", where """" is a strings containing 1 double quote.
Line 34:
You will have fun with these:
 
The &or;, &and;, ¬&not;, &ne;, &le;, &ge;, &times;, ÷&divide;, ⌷, &uarr;, &darr;, ⌊, ⌈ and &perp; characters can be found on the [[:wikipedia:IBM 2741]] keyboard with the [[:wikipedia:APL programming language#APL symbols and keyboard layout|APL]] "golf-ball" print head inserted, these became available in the mid 1960s while ALGOL 68 was being drafted.
 
Note that Unicode character "DECIMAL EXPONENT SYMBOL 23e8" is also permitted. eg In Algol "1 million" can be 1 000 000 or 1e6 or even 1⏨6.
Line 49:
'''channel''', '''file''', '''format''', '''struct''', '''union''',
Misc Syntax†:
'''of''', '''at''' "@", '''is''' ":=:", '''isnt''' ":&ne;:",
Builtin "constants"†:
'''true''', '''false''', '''empty''', '''nil''' "°&deg", '''skip''' "~" (also "?"),
Comments and Pragmats†:
'''co''' "¢&cent;", '''comment''' "¢&cent;", '''pr''', '''pragmat''',
Flow control†:
'''case''' '''in''' '''ouse''' '''''in''''' '''out''' '''esac''' "( ~ | ~ |: ~ | ~ | ~ )",
Line 75:
|ALIGN=CENTER| 10 || '''not''', '''up''', '''down''', '''lwb''', '''upb''',
-, '''abs''', '''arg''', '''bin''', '''entier''', '''leng''', '''level''', '''odd''', '''repr''', '''round''', '''shorten'''
| ¬&not;, &uarr;, &darr;, ⌊, ⌈
| ~
| ╰, ╭
Line 88:
!bgcolor=#cccccc|+Algol68<sup>Rev0</sup>
|-
|ALIGN=CENTER|9||+*, '''i'''||+&times;, &perp;|| ||
|-
|ALIGN=CENTER|8|| '''shl''', '''shr''', **, '''up''', '''down''', '''lwb''', '''upb''' || &uarr;, &darr;, ⌊, ⌈ || || ╰, ╭
|-
|ALIGN=CENTER|7|| *, /, %, '''over''', %*, '''mod''', '''elem'''|| &times;, ÷&divide;, ÷&divide;&times;, ÷&divide;*, %&times;, ⌷ || || ÷&divide;:
|-
|ALIGN=CENTER|6||-, + || || ||
|-
|ALIGN=CENTER|5||<, '''lt''', <=, '''le''', >=, '''ge''', >, '''gt'''|| &le;, &ge; ||
|-
|ALIGN=CENTER|4||=, '''eq''', /=, '''ne''' || &ne; || ~= ||
|-
|ALIGN=CENTER|3||&, '''and'''||&and;, /\||
|-
|ALIGN=CENTER|2||'''or'''||&or;, \/ ||
|-
|ALIGN=CENTER|1||'''minusab''', '''plusab''', '''timesab''', '''divab''', '''overab''', '''modab''', '''plusto''',
-:=, +:=, *:=, /:=, %:=, %*:=, +=:
|| &times;:=, ÷&divide;:=, ÷&divide;&times;:=, ÷&divide;*:=, %&times;:=|| || ÷&divide;::=
|}
 
Line 118:
!bgcolor=#cccccc|+Algol68<sup>Rev0</sup>
|-
|ALIGN=CENTER| effectively 0 || :=, =:, = , :=:, :/=:, '''is''', '''isnt''', '''of''', '''at'''|| :&ne;:, : || :~=: || '''ct''', ::, '''ctab''', ::=, .., '''is not''', &rarr;, @
|}
 
In conclusion: in 1969 ASCII was mandated in the US, hence many of the
characters above are unfamiliar to PC users. Including - surprisingly -
the character for 1 US cent, eg 1¢&cent;
 
note: I pulled most of the above from http://en.wikipedia.org/wiki/ALGOL_68