[00:05:21] There is of course another thing you might use generic functions for in your project [00:05:43] Which is to make _load, _save, etc. all generic functions. :) [00:06:06] At that point, you need only ever write one DM class, and everything else could be done with generic functions. :) [00:18:58] <_erikrose> One would have to come up with some way of organizing them, since you don't get that "class" thing for free. [00:19:45] <_erikrose> I'm still only beginning to understand PEAK, but, IMO the biggest liability of its extensive use of dynamic programming is that the code is not very self documenting. [00:20:52] <_erikrose> It's easy to look at some static Java class and see what it does and what it doesn't, but when there are 4 different metaclasses plugging stuff into a class at runtime, you've really got to have a spec somewhere. [00:21:03] <_erikrose> Interfaces, I suppose, help. [00:21:51] <_erikrose> As far as generic funcs, I guess you'd put the generics in one file [00:22:13] <_erikrose> and then maybe the SQLServer-specific implementations in another (I forget the vocab word). [00:28:00] <_erikrose> Back to dynamic programming and examinability...and I'm thinking aloud here...the more declarative one can be, the better, it seems to me. [00:28:29] <_erikrose> Something like binding.Make(whatever) is very clear, once you go read the spec for Make. [00:29:21] <_erikrose> Conversely, a very imperative for-loopy metaclass that adds a bunch of methods to a class is hard to grok by looking at it; you have to run the loops in your head. [00:29:36] <_erikrose> SQLDM still has some of those left in it. They won't last. [00:30:09] <_erikrose> I'm just so happy that thing runs. :-) Now, to attack it with a shovel and break it. [00:33:08] <_erikrose> Ah, it's late, and I'm babbling. To bed with me! [00:33:22] <_erikrose> Thanks again for the attention to storage, pje! [00:33:58] You actually would have classes, you know. [00:34:10] DM subclasses for one, to anchor specific mappings [00:34:16] Connection classes [00:34:16] <_erikrose> Right, but then code outside them would be executing. [00:34:23] And object classes [00:34:41] Well, you'd be declaring the methods within the body of a DM subclass. [00:34:59] <_erikrose> Right, and then instantiating (is that the word you use?) them some other place, possibly optionally. [00:35:42] Eh? No, I mean that if you need to create a custom mapping, you'd create a DM subclass and then write its custom methods within the body. [00:36:15] The predicate dispatch stuff automatically makes such methods applicable only to instances of that class or a subclass thereof. [00:36:32] (More precisely, it makes them require the first argument (i.e. self) to be of such a type) [00:36:34] <_erikrose> Riiiiight. [00:36:47] So there's no "other place" [00:36:49] <_erikrose> So how does that win over simple subclassing? [00:37:09] Because you can have more than one version of the method, based on the classes of the *other* arguments [00:37:10] <_erikrose> I do understand what predicate dispatch is, but I'm trying to grab a use case. [00:37:29] Not to mention the truth of arbitary boolean tests on the arguments. [00:37:41] So, think of it as expanded signature overloading [00:37:47] <_erikrose> Sure, that I grok. [00:38:17] But where in addition to dynamic dispatch on type (which of course most signature overload languages don't do), you can also add arbitrary guard conditions. [00:38:18] <_erikrose> So this gimmeTheAutoincrementSql() function... [00:38:27] ...is not a predicate-dispatch function [00:38:31] It only needs to be single-dispatch. [00:38:52] <_erikrose> Which is a subset thereof. [00:39:24] <_erikrose> But you had suggested making things like _new and _load into generics. [00:40:11] <_erikrose> Now, I'm just thinking, with my late-night-addled brain, whether that would subsume or combine with subclassing. [00:40:11] Yep. The purpose of this would be to allow you to create a DM that could work for any object type simultaneously. [00:40:34] So that instead of needing e.g. BulletinsDM and UserDM, you would just have TheDM. :) [00:40:42] <_erikrose> Hmm..... [00:40:58] The trick being that you then need to be a bit more creative about what you use as OID's. [00:41:08] <_erikrose> I'd probably have to code it up to see if it was a bigger or lesser mess than multiple subclasses. [00:41:21] <_erikrose> What's your guess? [00:41:30] Well, initially it'll be more of a mess. [00:41:53] But, as you understand the patterns, you'll create shorthand APIs, so that you can declaratively state info about fields and tables and suchlike. [00:42:04] And those APIs will just add methods to the generic function(s) for you. [00:42:28] <_erikrose> Double hmm. [00:42:29] Unadorned generic functions are very useful, but wrapped with a convenience API for a specific application domain, they're outstanding. [00:42:39] Take a look at the OptionsHowTo in the wiki [00:42:55] It's an example of an API that doesn't appear to have anything to do with generic functions [00:43:13] * _erikrose looks. [00:43:53] But it's implemented atop a predicate dispatcher. [00:44:36] The SecurityRules page shows a somewhat thinner wrapping over a pair of generic functions, to implement a predicate-based access control system. [00:44:56] <_erikrose> I'm more familiar with the security framework than the OptionsHowTo. [00:46:08] <_erikrose> I don't know what you're doing in Python. Why aren't you in Lisp? ;-) [00:46:43] <_erikrose> It seems like you'd have a great time with macros, rolling your own language. [00:47:15] Ugh. [00:47:28] Parentheses are a problem, for one thing. [00:47:44] But also, Lisp is just *too* unstructured. Python has just the right amount of pushback. [00:48:02] <_erikrose> Hmp. Interesting. [00:48:45] <_erikrose> I've not done much short of Hello, World in Lisp, but it never was readily apparent to me how I'd structure a program in it. [00:49:09] <_erikrose> I assumed (and still suspect) it would come with practice. [00:50:44] <_erikrose> Seeing how oftentimes tend to use callable classes, I began wondering what "def" was even for. Just a shortcut, I suppose. [00:50:54] <_erikrose> ^you [00:51:29] Shortcut? [00:51:36] <_erikrose> A shortcut for... [00:51:47] <_erikrose> class theDefName: [00:51:59] <_erikrose> def __call__: [00:51:59] <_erikrose> blah [00:52:06] <_erikrose> I guess that's recursive; isn't it? ;-) [00:52:08] Yes, and then how would you do that without def? [00:52:15] <_erikrose> lol [00:52:21] That's why you completely confused me. [00:53:40] <_erikrose> This time, I'm really going to bed. Good night, sir. It's been a pleasure. [00:59:21] * pje waves [01:09:55] ** hazmat has left IRC ("Leaving") [01:10:46] ** hazmat has joined us [01:38:19] ** pje has left IRC ("Client exiting") [04:02:31] [connected at Sat May 21 04:02:31 2005] [04:02:31] <> *** Looking up your hostname... [04:02:31] <> *** Checking ident [04:02:31] <> *** Found your hostname [04:03:02] <> *** No identd (auth) response [04:03:02] <> *** Your host is niven.freenode.net[niven.freenode.osuosl.org/6667], running version dancer-ircd-1.0.35 [04:03:02] [I have joined #peak] [04:03:02] ** niven.freenode.net set the topic to DMs made easy(er) -- http://www.eby-sarna.com/pipermail/peak/2005-May/002296.html [04:04:06] ** hazmat has left IRC ("This computer has gone to sleep") [09:44:32] ** debugger has joined us [14:27:50] {global notice} Hi all! In a little more then 12 hours, I will begin major maintenence on the network. For more information, please see 'http://www.freenode.net/news.shtml' Thank you for your patience, and thank you for using freenode! [16:39:45] [Global Notice] Hi all. As reported previously, we're going to have major downtime in about 11 hours.... for an update on the downtime and on fundraising, please take a look at http://freenode.net/news.shtml .... thank you for your patience, and thank you for using freenode! [16:48:38] ** hazmat has joined us [16:50:51] ** _erikrose has left IRC () [17:59:22] ** hazmat has left IRC ("This computer has gone to sleep") [19:23:52] ** hazmat has joined us [21:32:22] {global notice} Hi all! in 5.5 hours, I'm going to begin the maintenence on the network. This will affect about half the network. For more information, please see 'http://www.freenode.net/news.shtml' Thank you for your patience, and thank you for using freenode! [21:43:02] ** debugger has left IRC ()