It's just because it's mzscheme doing the printing: that's how it does it. Functions are called 'procedures' in scheme. But they are called 'functions' in Arc.
"In the normal case, the result of reduce is the combined result of function's being applied to successive pairs of elements of sequence. If the subsequence contains exactly one element and no initial-value is given, then that element is returned and function is not called. If the subsequence is empty and an initial-value is given, then the initial-value is returned and function is not called. If the subsequence is empty and no initial-value is given, then the function is called with zero arguments, and reduce returns whatever function does. This is the only case where the function is called with other than two arguments."
True, but sometimes you want some particular value for those special cases. In case of a sum (reduce add ()) should return 0, which is the (mathematically) "right" result.
Yes, I suppose the real solution is an optional initial value argument (as in CL reduce)), thus you can provide an appropriate identity value (e.g. 0 in the case of add).
(def prime (n)
(if (~isa n 'int) nil
(< (= n (truncate n)) 2) nil
(is n 2) t
(multiple n 2) nil
(with (div 3
lim (truncate (sqrt n))
result t)
(while (and (or (~multiple n div)
(= result nil))
(< div lim))
(++ div 2))
result)))
I, for one, endorse your approach of getting the foundations right before building towers atop.
I venture in explanation of the character set controversy: IIRC You have written of wanting Arc to be good specifically for web programming. (And obviously you are using it thus.) Ascii is fine when working on code to do symbolic differentiation (as I believe McCarthy was interested in at the dawns of time). But for a web app for the Chinese market, say, Unicode is obviously going to be involved. I think perhaps people were just expecting 'new web-app language' to entail Unicode support.
"I think perhaps people were just expecting 'new web-app language' to entail Unicode support." -- I would go further: I would say that many of us consider Unicode support an essential; it's part of getting the foundations right. PG mentioned hearing/reading Guido talk about the pain of switching Python's character support--but what was painful was the switching, not the character sets. The sooner Arc makes that switch, the less pain it'll be.
Hmm. Problem is, that means stdin is your arc script. For many scripting tasks, you want stdin to be the input to your script, e.g. a pipe or console or redirected file.