Re: Bug in new get()?

new topic     » goto parent     » topic index » view thread      » older message » newer message

Jason Gade wrote:
> 
> CChris wrote:
> > 
> > Jason Gade wrote:
> > > 
> > > CChris wrote:
> > > > What do you mean by this "file variable"?
> > > 
> > > "file variable" -- a variable defined at the top level of a file. It can
> > > hold
> > > state but is not visible to routines outside of that file. Also known as a
> > > "static
> > > variable".
> > > 
> > 
> > Oh, I am so used to calling them "local variables". I thought it was
> > something
> > else...
> 
> Heh. Sorry. To me a local variable is one defined inside a function or a
> procedure
> -- otherwise known as a "private" variable.
> 
> > Actually, there could be something to please the archconservative lobby. I
> > remembered
> > that, initially, I had only extended value() because the whitespace and
> > length
> > information are clearly of less use for get() than for value().
> > 
> > So a possibility could be to:
> > * leave get() and value() alone, alllowing embedded comments;
> > * add a value_from(sequnce s,integer start) which would return the 4 element
> > sequence and would allow to select where to start from. If the string holds
> > several Eu objects, it would be pretty useful, just like find_drom(). get()
> > wouldn't be extended.
> > 
> > What about that? The change will be very easy to implement.
> > 
> > Rob had explicitly stated he preferred to keep the symmetry between get()
> > and
> > value(). Perhaps there is no need to have a symmetrixc get_from().
> 
> Sounds okay to me -- again, I'm just trying to verify my build of
> interpreter/translator/backend.
> If everything had worked then I wouldn't have complained at all.
> 
> > > No, comments are a good thing! As long as they accurately reflect the
> > > code.
> > > 
> > 
> > So a side question is: shouldn't there be mmore comments in the standard
> > files?
> > They are pretty sparse in this respect.
> 
> I think there are two theories on that -- some think that the code should
> "comment
> itself". Personally I would at least prefer an "intent" comment -- "why this
> routine was written" or "what this routine does" kind of thing.
> 
> A lot of the time I'll write the comment before I write any code.
> 
> > If the modification I suggested above was preferred, then the pictture would
> > become as follows:
> > * Get() unchanged;
> > * Get2() unchanged;
> > * get() and value() return Get(), hence a 2 element sequence
> > * value_from() returns Get2(), hence a 4 element sequence.
> 
> I actually think that's a fine idea. What do others think?
> 
> --
> A complex system that works is invariably found to have evolved from a simple
> system that works.
> --John Gall's 15th law of Systemantics.
> 
> "Premature optimization is the root of all evil in programming."
> --C.A.R. Hoare
> 
> j.

  Thank you Jason and CChris,

Unwittingly you just explained to me what 'top level' and 'lower level' meant.
   I never understood this although I see it discussed often.

So readding this forum is not a compleat waste of time even if you don't
understand what they are talking about.

Don Cole

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu