Today's Question:  What does your personal desk look like?        GIVE A SHOUT

 ALL


  Clojure & Java Interop

About a year ago I got a phone call asking if I wanted to join another team at DRW. The team supports a (primarily) Java application, but the performance requirements would also allow it to be written in a higher level language. I'd been writing Clojure (basically) full-time at that point - so my response was simple: I'd love to join, but I'm going to want to do future development using Clojure.A year later we still have plenty of Java, but the vast majority of the new code I add is Clojure. One of the big reasons I'm able to use Clojure so freely is the seamless interop with Java.Execute Cloj...

3,659 0       JAVA FUNCTION CALL CLOJURE INTEROPRABILITY COMMIT


  JavaScript-style object literals in PHP

The object literal notation in JavaScript looks like:var fido = {name: "Fido", barks: true};or var fido = {};fido.name = "Fido";fido.barks = true;From assoc arrays to objectsIn PHP you would call that an associative array. $fido = array( 'name' => "Fido", 'barks' => true);And you can easily make it an object too:$fido = (object)$fido;echo gettype($fido); // "object"Or if you want to start with a blank object and add stuff to it:$fido = (object)array();or$fido = new StdClass();and then$fido->name = "Fido";$fido->barks = true;A little explanation maybe: objects in JavaScript are ha...

3,464 0       PHP JAVASCRIPT OBJECT FUNCTION CALL SELF VS THIS