ANN: Potemkin 0.3.0

瀏覽次數:500 次
跳到第一則未讀訊息

Zach Tellman

未讀,
2013年6月19日 下午3:12:412013/6/19
收件者:clo...@googlegroups.com
Potemkin [1] is a collection of facades and utilities that I've found helpful when writing larger-scale libraries or applications.  I've never formally announced it before, but I think it's gotten to the point where others can benefit from it.

A few highlights:

* 'def-map-type', which allows for the definition of custom map-like objects with 10x less code
* 'unify-gensyms', which allows for more concise nested syntax-quotes
* 'import-vars', which allows for code sprinkled across multiple namespaces to be exposed via a single namespace

It's been pointed out before that ideally a library should have no dependencies but Clojure itself, or we risk transitive dependency conflicts when everyone uses different versions of a utility library.  In deference to this, Potemkin is licensed such that any piece of code can be simply pasted into your library, as long as there's a comment describing the origin.

If anyone has questions, I'm happy to answer them.  If anyone has moral or aesthetic objections to 'import-vars', you're not alone, but please remember you're under no obligation to use it.

Zach

Zack Maril

未讀,
2013年6月19日 下午3:29:162013/6/19
收件者:clo...@googlegroups.com
We've been using Potemkin inside Titanium, Ogre, and Archimedes. It works well for importing functions, but I'm about to do a rewrite of Titanium and Ogre because of complications arising from being clever with importing dynamic vars. I would caution against trying to import dynamic vars (or functions that rely on dynamic vars) between libraries. 
-Zack

Matthew Chadwick

未讀,
2013年6月19日 晚上9:47:262013/6/19
收件者:clo...@googlegroups.com
If anyone has moral or aesthetic objections to 'import-vars', you're not alone, but please remember you're under no obligation to use it.

I used lein-clique to make a graph of Lamina's dependencies (huge PNG), but the use of import-vars caused several mirrored subgraphs which I don't really know how to filter out. 

Jason Wolfe

未讀,
2013年6月19日 晚上11:38:322013/6/19
收件者:clo...@googlegroups.com
We're starting to use potemkin at Prismatic, and the part we've found most useful which Zach didn't mention in his post are the smart types.  Especially definterface+, which is like a love child of defprotocol and definterface:
 - Same syntax as defprotocol, and defines functions in your namespace that wrap the interface functions (without extend-protocol support, obviously)
 - Allows for primitive arguments and return values (like clojure.core/definterface), which are propagated to the wrapper functions for maximal performance
 - Doesn't re-evaluate if the body has not changed, which can make repl development less painful (especially when used with its defrecord+ counterpart).

Dave Sann

未讀,
2014年9月14日 凌晨3:53:472014/9/14
收件者:clo...@googlegroups.com
Does Potemkin work well with clojurescript?

I have seen some discussion of issues in some places. Is there anywhere that notes challenges?

I am particularly interested with the import-vars scenario (defining namespaces separately and then merging definitions into one namespace for usage).

Dave

Dave Sann

未讀,
2014年9月16日 凌晨3:30:472014/9/16
收件者:clo...@googlegroups.com
to answer my own question. It does not play well. I created a couple of simple macros that mimics the import-vars behaviour for fns and vars in clojurescript. 
回覆所有人
回覆作者
轉寄
0 則新訊息