> > I like these ideas, and it suggests to me that Pollen could have some > better tools built in for managing poly projects. > I agree, any additional facilities for splitting out the logic of tag functions by output format would be welcome as long as they aren't too complicated.
After trying it this macro, my one thought was that using the > `poly-branch-tag` macro requires naming the underlying tag functions in a > certain way, which is potentially fragile (and requires escalating > housekeeping). > I thought about this a bit while writing it. It is kind of brittle, but it has one (extremely fringe) benefit. Suppose you have two target formats that require their tag functions to produce very similar output. For example, suppose you have a .txt format and a .wav format, where the tag functions for both are producing similar-looking plain text (which template.wav presumably converts using text-to-speech as the final step). In this case, it will be obvious from the name of the function you are editing what format you are working with. This works slightly better with how I think while skimming and writing code (i.e. lazy subconscious assumption that function names are unique within a project). Here's an alternate — not necessarily better or preferable — approach where > the macro takes as input the targets and the source files containing the > tags: > https://gist.github.com/mbutterick/caf88360fc0090305937ca54539054bc > I found this instructive and it got me thinking. What if Pollen automatically branched to tag functions prefixed with pdf: when current-poly-target is 'pdf ? That is, if 'pdf is the current target, Pollen would check for pdf:strong and, if it didn't find one, default to plain-ol strong. You could then (require (prefix-in pdf: "my-pdf-tags.rkt")) and everything in "my-pdf-tags.rkt" would be used for PDF. You wouldn't have to worry about filenames *or* function names. (Alternatively you could manually name all your PDF tag functions pdf:tagname and put them wherever you want.) This gives me most(*) of what I originally tried to accomplish, & doesn't break existing projects or the examples in the docs. (* - The other thing I like about my macro is the ability to add a required attribute, or to assign default values some attributes, prior to branching to the tag function for this or that format.) -- 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 [email protected]. For more options, visit https://groups.google.com/d/optout.
