git @ Cat's Eye Technologies Dieter / master eg / example10.dtr
master

Tree @master (Download .tar.gz)

example10.dtr @masterraw · history · blame

/* -*- encoding: utf-8 -*- */
/* from the article */

module tagged

  var tag_map : map to string

  procedure make_tagged(x: t): tagged t
  begin
    return (bestow tagged x)
  end

  procedure tag(x: tagged t, y: string): void
  begin
    tag_map[x] := y
  end

  procedure get_tag(x: tagged t): string
  begin
    return tag_map[x]
  end

end.