Regarding the hack to make function calls: if JSX elements start with a capital letter, then the pragma is ignored, and the element name is used as a local variable name instead, e.g.: transform(" hi! ") outputs Foo({id: "my-element"}, ["hi!"])
Generalizing JSX: Delivering on the Dream of Curried Named Parameters
21–29 of 29 posts
Re: Generalizing JSX: Delivering on the Dream of Curried Named Parameters
#22> Any sufficiently complicated [Javascript] program contains an ad hoc, informally-specified, bug-ridden, slow implementation of half of Common Lisp.
Re: Generalizing JSX: Delivering on the Dream of Curried Named Parameters
#23Re: Generalizing JSX: Delivering on the Dream of Curried Named Parameters
#24Very good article, it is easy to predict great use cases for JSX concept in the future. I proposed the idea of using JSX as angular2 templates. They didn't like it and I think the React competition was an important factor for that. https://github.com/angular/angular/issues/5131
Re: Generalizing JSX: Delivering on the Dream of Curried Named Parameters
#25Seeing 'xml' trees reminds me of a child from ML and XSLT...
Re: Generalizing JSX: Delivering on the Dream of Curried Named Parameters
#26A certain portion of programmers seems convinced that currying offers a huge amount of power, and we just haven't unlocked it yet. But I don't think I understand why they feel that way.
Uncurried: \xs -> map (\x -> f (fst x)) xs
Now comparing this to js would just be unfair (edit: ES6 lambdas are probably ok).
Re: Generalizing JSX: Delivering on the Dream of Curried Named Parameters
#27Re: Generalizing JSX: Delivering on the Dream of Curried Named Parameters
#28Whenever I run a code example, I get 5 403 errors one after the other trying to make PUT requests to http://tonicdev.com/new
Sample request:
{"model":{"content":{"package":{"engines":{"node":"4.x.x"},"lastEvaluatedDependencies":{},"dependencies":{}},"title":"","cells":[{"_id":"cells/3f4e1137-79ee-4dbd-b201-ba404a056e0f","content":{"type":"source","text":"/* @jsx console.log */\n\n// Now this is the same as console.log(\"div\", { \"id\":\"my-element\"}, \"hi\");\nhi"}},{"_id":"cells/fd8deede-cfeb-48df-ac0f-740397f61e47","content":{"type":"rich-text","text":"Created from: http://tolmasky.com/2016/03/24/generalizing-jsx/","tag":"p"}...},"evaluationCount":0},"fromNotebook":null,"fromLocation":"http://tolmasky.com/2016/03/24/generalizing-jsx/","embed":tr...}
And response:
{ "message": "CSRF token failure", "csrf": "4fa7f4dc-c906-4561-92dd-2489cc53c7f7" }
Safari on OSX, Chrome doesn't have the problem.
Re: Generalizing JSX: Delivering on the Dream of Curried Named Parameters
#29Does this go far enough that we can invoke Greenspun's Tenth Rule? > Any sufficiently complicated [Javascript] program contains an ad hoc, informally-specified, bug-ridden, slow implementation of half of Common Lisp. https://en.wikipedia.org/wiki/Greenspun%27s_tenth_rule