Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Lisp, the sacred language of the now and forever

Name: Anonymous 2015-02-18 8:24

La lingua sacra ed eterna

I can feel the godforce emanating from it.

You will soon have your God and you will construct it with your own hands.

Name: Anonymous 2015-02-22 5:58

>>88
Would you like to demonstrate how elegant LISP is by rewriting this simple program as lisp macros?
#include "void.h" //gist.github.com/FrozenVoid/87e6ad6212ac9ce496e0#file-void-h"

#define add5(x) x+5
#define fv5(...) apply(add5,__VA_ARGS__)
#define add4(x) x+4
#define fv4(...) apply(add4,__VA_ARGS__)
#define add3(x) x+3
#define fv3(...) apply(add3,__VA_ARGS__)
#define add2(x) x+2
#define fv2(...) apply(add2,__VA_ARGS__)
#define add1(x) x+1
#define fv1(...) apply(add1,revargs(__VA_ARGS__))
#define fv0(dist1,len2,...) "fv1 result:", __VA_ARGS__,"\n ",len2 ,"numbers in reverse order starting from ",dist1,"th to last from fv1 were:\n",sliceargs(dist1,len2,revargs(__VA_ARGS__))," and their product minus their sum:",opapply(-,original,opapply( * ,original,sliceargs(dist1,len2,revargs(__VA_ARGS__))),opapply( + ,original,sliceargs(dist1,len2,revargs(__VA_ARGS__))))

STDSTART
p(fv0(2,3,capply(5,fv1,fv2,fv3,fv4,fv5,1,2,3,4,5,6,7))) /* expected:
fv1 result: 22 21 20 19 18 17 16
3 numbers in reverse order starting from 2 th to last from fv1 were:
18 19 20 and their product minus their sum: 6783
*/

STDEND

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List