Message from discussion Function returning defined type?
Received: by 10.112.39.138 with SMTP id p10mr221445lbk.23.1353487441836;
Wed, 21 Nov 2012 00:44:01 -0800 (PST)
From: David Thompson <dave.thomps...@verizon.net>
Subject: Re: Function returning defined type?
Date: Fri, 16 Nov 2012 23:21:59 -0500
References: <email@example.com> <firstname.lastname@example.org> <email@example.com> <firstname.lastname@example.org> <1ksc1nd.1yb80xblb014uNemail@example.com> <1ksc53v.149dkahtcwjsqNfirstname.lastname@example.org> <ael6v1Frh3sU1@mid.individual.net> <email@example.com> <firstname.lastname@example.org> <email@example.com>
Injection-Info: mx04.eternal-september.org; posting-host="2cc660b1bc17903278ab0ac099cebd84";
logging-data="14058"; mail-complaints-to="ab...@eternal-september.org"; posting-account="U2FsdGVkX1+fQlDzqeovYI4AjjYZ9AcpwcoQo+yYY0s="
X-Newsreader: Forte Agent 3.3/32.846
Content-Type: text/plain; charset=us-ascii
On Mon, 5 Nov 2012 08:48:03 +0000 (UTC), glen herrmannsfeldt
> David Thompson <dave.thomps...@verizon.net> wrote:
> >> In many other languages, substring is an intrinsic function, not
> >> an operator. That allows it to be used on any expression, which
> >> sometimes might be useful. The first language I knew with the
> >> substring operator was HP2000 BASIC. (Is that here Fortran inherited
> >> it from?)
> > Pedantic: As you said elsethread, strictly speaking, it's not an
> > operator in Fortran: in F77 it's one form of primary in an arithmetic
> > character or logical expression as applicable; in F90+ it's (more
> > formally) a data designator, which can be (and often is) an expression
> > primary.
> Yes, I didn't think of any other name for it. There isn't
> a good antonym for function. How about operator-like form?
That works. Or I might focus on 'syntax', such as 'specific syntax',
since to me the main point is that the actual capabilities of
functional and operator-style syntax are basically the same.
For examples, LBOUND(a,n) is almost certainly inline code not an
actual function call, while X/Y for a greater-than-hardware type like
quad float probably calls a runtime support function.
> > C's treatment of array subscripting and struct member
> > selection, and also simple and compound assignments, as operators
> > almost the same as traditional computational operators (like plus) and
> > relational and boolean operators -- rather than another category --
> > was unusual when it was created and still far from universal.
> I was reading since that post that subscripting in Java isn't an
> operator, but it does allow subscripting of expressions of the
> appropirate type, such as method return values. One that I have
> done a few times, is to subscript the return value from get()
> in HashTable.
Java calls it ArrayAccess and it is one form of Primary. It applies to
any value of array type -- where arrays in Java are always objects aka
references. An array can be "hidden" in an Object, but it can only be
subscripted while its type is known to be an array type:
Hashtable<something,int> x ... x.get(...) [ i ] // works but
Hashtable<something,Object> y ... y.get(...) // even if that
// table entry is actually an array must be cast before subscripting