<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
--></style>
</head>
<body class='hmmessage'>
Any reuse is too obscuring and not worthwhile if the functions already fit on a page?<BR>
Huh.<BR>
 <BR>
 <BR>
By that metric, setop, setop2, m3cg_set_compare aren't needed either.<BR>
Actually I do find setop vs. setop2 a *little* hard to read.<BR>
And I hope to soon get rid of two out of its three uses pretty soon (set_singleton, member), maybe tonight.<BR>
 <BR>
 <BR>
The relationship between eq and ne seems among the strongest, except for all the other comparisons.<BR>
 <BR>
 <BR>
Actually I'm not sure I "like" a lot here.<BR>
There is or can be enough similarity in the backends, that the frontend probably should just generate either inline code or calls to portable Modula-3 functions, at least lt/le/gt/ge, and to memcmp for eq/ne.<BR>
singleton/member I'm a bit on the fence.<BR>
They can be generated portably inline with pretty small code, though that'd take away the ability of m3back to easily know to use bt/bts instructions.<BR>
 <BR>
 <BR>
You know, my big "fight" is with "too much code". Anything that the frontend can do pretty darn well, is better than doing it in multiple backends. "More higher level operations" are most useful so a "simpler" backend, such as m3back but not gcc, can more easily generate better code.<BR>
 <BR>
 <BR>
 - Jay<BR> <BR>

<HR id=stopSpelling>
<BR>
Subject: Re: set operations parse.c?<BR>From: hosking@cs.purdue.edu<BR>Date: Wed, 3 Mar 2010 22:27:55 -0500<BR>CC: m3devel@elegosoft.com<BR>To: jay.krell@cornell.edu<BR><BR><BR><BASE>
<DIV><SPAN style="TEXT-TRANSFORM: none; TEXT-INDENT: 0px; BORDER-COLLAPSE: separate; FONT: 12px Helvetica; WHITE-SPACE: normal; LETTER-SPACING: normal; COLOR: rgb(0,0,0); WORD-SPACING: 0px" class=ecxApple-style-span><SPAN style="TEXT-TRANSFORM: none; TEXT-INDENT: 0px; BORDER-COLLAPSE: separate; FONT: 12px Helvetica; WHITE-SPACE: normal; LETTER-SPACING: normal; COLOR: rgb(0,0,0); WORD-SPACING: 0px" class=ecxApple-style-span>
<DIV style="WORD-WRAP: break-word"><SPAN style="TEXT-TRANSFORM: none; TEXT-INDENT: 0px; BORDER-COLLAPSE: separate; FONT: 12px Helvetica; WHITE-SPACE: normal; LETTER-SPACING: normal; COLOR: rgb(0,0,0); WORD-SPACING: 0px" class=ecxApple-style-span><SPAN style="TEXT-TRANSFORM: none; TEXT-INDENT: 0px; BORDER-COLLAPSE: separate; FONT: 12px Helvetica; WHITE-SPACE: normal; LETTER-SPACING: normal; COLOR: rgb(0,0,0); WORD-SPACING: 0px" class=ecxApple-style-span><SPAN style="TEXT-TRANSFORM: none; TEXT-INDENT: 0px; BORDER-COLLAPSE: separate; FONT: 12px Helvetica; WHITE-SPACE: normal; LETTER-SPACING: normal; COLOR: rgb(0,0,0); WORD-SPACING: 0px" class=ecxApple-style-span><SPAN style="TEXT-TRANSFORM: none; TEXT-INDENT: 0px; BORDER-COLLAPSE: separate; FONT: 12px Helvetica; WHITE-SPACE: normal; LETTER-SPACING: normal; COLOR: rgb(0,0,0); WORD-SPACING: 0px" class=ecxApple-style-span><SPAN style="TEXT-TRANSFORM: none; TEXT-INDENT: 0px; BORDER-COLLAPSE: separate; FONT: 12px Helvetica; WHITE-SPACE: normal; LETTER-SPACING: normal; COLOR: rgb(0,0,0); WORD-SPACING: 0px" class=ecxApple-style-span><SPAN style="TEXT-TRANSFORM: none; TEXT-INDENT: 0px; BORDER-COLLAPSE: separate; FONT: 12px Helvetica; WHITE-SPACE: normal; LETTER-SPACING: normal; COLOR: rgb(0,0,0); WORD-SPACING: 0px" class=ecxApple-style-span><SPAN style="TEXT-TRANSFORM: none; TEXT-INDENT: 0px; BORDER-COLLAPSE: separate; FONT: 12px Helvetica; WHITE-SPACE: normal; LETTER-SPACING: normal; COLOR: rgb(0,0,0); WORD-SPACING: 0px" class=ecxApple-style-span><SPAN style="TEXT-TRANSFORM: none; TEXT-INDENT: 0px; BORDER-COLLAPSE: separate; FONT: 12px Helvetica; WHITE-SPACE: normal; LETTER-SPACING: normal; COLOR: rgb(0,0,0); WORD-SPACING: 0px" class=ecxApple-style-span>
<DIV><SPAN style="FONT-SIZE: medium" class=ecxApple-style-span>It obscures the simple intent of the eq/ne operations, and conflates them with other similarly simple set operations.</SPAN></DIV>
<DIV><SPAN style="FONT-SIZE: medium" class=ecxApple-style-span><BR></SPAN></DIV>
<DIV><SPAN style="FONT-SIZE: medium" class=ecxApple-style-span>Agreed, the implementations now vary in only one token, but I can read them each in a single page of my editor and validate their correctness without having to trace through multiple calls and track a flag value in context along the way.</SPAN></DIV>
<DIV><SPAN style="FONT-SIZE: medium" class=ecxApple-style-span><BR></SPAN></DIV>
<DIV><SPAN style="FONT-SIZE: medium" class=ecxApple-style-span>On 3 Mar 2010, at 19:45, Jay K wrote:</SPAN></DIV></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></DIV></SPAN></SPAN></DIV>
<DIV><BR class=ecxApple-interchange-newline>
<BLOCKQUOTE><SPAN style="TEXT-TRANSFORM: none; TEXT-INDENT: 0px; BORDER-COLLAPSE: separate; FONT: medium Helvetica; WHITE-SPACE: normal; LETTER-SPACING: normal; WORD-SPACING: 0px" class=ecxApple-style-span>
<DIV style="FONT-FAMILY: Verdana; FONT-SIZE: 10pt" class=ecxhmmessage>The flag to setop is maybe yucky, but I think<BR> static void m3cg_set_eq (void) { m3cg_set_eq_or_ne(EQ_EXPR); }  <SPAN class=ecxApple-converted-space> </SPAN><BR> static void m3cg_set_ne (void) { m3cg_set_eq_or_ne(NE_EXPR); }<SPAN class=ecxApple-converted-space> </SPAN><BR><BR> <BR>is still good.<BR>There are two functions *very* similar in functionality that vary in only one token.<BR> <BR> <BR>The counterpoint would be, perhaps, if one is proficient enough<BR>in maintaining parse.c, that the two functions are small and<BR>one could write them up in a flash without referring to examples.<BR></DIV></SPAN></BLOCKQUOTE>
<DIV><BR></DIV>
<DIV>EXACTLY!</DIV><BR>
<BLOCKQUOTE><SPAN style="TEXT-TRANSFORM: none; TEXT-INDENT: 0px; BORDER-COLLAPSE: separate; FONT: medium Helvetica; WHITE-SPACE: normal; LETTER-SPACING: normal; WORD-SPACING: 0px" class=ecxApple-style-span>
<DIV style="FONT-FAMILY: Verdana; FONT-SIZE: 10pt" class=ecxhmmessage>One needs that level of proficiency to make more significant changes anyway.<BR>(I'll be removing the set_singleton/member functions shortly, assuming<BR>reasonable codegen.)<BR> <BR><BR> - Jay<BR><BR></DIV></SPAN></BLOCKQUOTE></DIV><BR>                                     </body>
</html>