[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-smalltalk] Re: JSON Dumper/Parser
From: |
Robin Redeker |
Subject: |
Re: [Help-smalltalk] Re: JSON Dumper/Parser |
Date: |
Sun, 19 Aug 2007 11:28:57 +0200 |
User-agent: |
Mutt/1.5.11+cvs20060403 |
On Sat, Aug 18, 2007 at 09:46:27PM +0200, Paolo Bonzini wrote:
> >I'm just curious: Is there a reason why this will only return floats now?
>
> I probably fixed this after posting the code.
>
Oh, ok, is there some place where the current code is?
I'm a bit back into smalltalk programming right now and would
need it now :-)
Btw. when I run your json.st through gst-convert I get a conversion of
this:
!Object methodsFor: 'json'!
jsonPrintOn: aStream
self subclassResponsibility
!
toJSON
^String streamContents: [ :aStream | self jsonPrintOn: aStream ]
! !
To this:
Object class extend [
jsonPrintOn: aStream [
<category: 'json'>
self subclassResponsibility
]
toJSON [
<category: 'json'>
^String streamContents: [:aStream | self jsonPrintOn: aStream]
]
]
Is that intentional? Because adding a method to the class object
seems to be a bit weird (and also doesn't work when calling toJSON on
an instance of Object).
(I get those results with latest cvs and 2.95c)
Robin