I'm working on modernizing Rosetta Code's infrastructure. Starting with communications. Please accept this time-limited open invite to RC's Slack.. --Michael Mol (talk) 20:59, 30 May 2020 (UTC)

User talk:Mbishop

From Rosetta Code

Thanks for helping me out with the blog Martin. Maybe I'll just be on milestone and huge activity watch for a while (I've been checking on the statistics page every once in a while looking for something cool like 400 useful pages). When I'm done at my co-op maybe I'll be able to spend my Saturdays figuring out the IRC logging bot or MediaWiki bot. --Mwn3d 21:14, 9 January 2009 (UTC)

No problem, I current don't have a job, so I've got plenty of time, and it's pretty fun. Also one of the best parts of contributing (at least for me) was seeing my name on the blog :D --Mbishop 22:06, 9 January 2009 (UTC)

Omit from placement[edit]

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. --Mwn3d 19:49, 24 September 2009 (UTC)

Algol language file[edit]

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 - BEGIN/EXIT/END, IF/THEN/ELSE/FI, CASE/IN/OUT/ESAC, FOR/FROM/BY/TO/WHILE/DO/OD, MODEs and OPerators. Normally bolded.
  • OPerators - can be special characters, see below.
  • names - alphanumeric starting with alphabetic, spaces in the middle are ignored. Normally italiced.
    • 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 several 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.

Also bold words can be places in single quotes if bolding is not available on a particular computer:

  • 'IF' ~ 'THEN' ~ 'ELSE' ~ 'FI' - this is called quote stropping.

There are several other forms of stropping, but for simplicity you can probably ignore these.

If you want to make things really interesting, Algol68 was internationalised in 1968. Hence it supports other character sets, including Cyrillic: eg

(The Official report is also available in several other languages, including Braille because Algol68 was a UN/UNESCO sponsored language!!)

Special characters for operators[edit]

You will have fun with these:

The ∨, ∧, ¬, ≠, ≤, ≥, ×, ÷, ⌷, ↑, ↓, ⌊, ⌈ and ⊥ characters can be found on the wp:IBM 2741 keyboard with the APL "golf-ball" print head inserted, these became available in the mid 1960s while ALGOL 68 was being drafted. {c.f. IBM code pages 293, 907 & 910}

Notes:

  • 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.
  • binary/nibble/octal/hexidecimal literals are of the form 2r1001, 4r32100123, 8r12345670, 16r123456789abcdef0 respectively.

BOLD symbols and reserved words as typically printed[edit]

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 my C-style hybrid names.}

More specific details and examples[edit]

Monadic operators[edit]

priority Algol68 "Worthy characters" +Algol68Rev1 +Algol68C,G +Algol68Rev0
10 not, up, down, lwb, upb,

-, abs, arg, bin, entier, leng, level, odd, repr, round, shorten

¬, ↑, ↓, ⌊, ⌈ ~ ╰, ╭

Standard dyadic operators with associated priorities[edit]

priority Algol68 "Worthy characters" +Algol68Rev0&Rev1 +Algol68C,G +Algol68Rev0
9 +*, i +×, ⊥
8 shl, shr, **, up, down, lwb, upb ↑, ↓, ⌊, ⌈ ╰, ╭
7 *, /,  %, over,  %*, mod, elem ×, ÷, ÷×, ÷*, %×, ⌷ ÷:
6 -, +
5 <, lt, <=, le, >=, ge, >, gt ≤, ≥
4 =, eq, /=, ne ~=
3 &, and ∧, /\
2 or ∨, \/
1 minusab, plusab, timesab, divab, overab, modab, plusto,

-:=, +:=, *:=, /:=, %:=, %*:=, +=:

×:=, ÷:=, ÷×:=, ÷*:=,  %×:= ÷::=

Assignation and identity relations etc[edit]

priority Algol68 "Worthy characters" +Algol68Rev1 +Algol68C +Algol68Rev0
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

NevilleDNZ 13:11, 29 September 2009 (UTC)