🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.misc
Article #130

Re: Modula-3, Fortran, Numbers & Aliens

#130
From: Raul Deluth Miller-Rockwell
Date: Fri, 10 Apr 1992 04:33
71 lines
3538 bytes
Raul Deluth Miller-Rockwell:
   |> Well, in a very real sense, all objects except identifiers are
   |> statically declared.  [...]

Jim Giles:
   You mean, all objects except identifiers _and_ expressions involving
   identifiers.

Actually, I meant all objects except those which depend on i/o.
Which is a pretty significant exception, I'll admit.

   |> [...]  Also, there is a class of identifiers which may only be
   |> declared once.  [...]

   Really?  Please present the mechanism for doing this.

Use an alphanumeric identifier terminated by a colon.

   In particular however, I want the ability to declare identifiers to
   have _some_ fixed attributes and _some_ attributes that are allowed
   to vary.  For example, I want to be able to say that X is a scalar
   floating-point number - those characteristics of X are fixed for
   the life of the program - but I want the actual _value_ of X to be
   allowed to be changed.

Define yourself a verb to modify X.  If you're really paranoid, you
can write yourself a routine which does a static analysis of the
program text to find any instances where X is modified without the use
of this access verb.  If you need to do this sort of thing frequently,
you can call this routine a tool.

   |> [...] Finally, note that a compiler would likely create an
   |> object whose semantics are fixed.

   I don't know what you mean here.  The purpose of _any_ programming
   language is to define the semantics of an algorithm.  As such, the
   compiler always generates something with _some_ fixed properties.
   The question is whether the end user of the language has control
   over which properties are fixed and which aren't.

Yes.

I meant that if you compile a function to take only integer arguments
that you won't be able to pass to it arguments representing fractional
numbers.  The idea is that this is a restriction imposed during
compilation, and is not a property of the code.  Of course, you might
consider compiler invocation parameters to be code.

On the other hand, ain't no compilers of J written yet, so I'm
discussing vaporware, here.

   |>    Expressiveness is just exactly the issue.  J does not let me
   |>    express clearly those constraints that I know when I write
   |>    the code.

   |> It lets me express arbitrary constraints.  Of course, I have the
   |> advantage of having learned the language.

   Really?  Then you can tell me the very thing I keep asking and you
   keep dodging - how do I declare that a given identifier has a
   specific type for the life of the program - yet its _value_ can
   change?

I think I'd define an accessor verb.

Either that or just do a global search for all instances of that name
[though this seems, to me, more useful for maintenence than for
design].

-- 
Raul Deluth Miller-Rockwell                   <rockwell@socrates.umd.edu>
Technical Details
Message-ID: <ROCKWELL.92Apr9233337@socrates.umd.edu>
Path: arc1-ca.pugleaf.net!sparky!uunet!haven.umd.edu!socrates!socrates!rockwell
References: <ROCKWELL.92Apr5115242@socrates.umd.edu> <ROCKWELL.92Apr8231542@socrates.umd.edu> <1992Apr9.174123.19342@newshost.lanl.gov>

Show Full Headers
Complete Article Headers
Newsgroups: comp.lang.misc
Path: arc1-ca.pugleaf.net!sparky!uunet!haven.umd.edu!socrates!socrates!rockwell
From: rockwell@socrates.umd.edu (Raul Deluth Miller-Rockwell)
Subject: Re: Modula-3, Fortran, Numbers & Aliens
In-Reply-To: jlg@cochiti.lanl.gov's message of Thu, 9 Apr 1992 17:41:23 GMT
Message-ID: <ROCKWELL.92Apr9233337@socrates.umd.edu>
Sender: rockwell@socrates.umd.edu (Raul Deluth Miller-Rockwell)
Organization: Traveller
References: <ROCKWELL.92Apr5115242@socrates.umd.edu>
 <ROCKWELL.92Apr8231542@socrates.umd.edu>
 <1992Apr9.174123.19342@newshost.lanl.gov>
Date: Fri, 10 Apr 1992 04:33:37 GMT