Path: utzoo!mnetor!uunet!lll-winken!lll-tis!ames!killer!ltf From: ltf@killer.UUCP (Lance Franklin) Newsgroups: comp.lang.c Subject: Re: Of Standards and Inventions: A Cautionary Tale Message-ID: <3808@killer.UUCP> Date: 13 Apr 88 04:54:07 GMT References: <10949@mimsy.UUCP> <40@lakart.UUCP> Reply-To: ltf@killer.UUCP (Lance Franklin) Organization: The Unix(R) Connection BBS, Dallas, Tx Lines: 41 In article <40@lakart.UUCP> dg@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@killer | | incredibly insightful .signature quote. Send Now! | +------------------+ +------------------------------------------------------+