joshuaulrich/pack

Add ability to use Python-style templates

オープン

#2 opened on 2015/03/02

 (0 件のコメント) (0 件のリアクション) (0 人の担当者)R (2 件のフォーク)github user discovery
help wanted

Repository metrics

Stars
 (1 個のスター)
PR merge metrics
 (30d に merged PR はありません)

説明

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.

コントリビューターガイド