3 ms·
That doesn't seem very... joyful. In q it's just {(q%x),z%q:-.5y+signum[y]sqrt(yy)-4xz} This is easy to see is correct. How do you know that Joy is correct?
by geocar 8y ago
That doesn't seem very... joyful.
In q it's just {(q%x),z%q:-.5y+signum[y]sqrt(yy)-4xz}
This is easy to see is correct.
How do you know that Joy is correct?
I'm trying to mentally execute this. I know I haven't seen Joy before, but I've used Forth, Postscript and Lisp, so I feel like I have a lot to stand on:
- cons seems to have the same meaning in lisp, so x y cons -> (x . y) or in Erlangish, [x|y] right?
- x [y] dip seems to be y x
- [x] [y] infra seems to be the same as [x y]
- swap, first, pop, sqrt all seem reasonable
- wouldn't [] cons cons cons dup* be better than the extra list with [i] map ] infra first? it's not really clear to me what [i] map is doing... I see how the values have to flow, but it feels like it should be redundant.
I feel like it's immediately a lot more (mental) work. It reminds me of tracing forth code before I just gave in and started using variables like a normal person.
Is this really the best way to be introduced to Joy? Is this a typical problem that Joy programmers feel is the right way to program (and the right solution?) Am I missing something here?
- exikyut 8y agoFormatting note: It will look a bit messier for the things*involving*asterisks to be on their own line (indented two spaces), but that way Arc won't chew them. I'm mentioning this because I can't determine the original text myself.
- geocar 8y agoYeah, can't edit now. {(q%x),z%q:-.5*y+signum[y]*sqrt(y*y)-4*x*z}