Get to work Enterprise IntelliJ Java Beans and Node.js ES6 Enterprise frameworks Pajeet just won't stop talking about his shitting street Need something to cut out the noise Can count on Programmer's Music Mix for Dark Minds every time
>>7-8 JavaScript is Lisp. Lispers made JavaScript to spread Lisp ideas to the masses as the epitome of good.
It was their "Trojan horse" for embedding dynamic typing, Lisp-style garbage collection, Lisp-style dynamic OOP, etc. into a program the masses will have on their computer (web browsers).
Lispers originally planned to use a dialect of Scheme, but they made JavaScript so Lisp would remain free from criticism.
They knew from experience that when Lisp ideas become popular, they become hated, so Lisp must always be a minority.
Name:
Anonymous2017-01-05 5:27
smoke weed everyday.
Name:
Anonymous2017-01-05 6:27
check dubs everyday
Name:
Anonymous2017-01-05 7:26
>>9 Javascript definitely had some Lisp influence (as did other dynamic languages) but its lack of homoiconicity makes metaprogramming much harder (in JS, code generation is rarely used for any serious task; in fact, it's usually done to either minify or obfuscate the code as opposed to extending the language), and metaprogramming is one of the biggest draws of Lisp.
Name:
Anonymous2017-01-05 9:53
>>8 What is the point of partial application? #define add(a,b) (a)+(b) #define add5(b) add(5,b) int n=6; int r=add5(n)// Same thing
Name:
Anonymous2017-01-05 10:01
>>13 the point of partial application is to create more specialized functions at runtime. practical example: I do it a lot in the game I'm writing and the resulting functions are dependent on values not known at compile time so making a C macro or C function is not viable. as to why you'd need more specialized functions, it depends on the programming style you're using but it's obviously a pretty common need in FP. I'm not doing pure FP in my game (I'm using FIOC) but partial application helps me combine generic functions and runtime data into something that fits the required interface.
Name:
Anonymous2017-01-05 10:15
>>14 There is no magic barrier from ``the runtime'' #include <stdio.h> #define add(a,b) (a)+(b) #define add5(b) add(IamARunTimeVariable,b) int getnum(void){ int num; printf("Enter a RunTime variable: "); scanf("%d", &num); return num; }
int main(void){ int IamARunTimeVariable=getnum(); int n=6; int r=add5(n);
printf("\n Result:%d:\n",r); return 0;}
Name:
Anonymous2017-01-05 10:31
//rewritten to concise macro style i normally use #include <stdio.h> #define getnum() ({int num; printf("Enter a RunTime variable: "); scanf("%d", &num); ;num;}) #define add(a,b) (a)+(b) #define addnum(b) add(getnum(),b) int main(void){ printf("\n Result:%d:\n",addnum(6)); return 0;}
Name:
Anonymous2017-01-05 10:58
Bonus for >>8 you don't need the verbose drivel to create function in JS var add=(a,b) => (a)+(b); var addToFive = (n)=>add(n,5); alert(addToFive(1))
Name:
Anonymous2017-01-05 11:04
>>17 this syntax looks quite nice, completely unlike most of the javashit I've seen (which manages to be both verbose and inconsistent at the same time). maybe it's not such a bad language after all.
Name:
Anonymous2017-01-05 11:07
>>8 Its only due ES6 standard syntax being implemented in major browsers. Its basically a shorter way to write: var add=function(a,b){return (a)+(b)} var addToFive = function(n){return add(n,5)} alert(addToFive(1))
Name:
Anonymous2017-01-05 11:10
>>19 I know it's a syntactic sugar but it's both clear and concise. you can write lambdas this way, right? if so, javashit would be an implicit var away of not being a pain in the ass to read and write.
Additionally javascript objects are all associative arrays so this works too: var funcname=prompt("Enter function name","map"); alert( [1,2,5,10,25,100,250,500,100] [funcname] ((n)=>n*n) )
Name:
Anonymous2017-01-05 12:27
>>21-22 nice javashit FP and nice dubs. looks like I'm going to add JS to my list of languages that don't necessarily suck but are often misused horribly.