Hi,
the hello world example in the node.js is not working after "make clean". It must use packages instead of categories. Smalltalk current createPackage: 'Hello' properties: #{}! Object subclass: #Hello instanceVariableNames: '' package: 'Hello'! !Hello class methodsFor: 'main'! main console log: 'Hello world from JTalk in Node.js' ! ! Cheers, -- Pavel |
Thanks Pavel.
That's strange, we kept the categories for compatibility. Class >> subclass: aString instanceVariableNames: aString2 category: aString3 "Kept for compatibility." self deprecatedAPI. ^self subclass: aString instanceVariableNames: aString2 package: aString3 Nicolas On Wed, 2011-11-16 at 15:28 +0100, Pavel Krivanek wrote: > Hi, > > the hello world example in the node.js is not working after "make > clean". It must use packages instead of categories. > > Smalltalk current createPackage: 'Hello' properties: #{}! > > Object subclass: #Hello > instanceVariableNames: '' > package: 'Hello'! > > !Hello class methodsFor: 'main'! > > main > console log: 'Hello world from JTalk in Node.js' > ! ! > > > Cheers, > -- Pavel |
On 11/17/2011 10:03 AM, Nicolas Petton wrote:
> Thanks Pavel. > > That's strange, we kept the categories for compatibility. I just updated my amber from master git (and ehm, amberc failed after that because of some CRs in it?) and then did make clean and make etc for node.js hello and it looks fine to me (see below). Sure there is a deprecation warning, but only a warning :) regards, Göran gokr@quigon:~/amber/examples/nodejs/hello$ make clean rm -f Program.js Hello.js gokr@quigon:~/amber/examples/nodejs/hello$ make ../../../bin/amberc -m Hello Hello.st Program Loading libraries /home/gokr/amber/js/boot.js /home/gokr/amber/js/Kernel-Objects.js /home/gokr/amber/js/Kernel-Classes.js /home/gokr/amber/js/Kernel-Methods.js /home/gokr/amber/js/Kernel-Collections.js /home/gokr/amber/js/Kernel-Exceptions.js /home/gokr/amber/js/Kernel-Transcript.js /home/gokr/amber/js/parser.js /home/gokr/amber/js/Compiler.js /home/gokr/amber/js/init.js /home/gokr/amber/bin/nodecompile.js and compiling ... Reading file Hello.st Object class >> subclass:instanceVariableNames:category: is deprecated! (in BlockClosure >> value) Exporting (debug) category Hello as Hello.js Adding libraries /home/gokr/amber/js/boot.js /home/gokr/amber/js/Kernel-Objects.js /home/gokr/amber/js/Kernel-Classes.js /home/gokr/amber/js/Kernel-Methods.js /home/gokr/amber/js/Kernel-Collections.js /home/gokr/amber/js/Kernel-Exceptions.js /home/gokr/amber/js/Kernel-Transcript.js ... Adding Amber code Hello.js ... Adding initializer /home/gokr/amber/js/init.js ... Adding call to Hello class >> main ... Writing Program.js ... Done. gokr@quigon:~/amber/examples/nodejs/hello$ ./hello Hello world from JTalk in Node.js gokr@quigon:~/amber/examples/nodejs/hello$ |
Well, sorry, I tried the fresh git clone and it behaves the same way.
-- Pavel 2011/11/17 Göran Krampe <[hidden email]>: > On 11/17/2011 10:03 AM, Nicolas Petton wrote: >> >> Thanks Pavel. >> >> That's strange, we kept the categories for compatibility. > > I just updated my amber from master git (and ehm, amberc failed after that > because of some CRs in it?) and then did make clean and make etc for node.js > hello and it looks fine to me (see below). Sure there is a deprecation > warning, but only a warning :) > > regards, Göran > > gokr@quigon:~/amber/examples/nodejs/hello$ make clean > rm -f Program.js Hello.js > gokr@quigon:~/amber/examples/nodejs/hello$ make > ../../../bin/amberc -m Hello Hello.st Program > Loading libraries /home/gokr/amber/js/boot.js > /home/gokr/amber/js/Kernel-Objects.js /home/gokr/amber/js/Kernel-Classes.js > /home/gokr/amber/js/Kernel-Methods.js > /home/gokr/amber/js/Kernel-Collections.js > /home/gokr/amber/js/Kernel-Exceptions.js > /home/gokr/amber/js/Kernel-Transcript.js /home/gokr/amber/js/parser.js > /home/gokr/amber/js/Compiler.js /home/gokr/amber/js/init.js > /home/gokr/amber/bin/nodecompile.js and compiling ... > Reading file Hello.st > Object class >> subclass:instanceVariableNames:category: is deprecated! (in > BlockClosure >> value) > Exporting (debug) category Hello as Hello.js > Adding libraries /home/gokr/amber/js/boot.js > /home/gokr/amber/js/Kernel-Objects.js /home/gokr/amber/js/Kernel-Classes.js > /home/gokr/amber/js/Kernel-Methods.js > /home/gokr/amber/js/Kernel-Collections.js > /home/gokr/amber/js/Kernel-Exceptions.js > /home/gokr/amber/js/Kernel-Transcript.js ... > Adding Amber code Hello.js ... > Adding initializer /home/gokr/amber/js/init.js ... > Adding call to Hello class >> main ... > Writing Program.js ... > Done. > gokr@quigon:~/amber/examples/nodejs/hello$ ./hello > Hello world from JTalk in Node.js > gokr@quigon:~/amber/examples/nodejs/hello$ > |
On 11/17/2011 06:43 PM, Pavel Krivanek wrote:
> Well, sorry, I tried the fresh git clone and it behaves the same way. Can you show me your output? How does it fail? regards, Göran |
Sorry, It seems that I only was confused with the deprecation warning
(it is quite uncommon for hello world examples ;-)) and the fact, that the making will fail if you use different package name (it must fit with the source file name). If it doesn't fit then it reports something like Exporting (debug) category Hello as Hello.js String>>streamContents: a BlockClosure>>value: a Exporter>>exportPackageDefinitionOf:on: nil does not understand #name Cheers -- Pavel 2011/11/18 Göran Krampe <[hidden email]>: > On 11/17/2011 06:43 PM, Pavel Krivanek wrote: >> >> Well, sorry, I tried the fresh git clone and it behaves the same way. > > Can you show me your output? How does it fail? > > regards, Göran > |
Hi!
On 11/18/2011 09:25 AM, Pavel Krivanek wrote: > Sorry, It seems that I only was confused with the deprecation warning > (it is quite uncommon for hello world examples ;-)) and the fact, that Well, such code rots too :). I will update it to use "package", I just wanted to understand why it failed for you first. > the making will fail if you use different package name (it must fit > with the source file name). Known issue that is a tad complex to fix - but I am working on that one. It is one of the few things left for 0.9.1. But it involves adding support for "system change notifications" and tracking of what exactly we are doing when we file in an st file etc etc. ;) regards, Göran |
Free forum by Nabble | Edit this page |