Of Standards and Inventions: A Cautionary Tale

Lance Franklin ltf at killer.UUCP
Wed Apr 13 14:54:07 AEST 1988


In article <40 at lakart.UUCP> dg at lakart.UUCP writes:
>I throw this into the wind as food for thought. If nobody likes the
>idea, that is all fine and dandy, but I find it a sometimes useful system.
>
>I am in the process of implementing a language in the likes of BCPL and B,
>i.e. variables are typeless. HOWEVER, what I did was to type the appropriate
>operators: so
>
>		-2 / 2	== -1 (signed)
>
>		-2 ./ 2 == 32767 (unsigned) (16 bit implementation)
>
>The ./ is the unsigned divide, similarly .> is unsigned greater etc. etc.
>
>Thoughts anyone?

Well, this sounds familiar...some extended versions of BCPL used this very
same scheme for handling floating point numbers (which were, of course, the
same size (32 bits) as everything else).  Floating point constants were
of the following form:
        i.jEk
        i.j
        iEk
The arithmetic and relational operators for floating point quantities were:
        #* #/ #+ #- #= #^= #<= #>= #< #>
with the same precedence as the corresponding integer operations.
 
They also had two monadic funtions FIX(x) and FLOAT(x) for conversion between
integers and floating point numbers.
 
Ah, memories.  One of these days I gotta bring up BCPL on my Amiga...I still
have a copy of Martin Richard's transport tape (MR1084) around here somewhere.
A quick conversion from EBCDIC to ASCII and I'm ready to go!   :-)
 
 


-- 
+------------------+ +------------------------------------------------------+
| Lance T Franklin | |  Now accepting suggestions for clever, humourous or  |
|    ltf at killer    | |  incredibly insightful .signature quote.  Send Now!  |
+------------------+ +------------------------------------------------------+



More information about the Comp.lang.c mailing list