我正在尝试使用GNU Smalltalk中的Seaside创建一个应用程序。我在Linux (Fedora 17)上运行GNU Smalltalk 3.2.5。
我已经运行并执行了简单的计数器测试应用程序。在我的应用程序中,我需要动态创建一些类并使用它们。但是,gst-remote不会识别它们。下面是我的测试应用程序(test.st的内容):
Seaside.WAComponent subclass: Test [
| foo |
Test class >> canBeRoot [ ^true ]
initialize [
super initialize.
Object subclass: #Foo instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'test class'.
foo := Foo new.
]
states [ ^{ self } ]
renderContentOn: html [
html heading: 'Foo'.
]
]
Test registerAsApplication: 'test'在“服务器”端,我运行远程服务器:
$ gst-remote -I seaside.im --server --start=Seaside
gst-remote server started.在应用程序端(实际上在同一台PC上,只是在不同的终端窗口上),我运行以下命令并显示错误:
$ gst-remote -f test.st
gst-remote: error at line 330: Undefined variable 'Foo' referenced.我不明白为什么Foo是未定义的。在gst交互式会话中,它工作得很好:
st> Object subclass: #Foo instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'test class'.
Foo
st> foo := Foo new.
a Foo为什么gst-remote不允许这样做呢?
发布于 2015-08-02 02:38:05
对于Seaside开发来说,GST并不是一等公民,所以要让它正常工作,最好的办法是在Pharo映像中执行Seaside开发的第一步,然后将代码导出到GST。你可能会遇到一些问题,自2011年以来,Seaside已经做出了一些改变。一旦您对Seaside (在Pharo中)有了更好的了解,将GST移植到GST可能不会有太多的工作。如果您在CI设置中导出到GST,我们将能够帮助您解决Seaside或Seaside-dev邮件列表中的具体问题。
https://stackoverflow.com/questions/31724985
复制相似问题