Re: Eu improvements (part 4)

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

Karl Bochert wrote:
> 
> Jason Gade wrote:
> > 
> > Karl Bochert wrote:
> 
> > > With that in mind, I would ask those who disagree which category
> > > they place themselves in:
> > > 1) Good ideas, but flawed implementation
> > > 2) I don't like PBR
> > > 3) I don't like SS
> > > 4) Both are instruments of the devil
> > > 5) Irrelevant  -- Euphoria is perfect
> > > 
> > > Ktb
> > 
> > Hmm. I dunno if I can categorize very easily. Maybe I should put myself in
> > #1.
> > 
> > I don't really like SS but I like the idea of dot notation. They really
> > aren't
> > quite the same thing. I just like weaker types but there should be a better
> > way than defining a bunch of global constants.
> >
> Do you object to others using SS? Why?
No, I just don't think I'm explaining myself very well. Maybe because I don't
completely know what I want either smile

> Perhaps what you want is not to avoid SS, but to extend it??
> }}}
<eucode>
>   sequence colors is
>     constant
>         blue = 3, red = 1
>   end sequence
>   ?length(colors)  --> 0 
>   ?colors.blue     --> 3
> </eucode>
{{{

I'm not sure what you mean here... I guess something like that. There's a thread
by James W. Hoffman which I think has a pretty good idea for implementation.

> > Regarding PBR, I haven't really seen any good ideas regarding it yet. I
> > think
> > it should be possible maybe with the addition of a keyword in the function
> > or
> > procedure definition. PBR is only really needed for either very large
> > sequences
> > or for medium sequences that are accessed very many times. Plus there are
> > ways
> > of working around it (again, using globals though).
> > 
> 
> Excessive global variables is one of the things that makes it hard for me to
> comprehend (large) Eu programs. Namespace pollution and loss of locality --
> a global can be changed ANYWHERE!
> For me, the real advantage of PBR is that it allows a function to modify
> one of its parameters AND return a flag (without using a global or an
> extraneous sequence)
> 
> 
> KtB
I'm not really arguing with the need for it, just that I haven't seen a good
implementation. I know I've discussed with Rob on this list before whether it
could be done transparently. That is if the compiler recognizes a pattern like
this:
mySeq = DoSomethingTo(mySeq)

and avoid making a copy that would be good. I guess you lose your return flag
that you mention above, though. And you wouldn't be able to do it with a
procedure.

One problem with PBR is that it shouldn't surprise the programmer. Surprise
and/or side-effects can be a source of bugs. So another suggestion would be to
use a keyword in the function definition so it is explicit. Hmm. I tried to come
up with an example but I don't have one.

Anyway I'm just reading and thinking about these things. Part of me likes
Euphoria just the way it is and part of me would like to see improvements made.

--
"Any programming problem can be solved by adding a level of indirection."
--anonymous
"Any performance problem can be solved by removing a level of indirection."
--M. Haertel
"Premature optimization is the root of all evil in programming."
--C.A.R. Hoare
j.

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

Search



Quick Links

User menu

Not signed in.

Misc Menu