[M3devel] small array in modula-3?

Jay jay.krell at cornell.edu
Sat Nov 17 09:35:10 CET 2007


I forgot to point out something I half agree with -- overloading...We have a plain text index over a very large code base.
Look for "Close", and hypothetically, I'm making up names here, you find File::Close, Window::Close, Session::Close -- not too bad for the implementations, if you can look for "File::Close", but if you want to find the callers, f.Close, w.Close, s.Close, etc...
 
A "problem" with C++ is that the compiler implements it very well, and nothing else comes close.
Good luck evaluating expressions in a debugger, search, "refactoring editors", "wizards" that can change code, etc.
It's neat that Modula-3 is simple enough that the remoting feature can be a separate parser over the one language, instead of having a seperate interface language..
 
But still it is super tempting to have function names qualified by at least the static types of their first parameter or all parameters, if not the dynamic types.
 
Qualification by the dynamic type of the first parameter is if course super common, super popular, even supported in Modula-3.. and maybe in C via function pointers..though at least in C it is obvious when such "switching" is being used (except, even then, it is often hidden by an upper layer -- like, I call ReadFile/WriteFile and then way down under the covers there are drivers to switch between FAT, NTFS, SMB, etc.)
 
As to looseness and "duck typing", well, I see both sides here really..
 
And I am well aware of how buggy code is..
 
 - Jay



> Date: Fri, 16 Nov 2007 22:24:15 +0100> From: lemming at henning-thielemann.de> To: rodney.bates at wichita.edu> CC: m3devel at elegosoft.com> Subject: Re: [M3devel] small array in modula-3?> > > On Fri, 16 Nov 2007, Rodney M. Bates wrote:> > > If you don't want to have to write the module name as a qualifier, you can> > rename a procedure too, with a constant declaration (Procedures in Modula-3> > are actually the same thing a constants of procedure type.)> >> > CONST DoSomething = M.DoSomething> > ...> > DoSomething ( v )> > It would have been nice if PROCEDURE declarations would reflect this, like> in functional languages. Say> > CONST> Sin => PROCEDURE (x: LONGREAL;): LONGREAL> BEGIN> ...> RETURN y;> END;> > This would also be the key for anonymous functions or loops as higher> order functions. Just an idea, it's certainly simpler just to use a> functional language. :-)
_________________________________________________________________
Climb to the top of the charts!  Play Star Shuffle:  the word scramble challenge with star power.
http://club.live.com/star_shuffle.aspx?icid=starshuffle_wlmailtextlink_oct
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://m3lists.elegosoft.com/pipermail/m3devel/attachments/20071117/fd8b1923/attachment-0002.html>


More information about the M3devel mailing list