Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!hplabs!otter.hpl.hp.com!otter!sfk From: sfk@otter.hpl.hp.com (Steve Knight) Newsgroups: comp.lang.misc Subject: Re: Dynamic typing (part 3) Message-ID: <2400037@otter.hpl.hp.com> Date: 21 Mar 91 16:00:24 GMT References: <602@optima.cs.arizona.edu> Organization: Hewlett-Packard Laboratories, Bristol, UK. Lines: 20 Chris writes: > Dan certainly gets better efficiency: -oneof- is slow on lists (because > -length- and indexing are slow on lists). Given Steve's propensity for > speed-hacking, I'm surprised he didn't write the definition of -syllables- as > lvars syllables = {% 'syllables'.discin.incharline.pdtolist.dl %}; > to generate a vector rather than a list. No fair, Chris :-) It was only an anecdote ... Still if you insist[*]. define pdtovector( p ); lvars p; {% apprepeater( p, identfn ) %} enddefine; Footnote: Besides, you know I'd have written it like this for speed define program(); lvars n = #| apprepeater( '/tmp/syllables'.discinline, identfn ) |#; repeat 3 times n.random.subscr_stack.pr endrepeat; nl( 1 ); enddefine;