User talk:Mbishop: Difference between revisions

Line 6:
 
In response to your edit comment from a while ago, I think it's become normal to put the omits on the bottom of the page. It really doesn't matter where they go (I don't foresee any content being added to the template), so I guess going with the crowd will be fine for this. --[[User:Mwn3d|Mwn3d]] 19:49, 24 September 2009 (UTC)
 
== Algol language file ==
 
re: http://rosettacode.org/mw/index.php?title=User_talk%3ANevilleDNZ&diff=64759&oldid=22179
 
Actually it isn't to bad. There are several types of identifiers.
* BOLD - IF/THEN/ELSE/FI, CASE/IN/OUT/ESAC, FOR/Rev0OM/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>.
** library names - eg sin/cos/tan/open/close etc - I can dig out a complete list...
** Extension library names - Algol68 has additional OPerators, constants and PROCedures that I can generate a list if you like.
 
There are 4 different main contexts.
* Code - BEGIN ~ END or ( ~ )
* A COmment - either CO ~ CO or COMMENT ~ COMMENT or ¢ ~ ¢ (two cents worth)
* A PRagmat - either PR ~ PR or PRAGMAT ~ PRAGMAT.
* STRINGs - "double quotes", where """" is a strings containing 1 double quote.
* FORMATs - $ddd,g(2),l$, the tricky one is that $f(code)d$, where f(code) is indeed contains Algol68 code returning an INT.
 
If you want to make things really interesting, Algol68 was internationalised in
1968. Hence it supports other character sets, including Cyrillic: eg
* http://vak.ru/lib/exe/fetch.php/book/gost/pdf/gost-27974-88.pdf
(The Official report is also available in several other languages, including
Braille because Algol68 was a UN/UNESCO sponsored language!!)
 
====Special characters for operators====
You will have fun with these:
 
The ∨, ∧, ¬, ≠, ≤, ≥, &times;, ÷, ⌷, ↑, ↓, ⌊, ⌈ and ⊥ 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.
 
===BOLD symbols and reserved words as typically printed===
There are 61 such reserved words ( some with "brief symbol" equivalents ) in the standard sub-language:
Declaration sections†:
'''mode''', '''op''', '''prio''', '''proc''',
Modes modifiers†:
'''flex''', '''heap''', '''loc''', '''long''', '''ref''', '''short''',
Builtin modes†:
'''bits''', '''bool''', '''bytes''', '''char''', '''compl''', '''int''', '''real''', '''sema''', '''string''', '''void''',
Mode compositions†:
'''channel''', '''file''', '''format''', '''struct''', '''union''',
Misc Syntax†:
'''of''', '''at''' "@", '''is''' ":=:", '''isnt''' ":≠:",
Builtin "constants"†:
'''true''', '''false''', '''empty''', '''nil''' "°", '''skip''' "~" (also "?"),
Comments and Pragmats†:
'''co''' "¢", '''comment''' "¢", '''pr''', '''pragmat''',
Flow control†:
'''case''' '''in''' '''ouse''' '''''in''''' '''out''' '''esac''' "( ~ | ~ |: ~ | ~ | ~ )",
'''for''' '''from''' '''to''' '''by''' '''while''' '''do''' '''od''',
'''if''' '''then''' '''elif''' '''''then''''' '''else''' '''fi''' "( ~ | ~ |: ~ | ~ | ~ )", (Rev0 had '''elsf''')
'''par''' '''begin''' '''exit''' "." '''end''' "( ~ )", '''go''' '''''to''''', '''goto''', .
 
Note that these are normally printed in '''bold'''.
 
{† Apologies to C.H. Lindsey et al. for these descriptions, they are not the
official ALGOL 68 naming conventions, rather C hybrids.}
 
====Monadic operators====
{|border="1" style="border-collapse: collapse;"
!bgcolor=#cccccc|'''prio'''rity
!bgcolor=#cccccc|Algol68 "Worthy characters"
!bgcolor=#cccccc|+Algol68<sup>Rev1</sup>
!bgcolor=#cccccc|+Algol68<sup>C,G</sup>
!bgcolor=#cccccc|+Algol68<sup>Rev0</sup>
|-
|ALIGN=CENTER| 10 || '''not''', '''up''', '''down''', '''lwb''', '''upb''',
-, '''abs''', '''arg''', '''bin''', '''entier''', '''leng''', '''level''', '''odd''', '''repr''', '''round''', '''shorten'''
| ¬, ↑, ↓, ⌊, ⌈
| ~
| ╰, ╭
|}
 
====Standard dyadic operators with associated priorities====
{|border="1" style="border-collapse: collapse;"
!bgcolor=#cccccc|'''prio'''rity
!bgcolor=#cccccc|Algol68 "Worthy characters"
!bgcolor=#cccccc|+Algol68<sup>Rev0&Rev1</sup>
!bgcolor=#cccccc|+Algol68<sup>C,G</sup>
!bgcolor=#cccccc|+Algol68<sup>Rev0</sup>
|-
|ALIGN=CENTER|9||+*, '''i'''||+&times;, ⊥|| ||
|-
|ALIGN=CENTER|8|| '''shl''', '''shr''', **, '''up''', '''down''', '''lwb''', '''upb''' || ↑, ↓, ⌊, ⌈ || || ╰, ╭
|-
|ALIGN=CENTER|7|| *, /, %, '''over''', %*, '''mod''', '''elem'''|| &times;, ÷, ÷&times;, ÷*, %&times;, ⌷ || || ÷:
|-
|ALIGN=CENTER|6||-, + || || ||
|-
|ALIGN=CENTER|5||<, '''lt''', <=, '''le''', >=, '''ge''', >, '''gt'''|| ≤, ≥ ||
|-
|ALIGN=CENTER|4||=, '''eq''', /=, '''ne''' || ≠ || ~= ||
|-
|ALIGN=CENTER|3||&, '''and'''||∧, /\||
|-
|ALIGN=CENTER|2||'''or'''||∨, \/ ||
|-
|ALIGN=CENTER|1||'''minusab''', '''plusab''', '''timesab''', '''divab''', '''overab''', '''modab''', '''plusto''',
-:=, +:=, *:=, /:=, %:=, %*:=, +=:
|| &times;:=, ÷:=, ÷&times;:=, ÷*:=, %&times;:=|| || ÷::=
|}
 
====Assignation and identity relations etc====
These are technically not operators, rather they are considered "[http://vestein.arb-phys.uni-dortmund.de/~wb/Rev1/rr52.html units associated with names]"
{|border="1" style="border-collapse: collapse;"
!bgcolor=#cccccc|'''prio'''rity
!bgcolor=#cccccc|Algol68 "Worthy characters"
!bgcolor=#cccccc|+Algol68<sup>Rev1</sup>
!bgcolor=#cccccc|+Algol68<sup>C</sup>
!bgcolor=#cccccc|+Algol68<sup>Rev0</sup>
|-
|ALIGN=CENTER| effectively 0 || :=, =:, = , :=:, :/=:, '''is''', '''isnt''', '''of''', '''at'''|| :≠:, : || :~=: || '''ct''', ::, '''ctab''', ::=, .., '''is not''', →, @
|}
 
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¢
 
note: I pulled most of the above from http://en.wikipedia.org/wiki/ALGOL_68
 
[[User:NevilleDNZ|NevilleDNZ]] 13:11, 29 September 2009 (UTC)