Re: Infix operator names

From: Bruce C. Baker <bcbakerXX_at_cox.net>
Date: Sun, 1 Apr 2007 18:39:00 -0500
Message-ID: <3oXPh.5711$EJ6.1252_at_newsfe24.lga>


"David Cressey" <cressey73_at_verizon.net> wrote in message news:FvVPh.2867$hI4.2462_at_trndny08...
> After programming in other languages for almost 18 years, I learned
> Pascal.
>
> I found Pascal's infix operators easy to write and, more importantly, easy
> to read. Pascal's infix operators use a few symbols, like "and", "or",
> "div" "mod", and "in" as infix operators. Also "not" as a unary operator.
> I found this easy to take. Especially since there was a complete list of
> them up front in the user manual, so I didn't keep tripping over
> undiscovered ones. Also, unlike the discussion in c.d.t. there were no
> single letter symbol operators.
>
> Note especially the "in" operator. The left operand is an ordinal, and
> the right operand is a set based on the same ordinal, IIRC. SQL's "in"
> is
> a little more general than Pascal's but it's the same idea. I'm not a fan
> of overloading, especially when it comes to making code legible. I'll
> put
> up with it, but I won't enjoy it.
>
> I'm also not a fan of lots of completely mysterious symbols as operators.
> I
> read just a little APL, and decided not to write any of it.
>
> In a programming language that I'm designing as a hobby, I have an infix
> operator called "format". The left operand is of just about any data
> type,
> and the right operand is a character string shaws shows how to format the
> other operand. It yields a character string. This is a little like the
> "to_char" function in Oracle, or the FORMAT statement in Fortran, or some
> feature of Basic that I don't remember. Thus
>
> billing_date format "DD-MMM-YY" might yield "05-DEC-07" as a result. I
> haven't figured out what to call the inverse operator, or even how it
> should
> work.
>

If you're not already familiar with them, you may want to look into C's *printf() and *scanf() library functions.

http://einstein.drexel.edu/courses/CompPhys/General/C_basics/#io Received on Mon Apr 02 2007 - 01:39:00 CEST

Original text of this message