Skip to content

EizoAssik/clformat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

clformat

CL-format is a Python implementation of the format function in Common Lisp.

About

The function itself just depends on builtins, the str module and the itertools module.

As the format in Common Lisp used a complex rules (a powerful DSL, acctually) to format a sting, it's not that easy to reimplement a Python fork elegantly for me, so any help will be greatly appreciated.

NOTICE: Only tested in CPython 3.4.1, I'm sorry but clformar cannot works in PyPy3 now. I'll fix this after the function finally works.

Usage

from clformat import clformat

or

from clformat import *

and try it:

clformat(None, '~{~A~}!', ['Hello', ' ', 'world'])

Documention

See CL-format documents here.

For documentions of the format function in Common Lisp, see here.

About

A Python fork for the format ifunction n Common Lisp

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published