From: Madhu on 6 Jan 2010 14:25 * Madhu <m3r5q3cb9g.fsf(a)moon.robolove.meer.net> : Wrote on Thu, 07 Jan 2010 00:26:59 +0530: | * (Pascal J. Bourguignon) <873a2jt6zl.fsf(a)hubble.informatimago.com> : | Wrote on Wed, 06 Jan 2010 19:37:18 +0100: | | | Tamas K Papp <tkpapp(a)gmail.com> writes: | | | |> Couldn't one use LOAD-TIME-VALUE? For example: [snip] | | Nice. | | This looked vaguely familiar. Compare this solution with Naggum's | WITH-HASHED-IDENTITY solution at | <http://groups.google.com/group/comp.lang.lisp/msg/a79ba3b04895a4d8> Actually with Tamas' integers-instead-of-object-identity simplification one could eliminate the ECASE in the expanded form by compiling it into an indexed lookup in an array. IIRC Bradshaw posted a macro with that that idea, but I don't have it in my cache. -- Madhu
From: Pascal J. Bourguignon on 6 Jan 2010 15:04 Madhu <enometh(a)meer.net> writes: > Actually with Tamas' integers-instead-of-object-identity simplification > one could eliminate the ECASE in the expanded form by compiling it into > an indexed lookup in an array. As Tamas mentionned, the compiler probably does that better. -- __Pascal Bourguignon__ http://www.informatimago.com/
From: Madhu on 6 Jan 2010 15:18 * (Pascal J. Bourguignon) <87k4vvrodu.fsf(a)hubble.informatimago.com> : Wrote on Wed, 06 Jan 2010 21:04:29 +0100: | Madhu <enometh(a)meer.net> writes: |> Actually with Tamas' integers-instead-of-object-identity simplification |> one could eliminate the ECASE in the expanded form by compiling it into |> an indexed lookup in an array. | | As Tamas mentionned, the compiler probably does that better. Perhaps I was hoping someone would point me to Tim Bradshaw's macro. Note that Tamas' code already does more than half of the work---by generating consecutive numbers, generating the consecutive elements. So it is really trivial to create a vector along with the load time hash-table and avoid sequential lookup. Maybe you can show some disassembly of a compiler which compiles the CASE better? -- Madhu
From: Jochen Schmidt on 6 Jan 2010 15:26 On 2010-01-06 21:48:10 +0100, Madhu said: > * (Pascal J. Bourguignon) <87k4vvrodu.fsf(a)hubble.informatimago.com> : > Wrote on Wed, 06 Jan 2010 21:04:29 +0100: > > | Madhu <enometh(a)meer.net> writes: > |> Actually with Tamas' integers-instead-of-object-identity simplification > |> one could eliminate the ECASE in the expanded form by compiling it into > |> an indexed lookup in an array. > | > | As Tamas mentionned, the compiler probably does that better. > > Perhaps I was hoping someone would point me to Tim Bradshaw's macro. > Note that Tamas' code already does more than half of the work---by > generating consecutive numbers, generating the consecutive elements. So > it is really trivial to create a vector along with the load time > hash-table and avoid sequential lookup. > > Maybe you can show some disassembly of a compiler which compiles the > CASE better? What do you want to store in the vector? Anonymous functions? ciao, Jochen -- -- Jochen Schmidt CRISPYLOGICS Uhlandstr. 9, 90408 Nuremberg Fon +49 (0)911 517 999 82 Fax +49 (0)911 517 999 83 mailto:(format nil "~(~36r@~36r.~36r~)" 870180 1680085828711918828 16438) http://www.crispylogics.com
From: Madhu on 6 Jan 2010 15:44
* Jochen Schmidt <hi2rl4$9fu$1(a)news.eternal-september.org> : Wrote on Wed, 6 Jan 2010 21:26:12 +0100: | Perhaps. I was hoping someone would point me to Tim Bradshaw's macro. | Note that Tamas' code already does more than half of the work---by | generating consecutive numbers, generating the consecutive elements. | So it is really trivial to create a vector along with the load time | hash-table and avoid sequential lookup. | | What do you want to store in the vector? Anonymous functions? You're right. I forgot about the CASE forms. Sorry -- Madhu |