Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c > #76587

Re: dollar sign in variable name

From glen herrmannsfeldt <gah@ugcs.caltech.edu>
Newsgroups comp.lang.c
Subject Re: dollar sign in variable name
Date 2015-11-20 00:53 +0000
Organization Aioe.org NNTP Server
Message-ID <n2lque$lg$1@speranza.aioe.org> (permalink)
References <de259813-bcaf-4334-9fa8-a2cfff5d2251@googlegroups.com>

Show all headers | View raw


Jay Braun <lyngwyst@gmail.com> wrote:

> I was just playing around in gcc, and named a variable game$time, 
> and a function set_game$time, and the compiler accepted it.  
> The small program linked and ran fine as well.  
> This required no special options.
 
(snip)

> As to my rationale:  I am writing some C code to access variables 
> in a legacy FORTRAN application, and thought it would be "nice" to 
> use the same variable names, e.g.:

The IBM OS/360 Fortran compilers allow $ as a letter. It comes after Z
such that one can

      IMPLICIT INTEGER (A-$)

I believe the VMS compilers do also, as many VMS routines callable
from Fortran have $ in their names.

Note that the OS/360 compilers don't use call by reference for
scalar variables, but call by value result.  That is, copy-in
and copy-out. 

VAX/VMS has %val, %ref, and %descr such that one can override
the default convention for each argument.

-- glen

Back to comp.lang.c | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

dollar sign in variable name Jay Braun <lyngwyst@gmail.com> - 2015-11-19 16:18 -0800
  Re: dollar sign in variable name BartC <bc@freeuk.com> - 2015-11-20 00:27 +0000
    Re: dollar sign in variable name Jay Braun <lyngwyst@gmail.com> - 2015-11-19 16:29 -0800
      Re: dollar sign in variable name Joe Pfeiffer <pfeiffer@cs.nmsu.edu> - 2015-11-19 20:05 -0700
  Re: dollar sign in variable name Richard Heathfield <rjh@cpax.org.uk> - 2015-11-20 00:30 +0000
    Re: dollar sign in variable name Jay Braun <lyngwyst@gmail.com> - 2015-11-19 16:37 -0800
      Re: dollar sign in variable name Ian Collins <ian-news@hotmail.com> - 2015-11-20 13:42 +1300
        Re: dollar sign in variable name BartC <bc@freeuk.com> - 2015-11-20 00:47 +0000
          Re: dollar sign in variable name Philipp Klaus Krause <pkk@spth.de> - 2015-11-21 17:24 +0100
            Re: dollar sign in variable name Philip Lantz <prl@canterey.us> - 2015-11-22 15:37 -0800
      Re: dollar sign in variable name Robert Wessel <robertwessel2@yahoo.com> - 2015-11-19 23:22 -0600
        Re: dollar sign in variable name glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2015-11-20 06:51 +0000
    Re: dollar sign in variable name Keith Thompson <kst-u@mib.org> - 2015-11-20 03:32 -0800
    Re: dollar sign in variable name Ken Brody <kenbrody@spamcop.net> - 2015-11-23 13:27 -0500
  Re: dollar sign in variable name Barry Schwarz <schwarzb@dqel.com> - 2015-11-19 16:41 -0800
  Re: dollar sign in variable name glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2015-11-20 00:53 +0000
  Re: dollar sign in variable name Geoff <geoff@invalid.invalid> - 2015-11-19 21:40 -0800
  Re: dollar sign in variable name David Brown <david.brown@hesbynett.no> - 2015-11-20 11:04 +0100
  Re: dollar sign in variable name Jay Braun <lyngwyst@gmail.com> - 2015-11-20 06:35 -0800

csiph-web