Fork me on GitHub
#clojurescript
<
2016-09-15
>
fingertoe04:09:26

Trying to get some newbee clojurescript traction here — Can somebody expound on step 3 of the DIY here— https://github.com/jpb/aws-lambda-cljs

pat04:09:52

@fingertoe that would be your :output-to compiler option presumably with :simple opts

pat04:09:39

if you use advanced opts you need to be sure to ^export your public interface with awslambda so the name is not munged

jannikko15:09:30

Hey everyone. I have a function that is returned from an API like so (-> photos first :getUrl). How do I invoke the function that is returned?

anmonteiro15:09:04

@jannikko if (-> photos first :getUrl) is a function, this should invoke it: ((-> photos first :getUrl) arg1 arg2)

jannikko15:09:13

(It’s a js function)

anmonteiro15:09:36

ClojureScript functions are JS functions too, so no trouble there

jannikko15:09:56

Oh ok thanks

yury.solovyov18:09:53

what pipeline-async function returns? a channel?

yury.solovyov18:09:09

docs seem to only say what it takes

darwin18:09:37

I have a macro, it calls cljs.analyzer/warning to issue a compiler warning using &env, all is good: https://dl.dropboxusercontent.com/u/559047/cljs-oops-intro-oget.png but I want to move that warning pointer to point to a specific parameter passed into that macro, (identity “k1”) in the case above I guess need something which will update my &env to correct :line, :column after feeding it with tokens from &form

dnolen18:09:36

@darwin you’re calling something that’s not public nor intended to be used for this purpose

darwin18:09:23

I live dangerously

dnolen18:09:39

I can’t think of way to make that work

dnolen18:09:03

your time is probably better spent figuring out you need from the public api and suggesting some solution that will cover your use case

darwin18:09:00

ok, this is not that big issue for first version, I just wanted to make it better if possible

dnolen18:09:06

I have no issues with public hooks for tooling for this kind of thing

darwin18:09:46

I will try to put some effort into this, but I don’t have “full picture” in my head for cljs compiler stuff, I just go and hack some solution for problem at hand

dnolen18:09:08

my suspicion is that you could probably take the line & column info from env and then read the form

darwin18:09:25

I have been following repo commits for a while and I have tests, so I will be able to spot breakages quickly

dnolen18:09:30

I believe the form should have the source form as metadata (if it doesn’t that’s probably a simple thing to add)

darwin18:09:15

no, the problem is that it is after reader, and stuff like “#js []” is not original code, so I cannot trust its length

darwin18:09:39

a hacky idea is to wrap params in an “indentity” macro and steal the info from its expansion invocation

darwin18:09:49

not sure if this could fly

darwin18:09:38

outer macro would be stateful, it would set a flag “when inner macro expands use its info"

dnolen18:09:16

I don’t really understand why you need all this

dnolen18:09:30

the forms your macro gets should have the location info you need

dnolen18:09:38

as metadata

darwin18:09:53

so then problem solved

darwin18:09:35

thanks, going to try it

jasonjckn19:09:21

how do i set Xmx on clojurescript compiler in my leiningen project.clj file?

jasonjckn19:09:38

the compiler is taking up >4gb ram

pesterhazy19:09:18

wow, what are you building?

dnolen19:09:19

@jasonjckn in the normal way - there’s nothing special here

jasonjckn19:09:41

ok :jvm-opts

darwin19:09:47

worked! https://dl.dropboxusercontent.com/u/559047/oops-it-worked.png but my tests discovered that the meta information might get lost under some circumstances, it might be some problem in cljs.test macros, I’m able to reproduce it in are macro of cljs.test. not that big issue, it works most of the time, and I can fall back to parent env info if param meta is missing

dnolen19:09:01

@darwin the issue may be deeper - something about macroexpand if I recall

darwin19:09:50

thanks for that meta idea, didn’t know macro params have such info attached to them in metas

dnolen19:09:26

@darwin yeah I was confused about what you were trying (had tried), should have suggested that sooner

darwin20:09:18

wondering if closure compiler has some special treatment for goog.object/get, in my tests it leads to better DCE compared to raw aget: https://github.com/binaryage/cljs-oops/issues/1

dnolen20:09:20

not so surprising - another reason to relegate aget for the only thing it was ever meant for - arrays

richiardiandrea20:09:59

cljs-oops looks cool

richiardiandrea20:09:08

and much needed 😄

danielcompton20:09:59

@darwin how did you create those transcripts?

smw20:09:59

so there’s this too

smw20:09:07

and that was the earlier hit on google

smw20:09:17

and I thought maybe @richiardiandrea was trolling

darwin20:09:39

ah, didn’t know about the clj-oops, thanks, maybe time to change the name

richiardiandrea20:09:41

ah ah no trolling, genuinely was not aware of it

smw20:09:51

different things 🙂

darwin20:09:58

but zero stars 🙂

danielcompton20:09:02

No stars, 7 commits, no activity since Jan 2014

smw20:09:17

Yeah, I wouldn’t worry about it too much. Just so confused as to why someone wanted oo clojure

darwin20:09:39

I need something short and sweet, I feel oops will be used in all my new projects 🙂

richiardiandrea20:09:47

well there is OO already 😉

darwin20:09:03

circus == tools for generating the transcripts, arena == the tests themselves

darwin20:09:23

@danielcompton btw. I have successfully used that console.log inlining trick, as discussed here: https://github.com/Day8/re-frame/issues/164#issuecomment-222579135

darwin20:09:27

it really works!

richiardiandrea20:09:40

yeah that should be added EVERYWHERE 😄

mitchelkuijpers21:09:17

Wow thank you @darwin everyone should use this library

darwin21:09:51

@mitchelkuijpers thanks, but wait for 0.1 release first 🙂

darwin21:09:18

I will first battle-test it in https://github.com/binaryage/chromex and other projects of mine