[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Help-smalltalk] AbstractAutoload
From: |
Denis Washington |
Subject: |
[Help-smalltalk] AbstractAutoload |
Date: |
Thu, 06 Jan 2011 10:30:56 +0100 |
User-agent: |
Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.13) Gecko/20101230 Lanikai/3.1.7 |
Hi,
First of all, I'd like to introduce myself. My name is Denis Washington,
and I am a student living in Berlin, Germany. I just stumbled upon GNU
Smalltalk a few months ago, and I must say I love it! I am really
impressed by the beauty of Smalltalk, especially when being able to use
it in the "for-those-who-can-type" style that GNU Smalltalk supports.
Many thanks to Paolo and everyone else who made this happen!
I am currently playing with the idea of implementing GObject
Introspection [1] bindings for GNU Smalltalk, which would allow the
run-time generation of bindings for GObject libraries with the
appropiate introspection metadata. This does not only include GTK+ and
Glib, but many others such as Clutter and GStreamer, for which we would
then have bindings "for free". I don't know if I have the skills needed
to do this (I know C fairly well, but am only learning Smalltalk), but I
guess it doesn't hurt to try. ;)
Anyway, here is my actual question. I want to implement the bindings
generation lazily - a GObject class should be bound only if and when it
is first needed. I looked through the base classes and found out that
there is an Autoload class which does something similar, but only does
autoloading through file-ins. Therefor, I propose the addition of an
AbstractAutoload as a superclass of Autoload where most functionality of
Autoload is moved, plus the ability to let subclasses specify how a
class is autoloaded. For instance, it could have a class method
class:in:loadDo: that allows to create subclasses like the following:
AbstractAutoload subclass: GObjectAutoload [
class: nameSymbol in: aNamespace [
^super
class: nameSymbol
in: aNamespace
load: [
"Create wrapper for GObject class and return it"
];
yourself
]
]
Such an AbstractAutoload would probably also have other uses, for
instance for other automatic bindings or similar magic.
What do you think?
Regards,
Denis
- [Help-smalltalk] AbstractAutoload,
Denis Washington <=