Talk About Network



Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Apl > Re: APL & Progr...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 15 of 38 Topic 1007 of 1019
Post > Topic >>

Re: APL & Programming Concepts

by phil chastney <phil.hates.spam@[EMAIL PROTECTED] > May 10, 2008 at 09:54 PM

AAsk wrote:
> " on a  production line I wanted as strongly typed variables as
> possible as insurance against error."  Curtis
> 
> I don't mind loose or strong typing; however, I find that strong
> typing requires a lot more error handling code. It is interesting that
> VSScript & JavaScript have implicit typing only and C# 3.0 has
> introduced anonymous types.
> 
> APL has neither the requirement to declare variables nor strong
> typing. Typing is an integral programming concept.
> 
> Any ideas on how to 'mimic' typing in APL?

I assume the type of 'typing' you wish to mimic is the declarative style 
commonly used in compiled languages?

if not, ignore the rest of this msg

if so, then what you probably want to do is restrict the set of values 
that a variable may take

....except that APL does everything at runtime, and declaratives are 
compile-time instructions, so the question transforms to "is there some 
way of restricting, at runtime, the set of values that a variable may
take?"

....and now the answer is clearly, Yes

first, observe that such a restriction is but a special-case of 
assertion; then, bear in mind that someone (Susan Gerhardt? 
Copenhagen??) has already shown one way of adding assertions to APL, and 
the problem is solved

choose some suitable symbol for the "assert" command, and use it to 
prefix a predicate, so:
       assert x>0
       assert x<y
etc.

the "cetera" bit could include statements like
       assert x ϵ NNI		
where NNI is the set of non-negative integers (defined externally, 
presumably)

such a mechanism could be used at the start of a function to enforce 
[optional] strong typing on incoming actual values

a similar mechanism can be faked up using
       OK ← ÷x>0
but it's undeniably a lash-up

and there you have it, with very little change to existing syntax

the full semantics of "assert" are open to discussion (handling 
exceptions, whether the restriction be continuing, and other stuff)

assertions could also be made subject to other controls, so that they're 
only operative in a test system, for instance

and it is a useful idea  --  strong typing is necessary any time you 
need to communicate across an interface to a device, another module, 
another machine, but here we are drifting into logical vs. physical 
issues I would prefer to avoid for now

all the best   . . .   /phil




 38 Posts in Topic:
APL & Programming Concepts
AAsk <AA2e72E@[EMAIL P  2008-05-06 11:00:50 
Re: APL & Programming Concepts
pgilbert@[EMAIL PROTECTED  2008-05-06 19:19:16 
Re: APL & Programming Concepts
AAsk <AA2e72E@[EMAIL P  2008-05-06 22:13:30 
Re: APL & Programming Concepts
Gosi <gosinn@[EMAIL PR  2008-05-06 22:36:29 
Re: APL & Programming Concepts
Mb <mebian@[EMAIL PROT  2008-05-07 11:41:17 
Re: APL & Programming Concepts
"Curtis A. Jones&quo  2008-05-07 08:34:14 
Re: APL & Programming Concepts
Mb <mebian@[EMAIL PROT  2008-05-07 19:14:24 
Re: APL & Programming Concepts
"Kerry Liles" &  2008-05-07 13:44:47 
Re: APL & Programming Concepts
Mb <mebian@[EMAIL PROT  2008-05-08 00:53:12 
Re: APL & Programming Concepts
"Curtis A. Jones&quo  2008-05-07 08:42:03 
Re: APL & Programming Concepts
AAsk <AA2e72E@[EMAIL P  2008-05-07 09:05:00 
Re: APL & Programming Concepts
"jk" <aqxqy@  2008-05-07 18:46:37 
Re: APL & Programming Concepts
"David Liebtag"  2008-05-07 14:34:36 
Re: APL & Programming Concepts
"David Liebtag"  2008-05-09 13:37:05 
Re: APL & Programming Concepts
phil chastney <phil.ha  2008-05-10 21:54:22 
Re: APL & Programming Concepts
microapl@[EMAIL PROTECTED  2008-05-07 09:31:53 
Re: APL & Programming Concepts
AAsk <AA2e72E@[EMAIL P  2008-05-07 11:18:26 
Re: APL & Programming Concepts
"jk" <aqxqy@  2008-05-07 23:07:58 
Re: APL & Programming Concepts
Ric <r.g.sherlock@[EMA  2008-05-07 18:07:12 
Re: APL & Programming Concepts
Mb <mebian@[EMAIL PROT  2008-05-08 12:33:11 
Re: APL & Programming Concepts
Randy MacDonald <ramac  2008-05-09 19:07:23 
Re: APL & Programming Concepts
Gosi <gosinn@[EMAIL PR  2008-05-08 04:19:15 
Re: APL & Programming Concepts
Mb <mebian@[EMAIL PROT  2008-05-08 18:13:21 
Re: APL & Programming Concepts
Christopher Browne <cb  2008-05-08 19:48:11 
Re: APL & Programming Concepts
Gosi <gosinn@[EMAIL PR  2008-05-08 13:02:53 
Re: APL & Programming Concepts
microapl@[EMAIL PROTECTED  2008-05-09 02:01:51 
Re: APL & Programming Concepts
Ric <r.g.sherlock@[EMA  2008-05-09 16:54:24 
Re: APL & Programming Concepts
Ric <r.g.sherlock@[EMA  2008-05-09 17:18:43 
Re: APL & Programming Concepts
"Polivka@[EMAIL PROT  2008-05-11 15:55:03 
Re: APL & Programming Concepts
"jk" <aqxqy@  2008-05-12 08:03:21 
Re: APL & Programming Concepts
phil chastney <user@[E  2008-05-12 13:47:27 
Re: APL & Programming Concepts
Randy MacDonald <ramac  2008-05-13 18:03:57 
Re: APL & Programming Concepts
phil chastney <phil.ha  2008-05-13 21:59:03 
Re: APL & Programming Concepts
Randy MacDonald <ramac  2008-05-14 21:57:24 
Re: APL & Programming Concepts
phil chastney <phil.ha  2008-05-15 07:42:40 
Re: APL & Programming Concepts
Steve <steve@[EMAIL PR  2008-05-11 19:53:25 
Re: APL & Programming Concepts
RHui000@[EMAIL PROTECTED]  2008-05-12 11:21:07 
Re: APL & Programming Concepts
Jack <jgrudd@[EMAIL PR  2008-05-12 21:12:11 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri May 16 10:17:28 CDT 2008.