Re: A rather dreamy request...
- Posted by Irv <irv at ELLIJAY.COM> Aug 19, 1998
- 612 views
Hawke wrote: ...<snip> > Here goes: > In euphoria, you have three data types: atoms, sequences, > and objects. A sequence can be either a collection > of atoms, atoms & sequences, or sequences of sequences. > An object can be either an atom or sequence. > Nothing but the obvious so far..right? Onwards. > We have all been talking about OOP, dotnotations, > etc.etc.etc. blahblahblah ad nauseum... > What is the difference between Pascal/C and euph? > Data structures can contain procedure/function names. > It becomes the 'method', the way of calling a function > if an *element* is addressed. ....<snip> The real difference? In C or Pascal, you can declare an element of a structure to be: integer, string, func, proc, etc.... Euphoria doesn't allow that. There's the prob. You have: a. lost the ability to type-check stuff going into a structured variable, and b. the program no longer has any way to tell what is legal to do with that variable. > btnStartTimer[color] = {129,223,59} --RGB for font(trucolor??) > btnStartTimer[sunken] = FALSE --false is raised/etched > btnStartTimer[clicked] = --this is the idea... > ====end pseudocode====== > > see, btnStartTimer[clicked] would somehow be a *function*... Yes. and btnStartTimer[sunken] would be boolean. If there was a byte stored with that element of the structure, Euphoria could examine the byte and decide how to handle the request (either make an assignment or return a value) in the same manner it does now with: x = 0 if x then ... -- where x is 1 or 0. I don't know how difficult such a thing might be to add. But all the discussion on these subjects is leading the same way: simpler and more versatile syntax. Regards, Irv