[Newbies] closed and open interval

Randal L. Schwartz merlyn at stonehenge.com
Mon Nov 24 16:46:25 UTC 2008


>>>>> "Filip" == Filip Malczak <filet00 at gmail.com> writes:

Filip> You can always make subclass of Interval for example OpenedInterval , add
Filip> two variables: left and right.Make new methods:
OpenedInterval> from: aNumber to: aNumber left: aBoolean
OpenedInterval> from: aNumber to: aNumber right: aBoolean
OpenedInterval> from: aNumber to: aNumber left: aBoolean right: aBoolean

You're exposing implementation there.  I suggest:

beOpenLeft
beClosedLeft
isOpenLeft
isClosedLeft

and the corresponding "right" methods, rather than an explicit boolean.
More flexibility later.

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn at stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc.
See http://methodsandmessages.vox.com/ for Smalltalk and Seaside discussion


More information about the Beginners mailing list