joshuaulrich/pack

Add ability to use Python-style templates

Open

#2 opened on Mar 2, 2015

 (0 comments) (0 reactions) (0 assignees)R (2 forks)github user discovery
help wanted

Repository metrics

Stars
 (1 star)
PR merge metrics
 (No merged PRs in 30d)

Description

Currently, only perl-style templates are supported. It would be nice to support python-style templates.

It's not clear what is the best way to provide this functionality. A global option (via options) is undesirable because it makes reproducibility more difficult. Making pack and unpack generic and dispatching on a template class seems overkill. Adding an argument could be confusing, since the template and the argument might not agree.

Perhaps the easiest way is to let users start the template string with the template type? For example, pack("pl A4 C v", 2, 8, 'sequence'). The "pl" prefix would denote a perl-style template. A "py" prefix would denote a python-style template.

Contributor guide