Java::MyPackage::TheClass:0xDECAFBAD
https://github.com/jruby/jruby/search?q=declared_field&ref=cmdform
interface Pong<T> {} | |
class Ping<T> implements Pong<Pong<? super Ping<Ping<T>>>> { | |
static void Ping() { | |
Pong<? super Ping<Long>> Ping = new Ping<Long>(); | |
} | |
} | |
> javac Ping.java |
(defn scaffold | |
"Print the ancestor method signatures of a given interface." | |
[iface] | |
(doseq [[iface methods] (->> iface | |
.getMethods | |
(map #(vector (.getName (.getDeclaringClass %)) | |
(symbol (.getName %)) | |
(count (.getParameterTypes %)))) | |
(group-by first))] | |
(println (str " " iface)) |
For each Ruby module/class, we have Ruby methods on the left and the equivalent | |
Clojure functions and/or relevant notes are on the right. | |
For clojure functions, symbols indicate existing method definitions, in the | |
clojure namespace if none is explicitly given. clojure.contrib.*/* functions can | |
be obtained from http://github.com/kevinoneill/clojure-contrib/tree/master, | |
ruby-to-clojure.*/* functions can be obtained from the source files in this | |
gist. | |
If no method symbol is given, we use the following notation: |
(require 'clojure.test) | |
; Source: https://gist.github.com/mybuddymichael/4425558 | |
(defmacro spec | |
[name-string & body] | |
(let [name-symbol | |
(-> name-string | |
clojure.string/lower-case | |
(clojure.string/replace #"\W" "-") | |
(clojure.string/replace #"-+" "-") |
; Gives warning: Assert failed.... | |
(ns light.core | |
(:use [clojure.pprint])) | |
(def p pprint) | |
(+ 1 1) | |
(def x (into {} (map (fn [x] [x (inc x)]) (take 1000 (range))))) | |
(pprint x) |
export BUNDLE_GEMFILE=CapGemfile |
(defmacro class [name] | |
`(set! ~name | |
(do (defn ~name []) ~name )) | |
) | |
(class A) |
#!/bin/bash | |
# trap "kill -- -$BASHPID" SIGINT SIGTERM EXIT | |
trap 'exit 42' SIGINT SIGQUIT SIGTERM | |
function sayit() { | |
while [[ 1 ]] | |
do echo oi | |
sleep 1 | |
done | |
} |
function draw(ctx, f, width, height) { | |
var y; | |
var ch = height/2; | |
var cw = width/2; | |
ctx.beginPath(); | |
ctx.moveTo(0, ch-f(-width)); | |
for (var x=-width+1; x<width; x++) { | |
y = ch-f(x); | |
ctx.lineTo(x+cw, y); | |
} |
Java::MyPackage::TheClass:0xDECAFBAD
https://github.com/jruby/jruby/search?q=declared_field&ref=cmdform