gilch
gilch
A simple example: ```Hy => (defmacro foo [x &rest xs] `((fn [s &kwargs kws] (, s kws)) '~x ~@xs)) => (foo norf :bar 1 :baz 2) ('norf', {'bar': 1, 'baz':...
They look pretty different to me. They both have the property of caching the calculated values. @tuturto's sequences seems like more of an alternative to generators. My seq abstraction would...
> gilch's approach takes any iterator and creates a new immutable iterator: More precisely, it takes any _iterable_ and makes a new lazy immutable _iterable_ from it. The iterables are...
We'd have to design it carefully. My proof of concept might have a bit of a problem there. I haven't tested it enough (and have already uncovered other problems). But...
My vote would be for `inc`/`dec` non-mutative like Clojure (status quo). I understand that immutability is not as pervasive in Hy as it is in Clojure, so failing that, we...
> That will not break the existing API I'm not too worried about that at the moment. We've been breaking API every release, and have more breaking changes planned. That...
Thinking about this some more, we could probably write a macro to do this, and avoid catching extra exceptions with gensyms. ```Hy (defmacro/g! get [coll key &optional default] `(do ;;...
Here's an improved `insert-better-name`. Call it `attach` (it starts with `att` like `attr`) ```Hy (attach self x y :my_foo a_foo) ;; same as (setv self.x x self.y y self.my_foo a_foo)...
Here's an implementation. ``` (defmacro! attach [o!target &rest vs] (setv ivs (iter vs)) (import hy) `(setv ~@(chain.from-iterable (genexpr [`(. ~g!target ~(if (instance? hy.HyKeyword arg) (hy.HySymbol (cut (str arg) 1)) arg))...
> It's better to use (name kw) Forgot about that one. Revision. ``` (defmacro! attach [o!target &rest vs] (setv ivs (iter vs)) (import hy) `(setv ~@(chain #*(genexpr [`(. ~g!target ~(if...