I think that files in collections is the way to go. You don't have to use
collection-file-path, you could search the collections yourself, but I'm
not sure that it would be faster. Are you seeing something specific that
has bad performance?

Robby


On Fri, Mar 4, 2016 at 3:58 PM, Jon Zeppieri <[email protected]> wrote:

> I'm working on a new version of the CLDR (localization data) packages,
> with the goal of reducing the amount of data that most installations will
> need.
>
> The packages are broken up into:
> cldr2: provides functions for accessing the data and resolving locale names
> cldr2-data-core: provides the data from
> https://github.com/unicode-cldr/cldr-core
> cldr2-data_<locale name>: one per locale, provides data from the rest of
> the unicode-cldr repos, but only for the locale in the package name
>
> The cldr2 package depends on cldr2-data-core, but a user is free to
> install as many or as few locale-specific packages as desired.
>
> The problem I've run into is how, at runtime, to find the data files I
> need in a way that works during development.
>
> Each of the cldr2-data-* packages has a data archive at
> cldr2/data/json.zip from the package root directory. So, if someone wants
> data from the core package, we could do:
>
> ```
> (define dir (pkg-directory "cldr2-data-core" #:cache PKG-CACHE))
> ... [raise an exception if the package isn't installed] ...
> (define zip-path (build-path dir "cldr2" "data" "json.zip"))
> ... [open the archive and extract the relevant data] ...
> ```
>
> And that's fine, except that it doesn't work in development when using
> raco link, because raco link manages collections, not packages. And I don't
> think that collection-file-path is useful here either, since all of these
> json.zip files have exactly the same collection-relative path.
>
> What's the best way to handle this? Should I just give the zip files
> distinct names and use collection-file-path? Or is there a better way to
> handle this situation? (I'm a bit reluctant to use collection-file-path,
> since I think it searches the file system and so would be a bit expensive.
> pkg-directory needs to parse the package catalog, but it allows the results
> of that parse to be cached.)
>
> -Jon
>
>
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Racket Developers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/racket-dev/CAKfDxxxywSUuR0j%3DM1sgU3foezz_jt3%2BAChNEqCO3SuqYtffRA%40mail.gmail.com
> <https://groups.google.com/d/msgid/racket-dev/CAKfDxxxywSUuR0j%3DM1sgU3foezz_jt3%2BAChNEqCO3SuqYtffRA%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-dev/CAL3TdOOZ71T8NDBx2%2BRJx1dh4PnzA9%3DH9L42LGA8b%3DQhAYHs6w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to