[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: what most every language is missing :-)




Wow!  I seem to have started something a lot more serious than I had
intended.  I, too, had realized that this feature could have actual
uses, but I still think I came up with some pretty spiffy applications
for it.  :-)

I made a simple implementation of this, essentially making a "is-type-
of" operator.  That makes sense.  I guess the absurd quality I was
looking for was if the operator's value was simply random, but you
tried to use it as if it would produce predictable results.  Oh
well.  Maybe I'll do better next time!

 -- Trevis


Guy Steele - Sun Microsystems Labs wrote:
> 
>
> It's dangerous to make jokes about programming languages:
> almost every parody feature you can think of has already
> been tried out seriously.
> 
> In this case, for interval arithmetic, where a numerical
> quantity is represented by a lower and upper bound for
> a segment of the real number line that contains the
> quantity of interest, sometimes the best you can do
> is ask whether "x possibly equals y".  Sun Fortran supports
> interval arithmetic and provides 12 comparison operators:
> 
>         x .CLT. y       certainly(x .LT. y)
>         x .CLE. y       certainly(x .LE. y)
>         x .CEQ. y       certainly(x .EQ. y)
>         x .CGE. y       certainly(x .GE. y)
>         x .CGT. y       certainly(x .GT. y)
>         x .CNE. y       certainly(x .NE. y)
> 
>         x .PLT. y       possibly(x .LT. y)
>         x .PLE. y       possibly(x .LE. y)
>         x .PEQ. y       possibly(x .EQ. y)
>         x .PGE. y       possibly(x .GE. y)
>         x .PGT. y       possibly(x .GT. y)
>         x .PNE. y       possibly(x .NE. y)
> 
> "I am not making this up."  This is actually useful.
> 
> --Guy Steele