[M3devel] duplicated code and unit names -- M3ID, M3Keyword

Jay K jay.krell at cornell.edu
Thu Jul 16 21:08:23 CEST 2009


I might be able to win just by making m3scan/m3id.i3 not public, changing Module to module in the m3makefile or such.

Or renaming it, same thing really. The unit name only occurs twice. I have to verify nobody uses it outside of m3scan though.

Keeping MxConfig/M3Config duplicates isn't great, because I have MxConfig importing M3Config's constants, and then M3Config would want to have a Get function that called into MxConfig -- circularity..though the constants are generated and that could be copied instead...not a lot of duplication here in any case but I'll see...

 

 - Jay
 


From: jay.krell at cornell.edu
To: m3devel at elegosoft.com
Date: Thu, 16 Jul 2009 18:54:59 +0000
Subject: [M3devel] duplicated code and unit names -- M3ID, M3Keyword



We have some redundancies that are causing me some grief.
 
We have two units called M3ID.
They have no overlap, and could be merged into one.
"No overlap" doesn't mean they are completely unrelated, but sort of.
 
 
More bothersome is that m3-sys\m3scanner
and m3-tools\m3scan have near duplicate code, in particular
the list of tokens and the Classify function.
 
In particular, where people were using libm3\M3Config,
there are problems using instead m3quake\MxConfig, because
this can bring together the two M3IDs.
 
I was going to replace all uses of M3Config with MxConfig.
However to avoid the duplicate M3ID units, I think I'll
keep M3Config and MxConfig more like duplicates of each
other at least for now, to avoid bringing m3quake
into places that have the other M3ID.

M3Config is in libm3 and MxConfig is in m3quake.
m3quake imports m3middle, which has M3ID.
 
Therefore, if you use M3Config and have your own M3ID,
you can't switch to MxConfig without renaming one of the M3IDs.
This does occur in m3-tools.
 
C:\dev2\cm3.2\m3-sys\m3scanner\src\M3Keyword.m3(25):PROCEDURE Classify (READONLY x: ARRAY OF CHAR): TK =
C:\dev2\cm3.2\m3-sys\m3scanner\src\M3Keyword.m3(360):  END Classify;
C:\dev2\cm3.2\m3-tools\m3scan\src\M3ID.i3(12):PROCEDURE Classify (READONLY x: ARRAY OF CHAR): M3Token.T;
C:\dev2\cm3.2\m3-tools\m3scan\src\M3ID.m3(17):PROCEDURE Classify (READONLY x: ARRAY OF CHAR): M3Token.T =


 - Jay
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://m3lists.elegosoft.com/pipermail/m3devel/attachments/20090716/843b237d/attachment-0002.html>


More information about the M3devel mailing list