Re: [Pharo-dev] Opal hook?

2013-12-04 Thread Stéphane Ducasse
AnUnknownClass subclass: #Adaptor1Example instanceVariableNames: 'customers accountID address name phoneNumber' classVariableNames: '' poolDictionaries: '' category: 'Examples-Cookbook' executes the default action for OCUndeclaredVariableWarning, which is

Re: [Pharo-dev] Opal hook?

2013-12-04 Thread Marcus Denker
On 04 Dec 2013, at 20:02, Stéphane Ducasse stephane.duca...@inria.fr wrote: AnUnknownClass subclass: #Adaptor1Example instanceVariableNames: 'customers accountID address name phoneNumber' classVariableNames: '' poolDictionaries: '' category:

Re: [Pharo-dev] Opal hook?

2013-12-04 Thread Stéphane Ducasse
As a clear example, this is just bad that each time we want to change the UI message we have to change the compiler exception. ugly at wish. I have no cycle to fix that now. I will check if I can get something in UndefinedObject so that I can continue to work on my task. The whole

Re: [Pharo-dev] Opal hook?

2013-12-04 Thread Marcus Denker
On 04 Dec 2013, at 20:34, Stéphane Ducasse stephane.duca...@inria.fr wrote: As a clear example, this is just bad that each time we want to change the UI message we have to change the compiler exception. ugly at wish. I have no cycle to fix that now. I will check if I can get something

Re: [Pharo-dev] Opal hook?

2013-12-04 Thread Stéphane Ducasse
Ok I will check something on UndefinedObject to start with. Then it would be fun to prototype a kind of strategy hiearchy on the side (extracted from also) behavior of OCSemanticsError It was nice to see it and since now I'm ok to have a look at the compiler code it was interesting.

Re: [Pharo-dev] Opal hook?

2013-12-04 Thread Nicolas Cellier
Steph, each time you want to evaluate something, do you agree that this involves - a parse phase of the expression you want to evaluate to create an AST - a code generation phase from AST - bytecodes to generate a CompiledMethod - the evaluation phase itself which evaluates above CompiledMethod

Re: [Pharo-dev] Opal hook?

2013-12-04 Thread Nicolas Cellier
I forgot to add that the OCUndeclaredVariableWarning was already handled at semantic analysis. Do you suggest that default behavior should be to handle and retry instead of handle and return? One way to achieve what you are asking would be to initialize the Undeclared entry to some kind of

Re: [Pharo-dev] Opal hook?

2013-12-04 Thread Clément Béra
2013/12/4 Nicolas Cellier nicolas.cellier.aka.n...@gmail.com I forgot to add that the OCUndeclaredVariableWarning was already handled at semantic analysis. This is not the case. The OCUndeclaredVariableWarning is handled in the default action. Therefore anyone can catch it. In this case for

Re: [Pharo-dev] Opal hook?

2013-12-04 Thread Stéphane Ducasse
On Dec 4, 2013, at 10:02 PM, Clément Bera bera.clem...@gmail.com wrote: It didn't halt on your machine because you didn't copy and paste the code that halts (i guess I wrote too much code in the mail so it was not clear). You copied the code that I explicitly said that doesn't halt because

Re: [Pharo-dev] Opal hook?

2013-12-04 Thread Stéphane Ducasse
Hi nicolas I forgot to add that the OCUndeclaredVariableWarning was already handled at semantic analysis. Do you suggest that default behavior should be to handle and retry instead of handle and return? I suggest that we can define what is the behavior of handling an exceptional cases.

Re: [Pharo-dev] Opal hook?

2013-12-03 Thread Clément Bera
Well if the class does not exists it calls the method on UndefinedObject (UndeclaredBinding). And you have: UndefinedObjectsubclass: nameOfClass instanceVariableNames: instVarNames classVariableNames: classVarNames poolDictionaries: poolDictnames category: category Calling this method is now

Re: [Pharo-dev] Opal hook?

2013-12-03 Thread Clément Bera
Then for your project replace ProtoObject by StubRootClass in UndefinedObjectsubclass:instanceVariableNames:classVariableNames: poolDictionaries:category: it will work. An alternative is to catch OCSemanticWarning or its subclass OCUndeclaredVariableWarning while loading the new classes and

Re: [Pharo-dev] Opal hook?

2013-12-03 Thread Stéphane Ducasse
On Dec 3, 2013, at 11:20 AM, Clément Bera bera.clem...@gmail.com wrote: Then for your project replace ProtoObject by StubRootClass in UndefinedObjectsubclass:instanceVariableNames:classVariableNames:poolDictionaries:category: it will work. yes but this is ugly because I do not want

Re: [Pharo-dev] Opal hook?

2013-12-03 Thread Clément Bera
*do you know if the OCUndeclaredVariable is raised for unknown superclass?* this code: AnUnknownClass subclass: #Adaptor1Example instanceVariableNames: 'customers accountID address name phoneNumber' classVariableNames: '' poolDictionaries: '' category:

Re: [Pharo-dev] Opal hook?

2013-12-03 Thread Stéphane Ducasse
thanks for your analysis I will have a look at it. I was thinking to check if I should redefine UndefinedObjectsubclass: to raise an error Stef On Dec 3, 2013, at 3:17 PM, Clément Bera bera.clem...@gmail.com wrote: do you know if the OCUndeclaredVariable is raised for unknown superclass?

[Pharo-dev] Opal hook?

2013-12-02 Thread Stéphane Ducasse
Hi when I load a class whose superclass is not in the image I have the impression that the system create a subclass from ProtoObject and I would like to be able to control the superclass. ProtoObject subclass: #Adaptor1Example instanceVariableNames: 'customers accountID address name