[M3devel] [M3commit] CVS Update: cm3

Coleburn, Randy rcolebur at SCIRES.COM
Sat Mar 13 07:49:55 CET 2010


Jay:
I agree "bad examples beget bad code", but I don't need to be lectured.  I didn't create this example code.  The example code is from the "Reactor v4.1 days and was produced by Critical Mass, Inc."
Regardless of how the M3toC interface has changed since that time, it is obvious that the example code was not updated to be consistent with the changes.
Thus, we had an example that failed to even compile, and that's not good either, especially since CM3IDE creates a copy of the example package in your private repository and lets you try to build and run it.
I have repaired this example so that it compiles and runs.
I've also made the change to free the memory to serve as a better exemplar of proper practice, even though it really doesn't affect the running of the program since the program terminates after the message box is closed and no further processing is done.
I agree it was bad style in the first place on the part of the folks at Critical Mass.
Now it is better.
You will probably find other bad style examples, so if you want to fix them, be my guest.
Regards,
Randy

From: jayk123 at hotmail.com [mailto:jayk123 at hotmail.com] On Behalf Of Jay K
Sent: Saturday, March 13, 2010 1:36 AM
To: Coleburn, Randy; m3devel
Subject: RE: [M3devel] [M3commit] CVS Update: cm3

Bad examples beget bad code. Bad (and good) examples get copied into real code.
Don't make them.
It wasn't a rename, it was I believe a semantic change accompanied by a rename.
Better to not compile than compile and be incorrect.

 - Jay

________________________________
From: rcolebur at SCIRES.COM
To: jay.krell at cornell.edu; m3devel at elegosoft.com
Date: Sat, 13 Mar 2010 00:57:00 -0500
Subject: Re: [M3devel] [M3commit] CVS Update: cm3
Jay:

This is example code.

The program terminates after the message box is displayed.  There is no further processing.

I did not write this example; I merely fixed it to compile again after someone changed the names of the procedures in the M3toC interface.

Nevertheless, it is probably a bad "example" to foist on people by not also following the established pattern of freeing the storage , so I'll make a modification for this shortly.

Regards,
Randy

From: jayk123 at hotmail.com [mailto:jayk123 at hotmail.com] On Behalf Of Jay K
Sent: Friday, March 12, 2010 11:47 PM
To: m3commit at elegosoft.com; Coleburn, Randy
Subject: RE: [M3commit] CVS Update: cm3

This change is suspicious. I think it leaks.

Please see http://modula3.elegosoft.com/cgi-bin/cvsweb.cgi/cm3/m3-libs/libm3/src/os/WIN32/FSWin32.m3?rev=1.7;content-type=text%2Fplain<http://modula3.elegosoft.com/cgi-bin/cvsweb.cgi/cm3/m3-libs/libm3/src/os/WIN32/FSWin32.m3?rev=1.7;content-type=text/plain>

for the pattern that is usually used.

Granted, given the conservativeness of the collector -- it finds stuff in registers and the stack without a need for metadata telling it where the points are, and the fact that we no longer have VM-synchronization, I don't understand the need for the usual pattern. Maybe because it is willing to move stuff? Therefore a non-traced copy is made for C that won't ever move?

 - Jay

> Date: Sat, 13 Mar 2010 02:11:24 +0000
> To: m3commit at elegosoft.com
> From: rcoleburn at elego.de
> Subject: [M3commit] CVS Update: cm3
>
> CVSROOT: /usr/cvs
> Changes by: rcoleburn at birch. 10/03/13 02:11:24
>
> Modified files:
> cm3/examples/calling-c-win32/src/: OK.m3
>
> Log message:
> M3toC.TtoS has been renamed to M3toC.SharedTtoS, so make adjustments to Ok.m3 so that it will compile.--R.Coleburn
>

________________________________
CONFIDENTIALITY NOTICE: This email and any attachments are intended solely for the use of the named recipient(s). This email may contain confidential and/or proprietary information of Scientific Research Corporation. If you are not a named recipient, you are prohibited from reviewing, copying, using, disclosing or distributing to others the information in this email and attachments. If you believe you have received this email in error, please notify the sender immediately and permanently delete the email, any attachments, and all copies thereof from any drives or storage media and destroy any printouts of the email or attachments.

EXPORT COMPLIANCE NOTICE: This email and any attachments may contain technical data subject to U.S export restrictions under the International Traffic in Arms Regulations (ITAR) or the Export Administration Regulations (EAR). Export or transfer of this technical data and/or related information to any foreign person(s) or entity(ies), either within the U.S. or outside of the U.S., may require advance export authorization by the appropriate U.S. Government agency prior to export or transfer. In addition, technical data may not be exported or transferred to certain countries or specified designated nationals identified by U.S. embargo controls without prior export authorization. By accepting this email and any attachments, all recipients confirm that they understand and will comply with all applicable ITAR, EAR and embargo compliance requirements.

________________________________
CONFIDENTIALITY NOTICE: This email and any attachments are intended solely for the use of the named recipient(s). This email may contain confidential and/or proprietary information of Scientific Research Corporation. If you are not a named recipient, you are prohibited from reviewing, copying, using, disclosing or distributing to others the information in this email and attachments. If you believe you have received this email in error, please notify the sender immediately and permanently delete the email, any attachments, and all copies thereof from any drives or storage media and destroy any printouts of the email or attachments.

EXPORT COMPLIANCE NOTICE: This email and any attachments may contain technical data subject to U.S export restrictions under the International Traffic in Arms Regulations (ITAR) or the Export Administration Regulations (EAR). Export or transfer of this technical data and/or related information to any foreign person(s) or entity(ies), either within the U.S. or outside of the U.S., may require advance export authorization by the appropriate U.S. Government agency prior to export or transfer. In addition, technical data may not be exported or transferred to certain countries or specified designated nationals identified by U.S. embargo controls without prior export authorization. By accepting this email and any attachments, all recipients confirm that they understand and will comply with all applicable ITAR, EAR and embargo compliance requirements.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://m3lists.elegosoft.com/pipermail/m3devel/attachments/20100313/1ad1f5d8/attachment-0002.html>


More information about the M3devel mailing list