Organization of extensions

Lyndon Tremblay humasect at shaw.ca
Wed Nov 17 12:58:12 PST 2004


First an overview; If i have an extension called 'Huma', with one function,
this is how it is currently added to Slate, minimally:

-- src/[lib/]huma.slate

Huma traits atSlotNamed: #parent0 put: ExternalResource traits.
Huma addSlotsFrom: ExternalResource.

h@(Huma traits) justFiller
[ h primFunction ].

-- src/mobius/vm/platform/huma.c

void primFunction ()
{ printf("aString\n"); }

-- src/mobius/vm/platform/include/huma.h

void primFunction (); =)

-- src/mobius/vm/ext/huma.slate

addHeaderNamed: '"huma.h"'.

h at HumaTraits init
[ ('primFunction()' directly. interpreter pushNil ] `pidginPrimitive.

-- adding reference to "src/mobius/vm/ext/huma.slate" in
"src/mobius/vm/build.slate"
-- adding prototype to 'src/mobius/vm/bootstrap.slate' in 2 places

****

Okay, so 4 files, with two called huma.slate. (You could src/huma/lib.slate
too). Here is a way proposed, to organize these within one directory:

src/mobius/vm/ext/huma/ containing: huma.h, huma.slate, huma.pidgin, huma.c

I think the makefiles could be organized as such, what does everyone think?
I would like to clean up this bit, not just for coding organization, but for
distributing extensions based on where Slate is now.

-/_yndon




More information about the Slate mailing list