Article View: comp.lang.misc
Article #147Re: Types, arrays, generality, and notation (was: Fortran90 and Arrays)
From: Raul Deluth Miller-Rockwell
Date: Sat, 11 Apr 1992 03:27
Date: Sat, 11 Apr 1992 03:27
51 lines
2959 bytes
2959 bytes
Jim Giles: In J it is apparently possible for type information to come from I/O. There's two ways for this to happen. First, J objects can be saved and recovered via operating system mechanisms (files). These _are_ associated with identifiers. [Perhaps there ought to be some sort of general predicate mechanism to protect these? If so, what do you do when you find out that there's a bug in your specification? Rebuild the entire file system from scratch?] J can also accept random character data and, via interpreter operations, execute these as random expressions. This can be a great way to shoot yourself in the foot, but it can also be a great way of giving users control over their data. Certainly two different paths through the code may define these characteristics differently. How do you apply static tests to things that can inherently vary at run-time according to the very definition of the language? Either specify a statically useful test or live without it. Assume here that a certain amount of flow analysis will be used by the hypothetical compiler. |> But clearly both slightly broken and excessively restrictive: on |> the one hand the IDENTITY needs to be specified (in case the |> array is empty); and the DIRECTED reduce operator requires only |> that the function be in (T x U) -> U (resp. (U x T) -> U), where |> T is the element type of the array and U is the result type and |> the type of the identity element. Good point. However J doesn't appear to have this property either (or no one has seen fit to describe it). IDENTITY is a property of the built in operators, and may thus be derived for many user-defined operators. Thus far, only the left identity is supported, and there's no general mechanism for specifying an arbitrary identity element for an operation. Some function definition methods don't allow for an identity element, so you can't use these operations to "reduce an empty vector" -- unless you provide your own reduction operator. Note that it's pretty easy to define an arbitrary reduction operator in J. How arbitrary would depend on the problem you're trying to solve. -- Raul Deluth Miller-Rockwell <rockwell@socrates.umd.edu>
Technical Details
Message-ID:
<ROCKWELL.92Apr10222719@socrates.umd.edu>Path:
arc1-ca.pugleaf.net!sparky!uunet!haven.umd.edu!socrates!socrates!rockwellReferences:
<ROCKWELL.92Mar21001252@socrates.umd.edu> <STEPHEN.92Apr9220641@estragon.uchicago.edu> <1992Apr10.093445.26931@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: Types, arrays, generality, and notation (was: Fortran90 and Arrays) In-Reply-To: jlg@cochiti.lanl.gov's message of 10 Apr 92 09:34:45 GMT Message-ID: <ROCKWELL.92Apr10222719@socrates.umd.edu> Sender: rockwell@socrates.umd.edu (Raul Deluth Miller-Rockwell) Organization: Traveller References: <ROCKWELL.92Mar21001252@socrates.umd.edu> <STEPHEN.92Apr9220641@estragon.uchicago.edu> <1992Apr10.093445.26931@newshost.lanl.gov> Date: Sat, 11 Apr 1992 03:27:19 GMT Lines: 51