Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/xpath/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何看待GNU Smalltalk中的图像代码?_Smalltalk_Gstreamer_Gnu Smalltalk - Fatal编程技术网

如何看待GNU Smalltalk中的图像代码?

如何看待GNU Smalltalk中的图像代码?,smalltalk,gstreamer,gnu-smalltalk,Smalltalk,Gstreamer,Gnu Smalltalk,如何从GST命令行界面查看类/消息代码? 我只知道#inspect消息,但它只显示对象的定义或摘要,而不显示代码 谢谢:-)您可以使用“methodSourceString”方法,如 st>(Object >> #printNl) methodSourceString 'printNl [ "Print a represention of the receiver on stdout, put a new line the Transcript

如何从GST命令行界面查看类/消息代码? 我只知道#inspect消息,但它只显示对象的定义或摘要,而不显示代码

谢谢:-)

您可以使用“methodSourceString”方法,如

st>(Object >> #printNl) methodSourceString
'printNl [
        "Print a represention of the receiver on stdout, put a new line
         the Transcript (stdout the GUI is not active)"

        <category: ''printing''>
        Transcript showCr: self printString
    ]'
st>(对象>>打印NL)方法源字符串
'printNl[
“在标准输出上打印接收器的一个表示,放置一个新行
转录本(标准说明GUI未激活)”
成绩单showCr:self printString
]'
但是,字符串将使用双引号打印,这对于非平凡代码来说可能不方便

只使用文本编辑器通常更简单,因为类几乎总是包含在单个文件中。您也可以从REPL查询文件名:

st> Object methodDictionary anyOne methodSourceCode file
<File /usr/share/smalltalk/kernel/Object.st>
st>对象方法字典任何方法源代码文件

非常感谢你,保罗!这正是我想要的:)