[ClojureScript] [ANN] CLJS Bean: Clojure's bean function for ClojureScript

2019-06-15 Thread Mike Fikes
https://github.com/mfikes/cljs-bean

Like clojure.core/bean, but for ClojureScript.


(require '[cljs-bean.core :refer [bean]])

(bean #js {:a 1, :b 2})
;; => {:a 1, :b 2}


This lets you interoperate with JavaScript objects in an idiomatic fashion, 
while being an order of 
magnitude faster than equivalent constructs using js->clj:


(let [{:keys [a b]} (bean #js {:a 1, :b 2})]
  (+ a b))


-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
"ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at https://groups.google.com/group/clojurescript.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/clojurescript/9125f5a8-71cd-4480-bd97-c6644d2b%40googlegroups.com.


[ClojureScript] ANN: Replete 2.0

2019-03-16 Thread Mike Fikes
Replete 2.0 has been released.

Replete is a ClojureScript REPL for mobile devices.

Now supports Android! (Kudos to Roman Liutikov for the work done here.)

New features include replete.core, replete.io, and replete.http namespaces.

Replete 2.0 has a cool new icon. (Thanks to George Farro!)

And a new website: http://replete-repl.org

(The website has links to the App Store and Google Play.)

- Mike

-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
"ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at https://groups.google.com/group/clojurescript.


[ClojureScript] Replete 2.0 open beta (with Android support)

2019-01-19 Thread Mike Fikes
Help beta test Replete 2.0, which now supports Android!

We also have a spiffy new icon!

Replete is a ClojureScript REPL for mobile devices.

Join the open beta:

Android: https://play.google.com/apps/testing/com.fikesfarm.Replete

iOS: https://testflight.apple.com/join/yfsQO4yx

- Mike

-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
"ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at https://groups.google.com/group/clojurescript.


[ClojureScript] Re: self-hosted clojurescript eval-str and load-fn cljsjs dependencies

2018-04-07 Thread Mike Fikes
The answer to this can be pretty involved, so I'll just direct you to 
Planck, which sets things up for deps.cljs files embedded in JARS on the 
classpath around here

 
https://github.com/mfikes/planck/blob/51b88aac41c77207f25eaefd5cd4a66ccb8fb17f/planck-cljs/src/planck/js_deps.cljs#L59

and with Planck's *load-fn* ultimately making use of that information, with 
*load-fn* being set up in this namespace

  https://github.com/mfikes/planck/blob/master/planck-cljs/src/planck/repl.cljs

Lumo also does the same thing IIRC, and you can probably find similar code 
in its repository.

- Mike

-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
"ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at https://groups.google.com/group/clojurescript.


Re: [ClojureScript] Clojurescript exec shell command

2017-02-21 Thread Mike Fikes
Hi Max,

If you can do this at compile time, you could embed this logic in a macro, 
where Java capabilities are available.

Otherwise, you’d need to rely on facilities provided in your JavaScript 
environment for launching executables, and invoke those facilities using 
JavaScript interop. (For example, if your JavaScript runs in Node, you could 
use Node’s facilities.)

- Mike

> On Feb 21, 2017, at 5:14 AM, Max Muranov  wrote:
> 
> Trying to launch shell from settings of Light Table IDE. 
> 
> --
> (defn get-folder [path]
>  (reduce #(str %1 "/" %2) (butlast (.split path "\\"
> 
> (require '(clojure.java shell))
> 
> (defn exec-shell [file & commands]
>  (println (:out (clojure.java.shell/sh "cmd" "/c" (str "cd " (get-folder 
> file)) (reduce #(str %1 " & " %2) "" commands)
> 
> (cmd/command {:command :user.say-hello
>  :desc "User: Lein Deps"
>  :exec (fn []
>  (let [ed (lt.objs.editor.pool/last-active)]
>(exec-shell (-> @ed :info :path) "echo 1")))})
> --
> 
> But it seems that I can't use java or clojure libs here. How can I execute a 
> command with clojurescript?
> 
> Maybe there's a way to launch cmd.exe via full path?
> 
> -- 
> Note that posts from new members are moderated - please be patient with your 
> first post.
> --- 
> You received this message because you are subscribed to the Google Groups 
> "ClojureScript" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to clojurescript+unsubscr...@googlegroups.com.
> To post to this group, send email to clojurescript@googlegroups.com.
> Visit this group at https://groups.google.com/group/clojurescript.

-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
"ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at https://groups.google.com/group/clojurescript.


[ClojureScript] Re: Differences in emitted javascript for recursive function definitions

2016-10-22 Thread Mike Fikes
Hi Aravindh,

What you show has similarities to the concepts described in 
http://dev.clojure.org/jira/browse/CLJS-1495 FWIW.

- Mike

-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
"ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at https://groups.google.com/group/clojurescript.


Re: [ClojureScript] Getting ClojureScript running on Google Apps Script servers

2016-09-07 Thread Mike Fikes
Hi John,

You’ll have to arrange in some way to create a namespace so that defs work. 
While the cljs.user namespace is the default namespace when :ns is not 
specified, it is not automatically created for you.

Here is a way to do it directly in the script:

function evalstr() {
  clgs.core.evalCljs("(ns cljs.user)");
  var s = "(def x 3)";
  var res = clgs.core.evalCljs(s);
  Logger.log("output: " + res);
var s = "(+ x 2)";
  var res = clgs.core.evalCljs(s);
  Logger.log("output: " + res);
  return res;
  
  // In the menu above, click "Run" -> "evalstr"
  //   Then click "View" -> "Log"
  
}

[16-09-07 18:39:26:408 PDT] cljs in: (ns cljs.user)
[16-09-07 18:39:26:539 PDT] cljs out: {:value nil}
[16-09-07 18:39:26:540 PDT] cljs in: (def x 3)
[16-09-07 18:39:26:672 PDT] cljs out: {:value 3}
[16-09-07 18:39:26:673 PDT] output: 3
[16-09-07 18:39:26:674 PDT] cljs in: (+ x 2)
[16-09-07 18:39:26:767 PDT] cljs out: {:value 5}
[16-09-07 18:39:26:769 PDT] output: 5


If you are curious, Planck sets up cljs.user here 
https://github.com/mfikes/planck/blob/a4ffedda17da086581b40a48f87c66e1a36a6453/planck/PLKClojureScriptEngine.m#L1318-L1321
 


And Replumb accomplishes the same in a different way here:
https://github.com/Lambda-X/replumb/blob/d29caa57d336ea023e00319faedef47a4736141a/src/cljs/replumb/common.cljs#L125-L128
 


This topic has been discussed previously: 
https://groups.google.com/d/msg/clojurescript/j0CoBSK4nXg/gtNI_pDvBQAJ 


- Mike

> On Sep 7, 2016, at 6:14 PM, John Newman  wrote:
> 
> Hello all,
> 
> I am trying to get self-hosted CLJS running on Google's Apps Script servers.
> 
> I thought I would just try it out and was surprised to find that some simple 
> expressions just worked, like (take 4 (range 10)). However, def'ing does not 
> yet work.
> 
> Does anyone have any pointers on how to debug this? Perhaps collection 
> containing the current ns's vars is not accessible? If so, would I even be 
> able to run any expressions?
> 
> I will say, being able to run CLJS expressions as Google Sheets formulas is 
> pretty neat. And being able to automate the rest of the Google Apps Script 
> ecosystem with CLJS would be a blessing.
> 
> The Github project is here: https://github.com/johnmn3/clgs
> 
> The GAS script is here: 
> https://script.google.com/d/1vUqjhUd21PD84gXqgOUy9tpx-kpvLRn2kZh-2y9DpwTrf-JTwh2F0xp1/edit?usp=sharing
> 
> Let me know if you have any problems and thanks!
> 
> V/r
> 
> John
> 
> -- 
> Note that posts from new members are moderated - please be patient with your 
> first post.
> --- 
> You received this message because you are subscribed to the Google Groups 
> "ClojureScript" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to clojurescript+unsubscr...@googlegroups.com.
> To post to this group, send email to clojurescript@googlegroups.com.
> Visit this group at https://groups.google.com/group/clojurescript.

-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
"ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at https://groups.google.com/group/clojurescript.


Re: [ClojureScript] ClojureScript Compilation via Command Line

2016-08-15 Thread Mike Fikes
In the interim, you can pass multiple -e expressions, one for each form that 
would be in the build file you'd hypothetically be evaluating.

For example:

java -cp cljs.jar:src clojure.main -e "(require 'cljs.build.api)" -e 
'(cljs.build.api/build "src" {:output-to "out/main.js"})'

-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
"ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at https://groups.google.com/group/clojurescript.


Re: [ClojureScript] How can I get core.async to work in Cljs in Cljs

2016-07-05 Thread Mike Fikes

> i know I have been pushing for core.async to be pushed into master but I have 
> since changed my mind as i have seen that running macros in bootstrapped 
> clojurescript is very slow

Hey Zubair, 

For a library of the size of `core.async`, I’d recommend making use of 
bootstrapped ClojureScript’s ability to cache the results of compilation. You 
can at least eliminate 95% of the start up time (with Andare). Here is an 
example (where the -K option to Planck enables caching):

$ time planck -Kc andare-0.2.0.jar -e"(require 'cljs.core.async)" 
-e"(require-macros 'cljs.core.async.macros)" -e"(cljs.core.async.macros/go)"
#object[cljs.core.async.impl.channels.ManyToManyChannel]

real0m27.401s
user0m36.093s
sys 0m0.940s

$ time planck -Kc andare-0.2.0.jar -e"(require 'cljs.core.async)" 
-e"(require-macros 'cljs.core.async.macros)" -e"(cljs.core.async.macros/go)"
#object[cljs.core.async.impl.channels.ManyToManyChannel]

real0m1.505s
user0m2.658s
sys 0m0.357s

- Mike

-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
"ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at https://groups.google.com/group/clojurescript.


[ClojureScript] [Ann] Planck 2.0 alpha: Linux

2016-06-17 Thread Mike Fikes
Thanks to some truly incredible work by Lucas Stadler, Planck has been ported 
to Linux.

If you’d like to try the 2.0 alpha Linux binary, it is available here:

   http://planck-repl.org/download-alpha.html

It also works on Windows 10 if you have the Windows Subsystem for Linux 
installed.

- Mike Fikes

-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
"ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at https://groups.google.com/group/clojurescript.


Re: [ClojureScript] Re: ANN: ClojureScript 1.9.14, clojure.spec port

2016-06-02 Thread Mike Fikes
Hey Shaun,

It has been. It is cljs.spec.impl.gen

- Mike

> On Jun 2, 2016, at 9:32 AM, Shaun LeBron  wrote:
> 
> Great stuff, thanks!  I'm not familiar, but is the `clojure.spec.gen` 
> namespace going to be ported?
> 
> On Wednesday, June 1, 2016 at 1:01:58 PM UTC-5, David Nolen wrote:
>> ClojureScript, the Clojure compiler that emits JavaScript source code.
>> 
>> 
>> README and source code: https://github.com/clojure/clojurescript
>> 
>> 
>> Leiningen dependency information:
>> 
>> 
>> [org.clojure/clojurescript "1.9.14"]
>> 
>> 
>> This release includes a complete and faithful port of clojure.spec to
>> ClojureScript. The functionality resides in the new cljs.spec
>> namespace. All features present in Clojure 1.9.0-alpha4 are
>> implemented, including REPL support, testing support and macro
>> checking.
>> 
>> 
>> As always feedback welcome.
>> 
>> 
>> ## 1.9.14
>> 
>> 
>> ### Enhancements
>> * clojure.spec ported to cljs.spec
>> 
>> 
>> ### Fixes
>> * CLJS-1649: Possible issue with in cljs.reader or 
>> cljs.core/PersistentHashMap
>> * CLJS-1647: Rethrow exception from parallel-build
>> * CLJS-1642: cljs.core/reductions does not respect 'reduced'
>> * CLJS-1635: Var type implements IEquiv but not IHash
>> * CLJS-1629: Fix warning about duplicate test-pr-str
>> * CLJS-1637: Missing docstrings for a few vars
> 
> -- 
> Note that posts from new members are moderated - please be patient with your 
> first post.
> --- 
> You received this message because you are subscribed to the Google Groups 
> "ClojureScript" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to clojurescript+unsubscr...@googlegroups.com.
> To post to this group, send email to clojurescript@googlegroups.com.
> Visit this group at https://groups.google.com/group/clojurescript.

-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
"ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at https://groups.google.com/group/clojurescript.


[ClojureScript] [Ann] Andare: core.async for bootstrap ClojureScript

2016-05-21 Thread Mike Fikes
Andare is a fork of core.async ported for use with self-hosted ClojureScript.

  https://github.com/mfikes/andare

Available on Clojars: https://clojars.org/andare

A blog post: 
http://blog.fikesfarm.com/posts/2016-05-15-bootstrap-core-async.html

The Andare repo also includes additional code to run the core.async unit tests 
in a Node.js bootstrap ClojureScript environment. (The tests also pass if 
loaded and executed in Planck.)

- Mike Fikes

-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
"ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at https://groups.google.com/group/clojurescript.


[ClojureScript] [Ann] Planck 1.12

2016-05-16 Thread Mike Fikes
Planck 1.12 has been released.

http://planck-repl.org 

New Features

Pretty print REPL results using Fipp with syntax highlighting
A new planck.http namespace supporting get and post
Support :foreign-libs in deps.cljs embedded in JARs
Support re-configuring control keys used in REPL
Support disabling asserts at launch time (like :elide-asserts)
Add simpler cache support via -K to create .planck_cache dir 
Changes

console log simply logs text (w/o NSLog info)
Don't refer to Maven (brew install w/o Java)
Use tools.reader 1.0.0-beta1
Use Parinfer 1.8.1
Clean up stack traces (demunge symbols, elide -invoke)
Mark a few vars as private
Minimal OS required Mavericks (was Lion)
Fixes

Properly align docstring output for vars like some->
Fix a bug where caches were not invalided when using an updated JAR

-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
"ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at https://groups.google.com/group/clojurescript.


Re: [ClojureScript] How can I get core.async to work in Cljs in Cljs

2016-05-14 Thread Mike Fikes
On Tuesday, December 15, 2015 at 8:54:21 AM UTC-5, Zubair Quraishi wrote:
> Hi Mike,
>  I took a quick look. Really happy that you are actively working on this too. 
> When do you think a stable will be released? Just a ballpark figure I mean, 
> so that I can plan around it?
> thanks
> Zubair

Hi Zubair,

Basic `core.async` constructs now work in self-hosted ClojureScript in the fork 
I've been messing with. See 
https://gist.github.com/mfikes/22f553d8c9186dcc613e1263ca9deeda

- Mike

-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
"ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at https://groups.google.com/group/clojurescript.


[ClojureScript] [Ann] Planck 1.11

2016-04-25 Thread Mike Fikes
Planck 1.11 has been released

http://planck-repl.org

New Features

A quiet mode that disables banner and other output
Support for clojure.core.reducers
Ability to use cljs.js itself within Plank via planck.core/init-empty-state
Autocompletion on commonly used keywords and other autocomplete improvements
Changes

Update to ClojureScript 1.8.51
Use CloureScript cljs.test (instead of previous port)
Fixes

Fix for multi-arg file, add File/toString
Exit with failure when port is bound
Fix for caching top-level files
Don't inadvertently load bundled artifacts from classpath

-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
"ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at https://groups.google.com/group/clojurescript.


Re: [ClojureScript] compile static-fns

2016-04-14 Thread Mike Fikes
Yehonathan, here is a post giving an example of what can go wrong with 
static-fns at the REPL: 
http://blog.fikesfarm.com/posts/2016-04-14-static-free-clojurescript-repl.html

-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
"ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at https://groups.google.com/group/clojurescript.


[ClojureScript] Re: cljs.js/eval and functions/macros defined in user/custom namespace

2016-04-02 Thread Mike Fikes
Hi Olek,

The first argument to `eval`—the compiler state—would need to have metadata 
regarding your `sstr` function. Since the state is empty, you run into a 
problem. (As a quick aside, there is no need to write your own `eval-str` that 
calls `eval`—one exists in `cljs.js`.)

Frequently, for REPLs and other use cases, the compiler state is kept in a 
top-level def, and the same state passed back in. (This causes the compiler 
state to be mutated to incorporate new definitions that are encountered when 
evaluating things.)

But, in your case, you want to call a function in the very same namespace that 
is hosting your code. One interesting solution to this is in Chris Ford's 
Klangmeister project. Have a look in the code in this area to see how he does 
it using some cleverness with macros: 
https://github.com/ctford/klangmeister/tree/master/src/klangmeister/compile

With respect to your last question: If I understand, most definitely "yes". All 
of the evaluation / execution with self-hosted ClojureScript is happening in 
the target JavaScript engine (no need for runtime support in the back-end 
server.)

- Mike

-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
"ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at https://groups.google.com/group/clojurescript.


[ClojureScript] [Ann] Planck 1.10

2016-03-03 Thread Mike Fikes
Planck 1.10 has been released.

http://planck-repl.org

New Features

Bundle port of cljs.test for use in bootstrap (post 
)
Colors (with light and dark theme) (post 
)
Indentation (via Parinfer) (post 
)
eval and friends resolve, ns-resolve, intern (post 
)
Securely prompt for and read password
Source mapping for user code
with-open and line-seq
with-sh-dir and with-sh-env
sh accepts string and file
Honor :forms in doc output
planck.io/file-attributes (like fstat)
find-doc
Startup banner with helpful instructions
Changes

Use ClojureScript master (1.8.28)
Throw exception on error from sh
doc for catch, finally, &
AOT compile Planck macro namespaces (post 
)
Fixes

Throw if using closed file
Properly index open JARs (needed for large classpaths)
You can now require planck.repl namespace
Don't let cljs.env be inadvertently reloaded (clears *compiler*)
Search all loaded macro namespaces for docs

-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
"ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at https://groups.google.com/group/clojurescript.


[ClojureScript] Re: Self-hosted ClojureScript vs. cljs.user namespace

2016-02-25 Thread Mike Fikes
Yeah, cljs.js defaults to cljs.user, but generally self-host environments 
ensure that any namespace they are issuing forms in are defined.

If you have an `in-ns` REPL special, a user could switch to an entirely 
different namespace, and then you would pass in :ns, but you'd still need to 
ensure that the namespace exists before evaluating forms in it. In other words, 
cljs.user is not special in any way—it is just the default that cljs.js will 
assume if you don't specify anything.

-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
"ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at https://groups.google.com/group/clojurescript.


[ClojureScript] Re: Using require-as with include-macros in self-hosted js

2016-02-21 Thread Mike Fikes
Hi Nikita,

That's interesting. Things work for me (details below). A couple notes:

1) Since quil.sketch requires macros from its own namespace, consuming 
namespaces like quil.core get them for free. In other words, no need to add 
:include-macros true when requiring quil.sketch. If you do (doc ns), you will 
see this concept referred to as "implicit macro loading".

2) Owing to an accident or artifact of the way macros are implemented, 
(cljs.core$macros/or false true) actually works. I haven't investigated why 
this is the case.

So, here is what works for me:

src/quil/sketch.clj:

(ns quil.sketch)

(defmacro defsketch
  [app-name & options]
  `(str "Hello " ~app-name "!"))

src/quil/sketch.cljs:

(ns quil.sketch
  (:require-macros [quil.sketch]))

src/quil/core.cljc:

(ns quil.core
  (:require [quil.sketch :as ap]))

(defmacro defsketch
  [app-name & options]
  `(quil.sketch/defsketch ~app-name ~@options))

And using this from Planck:

$ planck -c src
cljs.user=> (require-macros 'quil.core)
nil
cljs.user=> (quil.core/defsketch "My App")
"Hello My App!"

-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
"ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at https://groups.google.com/group/clojurescript.


[ClojureScript] Re: Using require-as with include-macros in self-hosted js

2016-02-20 Thread Mike Fikes
There are a few fundamental facts that shape my thinking on this question:

1) .clic files are the only place reader conditionals are allowed. [1]

2) When code is compiled using bootstrapped ClojureScript, the :cljs branch is 
always followed.

3) In bootstrapped ClojureScript, .cljc is used only as a fallback when .cljs 
and .clj files cannot be found for runtime and macro code respectively. [2] (I 
suspect this load ordering preference is also true for JVM ClojureScript.)

So, the only places I think a single .cljc file can be used as the source of 
both runtime and macro code is regular JVM ClojureScript and regular Clojure. 

For JVM ClojureScript, I've referred to this "loading twice" as the "loop" 
pattern of arranging compilation stages [3].

And for Clojure, you can inherently freely intermix macros and functions in 
either .clj or .cljc files.

I can't think of a way to do this with bootstrapped ClojureScript. For 
bootstrapped ClojureScript you could have any of these arrangements:

Runtime Code   Macro Code
foo.cljs  foo.clj
foo.cljs  foo.cljc
foo.cljc  foo.clj

[1] http://clojure.org/reference/reader#_reader_conditionals
[2] 
https://github.com/clojure/clojurescript/blob/r1.7.228/src/main/cljs/cljs/js.cljs#L59-L63
[3] 
http://blog.fikesfarm.com/posts/2015-12-18-clojurescript-macro-tower-and-loop.html


-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
"ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at https://groups.google.com/group/clojurescript.


[ClojureScript] Re: Using require-as with include-macros in self-hosted js

2016-02-20 Thread Mike Fikes
Hi Nikita, 

Thanks for the comment in the ticket! (I'm sure such comments are immensely 
helpful to David when ascertaining patch validity.)

You are right about the loading twice. It will also result in populating 
'my.bar and 'my.bar$macros namespace entries in the compiler state, but, as you 
can see, otherwise things work.

I suppose, for production code (say, using a bar.cljc file), this might cause a 
little concern. Perhaps in the future, if a defmacro is found in a non-macro 
namespace, maybe the compiler would emit warnings or, worse, error out. (No 
such guards preventing defmacro in runtime code exists today.)





-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
"ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at https://groups.google.com/group/clojurescript.


[ClojureScript] Re: Using require-as with include-macros in self-hosted js

2016-02-20 Thread Mike Fikes
Hi Nikita,

It is a known issue with a fix. I'd recommend trying the second patch in 
http://dev.clojure.org/jira/browse/CLJS-1521 and, if it works for you, please 
add a comment to the ticket to that effect.

Also, as an aside, the way the my.foo ns form is structured, it will require 
the existence of a my.bar runtime namespace (a my/bar.cljs file). This is 
because of the way :include-macros desugars—do (doc ns) to see this. 
Alternately, you could write the my.foo ns form this way and avoid the need for 
a my/bar.cljs file:

(ns my.foo
(:require-macros [my.bar :as b]))

- Mike

On Saturday, February 20, 2016 at 4:53:18 AM UTC-5, Nikita Beloglazov wrote:
> Hello
> 
> 
> I have some problems understanding how macros are handled in self-hosted js. 
> Let's say I have 2 namespace: my.bar and my.foo.
> 
> 
> my.bar:
> 
> (ns my.bar)
>  
> (defmacro abs [x]
>   `(if (pos? ~x) ~x (- ~x)))
> 
> 
> my.foo:
> 
> (ns my.foo
>     (:require [my.bar :as b :include-macros true]))
>   (+ (my.bar/abs -4)
>      (my.bar/abs 5))
> 
> 
> This works fine. my.bar/abs is recognized as macro and expanded correctly:
> 
> {:value goog.provide('my.foo');
> goog.require('cljs.core');
> goog.require('my.bar');
> (-4) > (0)))?(-4):(- (-4))) + 5) > (0)))?(5):(- (5;
> }
> 
> 
>  But If I try to use (+ (b/abs -4) (b/abs 5)) then compiler treats it as 
> regular function:
> 
> 
> 
> WARNING: Wrong number of args (1) passed to my.bar/abs at line 3 
> WARNING: Wrong number of args (1) passed to my.bar/abs at line 4 
> {:value goog.provide('my.foo');
> goog.require('cljs.core');
> goog.require('my.bar');
> (my.bar.abs.call(null,(-4)) + my.bar.abs.call(null,(5)));
> }
> 
> 
> I'd expect b/abs to be resolved as macro. Am I doing something wrong or it is 
> known limitation/bug in currenct self-hosted js? 
> 
> 
> Full example for node js: 
> https://gist.github.com/nbeloglazov/38c1fc9a1da2eeca5b33
> 
> 
> Thanks,
> Nikita

-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
"ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at https://groups.google.com/group/clojurescript.


Re: [ClojureScript] Trivial self-hosted cljs example in node.js not working

2016-02-18 Thread Mike Fikes
Hey Nikita,

Please give ClojureScript master a try. Two patches have landed there for 
CLJS-1541 and CLJS-1565 which are likely related to what you are seeing.

- Mike

> On Feb 18, 2016, at 3:05 AM, Nikita Beloglazov  wrote:
> 
> Hi
> 
> I'm compiling cljs from cljs using cljs.js namespace. I followed instructions 
> from quick start: 
> https://github.com/clojure/clojurescript/wiki/Quick-Start#running-clojurescript-on-nodejs
>  
> 
>  and got simple "Hello,world" script working on node. Now I added cljs.js to 
> :require list and it looks bad.
> 
> core.cljs:
> 
> (ns my.core
>   (:require [cljs.nodejs :as nodejs]
> cljs.js))
> 
> (nodejs/enable-util-print!)
> 
> (defn -main [& args]
>   (println "Hello world!")  )
> 
> (set! *main-cli-fn* -main)
> 
> Errors while compiling it (first 5):
> ~/repos/cljstest $ java -cp cljs.jar:src clojure.main node.clj && node main.js
> WARNING: Use of undeclared Var cljs.core/defmacro at line 99 
> out/cljs/core.cljc
> WARNING: Use of undeclared Var cljs.core$macros/-> at line 99 
> out/cljs/core.cljc
> WARNING: Use of undeclared Var cljs.core$macros/x at line 104 
> out/cljs/core.cljc
> WARNING: Use of undeclared Var cljs.core$macros/& at line 104 
> out/cljs/core.cljc
> WARNING: Use of undeclared Var cljs.core$macros/forms at line 104 
> out/cljs/core.cljc
> 
> Error when running main.js:
> ~/repos/cljstest $ node main.js
> /home/nbeloglazov/repos/cljstest/out/cljs/core$macros.js:11
> cljs.core.defmacro.call(null,cljs.core$macros.__GT_,"Threads the expr through 
> the forms. Inserts x as the\n second item in the first form, making a 
> list of it if it is not a\n list already. If there are more forms, 
> inserts the first form as the\n second item in second form, etc.",new 
> cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, 
> [cljs.core$macros.x,cljs.core$macros._AMPERSAND_,cljs.core$macros.forms], 
> null),(function (){var x = cljs.core$macros.x;
>   ^
> 
> TypeError: Cannot read property 'call' of undefined
> at Object. 
> (/home/nbeloglazov/repos/cljstest/out/cljs/core$macros.js:11:19)
> at Module._compile (module.js:434:26)
> at Object.Module._extensions..js (module.js:452:10)
> at Module.load (module.js:355:32)
> at Function.Module._load (module.js:310:12)
> at Module.require (module.js:365:17)
> at require (module.js:384:17)
> at global.CLOSURE_IMPORT_SCRIPT 
> (/home/nbeloglazov/repos/cljstest/out/goog/bootstrap/nodejs.js:75:3)
> at Object.goog.importScript_ 
> (/home/nbeloglazov/repos/cljstest/out/goog/base.js:879:9)
> at Object.goog.writeScripts_ 
> (/home/nbeloglazov/repos/cljstest/out/goog/base.js:1321:16)
> 
> 
> ClojureScript version: 1.7.228 (I believe). 
> 
> Any ideas?
> 
> Thanks,
> Nikita
> 
> 
> 
> 
> 
> -- 
> Note that posts from new members are moderated - please be patient with your 
> first post.
> --- 
> You received this message because you are subscribed to the Google Groups 
> "ClojureScript" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to clojurescript+unsubscr...@googlegroups.com 
> .
> To post to this group, send email to clojurescript@googlegroups.com 
> .
> Visit this group at https://groups.google.com/group/clojurescript 
> .

-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
"ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at https://groups.google.com/group/clojurescript.


Re: [ClojureScript] [Ann] Planck 1.9

2016-01-25 Thread Mike Fikes
Yeah, I’d like Planck to work on Linux, but I haven’t been focused on it as a 
high priority.

> On Jan 25, 2016, at 4:21 AM, Karel Miarka  wrote:
> 
> On Monday, January 25, 2016 at 10:16:34 AM UTC+1, Karel Miarka wrote:
>> I'm just curious if there is any chance to run it on Linux?
>> Thanks!
> 
> The answer is probably here 
> https://twitter.com/mfikes/status/641737404018216960
> 
> -- 
> Note that posts from new members are moderated - please be patient with your 
> first post.
> --- 
> You received this message because you are subscribed to the Google Groups 
> "ClojureScript" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to clojurescript+unsubscr...@googlegroups.com.
> To post to this group, send email to clojurescript@googlegroups.com.
> Visit this group at https://groups.google.com/group/clojurescript.

-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
"ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at https://groups.google.com/group/clojurescript.


Re: [ClojureScript] Re: cljs.analyzer: how to use it?

2016-01-20 Thread Mike Fikes
Hi Andray,

Can you provide an example. FWIW this is working for me:

foo.core=> (cljs/eval-str st "(defn square [x] (* x x))" 'test {:eval 
cljs/js-eval} cb)
#object[cljs$user$square "function cljs$user$square(x){
return (x * x);
}"]
nil
foo.core=>

> 
> Hi, Maria!
> 
> I tried to eval clojurescript form in clojurescript via eval-str and it works 
> for code without functions.
> If i add 'defn' form then error occurs. I debugged it and first of all 
> following thing is suspicious: during analyzing defn we are dispatched into 
> core$macros.js functions where .core.cst$sym$cljs$core$macros_SLASH_fn is not 
> defined but similar cljs.core.cst$sym$cljs$core_SLASH_fn symbol is defined in 
> constants_table.js
> Can you advice me where i can have a look to resolve my problem?
> 
> Thanks in advance
> 
> ps by the way can you explain me when core$macros.js and constants_table.js 
> come to play during transpiling?
> 
> -- 
> Note that posts from new members are moderated - please be patient with your 
> first post.
> --- 
> You received this message because you are subscribed to the Google Groups 
> "ClojureScript" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to clojurescript+unsubscr...@googlegroups.com.
> To post to this group, send email to clojurescript@googlegroups.com.
> Visit this group at https://groups.google.com/group/clojurescript.

-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
"ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at https://groups.google.com/group/clojurescript.


Re: [ClojureScript] core.matrix in the browser!

2016-01-16 Thread Mike Fikes
Hi Jeff,

I’d be glad to help! 

The macros below look fundamentally fine to me—I tried them in bootstrapped 
ClojureScript and things are fine.

I tried further using that branch, to see if it works for me. Specifically I 
tried requiring clojure.core.matrix, but that namespace appears to attempt to 
use itself for macros (it has a :cljs condition that :require-macros for 
itself), and since bootstrapped macros are compiled as ClojureScript, when this 
selfsame file is loaded, it attempts to recursively process things in the same 
way, and stack overflows. (In other words, I think you can’t use the “loop” 
pattern (see bottom section of 
http://blog.fikesfarm.com/posts/2015-12-18-clojurescript-macro-tower-and-loop.html
 
<http://blog.fikesfarm.com/posts/2015-12-18-clojurescript-macro-tower-and-loop.html>)
 in bootstrap; it can only be used in JVM ClojureScript.

I’d be glad to help sort out issues in getting this stuff straightened out, 
though. If you are on IRC or Slack, perhaps it would be easier to have a dialog 
about it. Or, if nothing else, perhaps emails off this mailing list—I suspect 
there could be several details to discuss that might be a lot of traffic for 
the mailing list.

- Mike Fikes

> On Jan 16, 2016, at 5:30 PM, j...@thinktopic.com wrote:
> 
> Hi Clojurescripters,
> 
>  I've been chipping away on core.matrix support for Clojurescript, but I 
> could use some help figuring out some final macro issues that are breaking 
> the unit tests and driving me nuts.
> 
> For anyone motivated, we've got a cljc branch here:
> 
>https://github.com/thinktopic/core.matrix/tree/cljc
> 
> which is using the matrix branch of the ndarray library for cljs here:
> 
>https://github.com/thinktopic/ndarray/tree/matrix
> 
> 
> In short, I think the problem is that there are a few macros which need to 
> differ between Clojure and Clojurescript.  Here are two examples from 
> clojure.core.matrix.macros.cljc:
> 
> 
> (defmacro error
>  "Throws an error with the provided message(s)"
>  ([& vals]
>   `(throw (#? (:clj RuntimeException.
>:cljs js/Error.)
>   (str ~@vals)
> 
> (defmacro error?
>  "Returns true if executing body throws an error, false otherwise."
>  ([& body]
>`(try
>   ~@body
>   false
>   (catch #?(:clj Throwable :cljs js/Error) t#
> true
> 
> 
> What I'm unclear about is how conditional compilation works in such 
> situations.  By definition macros are in Clojure, but I need to have 
> different versions of the macro compile for clj and cljs.  When I try to 
> build cljc files that refer to these macros I get errors, that either they 
> don't exist, or that js/Error is an invalid java class.  How should such 
> situations be handled?
> 
> Thanks,
> Jeff
> 
> P.S.  The good news is: it works!  We can matrix multiply core.matrix arrays 
> in the browser.  Lots of very cool stuff to follow, but I need to get the 
> tests passing to get these changes merged upstream.
> 
> -- 
> Note that posts from new members are moderated - please be patient with your 
> first post.
> --- 
> You received this message because you are subscribed to the Google Groups 
> "ClojureScript" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to clojurescript+unsubscr...@googlegroups.com.
> To post to this group, send email to clojurescript@googlegroups.com.
> Visit this group at https://groups.google.com/group/clojurescript.

-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
"ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at https://groups.google.com/group/clojurescript.


Re: [ClojureScript] core.matrix in the browser!

2016-01-16 Thread Mike Fikes
Ahh you know, Jeff, when I read your email, the use of :cljc in macros caused 
me to think you are targeting bootstrapped ClojureScript.

If you are targeting regular (JVM-based ClojureScript), you are right, macros 
are written in Clojure for that environment, and in that case reader 
conditional in macros won’t help. The only thing I can think of off the top of 
my head is to have such macros expand to calls to functions, and write such 
functions in Clojure and ClojureScript, with the same name, and handle the host 
differences in those functions. So, for example, the error macro would expand 
to a form that makes use of a helper function, make-exception, or some such, 
where two versions of that function exist, one in the Clojure runtime code and 
one in the ClojureScript runtime code.

- Mike

> On Jan 16, 2016, at 7:58 PM, Mike Fikes <mikefike...@gmail.com> wrote:
> 
> Hi Jeff,
> 
> I’d be glad to help! 
> 
> The macros below look fundamentally fine to me—I tried them in bootstrapped 
> ClojureScript and things are fine.
> 
> I tried further using that branch, to see if it works for me. Specifically I 
> tried requiring clojure.core.matrix, but that namespace appears to attempt to 
> use itself for macros (it has a :cljs condition that :require-macros for 
> itself), and since bootstrapped macros are compiled as ClojureScript, when 
> this selfsame file is loaded, it attempts to recursively process things in 
> the same way, and stack overflows. (In other words, I think you can’t use the 
> “loop” pattern (see bottom section of 
> http://blog.fikesfarm.com/posts/2015-12-18-clojurescript-macro-tower-and-loop.html
>  
> <http://blog.fikesfarm.com/posts/2015-12-18-clojurescript-macro-tower-and-loop.html>)
>  in bootstrap; it can only be used in JVM ClojureScript.
> 
> I’d be glad to help sort out issues in getting this stuff straightened out, 
> though. If you are on IRC or Slack, perhaps it would be easier to have a 
> dialog about it. Or, if nothing else, perhaps emails off this mailing list—I 
> suspect there could be several details to discuss that might be a lot of 
> traffic for the mailing list.
> 
> - Mike Fikes
> 
>> On Jan 16, 2016, at 5:30 PM, j...@thinktopic.com 
>> <mailto:j...@thinktopic.com> wrote:
>> 
>> Hi Clojurescripters,
>> 
>>  I've been chipping away on core.matrix support for Clojurescript, but I 
>> could use some help figuring out some final macro issues that are breaking 
>> the unit tests and driving me nuts.
>> 
>> For anyone motivated, we've got a cljc branch here:
>> 
>>https://github.com/thinktopic/core.matrix/tree/cljc 
>> <https://github.com/thinktopic/core.matrix/tree/cljc>
>> 
>> which is using the matrix branch of the ndarray library for cljs here:
>> 
>>https://github.com/thinktopic/ndarray/tree/matrix 
>> <https://github.com/thinktopic/ndarray/tree/matrix>
>> 
>> 
>> In short, I think the problem is that there are a few macros which need to 
>> differ between Clojure and Clojurescript.  Here are two examples from 
>> clojure.core.matrix.macros.cljc:
>> 
>> 
>> (defmacro error
>>  "Throws an error with the provided message(s)"
>>  ([& vals]
>>   `(throw (#? (:clj RuntimeException.
>>:cljs js/Error.)
>>   (str ~@vals)
>> 
>> (defmacro error?
>>  "Returns true if executing body throws an error, false otherwise."
>>  ([& body]
>>`(try
>>   ~@body
>>   false
>>   (catch #?(:clj Throwable :cljs js/Error) t#
>> true
>> 
>> 
>> What I'm unclear about is how conditional compilation works in such 
>> situations.  By definition macros are in Clojure, but I need to have 
>> different versions of the macro compile for clj and cljs.  When I try to 
>> build cljc files that refer to these macros I get errors, that either they 
>> don't exist, or that js/Error is an invalid java class.  How should such 
>> situations be handled?
>> 
>> Thanks,
>> Jeff
>> 
>> P.S.  The good news is: it works!  We can matrix multiply core.matrix arrays 
>> in the browser.  Lots of very cool stuff to follow, but I need to get the 
>> tests passing to get these changes merged upstream.
>> 
>> -- 
>> Note that posts from new members are moderated - please be patient with your 
>> first post.
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "ClojureScript" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to clojurescript+

[ClojureScript] Re: macros in pure clojurescript

2015-12-12 Thread Mike Fikes
See the last two items in the FAQ at 
https://github.com/clojure/clojurescript/wiki/Bootstrapped-ClojureScript-FAQ

-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
"ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at https://groups.google.com/group/clojurescript.


[ClojureScript] Re: Problem with including JSX in Clojurescript build as a foreign library

2015-12-12 Thread Mike Fikes
Hi Timur,

Have you set up a defmethod js-transforms for :jsx (the value specified in 
:preprocess)?

- Mike

-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
"ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at https://groups.google.com/group/clojurescript.


[ClojureScript] Re: Can not "require" om.next in clojureScript (in clojurescript)

2015-12-12 Thread Mike Fikes
Hi Zubair,

I don't know the root cause of that, other than could be similar to 
https://github.com/mfikes/planck/issues/158

But, ignoring that, in order to (require 'om.next), it will have to 
(require-macros 'om.next) and if you look into om/next.clj, you'll see that it 
requires cljs.core, referring to deftype, and other macros. In self-hosted 
ClojureScript, om/next.clj will be compiled as ClojureScript, and that will 
cause a problem because this is in a :require spec and not a :require-macros 
spec.

Having said that, there is a JIRA http://dev.clojure.org/jira/browse/CLJS-1507 
that might ultimately make the existing code compilable (because it would infer 
that deftype is a macro and desugar things so that it appears in a 
:refer-macros spec.)

- Mike

-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
"ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at https://groups.google.com/group/clojurescript.


Re: [ClojureScript] [ANN] ClojureScript React Native: cljsrn.org

2015-12-12 Thread Mike Fikes

> One question I have for you: do we need to use Reagent/Om or can we just 
> build plain React components (with React Native components like View, Text, 
> etc) using framework-less CLJS? 

You don't need a ClojureScript library like Reagent or Om to act as a React 
binding to work with React Native. You can bypass all of that and directly 
manipulate React Native as is done in this Nicolas Kariniemi's project. Here is 
the main bit of code illustrating the technique:

https://github.com/nicholaskariniemi/ReactNativeCljs/blob/master/src/hello/core.cljs

-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
"ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at https://groups.google.com/group/clojurescript.


Re: [ClojureScript] Re: cljs.analyzer: how to use it?

2015-12-12 Thread Mike Fikes
There are a couple of ways to make use of macros in cljs.js. 

One would be to put the macros in a namespace and use cljs.js to require that 
namespace as a macros namespace. This would involve using cljs.js/*load-fn* to 
provide the source in the macro namespace. Then you can subsequently use 
cljs.js to compile and evaluate code that makes use of those macros.

Another approach, if you are just looking to expand a macro is detailed in this 
post:
http://blog.fikesfarm.com/posts/2015-09-05-runtime-macroexpand.html

-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
"ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at https://groups.google.com/group/clojurescript.


[ClojureScript] [ANN] Planck 1.8

2015-11-06 Thread Mike Fikes
http://planck.fikesfarm.com

New Features

Tab completion for core macros
Support for :static-fns (via -s or --static-fns)
Analysis / compilation cache (-k  option)
planck.core/*planck-version*
Changes

Use ClojureScript 1.7.170
Can now (require 'cljs.analyzer)
Fixes

0 is truthy
doc fix when using namespace alias
source fix when using namespace alias

-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
"ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at http://groups.google.com/group/clojurescript.


Re: [ClojureScript] [ANN] Planck 1.7

2015-10-04 Thread Mike Fikes
Hi gvim,

It’s not a regression in Planck, and affects nearly all bootstrapped 
ClojureScript REPLs as far as I can tell. (Somehow Replete escaped it.)

My guess is that it only affects the very limited scope of testing the literal 
zero and the empty string literal.

It’s an upstream issue that will be addressed at some point. (CLJS-1423).

- Mike

> On Oct 4, 2015, at 9:21 AM, gvim <gvi...@gmail.com> wrote:
> 
> You're doing great work with Planck, Mike, but should it really be released 
> while basic truthiness is broken?
> 
> cljs.user=> (if "" :True :False)
> :False
> cljs.user=> (if 0 :True :False)
> :False
> 
> 
> gvim
> 
> 
> On 03/10/2015 23:19, Mike Fikes wrote:
>> http://planck.fikesfarm.com
>> 
>> New Features
>> 
>>  * Support OS X 10.11 El Capitan
>>  * Support OS X 10.7 Lion
>>  * Support for setTimeout
>>  * Errors emitted when |spit| and |slurp| fail
>>  * Support terminating REPL by typing |quit| or |exit|
>> 
>> Changes
>> 
>>  * Use ClojureScript 1.7.122
>>  * Experimental analysis / compilation cache (|-k | option)
>> 
>> Fixes
>> 
>>  * |source| REPL special for |planck| namespace code
>>  * Fall back to ASCII encoding if needed when using |planck.shell|
>>  * Eliminate residual processing of |b| option
>>  * Properly merge requires (honoring established namespace aliases)
>>  * Proper VT100 escape sequences (brace matching in iTerm)
>> 
>> 
>> --
>> Note that posts from new members are moderated - please be patient with
>> your first post.
>> ---
>> You received this message because you are subscribed to the Google
>> Groups "ClojureScript" group.
>> To unsubscribe from this group and stop receiving emails from it, send
>> an email to clojurescript+unsubscr...@googlegroups.com
>> <mailto:clojurescript+unsubscr...@googlegroups.com>.
>> To post to this group, send email to clojurescript@googlegroups.com
>> <mailto:clojurescript@googlegroups.com>.
>> Visit this group at http://groups.google.com/group/clojurescript.
> 
> -- 
> Note that posts from new members are moderated - please be patient with your 
> first post.
> --- You received this message because you are subscribed to the Google Groups 
> "ClojureScript" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to clojurescript+unsubscr...@googlegroups.com.
> To post to this group, send email to clojurescript@googlegroups.com.
> Visit this group at http://groups.google.com/group/clojurescript.

-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
"ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at http://groups.google.com/group/clojurescript.


[ClojureScript] [ANN] Planck 1.7

2015-10-03 Thread Mike Fikes
http://planck.fikesfarm.com

New Features

Support OS X 10.11 El Capitan
Support OS X 10.7 Lion
Support for setTimeout
Errors emitted when spit and slurp fail
Support terminating REPL by typing quit or exit
Changes

Use ClojureScript 1.7.122
Experimental analysis / compilation cache (-k  option)
Fixes

source REPL special for planck namespace code
Fall back to ASCII encoding if needed when using planck.shell
Eliminate residual processing of b option
Properly merge requires (honoring established namespace aliases)
Proper VT100 escape sequences (brace matching in iTerm)

-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
"ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at http://groups.google.com/group/clojurescript.


[ClojureScript] [ANN] ClojureScript React Native: cljsrn.org

2015-10-01 Thread Mike Fikes
A new site aggregating info on how to use ClojureScript with React Native: 
http://cljsrn.org

-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
"ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at http://groups.google.com/group/clojurescript.


Re: [ClojureScript] [ANN] ClojureScript React Native: cljsrn.org

2015-10-01 Thread Mike Fikes
Hi Pete,

Yeah, I was thinking that if new things keep coming out, and I keep updating 
that site, it might be nice to have a feed of some sort. Will think about it, 
especially if activity ramps up.

- Mike

> On Oct 1, 2015, at 12:06 PM, Pete Doherty <pdoherty...@gmail.com> wrote:
> 
> This is great, Mike - thanks!
> 
> Are there any plans to set up an RSS/Twitter feed? (I'd be happy to pitch in 
> if you need any help.)
> 
> On Thu, Oct 1, 2015 at 11:57 AM, Mike Fikes <mikefike...@gmail.com 
> <mailto:mikefike...@gmail.com>> wrote:
> A new site aggregating info on how to use ClojureScript with React Native: 
> http://cljsrn.org <http://cljsrn.org/>
> 
> --
> Note that posts from new members are moderated - please be patient with your 
> first post.
> ---
> You received this message because you are subscribed to the Google Groups 
> "ClojureScript" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to clojurescript+unsubscr...@googlegroups.com 
> <mailto:clojurescript%2bunsubscr...@googlegroups.com>.
> To post to this group, send email to clojurescript@googlegroups.com 
> <mailto:clojurescript@googlegroups.com>.
> Visit this group at http://groups.google.com/group/clojurescript 
> <http://groups.google.com/group/clojurescript>.
> 
> 
> 
> -- 
> {:name "Pete Doherty"
>  :email "pdoherty...@gmail.com <mailto:pdoherty...@gmail.com>"
>  :phone "347-552-5753"
>  :twitter "pdoherty926"
>  :linkedin "linkedin.com/in/pdoherty926 <http://linkedin.com/in/pdoherty926>"}
> 
> -- 
> Note that posts from new members are moderated - please be patient with your 
> first post.
> --- 
> You received this message because you are subscribed to the Google Groups 
> "ClojureScript" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to clojurescript+unsubscr...@googlegroups.com 
> <mailto:clojurescript+unsubscr...@googlegroups.com>.
> To post to this group, send email to clojurescript@googlegroups.com 
> <mailto:clojurescript@googlegroups.com>.
> Visit this group at http://groups.google.com/group/clojurescript 
> <http://groups.google.com/group/clojurescript>.

-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
"ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at http://groups.google.com/group/clojurescript.


Re: [ClojureScript] [ANN] ClojureScript React Native: cljsrn.org

2015-10-01 Thread Mike Fikes
Marc,

You can definitely use React directly from ClojureScript without a layer like 
Om or Reagent. (I don’t have any experience with doing that.)

- Mike

> On Oct 1, 2015, at 12:34 PM, Marc Fawzi <marc.fa...@gmail.com> wrote:
> 
> Hi Mike,
> 
> Thank you for going all the way to make it easy for Clojurists to get going 
> with React Native.
> 
> I've been using React Native via JS with some niceties like ES7 decorators 
> ES6 classes and looking forward to using Redux. I've also been curious about 
> React Native's recent support for ES7 async/await and how that could work 
> within the React rendering model.
> 
> I will see if I get my employer to support try porting my work to use the 
> infrastructure you've been working on, Ambly etc, and report objectively on 
> the difference between using and not using CLJS on top of React Native. 
> 
> One question I have for you: do we need to use Reagent/Om or can we just 
> build plain React components (with React Native components like View, Text, 
> etc) using framework-less CLJS? 
> 
> Thank you again, your work is inspiring.
> 
> Marc
> 
> On Thu, Oct 1, 2015 at 8:57 AM, Mike Fikes <mikefike...@gmail.com 
> <mailto:mikefike...@gmail.com>> wrote:
> A new site aggregating info on how to use ClojureScript with React Native: 
> http://cljsrn.org <http://cljsrn.org/>
> 
> --
> Note that posts from new members are moderated - please be patient with your 
> first post.
> ---
> You received this message because you are subscribed to the Google Groups 
> "ClojureScript" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to clojurescript+unsubscr...@googlegroups.com 
> <mailto:clojurescript%2bunsubscr...@googlegroups.com>.
> To post to this group, send email to clojurescript@googlegroups.com 
> <mailto:clojurescript@googlegroups.com>.
> Visit this group at http://groups.google.com/group/clojurescript 
> <http://groups.google.com/group/clojurescript>.
> 
> 
> -- 
> Note that posts from new members are moderated - please be patient with your 
> first post.
> --- 
> You received this message because you are subscribed to the Google Groups 
> "ClojureScript" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to clojurescript+unsubscr...@googlegroups.com 
> <mailto:clojurescript+unsubscr...@googlegroups.com>.
> To post to this group, send email to clojurescript@googlegroups.com 
> <mailto:clojurescript@googlegroups.com>.
> Visit this group at http://groups.google.com/group/clojurescript 
> <http://groups.google.com/group/clojurescript>.

-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
"ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at http://groups.google.com/group/clojurescript.


Re: [ClojureScript] Planck empty string and 0 truthiness seems to be broken

2015-09-26 Thread Mike Fikes
Yeah, that’s a regular / conventional ClojureScript REPL. There are no 
regressions in this area for such ClojureScript REPLs.

This *unchecked-if* / truthiness issue only affects bootstrapped (self-hosted) 
environments.

- Mike

> On Sep 26, 2015, at 7:52 PM, gvim <gvi...@gmail.com> wrote:
> 
> I don't really understand how it all works :) but for feedback the Node REPL 
> which comes with a clean `lein new mies app` is not affected.
> 
> gvim
> 
> 
> 
> On 26/09/2015 22:56, Mike Fikes wrote:
>> Right,
>> 
>> This also affects http://clojurescript.net, Joel Martin’s Node
>> bootstrapped ClojureScript REPL and David's
>> http://swannodette.github.io/2015/07/29/clojurescript-17/ (try (if 0
>> (prn 1) (prn 2)) in the “Compilation” box and you’ll see a bare if(0) in
>> the emitted JavaScript. (Interestingly, it doesn’t affect Replete—not
>> sure how Replete dodged this one.)
>> 
>> For Planck this is covered with https://github.com/mfikes/planck/issues/144
>> 
>> It is also covered upstream via http://dev.clojure.org/jira/browse/CLJS-1423
>> 
>> At it root it is an issue with *unchecked-if* misbehaving in
>> bootstrapped mode in a way that has been vexing us, defying explanation.
>> 
>> - Mike
>> 
>>> On Sep 26, 2015, at 4:57 PM, gvim <gvi...@gmail.com
>>> <mailto:gvi...@gmail.com <mailto:gvi...@gmail.com>>> wrote:
>>> 
>>> Planck (1.6) gives me:
>>> 
>>> cljs.user=> (if "" :Truthy :Falsey)
>>> :Falsey
>>> cljs.user=> (if 0 :Truthy :Falsey)
>>> :Falsey
>>> 
>>> 
>>> This is wrong, according to "Clojurescript Up and Running" and
>>> https://github.com/swannodette/lt-cljs-tutorial :
>>> 
>>> ;; 0 is not a false-y value.
>>> 
>>> (if 0
>>> "Zero is not false-y"
>>> "Yuck")
>>> 
>>> ;; Nor is the empty string.
>>> 
>>> (if ""
>>> "An empty string is not false-y"
>>> "Yuck")
>>> 
>>> 
>>> Same results in 1.5 so not a version issue.
>>> 
>>> gvim
>>> 
>>> --
>>> Note that posts from new members are moderated - please be patient
>>> with your first post.
>>> --- You received this message because you are subscribed to the Google
>>> Groups "ClojureScript" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to clojurescript+unsubscr...@googlegroups.com 
>>> <mailto:clojurescript+unsubscr...@googlegroups.com>
>>> <mailto:clojurescript+unsubscr...@googlegroups.com 
>>> <mailto:clojurescript+unsubscr...@googlegroups.com>>.
>>> To post to this group, send email to clojurescript@googlegroups.com 
>>> <mailto:clojurescript@googlegroups.com>
>>> <mailto:clojurescript@googlegroups.com 
>>> <mailto:clojurescript@googlegroups.com>>.
>>> Visit this group at http://groups.google.com/group/clojurescript 
>>> <http://groups.google.com/group/clojurescript>.
>> 
>> --
>> Note that posts from new members are moderated - please be patient with
>> your first post.
>> ---
>> You received this message because you are subscribed to the Google
>> Groups "ClojureScript" group.
>> To unsubscribe from this group and stop receiving emails from it, send
>> an email to clojurescript+unsubscr...@googlegroups.com 
>> <mailto:clojurescript+unsubscr...@googlegroups.com>
>> <mailto:clojurescript+unsubscr...@googlegroups.com 
>> <mailto:clojurescript+unsubscr...@googlegroups.com>>.
>> To post to this group, send email to clojurescript@googlegroups.com 
>> <mailto:clojurescript@googlegroups.com>
>> <mailto:clojurescript@googlegroups.com 
>> <mailto:clojurescript@googlegroups.com>>.
>> Visit this group at http://groups.google.com/group/clojurescript 
>> <http://groups.google.com/group/clojurescript>.
> 
> -- 
> Note that posts from new members are moderated - please be patient with your 
> first post.
> --- You received this message because you are subscribed to the Google Groups 
> "ClojureScript" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to clojurescript+unsubscr...@googlegroups.com.
> To post to this group, send email to clojurescript@googlegroups.com.
> Visit this group at http://groups.google.com/group/clojurescript.

-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
"ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at http://groups.google.com/group/clojurescript.


Re: [ClojureScript] Planck empty string and 0 truthiness seems to be broken

2015-09-26 Thread Mike Fikes
Right,

This also affects http://clojurescript.net , Joel 
Martin’s Node bootstrapped ClojureScript REPL and David's 
http://swannodette.github.io/2015/07/29/clojurescript-17/ 
 (try (if 0 (prn 1) 
(prn 2)) in the “Compilation” box and you’ll see a bare if(0) in the emitted 
JavaScript. (Interestingly, it doesn’t affect Replete—not sure how Replete 
dodged this one.)

For Planck this is covered with https://github.com/mfikes/planck/issues/144 


It is also covered upstream via http://dev.clojure.org/jira/browse/CLJS-1423 


At it root it is an issue with *unchecked-if* misbehaving in bootstrapped mode 
in a way that has been vexing us, defying explanation.

- Mike

> On Sep 26, 2015, at 4:57 PM, gvim  wrote:
> 
> Planck (1.6) gives me:
> 
> cljs.user=> (if "" :Truthy :Falsey)
> :Falsey
> cljs.user=> (if 0 :Truthy :Falsey)
> :Falsey
> 
> 
> This is wrong, according to "Clojurescript Up and Running" and 
> https://github.com/swannodette/lt-cljs-tutorial :
> 
> ;; 0 is not a false-y value.
> 
> (if 0
>  "Zero is not false-y"
>  "Yuck")
> 
> ;; Nor is the empty string.
> 
> (if ""
>  "An empty string is not false-y"
>  "Yuck")
> 
> 
> Same results in 1.5 so not a version issue.
> 
> gvim
> 
> -- 
> Note that posts from new members are moderated - please be patient with your 
> first post.
> --- You received this message because you are subscribed to the Google Groups 
> "ClojureScript" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to clojurescript+unsubscr...@googlegroups.com.
> To post to this group, send email to clojurescript@googlegroups.com.
> Visit this group at http://groups.google.com/group/clojurescript.

-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
"ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at http://groups.google.com/group/clojurescript.


Re: [ClojureScript] self-hosted defmacro

2015-09-13 Thread Mike Fikes
Self-hosted ClojureScript supports defmacro in the same way that regular 
ClojureScript supports defmacro. In particular, macros must be defined 
separately from runtime code. And, perforce, macros must be written in 
ClojureScript (or, alternatively, they can be in a .clj file, so long as the 
Clojure in that file happens to also be ClojureScript.)

See this for more exposition on this:  
http://blog.fikesfarm.com/posts/2015-06-19-portable-macro-musing.html 


Also, if you’d like to just mess around with macros within a self-hosted 
ClojureScript REPL, it _is_ possible to do if you play games with the way 
things work under the hood. This is covered in more detail here: 
http://blog.fikesfarm.com/posts/2015-09-07-messing-with-macros-at-the-repl.html 


For your example below this ends up looking like:

cljs.user=> (ns foo.core$macros)
nil
foo.core$macros=> (defmacro m [x] `(- ~x))
true
foo.core$macros=> (foo.core/m 1)
-1

- Mike

> On Sep 13, 2015, at 10:43 AM, ZhX Chen  wrote:
> 
> In clojure:
> 
> => (defmacro m [x] `(- ~x))
> => (m 1)
> => -1
> 
> While in self-hosted clojurescript:
> 
> => (defmacro m [x] `(- ~x))
> => (m 1)
> => (- nil)
> 
> So this means self hosted clojurescript does not fully support the defmacro 
> yet?
> 
> -- 
> Note that posts from new members are moderated - please be patient with your 
> first post.
> --- 
> You received this message because you are subscribed to the Google Groups 
> "ClojureScript" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to clojurescript+unsubscr...@googlegroups.com.
> To post to this group, send email to clojurescript@googlegroups.com.
> Visit this group at http://groups.google.com/group/clojurescript.

-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
"ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at http://groups.google.com/group/clojurescript.


Re: [ClojureScript] Easiest way to compile cljs live

2015-09-12 Thread Mike Fikes
Yes, planck -v is overly verbose right now (owing to it showing the ancillary 
JavaScript used to emit vars for def forms).

I’d recommend :repl-verbose true for any ClojureScript REPL instead. For 
example, modify the last line of script/noderepljs that ships with the compiler 
to be

  (repl/repl (node/repl-env $1) :repl-verbose true)”

- Mike

> On Sep 12, 2015, at 2:36 PM, Yehonathan Sharvit <vie...@gmail.com> wrote:
> 
> On Friday, 11 September 2015 08:24:01 UTC+3, Linus Ericsson  wrote:
>> Figwheel is nice, even though I just get the repl in the command-line there 
>> (no autocomplete etc).
>> 
>> The features for compiling and update client side cljs is really really good.
>> 
>> https://github.com/bhauman/lein-figwheel
>> 
>> Den 11 sep 2015 04:22 skrev "Mike Fikes" <mikef...@gmail.com>:
>> 
>> 1. Are you setting :repl-options in project.clj? If so, I suspect that only 
>> affects Lein’s Clojure REPL.  See 
>> https://github.com/clojure/clojurescript/wiki/Running-REPLs and, in 
>> particular, :repl-verbose true would be provided in the map argument to 
>> cljs.repl/repl*.
>> 
>> 
>> 2. If you are running Planck on OS X, the `-v` option puts Planck into 
>> verbose mode, showing compiled JavaScript. If on OS X but running a REPL 
>> that ships with ClojureScript (like script/noderepljs) or a REPL that is 
>> based on from ClojureScript’s cljs.repl, comment #1 above applies.
>> 
>> 
>> 
>> 
>> On Sep 10, 2015, at 9:41 AM, Yehonathan Sharvit <vie...@gmail.com> wrote:
>> 
>> 1. I set   :repl-options {:repl-verbose true} but the repl didn't show any js
>> 2. I'm on mac but I can't see the compiled js on the repl
>> 
>> 
>> 
>> 
>> 
>> -- 
>> 
>> Note that posts from new members are moderated - please be patient with your 
>> first post.
>> 
>> --- 
>> 
>> You received this message because you are subscribed to the Google Groups 
>> "ClojureScript" group.
>> 
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to clojurescrip...@googlegroups.com.
>> 
>> To post to this group, send email to clojur...@googlegroups.com.
>> 
>> Visit this group at http://groups.google.com/group/clojurescript.
> 
> Thanks Mike.
> 
> I am able to see compiled js in planck (I was using an old version before)
> 
> But the repl approach is not so easy when you have a couple of lines of code.
> 
> Try to see the js of this piece of cljs code:
> 
> (deftype x [val])
> 
> (defprotocol Wow
>  (aa [this]))
> 
> (extend-type x
>  Wow
>  (aa [this] "aa from extend-type"))
> 
> 
> (extend-protocol Wow
>  x
>  (aa [this] "aa from extend-protocol"))
> 
> (aa (x. "a"))
> 
> 
> Is there another tool availble out there? Maybe  a web page that compiles 
> cljs?
> 
> 
> 
> -- 
> Note that posts from new members are moderated - please be patient with your 
> first post.
> --- 
> You received this message because you are subscribed to the Google Groups 
> "ClojureScript" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to clojurescript+unsubscr...@googlegroups.com.
> To post to this group, send email to clojurescript@googlegroups.com.
> Visit this group at http://groups.google.com/group/clojurescript.

-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
"ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at http://groups.google.com/group/clojurescript.


Re: [ClojureScript] Easiest way to compile cljs live

2015-09-10 Thread Mike Fikes
Yehonathan,

Any ClojureScript REPL derived from the shipping REPLs is capable of showing 
compiled JS for a form via the :repl-verbose option.

See

  https://github.com/clojure/clojurescript/wiki/REPL-Options#repl-verbose

and here is some non-normative exposition on the option:

   http://blog.fikesfarm.com/posts/2015-06-15-see-js-in-cljs-repl.html 


Also, if you happen to be on a Mac, Planck can do this at the command line:

$ planck -v -e '(inc (+ 3 2))'
Classpath resolves to:
type: src, location: /Users/mfikes/Projects/planck/planck/./
Evaluating (inc (+ 3 2))
((3 + 2) + 1)
6


- Mike

-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
"ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at http://groups.google.com/group/clojurescript.


Re: [ClojureScript] Easiest way to compile cljs live

2015-09-10 Thread Mike Fikes
1. Are you setting :repl-options in project.clj? If so, I suspect that only 
affects Lein’s Clojure REPL.  See 
https://github.com/clojure/clojurescript/wiki/Running-REPLs 
 and, in 
particular, :repl-verbose true would be provided in the map argument to 
cljs.repl/repl*.

2. If you are running Planck on OS X, the `-v` option puts Planck into verbose 
mode, showing compiled JavaScript. If on OS X but running a REPL that ships 
with ClojureScript (like script/noderepljs) or a REPL that is based on from 
ClojureScript’s cljs.repl, comment #1 above applies.

> On Sep 10, 2015, at 9:41 AM, Yehonathan Sharvit  wrote:
> 
> 1. I set   :repl-options {:repl-verbose true} but the repl didn't show any js
> 2. I'm on mac but I can't see the compiled js on the repl

-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
"ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at http://groups.google.com/group/clojurescript.


[ClojureScript] [ANN] Planck 1.6

2015-08-24 Thread Mike Fikes
http://planck.fikesfarm.com http://planck.fikesfarm.com/

New Features

Support JAR deps
Support -c / --classpath for specifying source directories and JAR deps
Support for OS X 10.8 Mountain Lion
Ship with bundled cljs.pprint and cljs.test
Support source REPL special
Support import REPL special
Support for planck.core/*command-line-args*
Support :encoding option for file I/O
Support for byte-oriented streams (planck.io/input-stream and 
planck.io/output-stream)
doc output for macros
doc and tab completion for special forms
Changes

Read pre-compiled namespaces and analysis metadata for faster loading
Deprecate -s / --src in favor of using -c / --classpath
Revise planck.core/file-seq to be lazy (in terms of tree-seq)
Fixes

Capture stderr for planck.shell/sh
Fix a glitch in brace highlighting when vertically aligned
Properly exit if planck.core/exit is called with 0
Don't block on I/O in planck.core/shell/sh
Properly decode UTF-8 from stdin

-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
ClojureScript group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at http://groups.google.com/group/clojurescript.


[ClojureScript] Re: Clojurescript Bootstrap Requiring clojure.string and clojure.set

2015-08-16 Thread Mike Fikes
On Sunday, August 16, 2015 at 10:37:24 AM UTC-4, Matthew Molloy wrote:
 I can successfully require files using cljs.js/require.  Requiring 
 clojure.string and clojure.set fails with the message 
 
 {:error #error {:message ERROR, :data {:tag :cljs/analysis-error}, :cause 
 #object[Error Error: Namespace clojure.set already declared.]}}
 
 These two namespaces fail because they are already required by cljs.js 
 itself.  Anybody else had this issue?

Previously, Planck made use of cljs.js/require and it could successfully load 
clojure.set

  https://github.com/mfikes/planck/issues/23

Feel free to take a look at how version 1.3 was making use of cljs.js/require.

Requiring clojure.string causes two issues.

1) You need an index for Google Closure.
2) You will encounter http://dev.clojure.org/jira/browse/CLJS-1330

See https://github.com/mfikes/planck/issues/28

-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
ClojureScript group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at http://groups.google.com/group/clojurescript.


Re: [ClojureScript] Re: [ANN] Planck 1.5

2015-08-16 Thread Mike Fikes
On Sunday, August 16, 2015 at 7:27:42 PM UTC-4, nchurch wrote:
 Speed is one use case for having the compiled script; another is 
 distribution.  A lot more people are apt to have nodejs installed than 
 Planck, so it might still be nice to have the compiled js in one file (that 
 you would presumably get from a command-line option from Planck?).

I suppose if you have ClojureScript that only makes use of, say, core 
namespaces, then that ClojureScript could be compiled and then executed in any 
JavaScript engine.

But, on the other hand, if your code makes calls into any of the planck.* 
namespaces (in order to do file I/O, shell out, etc.) then you need the Planck 
native runtime present.

-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
ClojureScript group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at http://groups.google.com/group/clojurescript.


Re: [ClojureScript] Leiningen for node.js + Cljs in Cljs

2015-08-15 Thread Mike Fikes
Hi Divyansh,

Joel Martin has this for Node.js:

sudo npm install -g cljs-repl

and then you can start up a REPL with

   cljs

If you are on OS X you can try Planck:

   http://planck.fikesfarm.com

Neither use the JVM. (While Joel’s uses Node, Planck uses the JavaScriptCore 
that ships with OS X.)

Planck is specifically catering to scripting: 

  http://blog.fikesfarm.com/posts/2015-08-01-planck-scripting.html
  http://blog.fikesfarm.com/posts/2015-07-29-clojurescript-mainia.html

- Mike

 On Aug 15, 2015, at 2:25 PM, Divyansh Prakash divyanshprakas...@gmail.com 
 wrote:
 
 I love Clojure, but am severely hindered by not being able to write scripts 
 due to high start-up times. Once I have a REPL running and hot, I actually 
 don't mind it much, but it would still be fun to have a tool that lets me say
 
lein-node new fun-script
cd fun-script/
 
 And then have an instant REPL up by saying
 
lein-node repl
 
 .. and generally hacking away like we do in Clojure.
 But all of it without the JVM.
 Basically, a first-class JS host for Cljs.
 
 I would love to be able to write quick and dirty scripts in Clojure.
 Is there something like this available that I'm missing out on? 
 Or does this sound completely heretical?
 
 -- 
 Note that posts from new members are moderated - please be patient with your 
 first post.
 --- 
 You received this message because you are subscribed to the Google Groups 
 ClojureScript group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to clojurescript+unsubscr...@googlegroups.com.
 To post to this group, send email to clojurescript@googlegroups.com.
 Visit this group at http://groups.google.com/group/clojurescript.

-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
ClojureScript group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at http://groups.google.com/group/clojurescript.


Re: [ClojureScript] [ANN] Planck 1.4

2015-08-12 Thread Mike Fikes
On Wednesday, August 12, 2015 at 9:34:56 PM UTC-4, g vim wrote:
 Great work, Mike. I'm a relative novice so where can I find info about 
 executing host commands with planck.shell and I/O reader/writer?
 
 gvim

The strategy is to mimic the existing Clojure namespaces / facilities.

Planck has doc support, so something like the following works:

(require 'planck.shell)
(doc planck.shell/sh)

You can also use this trick to have Planck display the source for those 
namespaces:

(println (js/PLANCK_LOAD planck/shell.cljs))
(println (js/PLANCK_LOAD planck/io.cljs))

-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
ClojureScript group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at http://groups.google.com/group/clojurescript.


[ClojureScript] Re: [ANN] Planck 1.0 - Bootstrapped ClojureScript OS X REPL

2015-08-04 Thread Mike Fikes
Planck 1.3 is now available via Homebrew:

   http://blog.fikesfarm.com/posts/2015-08-04-pour-a-pint-of-planck.html

-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
ClojureScript group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at http://groups.google.com/group/clojurescript.


Re: [ClojureScript] Re: [ANN] Planck 1.0 - Bootstrapped ClojureScript OS X REPL

2015-08-04 Thread Mike Fikes
  Is it possible to use other JS or CLJSJS libs from within Planck?

Planck implements `cljs.js/*load-fn*` by looking for source in a directory you 
specify. Perhaps in the future it will also be able to load code from JARs.

So, for now, you'd need to un-JAR a lib and do `planck -s /path/to/lib-dir`

Loading JS should work just as in ClojureScript. Planck implements *load-fn* 
according to the rules specified here, which includes looking for JS files: 
https://github.com/clojure/clojurescript/blob/r1.7.28/src/main/cljs/cljs/js.cljs#L59

-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
ClojureScript group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at http://groups.google.com/group/clojurescript.


Re: [ClojureScript] Re: [ANN] Planck 1.0 - Bootstrapped ClojureScript OS X REPL

2015-08-04 Thread Mike Fikes
 Where can I find info about any filesystem API that may be available?

There is a `planck.io` namespace, and a `planck.sh` namespace is in the works.

  https://github.com/mfikes/planck/blob/1.3/planck-cljs/src/planck/io.cljs

-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
ClojureScript group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at http://groups.google.com/group/clojurescript.


Re: [ClojureScript] [ANN] Planck 1.0 - Bootstrapped ClojureScript OS X REPL

2015-08-03 Thread Mike Fikes

 On Aug 3, 2015, at 6:00 PM, gvim gvi...@gmail.com wrote:
 
 On 01/08/2015 18:19, Mike Fikes wrote:
 It is a hybrid native / ClojureScript command-line app, with the native 
 portion being Objective-C / Cocoa driving JavaScriptCore. The native portion 
 is a fairly small (albeit non-portable) codebase.
 
 
 Would you be willing to port it to Windows and Linux? That would measurably 
 increase its usefulness as a teaching tool.

Yeah, I think once the dust has settled, perhaps a port to Chakra would be good 
as well as some engine on Linux.

-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
ClojureScript group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at http://groups.google.com/group/clojurescript.


Re: [ClojureScript] ClojureScript Self-hosting Demo

2015-08-03 Thread Mike Fikes
Marc,

See this FAQ entry:

https://github.com/clojure/clojurescript/wiki/Bootstrapped-ClojureScript-FAQ#with-bootstrapped-clojurescript-can-we-now-have-namespaces-that-mix-both-macros-and-functions
 
https://github.com/clojure/clojurescript/wiki/Bootstrapped-ClojureScript-FAQ#with-bootstrapped-clojurescript-can-we-now-have-namespaces-that-mix-both-macros-and-functions

- Mike

 On Aug 3, 2015, at 5:19 PM, Marc Fawzi marc.fa...@gmail.com wrote:
 
 Btw what consequence does this new capability has w/r/t macros? Does it make 
 possible writing macros in cljs? 

-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
ClojureScript group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at http://groups.google.com/group/clojurescript.


Re: [ClojureScript] [ANN] Planck 1.0 - Bootstrapped ClojureScript OS X REPL

2015-08-02 Thread Mike Fikes
Readline support is available now, along with tab autocompletion.

 Great work, Mike. Is readline support in the works, by any chance?
 
 gvim

-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
ClojureScript group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at http://groups.google.com/group/clojurescript.


Re: [ClojureScript] [ANN] Planck 1.0 - Bootstrapped ClojureScript OS X REPL

2015-08-01 Thread Mike Fikes
It is a hybrid native / ClojureScript command-line app, with the native portion 
being Objective-C / Cocoa driving JavaScriptCore. The native portion is a 
fairly small (albeit non-portable) codebase.

 What would it take to port this to Windows and Linux? Thinking of 
 opportunities to teach Clojurescript inside a terminal without the JVM 
 overhead.

-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
ClojureScript group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at http://groups.google.com/group/clojurescript.


[ClojureScript] [ANN] Planck 1.0 - Bootstrapped ClojureScript OS X REPL

2015-07-31 Thread Mike Fikes
Happy to announce that Planck 1.0 is available:

http://planck.fikesfarm.com http://planck.fikesfarm.com/

-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
ClojureScript group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at http://groups.google.com/group/clojurescript.


[ClojureScript] Re: [ANN] Replete ClojureScript REPL iOS app available

2015-07-24 Thread Mike Fikes
It was approved as is.

 Out of curiosity, how painful/painless was the process of getting it accepted 
 into the app store? I've heard that Apple is pretty sensitive about letting 
 anything in that does any kind of evaluation of arbitrary code.


-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
ClojureScript group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at http://groups.google.com/group/clojurescript.


[ClojureScript] [ANN] Replete ClojureScript REPL iOS app available

2015-07-20 Thread Mike Fikes
Replete 1.0 is now in the App Store

   
http://blog.fikesfarm.com/posts/2015-07-20-ios-clojurescript-repl-available-in-app-store.html

-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
ClojureScript group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at http://groups.google.com/group/clojurescript.


Re: [ClojureScript] Clojurescript special fns

2015-07-10 Thread Mike Fikes
Hi Ewen,

FWIW, the REPL special functions are mainly for their side effects.

Perhaps an argument could be made to have things (like `in-ns`) behave more 
like the plain Clojure REPL. But even in that case the return value seems to be 
specific to the JVM implementation:

user= (in-ns 'foo.bar)
#object[clojure.lang.Namespace 0x41488b16 foo.bar]

- Mike

 On Jul 10, 2015, at 3:30 PM, ewen ewen.grosj...@free.fr wrote:
 
 Hi,
 
 What is the reason for special fns to always print nil instead of printing 
 their result 
 (https://github.com/clojure/clojurescript/blob/master/src/main/clojure/cljs/repl.cljc#L824)?
  
 I'm asking because I'm building tooling around clojurescript and I would like 
 to be able to catch special fns result.
 
 Thanks,
 Ewen.
 
 -- 
 Note that posts from new members are moderated - please be patient with your 
 first post.
 --- 
 You received this message because you are subscribed to the Google Groups 
 ClojureScript group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to clojurescript+unsubscr...@googlegroups.com.
 To post to this group, send email to clojurescript@googlegroups.com.
 Visit this group at http://groups.google.com/group/clojurescript.

-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
ClojureScript group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at http://groups.google.com/group/clojurescript.


Re: [ClojureScript] Mobile dev on Android: clojure or clojurescript?

2015-07-09 Thread Mike Fikes
Here are some starters:

  When: http://www.reactnativeandroid.com http://www.reactnativeandroid.com/

  Why: https://joshaber.github.io https://joshaber.github.io/ and 
https://twitter.com/andy_matuschak/status/560511204867575808

  How: 
http://blog.fikesfarm.com/posts/2015-07-06-clojurescript-with-react-native.html



 On Jul 9, 2015, at 10:30 PM, Mike Pence mike.pe...@gmail.com wrote:
 
 I have been loving your tweets, Mike. They are what brought me here. Can you 
 recommend some links for getting started? I am partial to Intellij.
 
 On Thursday, July 9, 2015 at 1:11:23 PM UTC-4, Mike Fikes wrote:
 Hey Mike,
 
 A “big picture” consideration: If FP is important to you, ClojureScript with 
 React Native is worth taking a look at.
 
 - Mike
 
 On Jul 9, 2015, at 12:58 PM, Mike Pence mike.pe...@gmail.com wrote:
 
 Things are moving so quickly with ClojureScript, it is all very exciting. I 
 am wondering whether Clojure or ClojureScript is the way to go for Android 
 dev?
 
 -- 
 Note that posts from new members are moderated - please be patient with 
 your first post.
 --- 
 You received this message because you are subscribed to the Google Groups 
 ClojureScript group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to clojurescript+unsubscr...@googlegroups.com.
 To post to this group, send email to clojurescript@googlegroups.com.
 Visit this group at http://groups.google.com/group/clojurescript.
 
 -- 
 Note that posts from new members are moderated - please be patient with your 
 first post.
 --- 
 You received this message because you are subscribed to the Google Groups 
 ClojureScript group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to clojurescript+unsubscr...@googlegroups.com.
 To post to this group, send email to clojurescript@googlegroups.com.
 Visit this group at http://groups.google.com/group/clojurescript.

-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
ClojureScript group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at http://groups.google.com/group/clojurescript.


[ClojureScript] [ANN] Replete 1.0 beta: ClojureScript REPL iOS app

2015-06-29 Thread Mike Fikes
Wondering what all this “bootstrapped ClojureScript” hubbub is all about, and 
have an iOS device? There's a REPL app for that!

Try the beta; experience it firsthand:

  https://github.com/mfikes/replete/wiki/Beta

Special thanks to David Nolen and Joel Martin for making this possible!

- Mike Fikes

-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
ClojureScript group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at http://groups.google.com/group/clojurescript.


Re: [ClojureScript] Best way to write React Native ui in cljs?

2015-06-05 Thread Mike Fikes
Hey Daniel,

My guess is that nobody is working on this yet, at least for use with Om.

I'm also curious as to whether om.next will ultimately be required (and whether 
this matters).

(So far, I've just made do with some very simple helper functions.)

- Mike

 On Jun 5, 2015, at 8:12 PM, Daniel Bell dchristianb...@gmail.com wrote:
 
 Hiccup/sablono has been the gold standard for html; is there anything similar 
 for React Native elements?  If not, is anyone working on it?
 
 -- 
 Note that posts from new members are moderated - please be patient with your 
 first post.
 --- 
 You received this message because you are subscribed to the Google Groups 
 ClojureScript group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to clojurescript+unsubscr...@googlegroups.com.
 To post to this group, send email to clojurescript@googlegroups.com.
 Visit this group at http://groups.google.com/group/clojurescript.

-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
ClojureScript group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at http://groups.google.com/group/clojurescript.


[ClojureScript] Re: VanderHart's QTTT on native iOS

2015-05-15 Thread Mike Fikes
For those interested in delving into React Native with ClojureScript, I took a 
stab at documenting how you get off the ground with a new project:

   https://github.com/omcljs/ambly/wiki/ClojureScript-React-Native-Quick-Start

-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
ClojureScript group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at http://groups.google.com/group/clojurescript.


[ClojureScript] VanderHart's QTTT on native iOS

2015-05-14 Thread Mike Fikes
With some relatively minor tweaks to its Om binding, it is possible to run Luke 
VanderHart's Quantum Tic Tac Toe React web app natively on iOS using React 
Native.

For those interested, the port is in https://github.com/mfikes/qttt and I put 
together a quick demo illustrating it running at https://youtu.be/7HtOTzllwTY

It's shockingly easy to do, even with the current nascent state of the relevant 
the libraries and tooling.

- Mike

-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
ClojureScript group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at http://groups.google.com/group/clojurescript.


[ClojureScript] Re: Himera update

2015-04-27 Thread Mike Fikes
I've updated this beta so that it supports reader conditionals.

cljs.user #?(:cljs ClojureScript :clj Clojure)
ClojureScript

- Mike

On Friday, April 17, 2015 at 5:17:49 PM UTC-4, Mike Fikes wrote:
 I'm helping update Himera so that it runs the latest version of ClojureScript 
 (0.0-3196).
 
 I'd like to eliminate any regressions before submitting a PR to Fogus, and 
 have set up a copy with the changes here:
 
http://geit.fikesfarm.com
 
 I'm planning on letting it run there for several weeks. Please feel free to 
 give it a spin, especially trying out the newer ClojureScript features.
 
 - Mike

-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
ClojureScript group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at http://groups.google.com/group/clojurescript.


[ClojureScript] Re: ANN: ClojureScript 0.0-3211

2015-04-25 Thread Mike Fikes
Hey Tony, try updating the version of Clojure in your project.clj to 
1.7.0-beta1, which is used by 0.0-3211.

(In short, reader/read was given a second arity to allow options to be passed, 
thus supporting #? conditional reading.)

-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
ClojureScript group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at http://groups.google.com/group/clojurescript.


[ClojureScript] Himera update

2015-04-17 Thread Mike Fikes
I'm helping update Himera so that it runs the latest version of ClojureScript 
(0.0-3196).

I'd like to eliminate any regressions before submitting a PR to Fogus, and have 
set up a copy with the changes here:

   http://geit.fikesfarm.com

I'm planning on letting it run there for several weeks. Please feel free to 
give it a spin, especially trying out the newer ClojureScript features.

- Mike

-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
ClojureScript group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at http://groups.google.com/group/clojurescript.


Re: [ClojureScript] Exploring the ClojureScript REPL

2015-04-05 Thread Mike Fikes
Hi Alex,

I like it!

One thing worth considering is `deref`ing the `app-state` atom in lieu of 
letting the #Atom ... representation print. Maybe just slap an `@` on front 
without explaining atoms in depth?

- Mike



 On Apr 5, 2015, at 7:00 PM, Alex Eberts alex.ebe...@gmail.com wrote:
 
 Hi All,
 
 I just wrote a blog post for beginner CLJS developers (like me) which 
 illustrates a typical REPL session complete with many of the initial mistakes 
 that I made in the hopes that anyone new to ClojureScript REPL development 
 may avoid the same pitfalls.
 
 http://www.alexeberts.com/exploring-the-clojurescript-repl/
 
 It picks up where the Quick Start guide left off and covers:
 
 * Navigating ClojureScript namespaces from the REPL.
 * The connection between ClojureScript vars and JavaScript objects.
 * Using Chrome DevTools to explore a ClojureScript app running in the browser.
 * Interactive REPL development using :reload.
 
 Comments, corrections and improvements most welcome!
 best wishes,
 Alex
 
 -- 
 Note that posts from new members are moderated - please be patient with your 
 first post.
 --- 
 You received this message because you are subscribed to the Google Groups 
 ClojureScript group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to clojurescript+unsubscr...@googlegroups.com.
 To post to this group, send email to clojurescript@googlegroups.com.
 Visit this group at http://groups.google.com/group/clojurescript.

-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
ClojureScript group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at http://groups.google.com/group/clojurescript.


Re: [ClojureScript] Unexpected token return in a case form returning a function

2015-04-03 Thread Mike Fikes
Hi Sean,

Yes, I believe so. Here are all 3 forms and their emitted JavaScript before and 
after David's change on master:

https://gist.github.com/mfikes/8524482fc84c3c2ad4e0

Hope you can rejoin ClojureScript again soon! Things have improved greatly 
recently, especially in the area of tooling support.

- Mike

 On Apr 3, 2015, at 12:22 PM, Sean Corfield s...@corfield.org wrote:
 
 On Apr 2, 2015, at 7:21 PM, Mike Fikes mikefike...@gmail.com wrote:
 Here you go:
 
 https://gist.github.com/mfikes/b76ad8576b0357f1b617
 
 Thanks Mike. So, same bug as outside the `apply` context?
 
 (In case you’d like to try different expressions, I’m just stopping things 
 in a debugger.)
 
 I don’t have a suitable cljs env setup right now. We abandoned the cljs app 
 we were working on (due to changing business requirements, not any issues 
 with cljs) and it’ll be a while before we start back up on a new cljs app 
 (sometime later this year). I expect we’ll have to ramp up on a whole new set 
 of tooling as things seem to be changing so fast in the cljs world (still!).
 
 Sean Corfield -- (904) 302-SEAN
 An Architect's View -- http://corfield.org/
 
 Perfection is the enemy of the good.
 -- Gustave Flaubert, French realist novelist (1821-1880)
 
 
 
 -- 
 Note that posts from new members are moderated - please be patient with your 
 first post.
 --- 
 You received this message because you are subscribed to the Google Groups 
 ClojureScript group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to clojurescript+unsubscr...@googlegroups.com.
 To post to this group, send email to clojurescript@googlegroups.com.
 Visit this group at http://groups.google.com/group/clojurescript.

-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
ClojureScript group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at http://groups.google.com/group/clojurescript.


Re: [ClojureScript] Unexpected token return in a case form returning a function

2015-04-02 Thread Mike Fikes
Hi Sean

Here you go:

https://gist.github.com/mfikes/b76ad8576b0357f1b617 
https://gist.github.com/mfikes/b76ad8576b0357f1b617

(In case you’d like to try different expressions, I’m just stopping things in a 
debugger.)

- Mike

 On Apr 2, 2015, at 10:16 PM, Sean Corfield s...@corfield.org wrote:
 
 I’m curious what is emitted for this version:
 
 (defn print-foo [fb]
  (let [f (case fb
:foo #'foo
:bar #'bar)]
(apply f [])))
 
 based on there being `return` statements sprinkled throughout the body of the 
 switch... is `apply` special-cased to cause some sort of function context 
 to be in play while compiling the first argument?
 
 Sean
 
 
 
 On Apr 2, 2015, at 6:58 PM, Mike Fikes mikefike...@gmail.com wrote:
 
 I haven’t looked into the root cause, but if it helps, here is the emitted 
 JS:
 
 https://gist.github.com/mfikes/a6106afedd37b7e47138
 
 - Mike
 
 On Apr 2, 2015, at 9:33 PM, Elliot Bulmer sonell...@gmail.com wrote:
 
 I get this error when I try to define a case statement that is returning 
 function vars. See this gist for an example:
 
 https://gist.github.com/sonelliot/5beb9058460b49a7006a#file-unexpected-token-clj
 
 I like to return vars that get invoked rather than the entire function 
 implementation. This is useful because I can re-define a function later and 
 the changes are automatically picked up by callers.
 
 Am I misunderstanding something or is this a legitimate bug?
 
 -- 
 Note that posts from new members are moderated - please be patient with your 
 first post.
 --- 
 You received this message because you are subscribed to the Google Groups 
 ClojureScript group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to clojurescript+unsubscr...@googlegroups.com.
 To post to this group, send email to clojurescript@googlegroups.com.
 Visit this group at http://groups.google.com/group/clojurescript.

-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
ClojureScript group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at http://groups.google.com/group/clojurescript.


Re: [ClojureScript] Unexpected token return in a case form returning a function

2015-04-02 Thread Mike Fikes
I haven’t looked into the root cause, but if it helps, here is the emitted JS:

https://gist.github.com/mfikes/a6106afedd37b7e47138 
https://gist.github.com/mfikes/a6106afedd37b7e47138

- Mike

 On Apr 2, 2015, at 9:33 PM, Elliot Bulmer sonell...@gmail.com wrote:
 
 I get this error when I try to define a case statement that is returning 
 function vars. See this gist for an example:
 
 https://gist.github.com/sonelliot/5beb9058460b49a7006a#file-unexpected-token-clj
 
 I like to return vars that get invoked rather than the entire function 
 implementation. This is useful because I can re-define a function later and 
 the changes are automatically picked up by callers.
 
 Am I misunderstanding something or is this a legitimate bug?
 
 -- 
 Note that posts from new members are moderated - please be patient with your 
 first post.
 --- 
 You received this message because you are subscribed to the Google Groups 
 ClojureScript group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to clojurescript+unsubscr...@googlegroups.com.
 To post to this group, send email to clojurescript@googlegroups.com.
 Visit this group at http://groups.google.com/group/clojurescript.

-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
ClojureScript group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at http://groups.google.com/group/clojurescript.


Re: [ClojureScript] Good/Bad of React Native

2015-03-30 Thread Mike Fikes
With respect to it being ready for prime time within a year or two:

The Facebook Ads app is evidently written using React Native.

There is a tremendous amount of interest in it (for example, the #reactnative 
IRC channel is very active). Facebook appears to be very responsive―my guess is 
that a healthy ecosystem will quickly evolve, leading to a high quality feature 
set.

- Mike



 On Mar 30, 2015, at 9:25 AM, Marc Fawzi marc.fa...@gmail.com wrote:
 
 
 To start the conversation,
 
 http://unredacted.redalemeden.com/2015/initial-thoughts-about-react-native/
 
 (via HN, #1 link right now)
 
 I've been thinking hard if I should keep my hopes up in React Native based on 
 the potential for a ClojureScript version, but after reading this article 
 (plus some intuition I had that the article confirmed)  I'm more likely to 
 pick up Swift than a CLJS version of React Native. From a technical point of 
 view, I'm still very curious about the React Native approach to native 
 development, but I can't tell if it will be ready for prime time in a year, 
 two, or more?
 
 Any thoughts and/or speculations?
 -- 
 Note that posts from new members are moderated - please be patient with your 
 first post.
 --- 
 You received this message because you are subscribed to the Google Groups 
 ClojureScript group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to clojurescript+unsubscr...@googlegroups.com.
 To post to this group, send email to clojurescript@googlegroups.com.
 Visit this group at http://groups.google.com/group/clojurescript.

-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
ClojureScript group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at http://groups.google.com/group/clojurescript.


[ClojureScript] Re: Mac OS X Classpath issue in Getting Started?

2015-03-17 Thread Mike Fikes
On Monday, March 16, 2015 at 7:35:40 PM UTC-4, Josh Nursing wrote:
 I am being frustrated in trying out the latest Clojurescript release on Mac 
 OS X Yosemite. Not sure what I am doing wrong. I follow the Getting Started 
 instructions and get this error on launching java -cp cljs.jar:src 
 clojure.main build.clj
 
 Exception in thread main java.io.FileNotFoundException: Could not locate 
 cljs/closure'__init.class or cljs/closure'.clj on classpath:

In your build.clj, does it start off with

(require 'cljs.closure')

?

-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
ClojureScript group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at http://groups.google.com/group/clojurescript.


Re: [ClojureScript] Building ClojureScript locally.

2015-03-17 Thread Mike Fikes
You can run script/build and this will cause a locally-built version to be 
installed in your local Maven repo. Watch the number that gets built and you 
can use this in your project.clj.

These are the same steps as in 
https://github.com/clojure/clojurescript/wiki/Patches#testing-patches 
https://github.com/clojure/clojurescript/wiki/Patches#testing-patches

- Mike

 On Mar 17, 2015, at 12:56 AM, Kristján Oddsson kodds...@gmail.com wrote:
 
 I'm battling something similar to CLJS-1124 and so I wanted to try to figure 
 out if I could make some changes to the compiler myself and maybe even build 
 a custom build for myself.
 
 Is there any documentation on how to build the jar file locally that I can 
 look at?
 
 Thanks!
 
 -- 
 Note that posts from new members are moderated - please be patient with your 
 first post.
 --- 
 You received this message because you are subscribed to the Google Groups 
 ClojureScript group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to clojurescript+unsubscr...@googlegroups.com.
 To post to this group, send email to clojurescript@googlegroups.com.
 Visit this group at http://groups.google.com/group/clojurescript.

-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
ClojureScript group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at http://groups.google.com/group/clojurescript.


Re: [ClojureScript] Re: ANN: ClojureScript 0.0-3115

2015-03-16 Thread Mike Fikes


 If that is true, then it is a problem, indicative either of a widespread 
 lack of discipline among the tool makers or (more likely) a strong need for 
 some additional well-specified (and maintained!) APIs in the compiler for 
 tools to hook into. 


Sometimes it is just a simple bug or lack of robustness in a downstream 
tool that needs to be sorted before rushing to blame and/or burden upstream 
ClojureScript.

Take https://github.com/omcljs/ambly/issues/61 as an example. Previously 
ClojureScript 0.0-3030 would not print anything when evaluating (doc 
unknown-symbol), and with 0.0-3053 onwards it prints an empty string. This 
broke Ambly.

This doesn't really reflect a lack of discipline with APIs, but does 
illustrates the need to do downstream triage first.

-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
ClojureScript group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at http://groups.google.com/group/clojurescript.


Re: [ClojureScript] GCL advanced compilation bug-- :foo-bar and :foo_bar both become :foo_bar

2015-03-12 Thread Mike Fikes
Perhaps the same: http://dev.clojure.org/jira/browse/CLJS-1105 
http://dev.clojure.org/jira/browse/CLJS-1105

Fixed with a recent commit:

https://github.com/clojure/clojurescript/commit/4bcc95175e4282d43ed74bf0abd670550fc40140
 
https://github.com/clojure/clojurescript/commit/4bcc95175e4282d43ed74bf0abd670550fc40140



 On Mar 12, 2015, at 8:18 PM, Karl Guertin grayr...@gr.ayre.st wrote:
 
 If you have two identically named keywords, one being dash separated and the 
 other being underscore separated, both will come out as underscore separated 
 after getting run through advanced mode compilation and only in advanced 
 mode. The I'm posting this here because I'm unsure if it's a bug in 
 Clojurescript or a bug in Closure Compiler. I'm happy to file it in JIRA 
 instead.
 
 Clojurescript standalone jar r3058
 
 build.cljs:
 
 (require 'cljs.closure)
 
 (cljs.closure/build src
 {:main 'kw-underscore.core
  :output-to out/main.js
  :optimizations :advanced
  :target :nodejs})
 
 src/kw_underscore/core.cljs:
 
 (ns kw-underscore.core)
 
 (enable-console-print!)
 
 (defn -main [ args]
   (println :foo-bar :foo_bar))
 
 (set! *main-cli-fn* -main)
 
 command:
 
 $ java -cp cljs.jar:src clojure.main build.clj
 
 output:
 
 $ node out/main.js
 :foo_bar :foo_bar
 
 -- 
 Note that posts from new members are moderated - please be patient with your 
 first post.
 --- 
 You received this message because you are subscribed to the Google Groups 
 ClojureScript group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to clojurescript+unsubscr...@googlegroups.com 
 mailto:clojurescript+unsubscr...@googlegroups.com.
 To post to this group, send email to clojurescript@googlegroups.com 
 mailto:clojurescript@googlegroups.com.
 Visit this group at http://groups.google.com/group/clojurescript 
 http://groups.google.com/group/clojurescript.

-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
ClojureScript group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at http://groups.google.com/group/clojurescript.


Re: [ClojureScript] println not working in setIntervall callback

2015-03-08 Thread Mike Fikes
Hi Roger,

Are you using a REPL and is console output going to your REPL? (Some REPL 
implementations queue asynchronously printed output and only print it when a 
response to a form evaluation needs to be printed.)

- Mike

 On Mar 8, 2015, at 3:15 PM, Roger Gilliar roger.gill...@googlemail.com 
 wrote:
 
 The following code does not work:
 .
 (did-mount [_]
(js/setInterval (fn [] (println test)) 1000))
 
 It works if I use (.log js/console test) instead of println.
 
 Bug or working as designed ?
 
 BTW: I called (enable-console-print!)
 
 
 
 -- 
 Note that posts from new members are moderated - please be patient with your 
 first post.
 --- 
 You received this message because you are subscribed to the Google Groups 
 ClojureScript group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to clojurescript+unsubscr...@googlegroups.com.
 To post to this group, send email to clojurescript@googlegroups.com.
 Visit this group at http://groups.google.com/group/clojurescript.

-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
ClojureScript group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at http://groups.google.com/group/clojurescript.


[ClojureScript] Path names in :advanced compile

2015-02-03 Thread Mike Fikes
Try the :pseudo-names compiler option to see what the :advanced code is 
referring to 
(https://github.com/clojure/clojurescript/wiki/Compiler-Options#pseudo-names).

-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
ClojureScript group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at http://groups.google.com/group/clojurescript.


[ClojureScript] ClojureScript form call compiled to JavaScript

2015-01-14 Thread Mike Fikes
Also, see: 
https://github.com/clojure/clojurescript/wiki/Compiler-Options#static-fns

-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
ClojureScript group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at http://groups.google.com/group/clojurescript.


Re: [ClojureScript] Making sense of cljs compiler settings

2015-01-11 Thread Mike Fikes
Hi Jonathon, try the :pseudo-names compiler option [1] to get more insight into 
what might be going wrong with your is not a function error.

[1] https://github.com/clojure/clojurescript/wiki/Compiler-Options#pseudo-names

-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
ClojureScript group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at http://groups.google.com/group/clojurescript.


[ClojureScript] Re: Circular references broken?

2014-10-11 Thread Mike Fikes
In the namespaces chapter of ClojureScript: Up and Running, bottom of pg. 57, 
it indicates

ClojuresScript does not support circular references between namespaces.

-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
ClojureScript group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at http://groups.google.com/group/clojurescript.


[ClojureScript] Re: iOS app in ClojureScript

2014-09-16 Thread Mike Fikes
Hi Dylan,

I have no experience with PhoneGap / Cordova. I avoided that stack presuming 
that the resulting app is essentially like a packaged web app.” I wanted to 
instead produce an effectively native app where (ideally) the only difference 
is that instead of the underlying implementation language being Objective-C, it 
is Clojure.

There are a few projects that let you produce completely native apps using 
Clojure (an ARM binary), but those appear to be “experimental.” 

With iOS 7, Apple formally supports implementing parts of an iOS app in 
JavaScript via a newly-introduced Objective-C bridge capability. That, combined 
with using ClojureScript felt like the entire stack is “supported”—at least the 
individual pieces.

An example of things that might not be possible with PhoneGap is rendering a 
table view where the data in the cells come from Core Data (using an 
NSFetchedResultsController). Another example might be the ability to 
participate in Apple's app persistence / resumption capability. I suppose 
PhoneGap could implement any of this stuff (and may already have done so).

So, I'm short, the rationale behind the approach is to take an otherwise native 
app, and simply replace bits that would normally be implemented in one 
language, with my preferred language :)

-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
ClojureScript group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at http://groups.google.com/group/clojurescript.


[ClojureScript] iOS app in ClojureScript

2014-09-15 Thread Mike Fikes
I have an iOS app in the App Store where the view controllers and other code 
are written in ClojureScript instead of Objective-C. Otherwise, it is a native 
app, based on storyboards. The JavaScript is running in JavaScriptCore, 
manipulating UI elements via the Objective-C / JavaScript bridge. The 
Objective-C is minimal, with the bulk of the implementation in ClojureScript.

It is a paid app—so I'm definitely not interested in promoting the app in any 
way via this forum. Instead, I'm interested in:

1) Asking whether anyone else has gone down the same road.

2) Offering help to anyone who might be considering, or involved in the same.

Basically, just looking to share ideas with respect to this particular use of 
ClojureScript.

-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
ClojureScript group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at http://groups.google.com/group/clojurescript.


[ClojureScript] Re: Boolean vs. Number for Boolean field

2014-09-05 Thread Mike Fikes
I filed a rdar, and Apple engineering confirmed the inherent limitation with 
the 32-bit runtime:

  “Objective-C internally treats BOOL as int, so we can't do anything nicer.”

-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
ClojureScript group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at http://groups.google.com/group/clojurescript.


[ClojureScript] Re: Boolean vs. Number for Boolean field

2014-08-17 Thread Mike Fikes
Thanks Max! The unsigned char / _Bool type distinction is probably the root 
cause.

I did a little digging and found that exported BOOL properties are _supposed_ 
to be handled correctly. JSExport.h indicates

BOOL: values are converted consistently with valueWithBool/toBool.

where valueWithBool/toBool almost certainly are referring to methods on 
JSValue, and thus imply that we will end up with boolean values in JavaScript.

I've put together a small standalone Xcode project exhibiting the behavior 
(which indeed isolates it to ObjC/JSC and not ClojureScript): 
https://github.com/mfikes/js-export-bool

Incidentally, this Xcode project illustrates another workaround (in lieu of 
treating 0 as falsey): You can simply avoid BOOL and explicitly use JSValue 
instances. I think I may do this as it pushes the problem into my ObjC code and 
keeps my ClojureScript clean.

I'll file a rdar with Apple, but your explanation of the runtime limitations 
may prevent Apple from actually addressing the issue. (I've also confirmed that 
the problem exists in the latest betas from Apple.)

-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
ClojureScript group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at http://groups.google.com/group/clojurescript.


[ClojureScript] Understanding Dead Code Elimination

2014-07-14 Thread Mike Fikes
One thing I found instructive is David Nolen's “Minecraft” port 
http://swannodette.github.io/2013/06/10/porting-notchs-minecraft-demo-to-clojurescript/

In David's post he claimed that 400 lines would drop by 200 with real keyword 
support—it did; you can see this with the latest compiler.

Also of interest for code size is David's use of lower level constructs 
(JavaScript arrays instead of ClojureScript persistent collections) and the use 
of the == function instead of =.

In short, some small changes you might make to David's code can pull in 
surprisingly large dependencies—this gives you a good feel for the mechanics if 
you are striving for an extremely small output.

-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
ClojureScript group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at http://groups.google.com/group/clojurescript.


[ClojureScript] Re: Consequences of not closing channels in browser?

2014-07-12 Thread Mike Fikes
I would imagine Brandon Bloom's response to a similar question in the Clojure 
group is applicable to the ClojureScript implementation of of core.async:

https://groups.google.com/forum/#!searchin/clojure/close$20channel/clojure/Zr1FmmE2cpQ/F6m9Ye_n1VoJ

-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
ClojureScript group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at http://groups.google.com/group/clojurescript.


[ClojureScript] Re: Consequences of not closing channels in browser?

2014-07-12 Thread Mike Fikes
I would imagine Brandon Bloom's response to a similar question in the Clojure 
group is applicable to the ClojureScript implementation of of core.async:

https://groups.google.com/d/msg/clojure/Zr1FmmE2cpQ/B_6MV2sTP8wJ

-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
ClojureScript group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at http://groups.google.com/group/clojurescript.