Basic implementation of GO using vanilla CLJS. No frameworks. No libraries.
Run to start the game at the REPL:
clj -M --main cljs.main --compile game-of-go.core --repl
(in-ns 'game-of-go.core)
(draw-board!)
Basic implementation of GO using vanilla CLJS. No frameworks. No libraries.
Run to start the game at the REPL:
clj -M --main cljs.main --compile game-of-go.core --repl
(in-ns 'game-of-go.core)
(draw-board!)
(defn exception-handler [err] | |
(binding [*print-fn* *print-err-fn*] | |
(println "An error occurred that otherwise would have crashed the Node process:") | |
(println err))) | |
(defn handle-all [] | |
(.on js/process "uncaughtException" exception-handler)) | |
(defn handle-none [] | |
(.removeListener js/process "uncaughtException" exception-handler)) |
private static <T> Map<Class<T>, Function<T, List<JAXBElement<?>>>> mappings() { | |
return ImmutableMap.<Class<T>, Function<T, List<JAXBElement<?>>>>builder() | |
.put(BinaryLogicOpType.class, new Function<BinaryLogicOpType, List<JAXBElement<?>>>() { | |
@Override | |
public List<JAXBElement<?>> apply(BinaryLogicOpType t) { | |
return null; | |
} | |
}) | |
.build(); | |
} |
List<Map> resultTemplates = new ArrayList(); | |
// Will not compile | |
List<String> descriptors = | |
Optional.of(resultTemplates.get(0)) | |
.map(m -> m.get("descriptors")) | |
.map(List.class::cast) | |
.orElseThrow(() -> new AssertionError("Result template data was malformed")) | |
.stream() | |
.map(String.class::cast) // Explicitly ignoring this cast |
/** | |
* Returns a new {@link Dictionary} where values containing system property notation such as | |
* {@code ${my.system.property.name}} are substituted with their appropriate values. | |
*/ | |
private Dictionary<String, Object> expand(Dictionary<String, Object> original) { | |
Dictionary<String, Object> expanded = new Hashtable<>(); | |
for (String key : list(original.keys())) { | |
Object val = original.get(key); | |
if (val instanceof String) { | |
expanded.put( |
package com.connexta; | |
import static com.connexta.Utils.print; | |
import java.io.Closeable; | |
import java.io.IOException; | |
public class TryWithResourcesIgnoresClose { | |
static void run() { |