[03:51:52] ** thinkeryzu has left IRC (Read error: 104 (Connection reset by peer)) [03:52:10] ** thinkeryzu has joined us [05:24:42] [connected at Wed Aug 22 05:24:42 2007] [05:24:42] <> *** Looking up your hostname... [05:24:42] <> *** Checking ident [05:24:42] <> *** No identd (auth) response [05:24:42] <> *** Found your hostname [05:24:42] <> *** Your host is anthony.freenode.net[anthony.freenode.net/6667], running version hyperion-1.0.2b [05:24:44] [I have joined #peak] [06:13:17] ** apoirier has joined us [12:30:41] ** pje has joined us [13:49:56] ** apoirier has left IRC ("KVIrc 3.2.6 Anomalies http://www.kvirc.net/") [15:34:25] ** sk1tch has joined us [16:06:21] pje is now known as pje_mtg [17:59:28] pje_mtg is now known as pje [18:02:03] can anyone explain the Dispatching object to me? [18:34:37] ** sk1tch_ has joined us [18:55:12] ** sk1tch has left IRC (Read error: 110 (Connection timed out)) [19:24:04] The Dispatching object in PEAK-Rules, sk1tch? [19:24:17] yeah [19:24:26] i'm pretty confused as to just what it's doing [19:24:33] It holds dispatching information for the generic function. [19:24:44] It's basically a persistent adapter [19:25:09] (persistent in the sense that there's only one and it stays around for the life of the function, not that it's stored to disk or anything) [19:25:25] okay, so there is only one [19:25:32] yep. [19:25:59] if you know it well, would you mind kind of walking me through how something is stored in it? [19:26:07] i.e. what does Dispatching(a_function) do? [19:26:09] See http://pypi.python.org/pypi/ObjectRoles for a tutorial on role/aspect objects [19:26:39] I haven't updated PEAK-Rules yet, but the pattern for how Dispatching works is now a separate library, ObjectRoles [19:26:46] Dispatching is just a Role. [19:26:50] i see [19:27:13] SomeRoleClass(ob) returns the SomeRoleClass instance corresponding to ob [19:27:30] ok that makes some sense [19:27:32] i'm new to AOP [19:27:34] (and creates it if necessary) [19:27:38] SomeRoleClass.exists(ob) tells you if an instance exists [19:28:00] i see [19:28:03] Whoops, that was supposed to be .exists_for(ob) [19:28:17] SomeRoleClass.delete_from(ob) gets rid of the instance. [19:28:42] You can also have role keys, where you do things like SomeRoleClass(ob, "foo", 42) [19:28:57] which returns you the ('foo',42) instance for ob [19:29:07] okay [19:29:10] That's for cases where you want more than one per object. [19:29:11] that's a useful data structure [19:29:14] how the hell is that implemented [19:29:16] The indexes in PEAK-Rules work that way. [19:29:24] (i mean i'll look it up, it's interesting though) [19:29:30] http://pypi.python.org/pypi/ObjectRoles#role-storage-and-garbage-collection [21:01:17] ** sk1tch_ has left IRC () [21:10:54] ** sk1tch has joined us [21:35:44] ** sk1tch has left IRC (Read error: 110 (Connection timed out))