Fargo: new Scheme-like language working in Node.js/browser
fargo.jcoglan.com
Fargo: new Scheme-like language working in Node.js/browser
1–10 of 37 posts
Re: Fargo: new Scheme-like language working in Node.js/browser
#2 > (+ 1 1 1 1)
=> 2
> (* 3 4 5 6)
=> 12
Does it only consider the first and second items in a list?Re: Fargo: new Scheme-like language working in Node.js/browser
#3> (+ 1 1 1 1) => 2 > (* 3 4 5 6) => 12 Does it only consider the first and second items in a list?
https://github.com/jcoglan/fargo/blob/master/source/fargo/li...
Re: Fargo: new Scheme-like language working in Node.js/browser
#4Re: Fargo: new Scheme-like language working in Node.js/browser
#5 (define (count x)
(let loop ((x x) (sum 0))
(if (zero ? x)
sum
(loop (- x 1) (+ sum x)))))
(count 100000) ; ==> 5000050000 (doesn't blow up)
I'm very tempted to help out however I can. I've been dreaming of using Scheme instead of JS in a Node.js setting.Re: Fargo: new Scheme-like language working in Node.js/browser
#6> (+ 1 1 1 1) => 2 > (* 3 4 5 6) => 12 Does it only consider the first and second items in a list?
So it would seem: https://github.com/jcoglan/fargo/blob/master/source/fargo/li...
Other than being obviously new, this is pretty cool.
Edit: Would there be a better way to fix it than to add functions like this?
function adder() {
var args = Array.prototype.slice.call(arguments);
return args.reduce(function(a, b){return a + b})
}
function subtractor() {
var args = Array.prototype.slice.call(arguments);
return args.reduce(function(a, b){return a - b})
}
function multiplier() {
var args = Array.prototype.slice.call(arguments);
return args.reduce(function(a, b){return a * b})
}
function divider() {
var args = Array.prototype.slice.call(arguments);
return args.reduce(function(a, b){return a / b})
}
(I haven't really put too much thought into this, but would love to hear of stronger approaches or obvious bad ideas in this one)Re: Fargo: new Scheme-like language working in Node.js/browser
#7Earlier quoted context omitted.
So it would seem: https://github.com/jcoglan/fargo/blob/master/source/fargo/li...
Man, I forget how nice it is to be able to look into the source of stuff. Other than being obviously new, this is pretty cool. Edit: Would there be a better way to fix it than to add functions like this? function adder() { var args = Array.prototype.slice.call(arguments); return args.reduce(function(a, b){return a + b}) } function subtractor() { var args = Array.prototype.slice.call(arguments); return args.reduce(fun…
Someone has actually already submitted a pull request doing just this:
Re: Fargo: new Scheme-like language working in Node.js/browser
#8Re: Fargo: new Scheme-like language working in Node.js/browser
#9(cdr ()) makes it explode. What's nil? null nil don't exist
I do really like this. I was hoping for something like this where it would allow me to write lisp instead of javascript.
Re: Fargo: new Scheme-like language working in Node.js/browser
#10It is expected to be released very soon for Javascript (and Scheme).
[1]: http://news.ycombinator.com/item?id=1921347
[2]: https://groups.google.com/group/qilang/msg/bd474d815479b50a?...