FileOut with class pragmas

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

FileOut with class pragmas

Holger Freyther
Hi,

I am using class pragmas inside my GSM Information Element classes
to describe the assigned identifier, valid sizes and other information
but when doing a fileOut this information is lost.

I think this is because I am not changing classPragmas to add my new
class pragmas. Is this something we could/should warning about?


PackageLoader fileInPackage: 'Parser'.

Object subclass: Foo [
   Foo class >> extraPragma: aName [
   ]

   <extraPragma: 123>
]

Foo fileOutOn: stdout.




_______________________________________________
help-smalltalk mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-smalltalk
Reply | Threaded
Open this post in threaded view
|

Re: FileOut with class pragmas

Paolo Bonzini-2
Il 03/06/2013 18:03, Holger Hans Peter Freyther ha scritto:
> Hi,
>
> I am using class pragmas inside my GSM Information Element classes
> to describe the assigned identifier, valid sizes and other information
> but when doing a fileOut this information is lost.
>
> I think this is because I am not changing classPragmas to add my new
> class pragmas.

Yes.

> Is this something we could/should warning about?

Not for all pragmas; some (import:, shape:) are filed out automatically.
 But these are just a few, they could be special cased out.  Otherwise
it seems like a useful warning.

Paolo

>
> PackageLoader fileInPackage: 'Parser'.
>
> Object subclass: Foo [
>    Foo class >> extraPragma: aName [
>    ]
>
>    <extraPragma: 123>
> ]
>
> Foo fileOutOn: stdout.
>
>
>
>
> _______________________________________________
> help-smalltalk mailing list
> [hidden email]
> https://lists.gnu.org/mailman/listinfo/help-smalltalk
>


_______________________________________________
help-smalltalk mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-smalltalk
Reply | Threaded
Open this post in threaded view
|

Re: FileOut with class pragmas

Holger Freyther
On Mon, Jun 03, 2013 at 10:55:23PM +0200, Paolo Bonzini wrote:

> > I think this is because I am not changing classPragmas to add my new
> > class pragmas.
>
> Yes.

I stumbled across another issue. In the GSM 04.08 specs Information
Elements (attributes) have a minimum and maximum length. I have used
something like the below to handle that.

Object subclass: Foo [
    Foo class >> valueSize: min max: max [
    ]

    <valueSize: 1 max: 3>
]

this can not be expressed with the current classPragmas. So if I would
return #valueSize from the classPragmas then the 'max' would be lost
and if I return #valueSize:max: then it can not perform this selector?

Any idea how to resolve that?



> > Is this something we could/should warning about?
>
> Not for all pragmas; some (import:, shape:) are filed out automatically.
>  But these are just a few, they could be special cased out.  Otherwise
> it seems like a useful warning.

I will add this as another linter (but I think the STInST ast doesn't
have enough information for the pragmas to detect it).


holger

_______________________________________________
help-smalltalk mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-smalltalk
Reply | Threaded
Open this post in threaded view
|

Re: FileOut with class pragmas

Paolo Bonzini-5
Il 04/06/2013 11:14, Holger Hans Peter Freyther ha scritto:

> On Mon, Jun 03, 2013 at 10:55:23PM +0200, Paolo Bonzini wrote:
>
>>> I think this is because I am not changing classPragmas to add my new
>>> class pragmas.
>>
>> Yes.
>
> I stumbled across another issue. In the GSM 04.08 specs Information
> Elements (attributes) have a minimum and maximum length. I have used
> something like the below to handle that.
>
> Object subclass: Foo [
>     Foo class >> valueSize: min max: max [
>     ]
>
>     <valueSize: 1 max: 3>
> ]
>
> this can not be expressed with the current classPragmas. So if I would
> return #valueSize from the classPragmas then the 'max' would be lost
> and if I return #valueSize:max: then it can not perform this selector?

Right, you need to split the pragma in two...

Paolo

> Any idea how to resolve that?
>
>
>
>>> Is this something we could/should warning about?
>>
>> Not for all pragmas; some (import:, shape:) are filed out automatically.
>>  But these are just a few, they could be special cased out.  Otherwise
>> it seems like a useful warning.
>
> I will add this as another linter (but I think the STInST ast doesn't
> have enough information for the pragmas to detect it).
>
>
> holger
>


_______________________________________________
help-smalltalk mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-smalltalk