Data update

This commit is contained in:
Ingy döt Net 2024-10-16 18:07:41 -07:00
parent 81fd053722
commit 52a6ef48dd
10248 changed files with 63654 additions and 6775 deletions

View file

@ -1,11 +1,15 @@
# Inverted assignment #
# Assignment in Algol 68 is via ":=" which is automaically provided for all modes (types) #
# However we could define e.g. "=:" as an inverted assignment operator but we would need to #
# define a separate operator for each mode, e.g. for integers and strings: #
# define a separate operator for eaach mode, e.g. for integers and strings: #
# also note that although "a := b := c" works as expected ( a and b get set to c ) #
# brckets are need to make "c =: b =: a" work as expected, i.e. ( c =: b ) =: a #
PRIO =: = 1;
OP =: = ( INT a, REF INT b )REF INT: b := a;
OP =: = ( STRING a, REF STRING b )REF STRING: b := a;
OP =: = ( CHAR a, REF STRING b )REF STRING: b := a;
OP =: = ( INT ia a, REF INT ia b )REF INT: ia b := ia a;
OP =: = ( STRING ia a, REF STRING ia b )REF STRING: ia b := ia a;
OP =: = ( CHAR ia a, REF STRING ia b )REF STRING: ia b := ia a;
# examples #
INT a, b; STRING s;
1 =: a;
a + 1 =: b;
@ -19,9 +23,9 @@ print( ( a, b, s, newline ) );
print( ( s, newline ) );
# Inverted Conditional Expressions #
# We could define an operator called WHEN perhaps, that would execute its left operand if #
# We cuold define an operator called WHEN perhaps, that would execute its left operand if #
# the right operand was TRUE. However the left operand would need to be a PROC VOID so the #
# syntax would not be as convientent as the standard IF-THEN-FI construct. E.g.: #
# syntax would not be as conventient as the standard IF-THEN-FI construct. E.g.: #
PRIO WHEN = 1;
OP WHEN = ( PROC VOID code, BOOL test )VOID: IF test THEN code FI;