[chuck-users] OOP and Style Qs, Operators
ssalazar at CS.Princeton.EDU
Wed Mar 21 16:55:55 EDT 2007
On Mar 21, 2007, at 12:57 PM, Veli-Pekka Tätilä wrote:
> Hi Spencer,
> Very useful info. I'll snip a lot and only comment the stuff I have
> questions or additions for.
>> Additionally, you can save a little time/memory by using arrays of
>> null UGen references, rather than arrays of UGens.
> Hmm isn't this a bit suspicious, in terms of semantics. I mean the
> of instanciating arrays as though objects where already
> constructed. If they
> are added, that design cannot support classes that lack a
> constructor, singleton classes in which it is private, and abstract
> or interfaces which cannot b instanciated in the first place.
That should be okay--when constructors and abstract classes are
finally implemented in ChucK, the gotchas you mentioned can and
should be caught by the compiler.
> IS string also
> a class? I read something to that effect but cannot find its methods
> anywhere. I don't seem to be able to do much apart from
> concatenating them.
It is a class, but it doesn't have any documented methods (yet).
>>> will there be a template mechanism or the ability to
>> You can always cast them to back to what they were initially, using
>> the $ operator. You just have to actually know what they are.
> Ah that's the question. Quite OK for homogenous stuff but I can
> imagine a design in which this is not known. IN which I have to
> branch on a
> type name. That's a bad smell in OOPy circles often but not always.
> recursive data structure dumpers require, for example, that you
> know whether
> an element is a single item, some reference to an array or object or
> something else. Not very relevant to chucK right now, though, as
> there's no
> serialization support.
Yes, ChucK is definitely not the language for OO purists...
>> don't know yacc either, but in my experience its pretty easy to
>> pick up
>> basics by just reading a .y file.
> Ah I'll take a look. I'll be lazy and ask if there's a direct URL
> to the
> current CHucK yacc grammar. I usually don't get the source, though
> in this
> case it might be beneficial.
You'll probably have to take a look at the source, as the repository
is not online. If you have a cvs client on your machine, then
cvs -d :ext:anon-chuck at cvs.cs.princeton.edu:/cvs checkout chuck_dev/
should also do the trick. Just be sure to replace the ' at ' with an
actually 'at' sign, as I believe the list server automatically
replaces at signs with ' at ' to foil the spam bots.
> With kind regards Veli-Pekka Tätilä (vtatila at mail.student.oulu.fi)
> Accessibility, game music, synthesizers and programming:
> chuck-users mailing list
> chuck-users at lists.cs.princeton.edu
More information about the chuck-users