Re: Namespace request

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

Al Getz wrote:

<snip>

> I think that neither Rob nor anyone else truely understands the power
> of programming that would come out of something like this.  To be able
> to declare a class the same way you declare a variable like 'atom x'
> is quite a powerful programming technique, and the logic behind it
> stems from the way a language progresses anyway:
> 
>   You start with variables, which you include by declaring them:
>     atom a
>   You move toward 'groups' of these things:
>     sequence s
>     s={0,1,23,4}
>   You add function calls:
>     x=myfunc()
>   You add 'include' files which allow you to keep functions and
>   data (variables) in the same file as a set of functions and data.
> 
>   A logical next step is to be able to declare your built up
>   function/data groups as a single object which can be repeated
>   the same way you declare a 'normal' variable:
>     Normal var (Euphoria allows many atoms to be declared):
>       atom a
>       atom b
>     Group (Class):
>       include MyGroup.ew as MG1
>       include MyGroup.ew as MG2
> 
>   and now we have two groups to use as well as two atoms.
> 
>   Maybe a better wording would have been:
>      atom a,b
>      group("MyGroup.ew") MG1, MG2
>   so it ends up being something like a 'type', only a prefix instead.
> 
>   I guess another keyword would be more clear:
> 
>   include class MyGroup.ew as MG1
>   include class MyGroup.ew as MG2
> 
>   ie a Euphoria with classes :)  (the word 'include' is optional).
> 
> 
> Euphoria allows you to 'include' as many atoms and sequences as
> you care to declare, so why not allow you to include (declare) as
> many custom built objects as you care to ?
> Think also about how fast it would be to wrap a class object?
> You wouldnt have to try to 'sequence the living carp' out of 
> everything he he :)  (ie stick every dang thing into some sequence
> somewhere AND maintain them all).
> 
> 
> Al
> 
> 
> My bumper sticker: "I brake for LED's"

I'm not a big fan of OO, but I can see its usefulness. Euphoria includes can
practically be classes as they are, but only as singletons (I think that's the OO
word I'm looking for). Include files can keep state and allow or restrict access
to that state.

But in order to have more than one instance, you have to write a lot of logic in
your include to handle that.

I don't think any new keywords need to be added to make includes work as
classes.

--
"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
j.

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

Search



Quick Links

User menu

Not signed in.

Misc Menu