This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; assuming game object named "Ball" exists | |
(def ball-name "Ball") | |
;; this works | |
(GameObject/Instantiate (Resources/Load "Ball")) | |
;; but the following leads to error output | |
(GameObject/Instantiate (Resources/Load ball-name)) | |
MissingMethodException Cannot find member Instantiate matching args |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; just use DontDestroyOnLoad? | |
(defn mono-obj [] | |
(if (. Application isPlaying) | |
(or (if (not (UnityEngine.Object/op_Equality @-mono-obj nil)) | |
@-mono-obj) | |
(vreset! -mono-obj | |
(let [o (or (GameObject/Find "tween.core/-mono-obj") | |
(let [obj (GameObject. "tween.core/-mono-obj")] | |
(UnityEngine.Object/DontDestroyOnLoad obj)))] | |
(or (.GetComponent o MonoObj) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# tcp 4 | |
$ telnet 127.0.0.1 5555 | |
Trying 127.0.0.1... | |
Connected to 127.0.0.1. | |
Escape character is '^]'. | |
014-01-02 15:28:22.957823 | |
# tcp 6 | |
$ telnet ::1 5555 | |
Trying ::1... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// based on original udp repl-client.javascript | |
const net = require('net'); | |
const readline = require('readline'); | |
const client = new net.Socket(); | |
const rl = readline.createInterface({ | |
input: process.stdin, | |
output: process.stdout | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
user=> (use 'clojure.pprint) | |
nil | |
user=> (pprint 1) | |
TypeLoadException Could not resolve type with token 01000027 (from typeref, class/assembly clojure.pprint.proxy$TextWriter$IDeref$PrettyFlush$AEF722B8$_COMP_clojure.pprint.pretty_writer.clj, clojure.pprint.pretty_writer.clj, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null) | |
clojure/pprint$pretty_writer__24142.invoke (:0) | |
clojure/pprint$make_pretty_writer__24275.invokeStatic (:0) | |
clojure/pprint$make_pretty_writer__24275.invoke (:0) | |
clojure/pprint$pprint__24328.invokeStatic (:0) | |
clojure/pprint$pprint__24328.invoke (:0) | |
clojure/pprint$pprint__24328.invokeStatic (:0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
user=> (require 'clojure.pprint) | |
nil | |
user=> (clojure.pprint/pprint | |
(let [g (fn f [i] | |
(if (<= i 0) | |
:leaf | |
(vec | |
(repeatedly 3 | |
#(f (dec i))))))] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;;; | |
;; trace.clj -- simple call-tracing macros for Clojure | |
;; by Stuart Sierra, http://stuartsierra.com/ | |
;; December 3, 2008 | |
;; Copyright (c) Stuart Sierra, 2008. All rights reserved. The use | |
;; and distribution terms for this software are covered by the Eclipse | |
;; Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) | |
;; which can be found in the file epl-v10.html at the root of this |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
game.core=> (trace-ns (the-ns 'game.core)) | |
InvalidCastException Specified cast is not valid. | |
clojure/core$find_ns__41059.invokeStatic (:0) | |
clojure/core$find_ns__41059.invoke (:0) | |
clojure/core$the_ns__41083.invokeStatic (:0) | |
clojure/core$the_ns__41083.invoke (:0) | |
clojure/tools/trace$trace_ns_STAR___1190.invokeStatic (:0) | |
clojure/tools/trace$trace_ns_STAR___1190.invoke (:0) | |
game/core$eval__1420__1425.invokeStatic (:0) | |
game/core$eval__1420__1425.invoke (:0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;;; | |
;; trace.clj -- simple call-tracing macros for Clojure | |
;; by Stuart Sierra, http://stuartsierra.com/ | |
;; December 3, 2008 | |
;; Copyright (c) Stuart Sierra, 2008. All rights reserved. The use | |
;; and distribution terms for this software are covered by the Eclipse | |
;; Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) | |
;; which can be found in the file epl-v10.html at the root of this |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
public class Util | |
{ | |
public static Object[] makeObjectArray(int size) | |
{ | |
return new Object[size]; | |
} | |
} |
OlderNewer