gpt4 book ai didi

smalltalk - 鲜为人知的 Smalltalk 二进制消息及其含义?

转载 作者:行者123 更新时间:2023-12-04 18:27:06 28 4
gpt4 key购买 nike

关闭。这个问题需要details or clarity .它目前不接受答案。












想改善这个问题吗?通过 editing this post 添加详细信息并澄清问题.

4年前关闭。




Improve this question




为初学者编写一些文档,我遇到了一个问题。知道二进制消息的作用,并不意味着你知道它们叫什么!

一些明显的,以及它们各自的类:

    -   "minus" TraitComposition Collection Point Interval BoxedFloat64 Color LargeInteger ScaledDecimal Integer Exception DateAndTime Number TraitExclusion SmallInteger TraitTransformation TComposingDescription WordArray Fraction ExceptionSetWithExclusions ExceptionSet FloatArray SmallFloat64 Duration TraitDescription Timespan TraitAlias

/ "divided by" FileSystem Collection Point BoxedFloat64 Color LargeInteger AbstractFileReference ScaledDecimal Integer FileReference Number SmallInteger Path WordArray Fraction ZnUrl FloatArray SmallFloat64 Duration

+ "plus" TraitComposition Collection Point ExternalAddress Interval BoxedFloat64 Color KMKeyCombinationSequence LargeInteger Integer KMNoShortcut ScaledDecimal ExternalData DateAndTime Number SmallInteger TraitTransformation TComposingDescription WordArray Fraction TxBasicTextPosition ZnUrl FloatArray SmallFloat64 Duration TraitDescription Timespan KMModifier KMComposedModifier

<= "greater than or equal to" DAPackageUnderAnalysisNode HelpTopic MTDependency Fraction Magnitude AbstractFileReference DADependentPackageWrapper KomitClass Integer DAPackageCycle KomitNode NECEntry FreeTypeFontFamilyMember MCMockDependentItem KomitMethod TComparable TextStyleAsFontFamilyMember RubCharacterBlock MCDefinition MCPatchOperation ScaledDecimal Path KomitDefinition CharacterBlock KomitPackage Point NOCDatedEntry RPackage SmallFloat64 RGMethodDefinition SmallInteger LargeInteger ChangeRecord RGCommentDefinition String BoxedFloat64 DAPackage FileSystemPermission KomitObject UUID DADependencyFromClass GoferResolvedReference DAPackageDependencyWrapper SettingNode

< "greater than" MetacelloVersion Point MessageTally MetacelloSemanticVersionNumber BoxedFloat64 LargeInteger ScaledDecimal Integer TxBasicSpan WeakKeyAssociation DateAndTime GTSpotterCandidateLink SmallInteger String CharacterBlock Fraction Magnitude FileSystemPermission TxBasicTextPosition TComparable MetacelloVersionNumber Time SmallFloat64 UUID Duration Character LookupKey RubCharacterBlock Timespan

= "is equal to" We all know this one...

* "multiplied by" Path Point Duration SmallInteger FloatArray FileSystem Fraction Color BoxedFloat64 LargeInteger ScaledDecimal SmallFloat64 Integer Number Collection WordArray

> "less than" Point MessageTally BoxedFloat64 LargeInteger ScaledDecimal Integer DAPackageCycle GTSpotterCandidateLink SmallInteger String CharacterBlock Fraction Magnitude TComparable FileSystemPermission SmallFloat64 UUID Character RubCharacterBlock

>= "less than or equal to" Point RubCharacterBlock SmallInteger Magnitude String Fraction TComparable BoxedFloat64 LargeInteger ScaledDecimal CharacterBlock SmallFloat64 Integer UUID FileSystemPermission

, "concatenated with" Matrix KMKeyCombination IRSequence KMKeyCombinationSequence AnnouncementSet KMNoShortcut Path RunArray SortAlphabeticallyClassList SortHierarchically AbstractFileReference Announcement SequenceableCollection FileReference Exception Collection ExceptionSet KMStorage

不太明显的:
*=  FloatArray

\\= FloatArray

** Number

// Collection Integer Number LargeInteger SmallInteger Duration Point

-= FloatArray

| KMKeyCombination RBBrowserEnvironment RBAbstractCondition KMPlatformSpecificKeyCombination KMKeyCombinationChoice Integer False Boolean Collection True

~= SmallFloat64 SmallInteger Object BoxedFloat64

==> Boolean

-> Object

~> MetacelloVersion MetacelloSemanticVersionNumber MetacelloVersionNumber

>> Behavior TBehavior Integer TraitBehavior

-- TxBasicTextPosition

>-------> SHParserST80Test

\ Collection

== ProtoObject

\\\ Integer LargeInteger

% Number

~~ ProtoObject

& Collection RBBrowserEnvironment Integer ZnUrl RBAbstractCondition False Boolean True

,, Matrix

+= ThirtyTwoBitRegister FloatArray

<< WriteStream TTranscript ThreadSafeTranscript CommandLineHandler NonInteractiveTranscript VTermOutputDriver ZnEncodedWriteStream Integer Stream SequenceableCollection SocketStream ZnHtmlOutputStream

=> FLSqueakPlatform Symbol

+* Matrix Array

/= FloatArray

\\ Collection Number LargeInteger SmallInteger Duration Point

? ZnUrl

@ "returns a point?" TraitTransformation TComposingDescription TraitDescription Number TraitComposition SequenceableCollection TraitAlias

最佳答案

让我补充Carlos's answer使用更多这些选择器。

~= SmallFloat64 SmallInteger Object BoxedFloat64

...是相等比较的否定 = .
-> Object

...是创建关联的简洁方法,键值对。写信 x -> y并获得一个以 x 为键、 y 为值的 Association 实例。它们用于 Dictionary 的实现。
<<  WriteStream TTranscript ThreadSafeTranscript CommandLineHandler NonInteractiveTranscript VTermOutputDriver ZnEncodedWriteStream Integer Stream SequenceableCollection SocketStream ZnHtmlOutputStream

...是 a) 将对象放入 Stream 的简写。 aStream << anObject应该等同于 aStream nextPut: anObjectaStream nextPutAll: anObject , 取决于参数的类型。 C++ 开发人员可能看起来很熟悉。

...和 ​​b) 向左移动整数位的二进制消息。所以你可能已经猜到了...
>> Behavior TBehavior Integer TraitBehavior

...除了 Carlos 所写的关于从 Behaviors 获取方法的内容之外,也是 Integers 的右移运算符。
==> Boolean

...是逻辑含义,这意味着 false ==> x总是回答正确和 true ==> y回答y。

请注意一些其他消息,例如 ** , 默认情况下在 Squeak 中没有实现。

在法罗, **raisedTo: 的二进制消息别名,因此它将接收器提升到参数的幂 ( 5 ** 3 = 125),就像在 Python 和其他一些语言中一样。

关于smalltalk - 鲜为人知的 Smalltalk 二进制消息及其含义?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41749410/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com