Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

There's nothing specific to Lisp in that, though. I did something similar with my Lua redis client, sidereal (http://github.com/silentbicycle/sidereal/blob/master/siderea...):

    ---R: Return the string value of the key
    function Sidereal:get(key) end
    cmd("GET", "k")
    
    ---R: Set a key to a string returning the old value of the key
    function Sidereal:getset(key, value) end
    cmd("GETSET", "kv")
    
    ---R: Multi-get, return the strings values of the keys
    function Sidereal:mget(key_list) end
    cmd("MGET", "K")
(The comment and function lines are only there for luadoc; it could just be the cmd lines.)

FWIW, I need to update it - antirez changed the protocol in a recent version, and I haven't gotten back to it yet. It should remove a good portion of the code, though - he switched everything to using the bulk form.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: