Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
tree: 957bb0df97
Fetching contributors…

Cannot retrieve contributors at this time

206 lines (189 sloc) 7.708 kb
<!--
Copyright (c) 2012 Fogus and Relevance Inc. 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 COPYING the root of this
distribution. By using this software in any fashion, you are
agreeing to be bound by the terms of this license. You must not
remove this notice, or any other, from this software.
-->
<html>
<head>
<script type="text/javascript" src="javascript/jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="javascript/jquery.console.js"></script>
<script type="text/javascript" src="out/goog/base.js"></script>
<script type="text/javascript" src="con.js"></script>
<script type="text/javascript" src="repl.js"></script>
<script type="text/javascript">
goog.require('himera.client.repl');
</script>
<link rel="stylesheet" type="text/css" href="stylesheets/base.css" />
<link rel="stylesheet" type="text/css" href="stylesheets/layout.css" />
<link rel="stylesheet" type="text/css" href="stylesheets/skeleton.css" />
<link rel="stylesheet" type="text/css" href="stylesheets/himera.css" />
<title>Himera</title>
</head>
<body>
<div class="container">
<h1 id="title">Himera</h1>
<h2>ClojureScript compiler as web service.</h2>
<div class="console" id="console"></div>
<div class="source">
<p><a href="http://github.com/fogus/himera">View source on Github <img src="images/github-icon.png" /></a></p>
</div><!-- /source -->
<div class="rule sixteen columns"></div>
<h3>ClojureScript at a glance - <a href="https://github.com/fogus/clojure-cheatsheets/blob/master/pdf/cljs-cheatsheet.pdf?raw=true" class="doc-link">PDF</a> | <a href="http://clojuredocs.org/" class="doc-link">Searchable docs</a> | <a href="synonym.html" class="doc-link">Translations from JavaScript</a></h3>
<div class="cheat-box-container eight columns">
<div class="cheat-box">
<h4>Datatypes</h4>
<table>
<tr class="row-one">
<td class="row-label">Map</td>
<td>{:key1 :val1, :key2 :val2}</td>
</tr>
<tr>
<td class="row-label">Vectors</td>
<td>[1 2 3 4 :a :b :c 1 2]</td>
</tr>
<tr class="row-one">
<td class="row-label">Sets</td>
<td>#{:a :b :c 1 2 3}</td>
</tr>
<tr>
<td class="row-label">Scalars</td>
<td>a-symbol, :a-keyword, "a string"</td>
</tr>
<tr class="row-one">
<td class="row-label">Arrays</td>
<td>(array 1 2 3)</td>
</tr>
</table>
</div><!-- /cheat-box -->
<div class="cheat-box">
<h4>Functions</h4>
<table>
<tr class="row-one">
<td class="row-label">Calling</td>
<td>(<span class="ebnf">&lt;function&gt;</span>
<span class="ebnf">&lt;args*&gt;</span>)</td>
</tr>
<tr>
<td class="row-label">Defining named functions</td>
<td>(defn <span class="ebnf">&lt;name&gt;</span>
[<span class="ebnf">&lt;args*&gt;</span>]
<span class="ebnf">|constraints|</span>
<span class="ebnf">&lt;actions*&gt;</span>)</td>
</tr>
<tr class="row-one">
<td class="row-label">Anonymous function</td>
<td>(fn <span class="ebnf">|name|</span>
[<span class="ebnf">&lt;args*&gt;</span>]
<span class="ebnf">|constraints|</span>
<span class="ebnf">&lt;actions*&gt;</span>)</td>
</tr>
<tr>
<td class="row-label">Anonymous inline function</td>
<td>#(<span class="ebnf">&lt;action&gt;</span>
<span class="ebnf">|%,%2,%3, or %&|</span>)</td>
</tr>
</table>
</div><!-- /cheat-box -->
<div class="cheat-box">
<h4>Useful Macros</h4>
<table>
<tr class="row-one">
<td class="row-label">Conditionals</td>
<td>if if-let cond condp and or when when-let</td>
</tr>
<tr>
<td class="row-label">Nesting, chaining, and Interop</td>
<td>-> ->> doto .. .</td>
</tr>
<tr class="row-one">
<td class="row-label">Defining things</td>
<td>def defn fn let binding defmulti defmethod deftype defrecord reify this-as</td>
</tr>
</table>
</div>
</div><!-- /cheat-box-container -->
<div class="cheat-box-container eight columns">
<div class="cheat-box">
<h4>Useful Functions</h4>
<table>
<tr class="row-one">
<td class="row-label">Math</td>
<td>+ - * / quot rem mod inc dec max min</td>
</tr>
<tr>
<td class="row-label">Comparison</td>
<td>= == not= < > <= >=</td>
</tr>
<tr class="row-one">
<td class="row-label">Predicates</td>
<td>nil? identical? zero? pos? neg? even? odd? true? false?</td>
</tr>
<tr>
<td class="row-label">Data processing</td>
<td>map reduce filter partition split-at split-with</td>
</tr>
<tr class="row-one">
<td class="row-label">Data create</td>
<td>vector vec hash-map set for list list*</td>
</tr>
<tr>
<td class="row-label">Data inspection</td>
<td>first rest get get-in keys vals count get nth contains? find</td>
</tr>
<tr class="row-one">
<td class="row-label">Data manipulation</td>
<td>seq into conj cons assoc assoc-in dissoc zipmap merge merge-with select-keys update-in</td>
</tr>
<tr>
<td class="row-label">Arrays</td>
<td>first rest get get-in keys vals count get nth contains? find</td></td>
</tr>
</table>
</div><!-- /cheat-box -->
<div class="cheat-box">
<h4>JavaScript Interop</h4>
<table>
<tr class="row-one">
<td class="row-label">Method call</td>
<td>(.the-method target-object args...)</td>
</tr>
<tr>
<td class="row-label">Property access</td>
<td>(.-property target-object -property)</td>
</tr>
<tr class="row-one">
<td class="row-label">Property setting</td>
<td>(set! (.-title js/document) "Hi!")</td>
</tr>
<tr>
<td class="row-label">Direct JavaScript</td>
<td>(js/alert "Hello Cleveland!")</td>
</tr>
<tr class="row-one">
<td class="row-label">External library use</td>
<td>(.text (js/jQuery "#title") "ClojureScript Rocks!")</td>
</tr>
</table>
</div>
</div><!-- /cheat-box-container -->
<div class="rule sixteen columns"></div>
<div class="column footer-logo">Himera &copy; 2012 Fogus and Relevance Inc.</div>
<ul class="footer-links">
<li><a href="http://clojure.org/">Clojure.org</a></li>
<li><a href="https://github.com/clojure/clojurescript">ClojureScript</a></li>
<li><a href="http://clojuredocs.org/">Clojure Docs</a></li>
<li><a href="http://blog.fogus.me">Fogus</a></li>
<li><a href="http://www.joyofclojure.com">Joy of Clojure</a></li>
</ul>
</div><!-- / container -->
<script>
himera.client.repl.go();
goog.require('cljs.core');
goog.provide('cljs.user');
</script>
</body>
</html>
Jump to Line
Something went wrong with that request. Please try again.