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 2:13

>>79
Why don't you check my perfect square in the meantime?

Name: Anonymous 2015-02-22 2:19

Why don't we just rename tis board Error: Your IP address is blacklisted?

Name: Anonymous 2015-02-22 2:34

>>82
Why would we?

Name: Anonymous 2015-02-22 3:01

>>82
Never happened to me before.
Been spamming have you?

Name: Anonymous 2015-02-22 3:22

>>82
You could stop posting through Tor.

>>84
It's because he's posting through Tor.

Name: Anonymous 2015-02-22 3:28

I post through a dual-layer VPN purchased with bitcoin.

Name: Anonymous 2015-02-22 3:58

>>75
Actually i've been posting the whole week. I just wanted to show this "Advanced LISP wizardry"(which Paul Graham is fond of) is equivalent to "primitive, text juggling" C preprocessor macro.
The "killer feature" is passing code to the macro to expand somewhere and integrate into the macro. e.g. textreplace(parametername, chunkofcode) you can pass entire programs as ({macroblocks}) in C and even chain them in like 10 levels of macroexpansion. Nobody even thinks these are killer features, they are basic abstractions.
Example:
#define macropgrogram3(arg1,...) ({;arg1+1;})

#define macro3(macroprogram1,macroprogram2,macroprogram3,...) macroprogram1(macroprogram2(macroprogram3(__VA_ARGS__)))
Advanced LISP wizards would claim this macro chain is "function combinator" "lambda calculus" or some kind of academic bullshit which is only available in their LISP/Haskell/academic language.
Also, i see like 90% of TOR exit nodes blocked and this makes it harder to post.

Name: Anonymous 2015-02-22 4:22

>>85
It's more convenient for me to just wait until it switches to a node that isn't banned. Looking for a proxy to chain in front of tor is a huge pain in the ass to do regularly.

>>87
You can do a lot with cpp but it's still easier and more sane to write advanced macros with an actual programming language.

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

Name: Anonymous 2015-02-22 6:09

>>87
still using TOR
The NSA owns over half of the exit nodes now you moron, it's completely compromised.

I'd advise moving to a dual-layer VPN, yes it costs money, but ask yourself how much your freedom and privacy is worth?

Name: Anonymous 2015-02-22 6:27

>>90
I'm a poorfag and paying to shitpost through VPN doesn't seem like a great idea anyway. TOR works, is fast and i set it to use obfs3 bridges for added privacy.
i2p is much slower and doesn't have much gateways to the web.

Name: Anonymous 2015-02-22 7:15

>>89
seems too convoluted.

Name: Anonymous 2015-02-22 7:24

>>92
#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 product(...) opapply(*,original,__VA_ARGS__)
#define sum(...) opapply(+,original,__VA_ARGS__)
#define substracted(...) opapply(-,original,__VA_ARGS__)
#define revsliceargs(slicestart,slicedist,...) sliceargs(slicestart,slicedist,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:",substracted(product(revsliceargs(dist1,len2,__VA_ARGS__)), sum(revsliceargs(dist1,len2,revargs(__VA_ARGS__))))

#define numbers genargs(7)
#define genfunc(x) merge(fv,x)
#define functions apply(genfunc,genargs(5))

STDSTART
p(fv0(2,3,fapply(functions,numbers))) /* 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

Name: Anonymous 2015-02-22 9:18

The truth lisp weenies don't want you to know:

http://conal.net/blog/posts/the-c-language-is-purely-functional

Name: Anonymous 2015-02-22 9:21

Anal Elliott

Name: Anonymous 2015-02-22 9:37

>>94
a cpp expression yields a (pure) value of type C, which is an ADT (abstract data type) that represents imperative programs.
Lame.

Name: Anonymous 2015-02-22 9:40

>>96
Do you call any true statement "lame" or just the true statements that offend you?

Name: Anonymous 2015-02-22 9:43

>>97
I wrote that before reading the comments in which it becomes apparent the author doesn't intend for the article to be taken seriously. You clearly took it seriously, and for that you have my condolences.

Name: Anonymous 2015-02-22 9:45

cpp, the sacred language of the now and forever

Name: Anonymous 2015-02-22 9:49

>>98
I didn't take it serious, but that doesn't change the fact that the C pre-processor really does produce a pure monoidal value that represents an imperative program.

Name: Anonymous 2015-02-22 9:50

>>99
cpp < Dlang variadic templates/template mixins

Name: Anonymous 2015-02-22 9:50

>>101
Still primitive text manipulation => shit. Even worse than Lisp, lisp at least has parentheses.

Name: Anonymous 2015-02-22 9:53

>>100
The words "pure" and C preprocessor shouldn't occur in same sentence. C macros are ugly, unsafe and impossible to debug.

Name: Anonymous 2015-02-22 9:53

>>100
The words "pure" and C preprocessor shouldn't occur in same sentence. C macros are ugly, unsafe and impossible to debug.

Name: Anonymous 2015-02-22 9:58

>>100
I use an ASM preprocessor commonly installed on many systems as /usr/bin/cat. It produces a pure monoidal value that represents an imperative program.

Name: Anonymous 2015-02-22 10:08

>>104
I think you're taking the word "pure" too seriously. My condolences. What it really means is that for same inputs the value will be the same at any moment in time. Since the output of the C preprocessor does not change in time, it is indeed a pure function (with the single caveat that Anal Elliott spoke about).

Now, of course all this is just an amusing fact to poke fun at Haskellists. But it is fact nonetheless. C is a purely functional language no less than Haskell.

Name: Anonymous 2015-02-22 11:57

cpp is the primitive caveman, LISP is the civilized professor.
sometimes the caveman wins in racing competitions, but the professor has a car so he doesn't care how fast cavemen are.

Name: Anonymous 2015-02-22 12:00

>>107
LITHP
civilized

Needs a real type system first.

Name: Anonymous 2015-02-22 12:28

>>106
But it is fact nonetheless. C is a purely functional language
Come on, we've just spent the past few posts establishing that cpp is the pure language and C is not.

Name: Anonymous 2015-02-22 13:39

I don't want to read walls of unformatted macros.
Did he wrote some sort of miniLISP in >>93 ?

Name: Anonymous 2015-02-22 14:13

These trips are for our beloved President Robert Mugabe.

Happy birthday Mr. President!!! May Zimbabwe be blessed by 90 more years of your rule!

Name: Anonymous 2015-02-22 14:27

>>110
Greenspun's tenth rule:Any sufficiently complicated C or Fortran program contains an ad hoc, informally-specified, bug-ridden, slow implementation of half of Common Lisp.

Name: Anonymous 2015-02-22 14:54

Is there a way in Common Lisp to get the names of all the bound macros currently in scope?

I want to define my custom defmacro and extend it to all macros, even imported from other packages. I.e. to get names of all macros in scope and have a macro redefine all of them.

Name: Anonymous 2015-02-22 17:31

>>113
Please? Lisp wizards?

Name: Anonymous 2015-02-22 17:51

>>114
Calm down, it's been less than three hours.

Name: Anonymous 2015-02-22 21:25

>>113
Maybe the implementation will expose it for you. If not, define an alternative to defmacro and macrolet that registers the macro in a global list you can access.

Name: Anonymous 2015-02-22 23:13

Type systems are not truly good things or else they'd be more popular with people who know what they are doing. There isn't really any actual industrial or scientific evidence of their value. If anything, they get just get in the way and make things worse. It doesn't help with the fact that some of the main peddlers of type systems have been shown to be frauds and scam artists in their personal lives.

Name: Anonymous 2015-02-23 7:25

>>116
So there isn't a list of all bindings in DA STANDARD? I know there are symbol-value and symbol-function, why aren't there get-all-symbol-values etc?

define an alternative to defmacro and macrolet that registers the macro in a global list you can access
You mean use macrolet to register every macro that I use?

Name: Anonymous 2015-02-23 23:43

>>118
[code]do-all-symbols[code]

Name: Anonymous 2015-02-25 4:18

>>118
See >>119.

You mean use macrolet to register every macro that I use?
I was thinking of something more like:

(defmacro cl-extensions:macrolet (macro-name args and stuff)
(register-a-macro-in-a-global-table macro-name other stuff)
`(macro-let macro-name args and stuff))


And then adjusting the packages of the code you want to affect to use your macro let so then macro lets will add the macro name to a table in addition to behaving like they normally do.

But you don't need to do any of that since >>119 is part of da standard.

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