DefMod Syntax
Tony van der Hoff
OSLib at mk-net.demon.co.uk
Thu Mar 9 14:58:15 GMT 2000
On Wed, 8 Mar 2000, at 23:39:12, Tom Hughes <tom at compton.nu> wrote on
the subject "DefMod Syntax":
>In message <200003081944.LAA06788 at purple.trimedia.sv.sc.philips.com>
> "Jonathan Coxhead" <jonathan at doves.demon.co.uk> wrote:
>
>> Are you committed to "FullMessage" everywhere? I think that the
>> full message will be more commonly used, so it deserves a shorter
>> form of the name. My proposal was to give the full message the same
>> name as the message body, but with "Message" deleted. (Ideally, the
>> full message would have had the name with "Message", and the message
>> body would have had the name with "MessageBody", but it's too late
>> for that now.) I don't know if this would lead to any name clashes
>> with other types.
>
>I think I probably prefer your scheme as well.
Pah! :-)
I agree in principle, although I think it's useful to be able to
implicitly identify message structures.
Anyway, I started doing it your way, but unfortunately there are name
clashes (Wimp_WindowInfo for a start; WimpSlotSize is another), and
rather than make a special case for these, and after much soul-
searching, I made everything FullMessage. Maybe that was a poor choice;
how about Msg? I'm open to suggestions; It's easy enough to change ;-)
There is another change I made to your proposed header: I renamed "size"
to "messagesize", and "sender" to "messagesender" to avoid clashes with
"size" in (say) wimp_ram_xfer, and "sender" in "alarm_set". I was
tempted to rename "action" to "messageaction", although presently no
clash exists. "my_ref" and "your_ref" should be safe enough. What do you
think?
On the subject of name clashes, Tom, you will need to do something
similar for your gadget object structure: "flags" is duplicated in many
objects - I've called it "gadgetflags".
Also, in Territory, Territory_Alphabet is defined both as an Int, and as
a SWI. I've called the former Territory_AlphabetNumber, in both this and
ServiceInternational.
Obviously, no-one has used ScrollBar since it was introduced:
In Scrollbar_SetLineIncrement, the first parameter should be
Scrollbar_IncrementsFlags, not Scrollbar_IncrementsLine;
in Scrollbar_SetPageIncrement, the first parameter should be
Scrollbar_IncrementsFlags, not Scrollbar_IncrementsFlag;
in Scrollbar_GetIncrement, the first parameter should be
Scrollbar_IncrementsFlags, not Scollbar_IncrementsFlags.
I have made these corrections here; no need for a patch if you agree
with what I've done.
>> A different way to do it is to declare 2 different message types
>> and then make a union from them separately
Great, I like it! we'll go for that, then.
--
Tony van der Hoff | Mailto:tony at mk-net.demon.co.uk
| Mailto:avanderhoff at iee.org
Buckinghamshire, England | http:www.mk-net.demon.co.uk
More information about the oslib-team
mailing list