[GUI] I love GIO.
Sven Panne
Sven.Panne@informatik.uni-muenchen.de
Fri, 14 Feb 2003 21:45:44 +0100
Axel Simon wrote:
> Hm, ok then I see a good reason not to use := . I think it's better to
> stick to Haskell 98 features. But I don't feel very strongly about
> this.
Well, but I do. :-) Granted, ":=" looks better than "=:", but losing H98
compliance just for a small cosmetic thing is rather bad IMHO.
After a look at Yahu/GIO I decided to use set/get/=: in 'HOpenGL: The
Next Generation' :-) instead of the current rather ad-hoc stuff
inherited from C. OpenGL is a state machine and uses state variables
rather extensively, and these map very nicely to Haskell using the
functions above. The only concept Yahu/GIO is missing is the distinction
between read-only, write-only, and "normal" state variables, so I've
adapted it slightly, see:
http://cvs.haskell.org/cgi-bin/cvsweb.cgi/fptools/libraries/OpenGL/Graphics/Rendering/OpenGL/GL/StateVariable.hs?rev=1.1&content-type=text/x-cvsweb-markup
My question is: The attribute/property/state variable pattern seems to
be a more universal concept than I initially thought, so it might be a
good idea to have support for this in the standard libraries. But
exactly how is not completely clear to me, e.g. GIO uses an additional
type variable (for the kind of widget). Any ideas and/or suggestions?
OK, modules like this look rather obvious and small, so why should we
standardize it at all? Linguistic abstraction! Having a set of standard
functions/operators available for a common task is always a good idea,
it makes other people's programs (and old ones written by oneself :-)
much easier to read. Embedding a domain specific language into Haskell
by defining myriads of home-grown operators is often a fine way of
obfuscating a program (Prolog programs are often not much better in this
respect, BTW).
> If := is going to be a reserved symbol one day, then we should perhaps
> not use it. [...]
I wasn't aware of that, but it's just another reason...
Cheers,
S.