Listen to Midnight by Dstllry Music.
This is a tumblelog, kinda like a blog but with short-form, mixed-media posts with stuff I like. Scroll down a bit to start reading, or a bit more to read more about me.
(defn recursive-reverse [coll]
(loop [coll coll
acc '() ]
(if (= (count coll) 0)
acc
(recur (rest coll) (cons (first coll) acc))
)
)
)
I struggled with this one for a while - I don’t want to admit it, but honestly even though i have been coding since I was 16 years old - there are still many areas where I am rusty or weak.
There is actually a surprising amount of low level concepts operating in a list recursive reverse in clojure.
I have some questions about how this “special form” loop operates with recur
I think I need to make sure that I always remember the following :
I’m not sure how this loop / recur mechanism is implemented in the JVM - I imaging that the binding created by ‘loop’ is associated with registers that are overwritten as part of the call to ‘recur’. The documentation says the bindings are rebound on call of recur in parallel and the execution of recur - is done in order.
My questions are
More importantly - Is there a chapter in Knuth AOC that could help me with this? Any other resources?
I feel like I am really missing some context.
I’m currently playing with using a ‘column’ definition and then redeclaring it’s width for each device i’m supporting - tablet, desktop.
Using the ‘base’ unset media query as lowest common denominator.
I spent the last few days struggling with chef.
What can i tell you so that you need not have to have the same struggle.
What ended up confusing me the most:
Essentially ruby needs to exist on the server side - I use RVM because it is easy to script and i know it well enough. The client side Capistrano script expects the gem bundler to exist on the client side and to be part of the gemset described in Capistrano - this gemset is named ‘blazing_gemset_for_client_xxx’ for the purpose of this post.
Design problem:
[RVM + Chef-Solo ]:: Server Side -> responsible for bootstrapping a fresh ubuntu 10.10 LTS machine into complete ready state (DB+WEB)
[RVM + Capistrano ]:: Client Side -> cap production deploy should just work as it always does in the regular dev-cycle
Design Principles:
Easy to start a new production machine from scratch
Developers do not need root to deploy
What is less than vanilla in our setup:
Had some legacy perl that expected to have apache.
What web stack did we choose :
Passenger 3
What did I end up doing in the end
What I wish i could do differently
What I like about what was accomplished
What was in the way from taking a userland based approach for RVM
Notes
About Me
Footnote 1 :
I implemented a internet-hostile standalone chef-solo system for unpacking complete systems inside user accounts on lockdown intranet virtual machines as well - this was a build based solution and did not use rvm - but took a userland based ruby approach.
When using ’export’ a typo of ’exports’ will result in a warning that your functions are not used.
a function declaration seems to be a collection of ’,’ separated statements ending in a period.
If a process executes a function with a runtime error then an error report will be generated and the exit value, the error with it will be described.
HOWTO : NO COMPROMISE DESIGN WHY (HOW,WHAT) CUCUMBER? (RUBY,BDD)