Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
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)
Path: q13ni3823wii.0!nntp.google.com!feeder2.cambriumusenet.nl!feeder1.cambriumusenet.nl!feed.tweaknews.nl!193.141.40.65.MISMATCH!npeer.de.kpn-eurorings.net!npeer-ng0.de.kpn-eurorings.net!border2.nntp.ams2.giganews.com!border4.nntp.ams.giganews.com!border2.nntp.ams.giganews.com!backlog2.nntp.dca.giganews.com!border4.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!news.glorb.com!eternal-september.org!feeder.eternal-september.org!mx04.eternal-september.org!.POSTED!not-for-mail
From: David Thompson <dave.thomps...@verizon.net>
Newsgroups: comp.lang.fortran
Subject: Re: Function returning defined type?
Date: Fri, 16 Nov 2012 23:21:59 -0500
Organization: Poor
Lines: 50
Message-ID: <j99ba8h3h61hp8gq57ourctdica6cjoo1f@4ax.com>
References: <k5tp80$49o$1@speranza.aioe.org> <c49317df-416f-498c-8885-69e9329a39f0@o8g2000yqh.googlegroups.com> <c343a3b1-9f88-4325-9a63-e6dbdd3ce16e@googlegroups.com> <4ef7e682-013d-420a-a7b2-2c456fb398e5@g8g2000yqp.googlegroups.com> <1ksc1nd.1yb80xblb014uN%nospam@see.signature> <1ksc53v.149dkahtcwjsqN%nospam@see.signature> <ael6v1Frh3sU1@mid.individual.net> <k644d4$ubl$1@speranza.aioe.org> <bnbe98lofr7of5v6l015lt361go5vp5u0d@4ax.com> <k77ug2$a5h$1@speranza.aioe.org>
Mime-Version: 1.0
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
Cancel-Lock: sha1:QP26UCY653k+NCD00yCNdxdEuiU=
Bytes: 3895
X-Original-Bytes: 3791
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

On Mon, 5 Nov 2012 08:48:03 +0000 (UTC), glen herrmannsfeldt
<g...@ugcs.caltech.edu> wrote:

> David Thompson <dave.thomps...@verizon.net> wrote:
> 
> (snip)
> 
> >> 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

<snip rest>