[racket-dev] Caching rendered icons

From: Neil Toronto (neil.toronto at gmail.com)
Date: Thu Jan 12 14:32:22 EST 2012

On 01/12/2012 12:22 PM, Eli Barzilay wrote:
> Neither of these is relevant now, but still:
> An hour ago, Neil Toronto wrote:
>> Which directory would I put them in? Would I make a subdirectory of
>> 'pref-dir? (Not 'temp-dir, because that might be the current
>> directory.)
> The temp directory is a bad idea because it's shared.  The preferences
> would be much better, but you'd need to worry about locking too.
>> 2. Compile time: Provide macros that render icons during expansion and
>> try to store them in the "compiled" directory. They expand to code
>> that loads the icon if the file exists; renders it otherwise. This
>> turns rendering into compiling and icons into program binaries,
>> which Seems Right.
>> Is there a way to reliably get the "compiled" directory path during
>> expansion, and then load files from it at runtime? Can I ensure that
>> .PNG files are distributed automatically?
> Putting other stuff in compiled directories would probably complicate
> distributions (of both kinds), so the compile-to-bytestring is really
> better.  (One possible thing to keep in mind is to avoid compilation
> relying on having a display.)

All good to know. Thanks, Eli.

Neil T

Posted on the dev mailing list.