Question re: Object class requirements on arguments to primitive 986

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Question re: Object class requirements on arguments to primitive 986

mark.b.ballard
In the method primDisplayPolyline:at: <primitive: 986>, the collection
argument seems like it must be an Array, an OrderedCollection won't do.


Also, the x,y values of the points seem like they must be smallIntegers.


Is this correct?  Where are these type requirements for primitives
documented?

Reply | Threaded
Open this post in threaded view
|

Re: Question re: Object class requirements on arguments to primitive 986

Reinout Heeck

On Oct 24, 2006, at 4:15 AM, <[hidden email]>  
<[hidden email]> wrote:

> In the method primDisplayPolyline:at: <primitive: 986>, the collection
> argument seems like it must be an Array, an OrderedCollection won't  
> do.
>
>
> Also, the x,y values of the points seem like they must be  
> smallIntegers.
>
>
> Is this correct?  Where are these type requirements for primitives
> documented?
>
>

The expected types are 'documented' by the way the failure code is  
written. Whenever you see a primitive method implementation that  
retries with different argument types (instead of raising an  
exception) you see what types are expected.

As for ranges you will need to ask here or dig into the VM source.  
AFAIK graphic coordinates are limited to 16 bits signed (although  
this might only be on X11 platforms).



HTH,

Reinout
-------

Reply | Threaded
Open this post in threaded view
|

RE: Question re: Object class requirements on arguments to primitive 986

mark.b.ballard
Okay, but it seems a simple AR request for cincom to have the name of
the formal arguments supply more information.

For example, instead of the current method

+++

primDisplayPolyline: pointCollection at: aPoint
        "Display the polyline whose vertices are specified by
pointCollection,
        translated by aPoint.

        If the first and last vertices do not coincide, the polyline is
considered
        to be open.  The endpoints will be drawn with caps and the
        intervening vertices drawn with joins.  If the first and last
vertices do
        coincide, the polyline is considered to be closed, and all
vertices
        will be drawn using joins.

        Use the current line width, cap style, join style, and paint."

        <code>

+++++++

It could read

primDisplayPolyline: integralPointArray at: anIntegralPoint
        "Display the polyline whose vertices are specified by
integralPointCollection,
        translated by anIntegralPoint.

        If the first and last vertices do not coincide, the polyline is
considered
        to be open.  The endpoints will be drawn with caps and the
        intervening vertices drawn with joins.  If the first and last
vertices do
        coincide, the polyline is considered to be closed, and all
vertices
        will be drawn using joins.

        Use the current line width, cap style, join style, and paint."

        <code>




-----Original Message-----
From: Reinout Heeck [mailto:[hidden email]]
Sent: Tuesday, October 24, 2006 2:30 AM
To: VisualWorks Mailing List
Subject: Re: Question re: Object class requirements on arguments to
primitive 986



On Oct 24, 2006, at 4:15 AM, <[hidden email]>  
<[hidden email]> wrote:

> In the method primDisplayPolyline:at: <primitive: 986>, the collection
> argument seems like it must be an Array, an OrderedCollection won't  
> do.
>
>
> Also, the x,y values of the points seem like they must be  
> smallIntegers.
>
>
> Is this correct?  Where are these type requirements for primitives
> documented?
>
>

The expected types are 'documented' by the way the failure code is  
written. Whenever you see a primitive method implementation that  
retries with different argument types (instead of raising an  
exception) you see what types are expected.

As for ranges you will need to ask here or dig into the VM source.  
AFAIK graphic coordinates are limited to 16 bits signed (although  
this might only be on X11 platforms).



HTH,

Reinout
-------