SDL-News: Un-intuitive Type System

Subject: SDL-News: Un-intuitive Type System
From: Patrick Frend (
Date: Mon Jun 16 2003 - 17:13:38 GMT

Become an SDL Forum Society member <>
The originator of this message is responsible for its content.
-----From "Patrick Frend" <> to sdlnews -----

Is it just me or is some of the symantics of the SDL type
system un-intuitive. You could even go so far as saying
"Dangerous" and I'd have a hard time dis-agreeing.

For example:

I need a type in various different contexts which may only
have a positive integral value that will fit into 16 bits

So I define

SYNTYPE PositiveInteger = Natural

Now this range of values is used in the
protocol for various different uses, so I want to separate
the types. So intuitively I define.

SYNTYPE MadeUpUseOne = PositiveInteger

SYNTYPE MadeUpUseTwo = PositiveInteger

I define 2 variables.

DCL instanceOne MadeUpUseOne;
DCL instanceTwo PositiveInteger;

Question1: What value do each of the variables have immediately after
Question2: What range of values that each of the variables may be assigned?

You may have to delve right into the small-print of the SDL language spec to
get the
"correct" answers. I did, but still don't understand!

Are there any other strange, but commonly used constructs lurking out there
to bite?

Patrick Frend

Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (
Version: 6.0.488 / Virus Database: 287 - Release Date: 05/06/2003

--End text from "Patrick Frend" <> to sdlnews --- For extra SDL Forum Society benefits join at <>

This archive was generated by hypermail 2a23 : Thu May 09 2013 - 16:05:49 GMT