Very good solution :)
To continue this discussion, feel free to mail me; we will also reduce some
noise here on the list.
Sanel
On Friday, April 6, 2012 6:47:37 PM UTC+2, Andru Gheorghiu wrote:
>
> It's ok now. The problem was in the let of the optimize function...
> initially I had:
> (let
It's ok now. The problem was in the let of the optimize function...
initially I had:
(let [reduced (reverse (into nil (eval-deep exprs)))]
because exprs was a lazy sequence and I wanted to turn it into a list.
I replaced the "(reverse (into nil ..." part with "(apply list ..."
and it works just f
This looks really nice; good work!
To force evaluation of lazy constructs, you can use 'doall' and 'dorun'.
Can you show the snippet with this problem?
Sanel
On Thursday, April 5, 2012 1:19:32 AM UTC+2, Andru Gheorghiu wrote:
>
> Sorry for dropping off the radar, I was caught up in some homewor
Sorry for dropping off the radar, I was caught up in some homework for
college.
I've written a very simple program for a limited form of constant
folding:
; Forces evaluation of an expression or returns the expression if
; it can be evaluated
(defn force-eval [exprs]
(try (eval exprs)
(catch
b))
>
> > > here it could rewrite whole block as:
>
> > > (if something
> > > 1)
>
> > > or even can recognize Clojure patterns like:
>
> > > (apply + (range 1 10))
>
> > > where the pattern matching approach could rewrite e
>
> This isn't a big issue, as recursive functions aren't much advised in
> Clojure. However, ideal solution would be to detect tail calls and rewrite
> block in loop/recur combo. This would allow Clojure to fully reuse TCO
> without waiting for JVM to implement it (which will probably never happen
posal.
> Of
> > course, taking some expert system approach and doing Kibit-style
> matching
> > can be a good starting point too :)
> >
> > Also, if you are interested to take tree shaking way, a good starting
> point
> > can be SBCL alpha shaker athtt
ut the code is quite easy to follow.
>
> Sanel
>
>
>
>
>
>
>
> On Saturday, March 17, 2012 10:59:44 PM UTC+1, Andru Gheorghiu wrote:
>
> > Hello,
>
> > I am a third year student majoring in computer science and I am
> > interested in the Clojure code o
tation, but the code is quite easy to follow.
Sanel
On Saturday, March 17, 2012 10:59:44 PM UTC+1, Andru Gheorghiu wrote:
>
> Hello,
>
> I am a third year student majoring in computer science and I am
> interested in the Clojure code optimizer project proposed for GSoC
> 2012.
On Sat, Mar 17, 2012 at 5:59 PM, Andru Gheorghiu wrote:
> Hello,
>
> I am a third year student majoring in computer science and I am
> interested in the Clojure code optimizer project proposed for GSoC
> 2012. Could you please give more details (or examples) on the types of
>
Hello,
I am a third year student majoring in computer science and I am
interested in the Clojure code optimizer project proposed for GSoC
2012. Could you please give more details (or examples) on the types of
optimizations the optimizer should be able to do? Also, what is a tree
shaker
11 matches
Mail list logo