'Singleton' and Null Limited Types 
Author Message
 'Singleton' and Null Limited Types

In Dylan, what would this return:

subtype?(limited(<integer>, min: 3, max: 3),singleton(3))

...? The DRM isn't clear.

What about:

subtype?(limited(<integer>, min: 21, max: 20),limited(<integer>, min: 0,
max: 10))

and

subtype?(limited(<integer>, min: 21, max: 20),limited(<integer>, min: 11,
max: 10))

...? The DRM
< http://www.*-*-*.com/ #HEADIN...>
says these two should return false. I think all three should return true.

--
Ashley Yakeley, Seattle WA



Sun, 20 May 2001 03:00:00 GMT  
 'Singleton' and Null Limited Types
In fact, I think for any type T

subtype?(limited(<integer>, min: 21, max: 20),T)

...should return true. If it's really a problem to deal with this, it
wouldn't be difficult to amend limited(<integer>,...) to prohibit null
types and even singletons.

--
Ashley Yakeley, Seattle WA



Mon, 21 May 2001 03:00:00 GMT  
 'Singleton' and Null Limited Types


Quote:
>In Dylan, what would this return:

>subtype?(limited(<integer>, min: 3, max: 3),singleton(3))

>...? The DRM isn't clear.

>What about:

>subtype?(limited(<integer>, min: 21, max: 20),limited(<integer>, min: 0,
>max: 10))

>and

>subtype?(limited(<integer>, min: 21, max: 20),limited(<integer>, min: 11,
>max: 10))

>...? The DRM
><http://www.harlequin.com/products/ads/dylan/doc/drm/drm_46.htm#HEADIN...>
>says these two should return false. I think all three should return true.


Quote:
>In fact, I think for any type T

>subtype?(limited(<integer>, min: 21, max: 20),T)

>...should return true. If it's really a problem to deal with this, it
>wouldn't be difficult to amend limited(<integer>,...) to prohibit null
>types and even singletons.

Has anyone had any thoughts on this? As far as I can tell, the designers
of Dylan more-or-less overlooked the possibilty of empty types and
limited singleton types. In fact, I don't think you can create a null
type or a non-'singleton()' singleton type without using 'limited()' on
<integer>.

My guide for correct behaviour here is the DRM at
<http://www.harlequin.com/products/ads/dylan/doc/drm/drm_40.htm#HEADIN...

Quote:
>:

     The following is an informal description of type relationships:

     The function subtype? defines a partial ordering of all types.
     Type t1 is a subtype of type t2 (i.e., subtype?(t1, t2) is
     true) if it is impossible to encounter an object that is an
     instance of t1 but not an instance of t2. It follows that every
     type is a subtype of itself. Two types t1 and t2 are said to be
     equivalent types if subtype?(t1, t2) and subtype?(t2, t1) are
     both true. t1 is said to be a proper subtype of t2 if t1 is a
     subtype of t2 and t2 is not a subtype of t1.

It's my opinion that these relations should always hold.

--
Ashley Yakeley, Seattle WA



Sun, 27 May 2001 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Newbie - error with 'Limited Type' assignment

2. Fun with singletons' singleton classes

3. Using 'Access in a limited type declaration as an initialization hook

4. Prodata '$null$' problem

5. How To Do Variable 'Range Limit'

6. 'Dynamic Pool Limit exceeded' in 4C

7. More than one 'Range Limit Field'

8. Limits of Clipper DBF's and NTX's

9. Graph legend limit 'Plot194'

10. ``same signature'' and ``same type'' and anchored types

11. KGL's fuzzy values (was: empty and singleton tuples)

12. More beginner's questions: singleton variables

 

 
Powered by phpBB® Forum Software