some comments on the seaside port for dolphin

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

some comments on the seaside port for dolphin

Martin Rubi
Hello everybody.
First of all, my apologies if some of the comments were reported already.
This week I started to play a little with the Seaside port for Dolphin, and a few comments came to mind:
 
1) When the current Seaside.pac is loaded, it creates a circular dependency between Seaside and Dolphin, making it impossible to save modifications or unload almost every package in the image. This is because the package loose methods are no loaded as such. I've made 2 small modifications to the class DolphinPackageExporter to (hopefully) solve this:
 
---
DolphinPackageExporter>>fileOut
 self fileOutPackageInformation.
 self fileOutClassNames.
 self fileOutLooseMethodsNames. "added by me"
 self fileOutPrerequisites.
 super fileOut
---
DolphinPackageExporter>>fileOutLooseMethodsNames
 
 stream cr; cr; nextPutAll: 'package methodNames'.
 
 self sortedMethods
  select: [:ref | ref category first = $*]
  thenDo: [:ref |
   stream
    cr;
    nextPutAll: 'add: ',
       ref classSymbol printString,
       ' -> ',
       ref methodSymbol printString,
       ';'].
 
 stream cr; nextPutAll: 'yourself.'.
---
 
2) I have also added the method
---
DolphinPackageExporter>>fileOutInitializerForClass: aClass
    "do nothing"
---
 
because the initialization was happening twice. This, however, does not happen in the current Seaside.pac available from the web, so maybe my Squeak image is a mess.
 
3) The package Seaside-Dolphin.pac contains the method
---
Symbol>>isUnary
^self argumentCount = 1
---
I think it should say
---
Symbol>>isUnary
^self argumentCount = 0
---
 
I saw a manifestation of this possible error when I tried to use scriptaculous in Dolphin.
 
4) While using scriptaculous, I detected what could be a possible semantic difference in the class MessageSend. For instance, in the method
 
SUAjax>>on: aSelector of: anObject
    self
      callback:
           (MessageSend
            receiver: anObject
            selector: aSelector)
 
aMessageSend is created, and then it's evaluated with 1 argument. However, Dolphin seems to need the MessageSend to be created with (at least) one argument in order to be correctly evaluated later, so I changed it to
 
SUAjax>>on: aSelector of: anObject
    self
      callback:
           (MessageSend
            receiver: anObject
            selector: aSelector
            argument: nil)
 
This was only a problem for scriptaculous, I didn't see an error in Seaside due to this, but it seems to be something to be aware of.
 
5) Finally, I exported scriptaculous using the DolphinPackageExporter, and with minor (and trivial) fixes could make the examples work. I added a class
 
ScriptaculousVWInfo subclass: #ScriptaculousDolphinInfo
 instanceVariableNames: ''
 classVariableNames: ''
 poolDictionaries: ''
 category: 'Scriptaculous-Platform'
 
which is pretty much c&p from SeasideDolphinInfo, beeing the #packageName the only modification I made. Although it worked, I guess my c&p is not the best approach, and perhaps there are details to be considered when writting such a class.
 
Well, that's all. Seaside and Scriptaculous looks like a lot of fun, by the way.
 
best regards
martin
 

_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside