5 ms·
From the examples: # A simple fizz buzz example (loop [i :range [1 101] :let [fizz (zero? (% i 3)) buzz (zero? (% i 5))]] (print (cond
by MaysonL 6y ago
From the examples:
# A simple fizz buzz example
(loop [i :range [1 101]
:let [fizz (zero? (% i 3))
buzz (zero? (% i 5))]]
(print (cond
(and fizz buzz) "fizzbuzz"
fizz "fizz"
buzz "buzz"
i)))
Is this not lisp?
- nonbirithm 6y agoI'm not clear on the exact reasons, but I think some people see it as "Python with S-expressions" rather than "Lisp". I think it's because Janet does not use lists implemented with cons cells and historically that's just what Lisp always used. (Janet uses arrays instead.) But by that logic Clojure isn't a Lisp, if has no cons cells... Another criteria used is homoiconicity. I think the argument is about if a language satisfies the historical definition of "Lisp" rathen than being a Lisp-inspired language with parens.
- yarrel 6y agoClojure isn't a Lisp, and really screws up some of the concepts.
- oalae5niMiel7qu 6y agoA good reason to regard this as "Python with parentheses" is because not only does it use arrays instead of cons cells, but there's no non-mutating `append` function. Instead, Janet has an `array/concat` function that behaves like a Python array's `.append` method, and that's it. And no, Clojure isn't a Lisp. Perhaps it would be appropriate to say that Janet is "a Clojure".
- zdragnar 6y agoLisp comes from LISt Processing, and prefix notation with enclosing parentheses alone doesn't mean processing lists. With that said, the underlying datastructures don't actually deter from the fact that you can quote and unquote what appear to be lists, and it walks and quacks more or less like a lisp (like clojure, as a sibling pointed out), so I don't actually mind. In fact, Janet just might be my favorite scripting language, even if I haven't had occasion to use it for anything impressive yet.
- deleted 6y ago[deleted]