> On Dec 2, 2017, at 10:39 PM, Joel Dueck <dueckofe...@gmail.com> wrote:

> The get-* functions will accept a pagenode or a path/string, but the cached-* 
> functions will only accept a path/string
> The get-* functions take an argument pointing at the output filename (when 
> using a pagenode), but the cached-* functions expect their argument to point 
> at the source filename (like get-doc does when you pass it a path/string)

Right. `get-doc` and `get-metas` came first. I think of them as the preferred 
high-level interface. Basically they just wrap `cached-doc` and `cached-metas`, 
which are lower-level implementational functions.

> Would you consider a change (or a pull request) to allow the 
> cached-*functions to accept a pagenode, just like the get-* functions do?
> If not, would it be worth updating the docs for pollen/cache to make clear 
> that the cached-* functions expect their pathish argument to point at a 
> source file? The argument is of course named source-path, but that still 
> feels 
> It seems there is a function, cached-require, that is provided by 
> pollen/cache but not documented, could this be included in the docs? I’m 
> curious what one might use it for.
I see your point, though that would collapse the high/low difference between 
the two sets of functions. For instance, if there's more convenience 
housekeeping to be done in the future, I think that should go only in `get-doc` 
nad `get-metas` (esp since cache functions are designed to be fast, so one 
should avoid putting anything extraneous in them)

I'd agree however that the message in the docs that "you should always use 
cached-doc and cached-metas to get data from Pollen source files" is misleading 
and should be changed. What I meant is "if you were considering using a 
`require` form, don't". 

Though in general, `get-docs` and `get-metas` are the wiser choice.

PS `cached-require` ... I think my idea was to make it possible to send any 
value exported by a Pollen source file into the cache, i.e. things other than 
`doc` or `metas`, for those who want to get fancy. I stubbed it out but never 
finished it, so that's why it's not in the docs.

-- 
You received this message because you are subscribed to the Google Groups 
"Pollen" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to pollenpub+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to