This is the mail archive of the guile@sourceware.cygnus.com mailing list for the Guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

goops/guile doc (was Re: Simple example program to illustrate Goops)


Neil Jerram wrote:
> 
> Julien Rousseau writes:
> 
>    Hi everyone,
> 
>    I read (quite all) the GOOPS tutorial yesterday and
>    was wondering where I could find a program using it
>    that would be simple enough for a newbie to grasp it
>    (that is not to big, nor using obscure features of
>    Goops) but complete enough to illustrate its use.
> 
>    If there is no such program (yet) I may take the time
>    (although not before at least next week) to make such
>    one when I understand Goops better and if people are
>    interested/can give me some clue about what it should
>    cover.
> 
> Take a look at the following.  It's undocumented, sadly, but it does
> at least demonstrate
> - defining a class
> - defining methods for that class
> - use of slot accessors.
> 
> Does this help you at all?
> 

Helps me for one, but I'm afraid if I showed it to the pythonites at the
office it would only reinforce their Fear of Scheme.

One of the things Python has going for it is that the OO parts _look_
like OO parts - you can visually pick out, at a glance, the OO
structure.  (Assuming that for 90% of the tech world C++ and/or VB
defines OOness.)  I think for simple example intended to give newbies a
quick grasp of the essence of goops we need a standard animal/dog/cat or
shape/rectangle/circle example.  Also, I would recommend adopting the
assumption that new readers already have some familiarity with OO, and
that said familiarity was bred in the quagmire of C++, VB, possibly
Perl.  Or maybe two intros are needed, one for complete neophytes and
another tailored for experienced OO programmers trying to break their
bad habits.  In particular, it would be good to specifically compare
goops code with the equivalent code in other languages.

Since I don't have time to do it myself I'll throw this out as a
suggestion:  the goops doco (like the guile doco in general) should
track the documentation of perl and python.  That is, the sample
programs and examples in the Camel book, for example, should be
explicitly included in guile docs, on the assumption that most people
who are going to look at guile have already looked at its main
competitors.  Plus, that way the doco will have preemptively covered
questions of the "I can do foo in python; how do you do it in guile?"
variety.

Maybe that's a subproject for guile application programmers: go through
the perl cookbook and the python book, etc. and write guile programs to
do the same things.  An example picked at random from the 1992 edition
of the camel book:  p 38, "Words versus Lines versus Paragraphs",
discusses using "$/" to operate on whole paragraphs, so that searches
will find hyphenated words split over lines.  A seven-liner, no real
programming needed, and really useful.  Guile must be able to match this
kind of stuff, and it must be easy for newcomers to figure out how.

-gregg

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]