smalltalkx

Simple class definition error in smalltalk

╄→гoц情女王★ 提交于 2019-12-23 17:10:42
问题 I am trying to use smalltalk with smalltalk/x-jv branch. I have following simple code: Object subclass: Myclass[ |mainval| init [mainval := 555] getmainval [^mainval] ] gc := Myclass new. gc init. gc getmainval printNl. I am trying to run it on command line with stc command of smalltalk/x-jv, but it it not working. Following is the error: $ ./stc testsrc.st testsrc.st, line 1: Error: syntax error in 'class definition' near "Myclass" (char/token=286 / 0x11e) (fileIn expression) Where is the

How to access and use Java library/package in Smalltalk

大憨熊 提交于 2019-12-12 16:14:12
问题 It was mentioned in comments on another Stackoverflow question that it may be possible to access Java packages from Smalltalk. However, I have not been able to find any information regarding this on searching the net. Any insight in this regard will be highly appreciated. 回答1: Essentially there three ways to (re)use Java code in Smalltalk/X: Implement / port bindings to Java using JNI as Victor suggested. While not ported to Smalltalk/X, this has been done by Johan Brichau et al. - search for