1. Re: Digest for EUforum at topica.com, issue 6333

Chris Bensler wrote:
> 
> ags wrote:
> > 
> >  Take "$ for sequence length" for example; I don't like it, but at least
> > I don't have to use it (and I don't).
> > 
> 
> Au contraire. Regardless if you use it or not, $ still affects your code.
> The whole side-effects issue that forces us to split up assignment statements
> that contain subscripts and/or function calls is due to $.

Ah, I wasn't really aware of that.

> I don't like it either. I think it was a rather poor choice to choose a very
> slight increase in speed over properly functioning code.
> I would be perfectly fine with it, if it were just syntactic sugar, since it
> is a useful shorthand.

I think it hinders the readability of the code.  But hey, it's there and I'm
certainly not advocating removing it smile smile  And I'm sure I'll get used to
seeing it at least.

> > As far as accessing sequence members by name, I'm leaning toward a system
> > where
> > it is just syntactic sugar that doesn't affect the back end at all.  By the
> > time it gets to execute.e it should be unchanged from the code that worked
> > before.
> >  So it should be something done in the lexer.  IMHO :)
> 
> To make support for structures in the front end only would require either
> A) some kind of casting syntax
> or
> B) limiting support for structures to statically declared variables only
> 
> If we need to use casts, I don't know that it's worth implementing.

Well look at what we have to do now; if you want some kind of structure in a
sequence you declare a bunch of constants, FIRST = 1, SECOND = 2, THIRD = 3 etc.

It's not a big deal, but changing the position of a field or inserting a new one
involves renumbering anything after that, which can easily lead to errors
(missing a number, or duplicating etc).

In order to separate each of these field name lists in the code you need a
prefix on the constants for each type of structure.

So if there was a way to automate the creation of these field name lists, and
preferably associate them somehow with a sequence then that would be good.  To
have them private to some kind of sequence would be ideal, but not an absolute
necessity, given what we currently have.

To just automate the creation of the lists would be an acceptable first step (ie
enums :)

Gary

new topic     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu