5 ms·
Try Clojure in your browser
- gus_massa 15y agoTo get help, you can type tutorial. I think it would be better to type (tutorial), or at least have both options available.
- kghose 15y agoI found it fun to see division results returned as fractions. Has anyone here switched from Python to Clojure for data analysis? What has been their experience?
- spacemanaki 15y agoI haven't used it, but Incanter is a Clojure statistics and data analysis thing... http://incanter.org/ http://incanter.org/
- tomjen3 15y agoThat is because Lisp has fractions as a native datatype. You would get the same result in Common Lisp.
- gukjoon 15y agoNot recommended. Matrix multiplication is really slow, even with Incanter. I doubt you'll get very far with data analysis without multiplying a few matrices so avoid.
- rabidsnail 15y agoSlow compared to what? Numpy (or equivalent) or optimized fortran?
- deleted 15y ago[deleted]
- gukjoon 15y agoYou know what? I realized that I didn't read the whole question. I switched from Octave, not Python. Oops.
- tel 15y agoI'm in the process right now. I didn't want to use Incanter since I don't like the kitchen sink reinvent R style, but there aren't any Clojure-esque matrix libraries around. You, flatly, gain the language advantages of Clojure but have absolutely none of the Numpy/Matlab/R-like environments.
- eldina 15y agoLinux + Opera here: After one has inputted a fifth line, the window will scroll to the top whenever one presses a key to type a statement. I appreciate the effort by people creating repls for various languages. It was a similar repl for Haskell that was my entry point into Haskell and the wonderful world of functional programming.
- deleted 15y ago[deleted]
- nyellin 15y agoAwesome, but please highlight matching parenthesis.
- alpb 15y agoI have always been frustrated by tutorial REPLs that make me copy and paste example codes. I simply don't write them manually to CLI and I believe many people do so. Therefore maybe a link to directly paste and execute code on tutorial steps would be quite useful. Like "run this".
- spacemanaki 15y agoIf you click some of the code examples in the tutorials, it will paste them into the REPL. You have to hit enter to run them though.
- ColinWright 15y agoNice to see this submission getting traction, especially given that the first submission got none at all. Clever of llambda to use the trailing question mark on the URL to confound PG's duplicate detection mechanism.
- mgkimsal 15y agoUmmm.... Following the first thing in the tutorial: Clojure> (+3 3) java.lang.ClassCastException: java.lang.Long cannot be cast to clojure.lang.IFn http://gyazo.com/22c613f5bb4ebda5a36d0fbc0a85b83d http://gyazo.com/22c613f5bb4ebda5a36d0fbc0a85b83d What have I missed?
- quinedstatement 15y agoYou need a space between the + and the first 3 (+ is the function you want to call).
- mgkimsal 15y agoThanks. The tutorial didn't show that: http://gyazo.com/9d330e8bdb0537f9179c34ad2924928c http://gyazo.com/9d330e8bdb0537f9179c34ad2924928c And when I click the tutorial's "(+3 3)" grey box, it inserts what looks like no space between the + and 3, and lo and behold, it works (6). And when I type it in now with no space (+3 3) it works too. :/
- mgkimsal 15y agooops - sorry - I'm totally misreading it. :/
- rayiner 15y agoSo just to give you some background. In any Lisp, when you evaluate a list, the first element is treated as an operator, and the remaining items are treated as arguments. Moreover, there is no distinction between graphic characters or alphabetic characters for the purposes of defining variable names. So '+' is a valid name for a variable (which is bound to the addition function), and so is '+3'. So without the space, it thinks you are trying to call the function '+3' with the argument '3'.
- andrewflnr 15y agoI appreciate that it works very nicely on my iPad, as far as writing lisp on a touch keyboard goes.
- 2nd_planet 15y agoIt's cool, but the REPL could let you do multiline stuff by detecting whether you've closed all the parentheses and quotes yet.
- iso8859-1 15y agoIs there a Java Applet version available? Why run it remotely when you don't need to?
- krasin 15y agoWhy Java, if JavaScript is so fast nowadays? But I agree, no point to run it remotely.
- jodrellblank 15y agoPresumably because Clojure runs on the JVM.
- mtraven 15y agoTry Common Lisp in your browser: http://nostoc.stanford.edu/Doc/demointro.html http://nostoc.stanford.edu/Doc/demointro.html