typo in MessageLookup

classic Classic list List threaded Threaded
4 messages Options
Ladislav Marek Ladislav Marek
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

typo in MessageLookup

Hi,

MessageLookup.st is missing in kernel/Makefile.frag and packages.xml, see patch.
MessageLookup>>sendTo: also reference undefined variable, patch:

diff --git a/kernel/MessageLookup.st b/kernel/MessageLookup.st
index ca495b9..e7f2bac 100644
--- a/kernel/MessageLookup.st
+++ b/kernel/MessageLookup.st
@@ -71,11 +71,11 @@ but also the starting class for the search.'>
         ^self startingClass lookupSelector: self selector
     ]

-    sendTo: receiver [
+    sendTo: anObject [
        "Send the message to the given receiver"

        <category: 'basic'>
-       ^receiver perform: self method with: anObject
+       ^anObject perform: self method with: anObject
     ]

     startingClass: aClass [

_______________________________________________
help-smalltalk mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-smalltalk
Paolo Bonzini-2 Paolo Bonzini-2
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: typo in MessageLookup

On 01/28/2012 08:15 PM, Ladislav Marek wrote:

> Hi,
>
> MessageLookup.st is missing in kernel/Makefile.frag and packages.xml, see patch.
> MessageLookup>>sendTo: also reference undefined variable, patch:
>
> diff --git a/kernel/MessageLookup.st b/kernel/MessageLookup.st
> index ca495b9..e7f2bac 100644
> --- a/kernel/MessageLookup.st
> +++ b/kernel/MessageLookup.st
> @@ -71,11 +71,11 @@ but also the starting class for the search.'>
>           ^self startingClass lookupSelector: self selector
>       ]
>
> -    sendTo: receiver [
> +    sendTo: anObject [
>          "Send the message to the given receiver"
>
>          <category: 'basic'>
> -       ^receiver perform: self method with: anObject
> +       ^anObject perform: self method with: anObject

should be "withArguments: self arguments".

>       ]
>
>       startingClass: aClass [

I had fixed this locally, but I still have to push.

Thanks!

Paolo


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

Re: typo in MessageLookup

I'm getting an error when building GST:

gst-doc: Invalid argument nil: must be a Symbol

backtrace:

optimized [] in UndefinedObject>>executeStatements (../scripts/GenDoc.st:176)
SystemExceptions.WrongClass(Exception)>>activateHandler: (ExcHandling.st:515)
SystemExceptions.WrongClass(Exception)>>signal (ExcHandling.st:254)
SystemExceptions.WrongClass class>>signalOn:mustBe: (SysExcept.st:778)
SystemExceptions.WrongClass class>>signalOn:mustBe: (SysExcept.st:774)
Object class(Object)>>perform:withArguments: (Object.st:1269)
MessageLookup>>sendTo: (MessageLookup.st:78)
Object class(Object)>>perform: (Object.st:1138)
STInST.STClassLoaderObjects.ProxyClass>>doesNotUnderstand: #name
(Parser.star#VFS.ZipFile/STLoaderObjs.st:815)
STInST.STClassLoaderObjects.ProxyClass(STInST.STClassLoaderObjects.PseudoBehavior)>>nameIn:
(Parser.star#VFS.ZipFile/STLoaderObjs.st:606)
STInST.TexinfoDocPublisher class>>printTreeClass:shouldLink:on:indent:
(ClassPublisher.star#VFS.ZipFile/Texinfo.st:227)
[] in STInST.TexinfoDocPublisher class(STInST.DocPublisher
class)>>printHierarchyOf:hierarchy:startAt:on:indent:
(ClassPublisher.star#VFS.ZipFile/Publish.st:561)
SortedCollection(OrderedCollection)>>do: (OrderColl.st:66)
SortedCollection>>do: (SortCollect.st:121)
STInST.TexinfoDocPublisher class(STInST.DocPublisher
class)>>printHierarchyOf:hierarchy:startAt:on:indent:
(ClassPublisher.star#VFS.ZipFile/Publish.st:555)
STInST.TexinfoDocPublisher class(STInST.DocPublisher
class)>>makeDescendentsDictionary:thenPrintOn:
(ClassPublisher.star#VFS.ZipFile/Publish.st:611)
STInST.TexinfoDocPublisher class(STInST.DocPublisher
class)>>printHierarchyOf:on:
(ClassPublisher.star#VFS.ZipFile/Publish.st:543)
STInST.TexinfoDocPublisher class>>publishAll:on:
(ClassPublisher.star#VFS.ZipFile/Texinfo.st:80)
[] in STInST.TexinfoDocPublisher class>>publishAll:onFile:
(ClassPublisher.star#VFS.ZipFile/Texinfo.st:63)
BlockClosure>>ensure: (BlkClosure.st:268)
STInST.TexinfoDocPublisher class>>publishAll:onFile:
(ClassPublisher.star#VFS.ZipFile/Texinfo.st:62)
STInST.TexinfoDocPublisher class>>publishAll:toLocation:
(ClassPublisher.star#VFS.ZipFile/Texinfo.st:96)
optimized [] in UndefinedObject>>executeStatements (../scripts/GenDoc.st:159)
BlockClosure>>on:do:on:do: (BlkClosure.st:206)
UndefinedObject>>executeStatements (../scripts/GenDoc.st:174)

I have to change method
STInST.STClassLoaderObjects.ProxyClass>>doesNotUnderstand:

diff --git a/packages/stinst/parser/STLoaderObjs.st
b/packages/stinst/parser/STLoaderObjs.st
index 6eda6e1..72deded 100644
--- a/packages/stinst/parser/STLoaderObjs.st
+++ b/packages/stinst/parser/STLoaderObjs.st
@@ -812,6 +812,7 @@ superclass
 !

 doesNotUnderstand: aMessage
+    aMessage startingClass: proxy class.
     ^proxy perform: aMessage
 ! !


On Mon, Jan 30, 2012 at 08:39, Paolo Bonzini <[hidden email]> wrote:

> On 01/28/2012 08:15 PM, Ladislav Marek wrote:
>>
>> Hi,
>>
>> MessageLookup.st is missing in kernel/Makefile.frag and packages.xml, see
>> patch.
>> MessageLookup>>sendTo: also reference undefined variable, patch:
>>
>> diff --git a/kernel/MessageLookup.st b/kernel/MessageLookup.st
>> index ca495b9..e7f2bac 100644
>> --- a/kernel/MessageLookup.st
>> +++ b/kernel/MessageLookup.st
>> @@ -71,11 +71,11 @@ but also the starting class for the search.'>
>>          ^self startingClass lookupSelector: self selector
>>      ]
>>
>> -    sendTo: receiver [
>> +    sendTo: anObject [
>>         "Send the message to the given receiver"
>>
>>         <category: 'basic'>
>> -       ^receiver perform: self method with: anObject
>> +       ^anObject perform: self method with: anObject
>
>
> should be "withArguments: self arguments".
>
>>      ]
>>
>>      startingClass: aClass [
>
>
> I had fixed this locally, but I still have to push.
>
> Thanks!
>
> Paolo
>

_______________________________________________
help-smalltalk mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-smalltalk
Paolo Bonzini-2 Paolo Bonzini-2
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: typo in MessageLookup

On 02/03/2012 07:49 PM, Ladislav Marek wrote:

> diff --git a/packages/stinst/parser/STLoaderObjs.st
> b/packages/stinst/parser/STLoaderObjs.st
> index 6eda6e1..72deded 100644
> --- a/packages/stinst/parser/STLoaderObjs.st
> +++ b/packages/stinst/parser/STLoaderObjs.st
> @@ -812,6 +812,7 @@ superclass
>   !
>
>   doesNotUnderstand: aMessage
> +    aMessage startingClass: proxy class.
>       ^proxy perform: aMessage
>   ! !

Actually, #doesNotUnderstand: can do one of three things:

1) do everything by itself;

2) forward the message to another object;

3) create the missing method and retry it.

(3) is relatively rare, but it is the scenario for which I introduced
MessageLookup.  It turns out that the new MessageLookup>>#sendTo: is
only good for (3), and the old implementation from the Message class is
appropriate for (2).

I'm applying this patch to differentiate how you restart execution in
the two cases:

diff --git a/kernel/MessageLookup.st b/kernel/MessageLookup.st
index bbc18f2..dc9e831 100644
--- a/kernel/MessageLookup.st
+++ b/kernel/MessageLookup.st
@@ -71,8 +71,9 @@ but also the starting class for the search.'>
          ^self startingClass lookupSelector: self selector
      ]

-    sendTo: receiver [
- "Send the message to the given receiver"
+    retrySendTo: receiver [
+ "Send the message to the given receiver, looking up the
+         method starting at #startingClass."

  <category: 'basic'>
  ^receiver perform: self method withArguments: self arguments

Paolo

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