From b29d57afe23194bd8ce198827b70e168a9d8d526 Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Tue, 30 Jul 2002 23:30:43 -0400 Subject: [PATCH] XML conversion. --- website/overloading.html | 145 +++++++++++++++++++++++---------------- 1 file changed, 85 insertions(+), 60 deletions(-) diff --git a/website/overloading.html b/website/overloading.html index 37652c9..fc28fbc 100644 --- a/website/overloading.html +++ b/website/overloading.html @@ -1,95 +1,120 @@ - - - - - - -Overloading proposal for INTERCAL - - - -
Back to Intercal Home Page -Up to Site Map -$Date: 1998-08-17 13:28:05 $ + + + + + + + + +Overloading proposal for INTERCAL + + + + + + + + +
Back to Intercal Home +PageUp to Site Map$Date: 2002-07-30 23:30:43 $
-
-

Operand Overloading in INTERCAL

-Andrew Arensburger <arensb@cfar.umd.edu> writes:

+


+

Operand Overloading in INTERCAL

-While rereading the INTERCAL reference manual, it occurred to me that -INTERCAL is a bit dated, since the languages whose features it avoids -(Fortran, COBOL, etc.) are pretty much dead. Shouldn't INTERCAL start -avoiding features found in some more modern languages, like C++, Java -and Perl?

- -In this vein, let me suggest a direction for future -development: overloaded operands. I suggest the following syntax:

+

Andrew Arensburger <arensb@cfar.umd.edu> writes:

+ +

While rereading the INTERCAL reference manual, it occurred to me +that INTERCAL is a bit dated, since the languages whose features it +avoids (Fortran, COBOL, etc.) are pretty much dead. Shouldn't +INTERCAL start avoiding features found in some more modern +languages, like C++, Java and Perl?

+ +

In this vein, let me suggest a direction for future development: +overloaded operands. I suggest the following syntax:

         <var>/<expr>
         <expr1>\<expr2>
 
-In the first form, <var> is a variable (16- or 32-bit, scalar or -array). Subsequently, any time it appears as an operand to $ , ~ , & , -V , or ? , it will be silently replaced by <expr>. Thus,

+

In the first form, <var> is a variable (16- or 32-bit, +scalar or array). Subsequently, any time it appears as an operand +to $ , ~ , & , V , or ? , it will be silently replaced by +<expr>. Thus,

-        DO .7/#&77
-        DO :8<-.7
+        DO .7/#&77
+        DO :8<-.7
 
-will have the same effect as

+

will have the same effect as

-        DO :8<-#&77
+        DO :8<-#&77
 
-In the second form, <expr1> is a 32-bit expression, divided into two -16-bit numbers (high 16 bits and low 16 bite). This defines a range. -Any time a variable whose number is in the range thus defined appears -as an operand, it is replaced with the value of <expr2>.

+

In the second form, <expr1> is a 32-bit expression, +divided into two 16-bit numbers (high 16 bits and low 16 bite). +This defines a range. Any time a variable whose number is in the +range thus defined appears as an operand, it is replaced with the +value of <expr2>.

-Furthermore, any time the special token ) appears in <expr2>, -it is replaced with the number of the variable being affected. Thus,

+

Furthermore, any time the special token ) appears in +<expr2>, it is replaced with the number of the variable being +affected. Thus,

         DO #196608\#99
 
-will affect variables .3 through .10, :3 through :10, ,3 through ,10 , -and ;3 through ;10 , replacing them with #99 whenever they appear as -an operand to $ , ~ , & , V , or ? .

+

will affect variables .3 through .10, :3 through :10, ,3 through +,10 , and ;3 through ;10 , replacing them with #99 whenever they +appear as an operand to $ , ~ , & , V , or ? .

-        DO #196608\;)SUB".&)"
-        DO :1<-.9
+        DO #196608\;)SUB".&)"
+        DO :1<-.9
 
-has the same effect as

+

has the same effect as

-        DO :1<-;9SUB".&9"
+        DO :1<-;9SUB".&9"
 
- -Since overloading is not indicated by a keyword, there can be -no PLEASE ABSTAIN FROM OVERLOADING directive, but overloading can be -undone by mapping variable numbers back to their original values.

-There are, of course, various issues that still need to be +

Since overloading is not indicated by a keyword, there can be no +PLEASE ABSTAIN FROM OVERLOADING directive, but overloading can be +undone by mapping variable numbers back to their original +values.

+ +

There are, of course, various issues that still need to be ironed out, but it seems to me that operand overloading can be a -powerful technique, on a par with Perl closures or Java's on-the-fly -class definitions.

- -


- -
Back to INTERCAL Home Page -Up to Site Map -$Date: 1998-08-17 13:28:05 $ +powerful technique, on a par with Perl closures or Java's +on-the-fly class definitions.

+ +
+ + + + + +
Back to INTERCAL Home +PageUp to Site Map$Date: 2002-07-30 23:30:43 $
-

Eric S. Raymond <esr@snark.thyrsus.com>
- - +
+
Eric S. Raymond <esr@snark.thyrsus.com>
+ + -- 2.43.0