MarkingKey

Niko Schwarz niko.schwarz at gmx.net
Tue Jun 11 11:58:54 UTC 2002


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello Richard,

Am Dienstag, 11. Juni 2002 04:40 schrieb Richard A. O'Keefe:
> Niko Schwarz <niko.schwarz at gmx.net> wrote:
> 	In a lot of algorithms it is useful to have a marking key that
> 	is bigger than all other elements of a list or another data
> 	structure.
>
> I have never EVER heard the term "marking key" used before, and I've
> been studying and teaching algorithms for longer than I care to remember.
> The term that is almost universally used is "sentinel",

Well, I didn't find the word in my dictionary, so I translated it like I found 
it appropriate. But sentinel sounds nice, too.

>  - it is quite as common to have a use for "minus infinity" as
>    for "plus infinity"
>  - in many cases a sentinel is NOT an extreme value at all, but
>    something having a particular property (being a blank, not being
>    a letter, being divisible by something, having an area which is
>    extreme, being the name of an empty file you are sure to be able
>    to open, ...)

Ho, that's not my marking key. They're quite useful, each one, like an element 
z in a linked list. And of course I know you cannot ship that with squeak for 
each purpose. But this "sentinel" I'm talking about is a special one, and as 
it seems to me, it is very common when working with basic data structures. 

> 	In other languages you usually use maxInt and so on
> 	for that, but that is not appropriate for squeak.
>
> It is very seldom appropriate in the other languages either.
> A sentinel should be a value that you KNOW CANNOT POSSIBLY occur as
> legitimate data.  As such, sentinel values tend to be extremely
> problem-specific.

How "seldom appropriate"? I need a value that is below or above anything else, 
that's all. And when numbers are keys (very common) than the biggest or 
smallest number is the solution. 
A generalization would be such a MarkingKey class, or Sentinel, if you want 
so.

regards,

nick
- -- 
G. B. Shaw to William Douglas Home: "Go on writing plays, my boy.  One
of these days a London producer will go into his office and say to his
secretary, `Is there a play from Shaw this morning?' and when she says
`No,' he will say, `Well, then we'll have to start on the rubbish.' And
that's your chance, my boy."
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE9BeX+c9uyCiO8RNQRAg1KAJ976Gox9eThmrwHhAEreqHCoyoe3QCghpty
gt/HKslY2lKFVURf7RisWKw=
=crnE
-----END PGP SIGNATURE-----




More information about the Squeak-dev mailing list