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

Pages: 1-4041-

seriose lisp programming

Name: Anonymous 2008-01-23 12:53

How/what libs?
Mainly sockets and SDL stuff.
Please tell me i can use these in scheme. I don't want to read steeles book on common lisp it's huge ;_;
currently i am using MIT/scheme.

Name: Anonymous 2008-01-23 13:00

SICP is all you need for any purpose

Name: Anonymous 2008-01-23 13:34

>>2
Well, I know you aren't serious, but SICP won't 'teach' me that.
I have in fact read parts of SICP (not all of it though i plan to)

Name: Anonymous 2008-01-23 13:41

No, you can't use real features in a toy language.
No, don't learn CL.
No, use MzScheme.
No, read SICP right now.

Name: Anonymous 2008-01-23 13:49

SDL: use CL-SDL
Sockets: use whatever your implementation provides, or some cross-platform wrapper library. Dunno what the canonical one is.
Scheme: don't use that shit. Will lead only to tears and wasted time.

Name: Anonymous 2008-01-23 14:41

Scheme: don't use that shit. Will lead only to tears and wasted time.
Why? It seems very clear, unlike common lisp.

Name: Anonymous 2008-01-23 14:56

>>6
Use PLTScheme and you can even use opengl in your code.

Name: Anonymous 2008-01-23 15:15

>>6
Because it's not. I don't know what you think is unclear about Common Lisp, but my experience with Scheme is that it's the only Lisp that manages to actively be a pain in the ass, doing so by deliberately excluding features in the name of some theoretical cleanliness. ``Cleanliness'' = passing too many arguments and writing iteration and such explicitly (and explicit = unclear). And also clobbering the variable namespace with functions. And a lack of straightforward macros. Of course, it's possible to add fancy iteration and objects and whatnot to Scheme, but now you're just Greenspunning.

If you're an academic looking to investigate ``Lambda, the Ultimate X'', Scheme may be a good fit, but if you want to write programs it's just going to be a pain in the ass.

Name: Anonymous 2008-01-23 16:06

passing too many arguments
Huh? WTF do you mean?

writing iteration and such explicitly
What's "and such"?
BTW: learn scheme

clobbering the variable namespace with functions
idiot. one could also argue about #'
why don't you prepend all your function names with f_? Then you have something that resembles #'. And you don't even need funcall

And a lack of straightforward macros
Not standard, but almost every implementation has it

The lack of something CLOS-like is alwas not very good, with that I agree.

Name: Anonymous 2008-01-23 16:48

Name: Anonymous 2008-01-23 17:32

>>9
Doesn't Scheme have some scoping wonkiness that necessitates passing more stuff explicitly.

"And such" is CLOS and whatever utility functions that aren't included yet by all rights should be. I don't write enough Scheme to know what those functions are, but any language that lacks basic iteration constructs is bound to lack more.

Idiot, why would I prepend my functions with f_? That's as ugly as variable names like "lst". I don't know about you, but I use a lot more variables than anonymous functions, and I'd like to make the case that's actually common be the easy one.

tl;dr — enjoy your prolix programs and non-standard extensions, academicfag.

Name: Anonymous 2008-01-23 19:59

>>1
Learn Scheme in Fixnum Days. It's worth learning Scheme and Common Lisp. But learn Scheme first. Look below for what happens to you if you do it the other way round.

>>11
Doesn't Scheme have some scoping wonkiness that necessitates passing more stuff explicitly.
What are you babbling about?
I don't write enough Scheme to know what those functions are,
No, you don't.
but any language that lacks basic iteration constructs is bound to lack more.
I agree. Scheme is not one of those languages.
I don't know about you,
No. You don't.
but I use a lot more variables than anonymous procedures,
Schemers tend to use procedures as first-class objects all the time. You don't seem to understand what lisp-1 and lisp-2 are. Scheme is a lisp-1. Procedures are first-class objects. Meaning you have have them in variables, and pass them to procedures. Common Lisp is a lisp-2, meaning "functions" (neither Scheme or Common Lisp have functions, they have procedures.) are not first-class. It's not just about anonymous procedures, it's about any procedure.
and I'd like to make the case that's actually common be the easy one.
The lisp-1 vs. lisp-2 argument is a boring point of contention and isn't worth arguing. If you really find that you have to lose clarity in your lisp-1 code because procedures are first-class then go ahead and use lisp-2. Don't bitch to others that they should also use lisp-2 just because you want to.
"And such" is CLOS and whatever utility functions that aren't included yet by all rights should be. I don't write enough Scheme to know what those functions are, but any language that lacks basic iteration constructs is bound to lack more.
You seem to be confused. The spirit of Scheme is to be as small and simple as possible. And it is. Its language report is said to be shorter than Common Lisp's report's contents page.
tl;dr — enjoy your prolix programs and non-standard extensions, academicfag.
Just out of interest; what is the standard way to use TCP/IP sockets in Common Lisp?

Name: Anonymous 2008-01-23 22:51

>>12
I can see you're just too ACADEMIC to admit Scheme's inferiority. Carry on.

neither Scheme or Common Lisp have functions, they have procedures.
Wat? Check your goddamn facts. In CL they're called functions, and they are most certainly first-class. You clearly don't understand what Lisp-1s and -2s are.

http://www.lispworks.com/documentation/HyperSpec/Body/t_fn.htm
This is SBCL 1.0.9, an implementation of ANSI Common Lisp.
More information about SBCL is available at <http://www.sbcl.org/>;.

SBCL is free software, provided as is, with absolutely no warranty.
It is mostly in the public domain; some portions are provided under
BSD-style licenses.  See the CREDITS and COPYING files in the
distribution for more information.
; loading system definition from /home/paul/.sbcl/systems/metabang-bind.asd
; into #<PACKAGE "ASDF0">
; registering #<SYSTEM METABANG-BIND {AE34A69}> as METABANG-BIND
STYLE-WARNING: implicitly creating new generic function BIND-GENERATE-BINDINGS
* (lambda ())

#<FUNCTION (LAMBDA ()) {B10E29D}>


I know damn well what the spirit of Scheme is: to give its users little twinges of academic glee every time they write a recursive iterative procedure by hand. I'm just telling OP about it.

Just out of interest; what is the standard way to use TCP/IP sockets in Common Lisp?
Well shit, just a minute ago you were telling me that the Scheme standard's lack of everything was a plus. Now lacking anything is a minus? Yes, it would be nice to have BSD sockets in the spec. If I had a time machine, I'd go back and tell the guys who wrote it that if they'd just write them in, Berkeley would free them in just a couple years and it would pay off big.

Name: Anonymous 2008-01-24 6:46

>>13
I can see you're just too ACADEMIC to admit Scheme's inferiority. Carry on.
Your ad hominem interests no one.

Wat? Check your goddamn facts. In CL they're called functions,
A function is a relationship. CL's "functions" support side-effects. This is a procedure. They're called "functions" in CL for the same reason they are called "functions" in C. History, confusion and stupidity. Of course I know they're called functions in CL. I have used the language before.

and they are most certainly first-class
CL "functions" are not first class.

I know damn well what the spirit of Scheme is:
I disagree. One can be pragmatic when using Scheme.

I'm just telling OP about it.
Stop spreading rubbish.

Well shit, just a minute ago you were telling me that the Scheme standard's lack of everything was a plus.
I am still telling you that, albeit in a less retarded fashion. Scheme's spirit is to be simple. I see that you are beginning to understand.

Now lacking anything is a minus?
Your previous message had given me the impression that Common Lisp should be pragmatic and have everything a programmer needs in common tasks. You further suggested that they should be standard with your last statement. So, yes, in the context of Common Lisp, lacking something probably is a minus. It just so happens that sockets are a very fundamental thing to have for a programmer.

This brings me to the point I was trying to make with my last question; it seems to me that you are saying that because Scheme's features are nonstandard, then the language itself is not worth using. I can apply that argument to Common Lisp, whose sockets, foreign function interfaces, and probably other things, are nonstandard. Yet your community works around these issues by either (1) coming up with a 'bona fide standard' (like CFFI), or (2) just focus on one implementation (like using SB-ALIEN).

Finally, my conclusion (based on the previous paragraphs) is that a programmer has his own criteria of what he wants from a language. This might involve sticking with one implementation, attempting to write code for every implementation, not caring, the need for a simple language that is very easy to do a conforming implementation for (Scheme) or a beast language which does as many things as possible, and tries to be as pragmatic as possible (Common Lisp), as standard. The implementations of Scheme have lots of good libraries, which, in my opinion, makes it just as useful for writing interest programs as Common Lisp.

What do you think?

Name: Anonymous 2008-01-24 6:57

Would you like to take the discussion a step further and provide some example code of Common Lisp for which Scheme code to solve the same task would be less elegant (due to lacking basic iteration constructs)?

Name: Anonymous 2008-01-24 7:12

While you guys were arguing about it, I coded a solution in VB.NET that worked first time and can be understood by almost anyone.

Name: Anonymous 2008-01-24 7:45

OP here, here's what i like in scheme

((if #t + -)
  1 2)

In common lisp, you'd have to do this

(funcall (if t #'+ #'-)
  1 2)

Same with lambda. (eg you need funcall)

Sure, it's a stupid reason to prefer one language from another, but i haven't used both much anyway.

Also, another thing i have noticed: Is it even possible to create an actual executable (ELF, PE, etc) with common lisp or scheme? It would be nice if its possible, im thinking of using lisp for some fun stuff (simple SDL games, i have some fresh ideas for games that might be pretty damn addictive) which i firstly intended to write in C, but it's too much for me (im a perfectionist, cannot stand bugs and there's just *too much* you have to worry about in C) so i thought lisp but that would be useless if i cant distribute exetutables too (i doubt the average gamer would want to install SBCL ..)

Name: Anonymous 2008-01-24 8:17

>>17
(funcall (if t #'+ #'-) 1 2)
what

Name: Anonymous 2008-01-24 8:22

>>17
Is it even possible to create an actual executable (ELF, PE, etc) with common lisp or scheme?
Short answer: in CL, no, unless you pay your ass off1. There are many free Scheme implementations that can do this, though, for example Chicken:
http://www.call-with-current-continuation.org/

1 in b4 save-lisp-and-die. Enjoy your ``fucking'' huge executables.

Name: Anonymous 2008-01-24 8:29

>>18
It's valid moron

Name: Anonymous 2008-01-24 9:24

>>18
It's valid perl

Name: Anonymous 2008-01-24 9:45

>>1 is illiterate, please don't help him

Name: Anonymous 2008-01-24 10:00

>>22
DON'T HELP HIM!!!

Please use a meme equivalent when applicable.

Name: Anonymous 2008-01-24 10:19

>>23
Memes considered harmful.

Name: Anonymous 2008-01-24 10:22

>>23
I considered it, but it would not have looked appropriate.

Name: Anonymous 2008-01-24 12:55

>>24
``Considered harmful'' considered harmful.

Name: Anonymous 2008-01-24 13:47

>>26
``Faggot quotes'' considered harmful

Name: Anonymous 2008-01-24 13:53

>>24
  Whoa, stop that won't ya?

    Before I type out my long ranting a few information about me
you should all be aware of.
I have been browsing 4chan ab initio; I was one of the first
to post on /prog/. (hi Jukin :-)
Back in the day we used to babble about realistic issues and
real-world programming posting quality code and giving this
shithole a reason to exist.

    /prog/ was a helpful board ex vi termini! Would you monsters
dare to imagine that? Foolish trolls, you disgust me. All you
do currently is spout nonsense and unfunny memes, while you
have another debate about esoteric functional languages perhaps
to satisfy your ego and perhaps defend your corrupted reality.
Wake up from this torpor. But that is not applicable here,
you enjoy the illusion that you are part of an obscure clique
posting on a shambolic bbs-like system, don't you?

    Has it come to this? Post nothing but references to an obsolete
textbook? Please do not wonder why most reasonable people have
abandoned this preternatural madness, this cesspool filled with
pretentious feces -- you.

    Please, for once perhaps in your whole lifetime, admit your ways
of doing things is by far not correct. Not everyone here is endemic
to programming. Pedantry whilst being technically accurate actually
is of no help at all to anyone but perhaps you. In all honesty, the
minutiae of an academic paper are of no interest to the average Joe.

    I only posted this to warn you of this parlous armageddon. It takes
courage to realise this is only the mendicant. It's of no wonder that
pusillanimous rhymes with anonymous. A trope; I don't think so.

    I hope there are still some here that remember the pulchritudinousness
of this once-full-of-manque-posters board. I hope my animadversion does
not surprise you. One would observe that you codigned it all the way.

Absum.

--
  ``Is not such recondite reasoning, leading to such opaque conclusions about such
baroque regulations of speech, prima facie evidence of incompatibility with the
austere brevity of the First Amendment?''

Name: Anonymous 2008-01-24 13:57

>>15
Real Scheme code. Note the hilarious hack and the manually passed random state.
(map (lambda x
           (let ((idx (random 12 random-state)))
            (make-music 'EventChord
             'elements (list (make-music 'NoteEvent
                              'duration (ly:make-duration 2 0 1 1)
                              'pitch (ly:make-pitch (quotient idx 7)
                                      (remainder idx 7)
                                      0))))))
       (make-list 32)))))

How it would look in CL. Notice the improvement in every way.
(loop
  for i below 32
  for note = (random 12)
  for octave = (truncate note 7)
  for class = (mod note 7)
  collect (make-music
           'EventChord
           'elements
           (list
            (make-music
             'NoteEvent
             'duration (ly:make-duration 2 0 1 1)
             'pitch (ly:make-pitch octave class 0)))))

Name: Anonymous 2008-01-24 15:18

>>28
What's with the signature?

Name: Anonymous 2008-01-24 15:19

>>30

It's a hint.

Name: Anonymous 2008-01-24 15:20

>>30
is that the only thing you found weird LOL

Name: Anonymous 2008-01-24 16:01

>>28
It's like a cryptic crossword, in paragraphs.

Name: Anonymous 2008-01-24 16:04

>>29
What is the hilarious hack? What is the random-state variable?

Most of this code is irrelevant.

(define (random-music _)
  (let* ((note (random 12))
         (octave (quotient note 7))
         (class (remainder note 7))
         (duration (ly:make-duration 2 0 1 1))
         (pitch (ly:make-pitch octave class 0))
         (elements (list (make-music 'NoteEvent duraion pitch)))
         (music (make-music 'EventChord 'elements elements)))
    music))

(map random-music (make-list 32))


Once you write the Scheme code so it is not horrifically indented, it begins to look quite like your CL example (except yours still has some horrific indenting).

I'd probably abstract it a tad, though.

(define (random-music)
  (let* ((note (random 12))
         (octave (quotient note 7))
         (class (remainder note 7))
         (duration (ly:make-duration 2 0 1 1))
         (pitch (ly:make-pitch octave class 0))
         (elements (list (make-music 'NoteEvent duraion pitch)))
         (music (make-music 'EventChord 'elements elements)))
    music))

(define (make-list/thunk n p)
  (let collect ((i 0))
    (if (< i n)
        (cons (p) (collect (add1 i)))
        '())))

(make-list/thunk 32 random-music)


Now my code is more abstract than yours.

Name: Anonymous 2008-01-24 16:18

The only improvement is the fact the megabeast LOOP macro has a specific feature. That feature is creating a list where the elements are thunks. The rest of the code, you simply formatted poorly. I admit, I had to create the make-list/thunk procedure, but there are libraries to do list stuff like this. It's not really an iteration problem (thought you have tried to make it one), it is a list creation problem.

Do you have any more examples?

Name: Anonymous 2008-01-24 16:46

    I believe the true question (let us asume for the sake
of this document such question exists) is not whether one has
more examples; But whether he can post them here or not.

    If for some reason you disagree and have other thoughts on
this matter, please elaborate them thoroughly. You have the
most of my attention, quite an accomplishment if you take into
account my position and perhaps my animosity against slow-witters.

    Please excuse me for my bold statements on this matter, not
the best of my manners.

--
    ``I hope this doesn't sound pompous but I don't think of myself as famous, whatever fame I've got has come through what I've done and associations of things I've done.''

Name: Anonymous 2008-01-24 16:53

>>36
You express nothing with extreme verbosity.

Name: Anonymous 2008-01-24 17:08

>>37
    And your deplorable posts dear, while lacking content,
somehow manage to reflect your repugnant personality, your
uncivilized manners; a sordid, licentious person full of himself.

   Your posts are a soporific drug, as for you sir; A charlatan
with stagnant opinions. Apparently manners where of no
significance to your progenitors.

   As they say; Qualis pater talis filius.

--
    ``Many men go fishing all of their lives without knowing that it is not fish they are after.''

Name: Anonymous 2008-01-24 17:15

>>38
person full of himself

I heard they call that irony.

Name: Anonymous 2008-01-24 17:32

>>39
YHBT

Name: Anonymous 2008-01-24 17:32

>>38
What kind of stupid fuck are you?

Name: Anonymous 2008-01-24 17:37

>>38
EXPERT WANKER

Name: Anonymous 2008-01-24 17:38

>>41
>>42
YHBT too

Name: Anonymous 2008-01-24 18:20

>>40

YHBT

Name: Anonymous 2008-01-24 20:59

manners where of no
where of
where

they where of no significance

Name: Anonymous 2010-11-26 5:19


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