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

Pages: 1-

LITHPu

Name: Anonymous 2012-02-16 23:16

I have a terrible confession to make.

I've never dabbled much with lisp, and am not great with it,

but it looks BEAUTIFUL ;_;

Name: Anonymous 2012-02-16 23:29

parentheses are not beautiful

Name: Anonymous 2012-02-16 23:53

>>2
I like to think of them as tits.

Name: Anonymous 2012-02-17 2:14

>>3
I like to think of them as bubbles

Name: Anonymous 2012-02-17 4:56

I don't know a thing about programming, yet I post on /prog/. Address this matter any way you see fit.

Name: Anonymous 2012-02-17 5:07

s-expressions are the best syntax
everything is a list evaluation)))))))))))))))))))

Name: Anonymous 2012-02-17 11:09

sexps are fucking ugly

Name: Anonymous 2012-02-17 11:10

>>5
Cool tweet bro.

Name: Anonymous 2012-02-18 5:46

It's much better to build syntactic sugar onto a base of S-expressions, than to take some syntactic sugar and work it back into S-expressions.

Name: Anonymous 2012-03-12 6:03

>>11
nice dubs bro

Name: Anonymous 2012-03-12 6:08

DUBSu

Name: Anonymous 2012-03-12 10:47

>>9
I've had a similar thought, but I never really see any examples of this.  Where is all the "readable" Lisp hiding?

Name: Anonymous 2012-03-12 11:27

>>12
Inside SLIME and Eclipse.

Name: Anonymous 2012-03-12 15:05

>>9,12
Every fanatical lisper actually has a hidden readable-syntax-to-sexpr compiler in his hidden porn directory.  They would never admit to using it, but in fact almost all Lisp code that has ever been written was generated that way.

Name: Anonymous 2012-03-12 15:08

(lisp (lisp (lisp (lisp
    (lisp (lisp (lisp (lisp
        (lisp (lisp (lisp (lisp
            (lisp (lisp (lisp (lisp
                (lisp (lisp (lisp (lisp
                    (lisp (lisp (lisp (lisp
                        (lisp (lisp (lisp (lisp
                            (lisp (lisp (lisp (lisp
                                (lisp (lisp (lisp (lisp
                                    (lisp (lisp (lisp (lisp
                                        (lisp (lisp (lisp (lisp))))))))))))))))))))))))))))))))))))))))))))

Name: Anonymous 2012-03-12 21:56

>>13
Fuck off and die.

>>14-15
This.

Name: Anonymous 2012-03-12 22:48

>>14
naw not really. If you were to go that far, you may as well use some other language. All it takes is getting used to typing out and reading the usual syntax constructs. It's muscle memory:


(let ((x 2))
  ( )
  ( )
  (( ) ( )
       (( ) ( ) ( ))
       ( )))



class ____ {
  public static void main(String[] args) {
    System.out._____("____" + ______);
    if( ____ == 0) {
      ______Factory<____Tupple<___Key, ___>>[] __ = new ______Factory<____Tupple<____Key, ___>>[_____*5*57*___];
    }
    else {
      ______
    }
  }
}


And then learning how to quickly manipulate code. In vim, y% can be convenient for copying a chunk of lisp.

Name: Anonymous 2012-03-12 22:52

>>17
steve?

Name: Anonymous 2012-03-12 22:58

>>18
nope. But tell steve I say hi.

Name: Anonymous 2012-03-13 9:45

>>17
Comparing something with absolute shit doesn't make it great.

Name: VIPPER 2012-03-13 12:03

What is this load of shit?

Name: Anonymous 2012-03-13 12:26

>>21
doubles

Name: Anonymous 2012-03-13 13:36

>>21
Lisp.

Name: Anonymous 2012-03-13 17:48

Lisp is shit and lithperth are faggotth.

Name: Anonymous 2012-03-13 18:28

Name: Anonymous 2012-03-13 22:39

>>25
Right, Lisp the perfect language.  Remind me again why symbols and strings are different things?

Name: Anonymous 2012-03-14 0:38

>>26
sometimes it is better if strings are mutable and symbols ain't. And sometimes symbols are case insensitive.

Name: Anonymous 2012-03-14 0:52

>>27
sometimes it is better if strings are mutable
Almost never is -- it's already bad enough that most Lisp implementations allow cons mutation by default, making strings mutable is just insane.

And sometimes symbols are case insensitive.
And that's definitely a good reason to introduce a whole new type.

Name: Anonymous 2012-03-14 1:46

>>28
mutable string buffers can be handy. Albiet, in place modification of strings for formating isn't the most productive thing to do when you have more powerful tools at your disposal than what you get in the C standard library. But sometimes you just need a large expandable array of untyped binary data for serialization. String buffers can be good for that, provided the language provides a means to write and read an object to and from a binary string.

Although I should have mentioned that not only are symbols immutable, but they are also unique. That is, converting a string to a symbol has an implicit dictionary look up for an already existing equivalent symbol, in a symbol table. So this means that if you do file io and represent the read text lines as symbols, every get line has an implicit hash table look up, where the line from the file is interned as a symbol. With strings this doesn't need to happen, making them better for fast reading, transforming, and writing. Although the uniqueness of symbols makes them good for cases when they are created once and then compared to other symbols many times. Because each symbol is unique, equality can be resolved by pointer equality.

It's not that hard to have symbols and strings. If you are going to be able to generate code at run time, symbols can help make it more efficient. But symbols aren't great for everything. Lisp/Scheme has capabilities that provide symbols with a niche. Strings would be shitty representations of unevaluated code, and symbols are shitty when strings are faster and easier.

Name: Anonymous 2012-03-14 9:34

("defun" "f" ()
  ("format" "t" '"I agree, symbols and strings should be the same.~%"))

Name: Anonymous 2012-03-14 10:33

>>30
neither symbols nor strings are callable, fagstorm

Name: Anonymous 2012-03-14 10:46

>>31
Code is made up of symbols, retard. It's called homoiconicity, maybe you've heard of it.

Name: Anonymous 2012-03-14 10:50

>>32
Nothing prevents it from being made up of interned immutable strings instead, retard. It's called common sense, maybe you've heard of it.

Name: Anonymous 2012-03-14 10:51

>>33
interned immutable strings
You mean symbols?

Name: Anonymous 2012-03-14 11:00

>>34
Symbols may be case-insensitive.

Name: 33 2012-03-14 11:08

>>34
Oh yeah and check these motherfucking dubz you little queer.  Worship my goddamn dubz.

Name: Anonymous 2012-03-14 11:09

>>35
may be
Exactly. Scheme has case-sensitive symbols, for example. So if you want case-sensitivity, that's no reason to use strings.

The thing is, if you end up implementing "interned immutable strings", that's basically a completely different datatype from regular strings, and I thought what you were trying to avoid was having two different datatypes. What's the point?

Name: Anonymous 2012-03-14 11:19

>>26
Because symbols are partially built upon strings.

Also, symbols aren't case insensitive, it's the reader that is and you can modify the reader's behavior to be case sensitive, though then you'd have to recompile everything so you can write "defun" instead of "DEFUN".


Lets check out some code:



* (symbol-name 'hello)
"HELLO"
* (defun hello (x) (+ x x))
HELLO
* (symbol-function 'hello)
#<FUNCTION HELLO>

* (symbol-name '|heLLo|)
"heLLo"


| is a reader macro for handling symbols with case sensitivity.

Symbols are very different to strings and if you want something similar to strings then use keywords, they are basically non-setable (self-evaluating I do believe) symbols residing in the keyword package



* (symbol-package :hello)
#<PACKAGE "KEYWORD">

* (intern "HELLO" 'keyword)
:HELLO

* (symbol-value :hello)

:HELLO



Whatever.

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