Skip to content

Chapter 16 #1

Description

@Ducasse
  • Chap16
    16.9 Class creation messages Page182
    Better instance creation for additions:

EEAdditionTest >> testEvaluateWithClassCreationMessage
| ep1 ep2 |
ep1 := EConstant constant5.
ep2 := EConstant constant3.
self assert: (EAddition left: ep1 right: ep2) evaluate equals: 8

Ici on n'a pas encore définir message constant5 et constant3.


  • 16.11 Printing Page186
    Printing constant

EConstantTest >> testPrinting
self assert: (EConstant value: 5) printString equals: '5'

Ici on peut remplace (EConstant value: 5) à EConstant constant5


16.16 Variables Page195
Back to variable expressions

EVariable >> printOn: aStream
aStream nexPutAll: id asString

Il manque un 't': nextPutAll: .

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions