/usr/share/tcltk/xotcl1.6.7-patterns/adapter.xotcl is in xotcl 1.6.7-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 | # $Id: adapter.xotcl,v 1.4 2005/09/09 21:09:01 neumann Exp $
package provide xotcl::pattern::adapter 0.9
package require XOTcl
namespace eval ::xotcl::pattern::adapter {
namespace import ::xotcl::*
Class Adapter -superclass Class
@ @File {
description {
Simple adapter pattern meta-class taken from the paper
'Filters as a Language Support for Design Patterns in
Object-Oriented Scripting Languages'.
}
}
Adapter instproc adapterFilter args {
set r [self calledproc]
my instvar specificRequest adaptee \
[list specificRequest($r) sr]
if {[info exists sr]} {
return [eval $adaptee $sr $args]
}
next
}
Adapter instproc init args {
my instfilter add adapterFilter
next
my instproc setRequest {r sr} {
my set specificRequest($r) $sr
}
my instproc setAdaptee {a} {
my set adaptee $a
}
}
namespace export Adapter
}
namespace import ::xotcl::pattern::adapter::*
|