This post worries me.
I've considered rewriting functions as inlining-macros for
optimization purposes. But I thought it would be a transparent change.
This post shows that it's not a transparent change, and could
potentially lead to some very odd looking bugs.
What if I wanted to optimize printl
On Jun 16, 2:22 pm, Kevin Downey wrote:
> you can use apply to avoid in-lining:
>
> user=> (binding [+ -] (apply + '(5 3)))
> 2
>
Indeed; this is what my macro ended up doing anyway, since it has to
work regardless of the arity of the functions to trace.
--
Michel
--~--~-~--~~-
you can use apply to avoid in-lining:
user=> (binding [+ -] (apply + '(5 3)))
2
On Tue, Jun 16, 2009 at 11:16 AM, Michel S. wrote:
>
>
>
> On Jun 16, 1:42 pm, Paul Stadig wrote:
>> On Tue, Jun 16, 2009 at 1:38 PM, Michel Salim wrote:
>>
>>
>>
>> > It's currently not possible to dynamically reb
On Jun 16, 1:42 pm, Paul Stadig wrote:
> On Tue, Jun 16, 2009 at 1:38 PM, Michel Salim wrote:
>
>
>
> > It's currently not possible to dynamically rebind functions:
>
> > (binding [+ -] (+ 5 3)) ==> 8 ;; not 2
>
> > Thanks,
>
> > --
> > Michel S.
>
> It is possible to rebind (even core) functio
Yes, people have shown examples on this list where
(+ a b)
is dramatically faster than
(+ a b c)
On Jun 16, 1:42 pm, Paul Stadig wrote:
> On Tue, Jun 16, 2009 at 1:38 PM, Michel Salim wrote:
>
>
>
> > It's currently not possible to dynamically rebind functions:
>
> > (binding [+ -] (+ 5 3)) =
On Tue, Jun 16, 2009 at 1:38 PM, Michel Salim wrote:
>
> It's currently not possible to dynamically rebind functions:
>
> (binding [+ -] (+ 5 3)) ==> 8 ;; not 2
>
> Thanks,
>
> --
> Michel S.
>
It is possible to rebind (even core) functions, but there are a couple of
limitations. One of which is
It's currently not possible to dynamically rebind functions:
(binding [+ -] (+ 5 3)) ==> 8 ;; not 2
Would this be supported in the future? It would make it easier, for
example, to extend the current tracing functionality, e.g.
(trace-in-expr [f1 f2] (f1 (f2 10))) ==>
(let [oldf1 f1 oldf2 f2]