Hi pharoers,

If I do the following in a minimal Pharo image, using the command line:

./Pharo --headless Pharo.image eval "Object subclass: #TestClass
instanceVariableNames: 'one' classVariableNames: '' package: 'IS-Test'."

I get the class created. However, if I try to pass the following argument to
eval:

"Object subclass: #TestClass instanceVariableNames: 'one'
classVariableNames: '' package: 'IS-Test'. TestClass compile:'one ^one'
classified: 'accessor'."

I get an UndefinedObject>>DoIt (TestClass is Undeclared).

At first I thought it could be that it takes sometime to compile the class,
so added some delay:

"Object subclass: #TestClass instanceVariableNames: 'one'
classVariableNames: '' package: 'IS-Test'. (Delay forSeconds: 5) wait.
TestClass compile:'one ^one' classified: 'accessor'."

But again: UndefinedObject>>DoIt (TestClass is Undeclared).

I even tried to do:

"Object subclass: #TestClass instanceVariableNames: 'one'
classVariableNames: '' package: 'IS-Test'. Smalltalk saveAndQuit."

and after that add only a method by passing:

"TestClass compile:'one ^one' classified: 'accessor'. Smalltalk
saveAndQuit."

But again: UndefinedObject>>DoIt (TestClass is Undeclared) 

How do I add a method to a class using the command line? 
Thanks in advance
Nacho



-----
Nacho
Smalltalker apprentice.
Buenos Aires, Argentina.
--
View this message in context: 
http://forum.world.st/Methods-Classes-using-the-command-line-tp4941977.html
Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.

Reply via email to