pharo-project / pharo

Pharo is a dynamic reflective pure object-oriented language supporting live programming inspired by Smalltalk.
http://pharo.org
Other
1.2k stars 356 forks source link

Adding more executable comments #15844

Open Ducasse opened 9 months ago

Ducasse commented 9 months ago

Here is a method with typical executable comments.

> aString
    "Answer whether the receiver sorts after aString.
    The collation order is simple ascii (with case differences)."

    " 'def' > 'abc' >>> true"
    " 'def' > 'def' >>> false"
    " 'abc' > 'def' >>> false"

    ^ (self compare: self with: aString) > 0

" 'def' > 'abc' >>> true" is an executable comment. The idea is to have little examples that we can check by executable the first part 'def' > 'abc' and this part should return the second part here true.

We need to add more of them to core classes.

JulienLamhene commented 3 months ago

Could you, give more detail about what is a core class, please ? Thank you in advance