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

Pages: 1-

quick question about scheme

Name: Anonymous 2015-11-06 22:20

and what's this craze about tail-recursion? they didn't like loops?

Name: Anonymous 2015-11-06 22:38

Recursive functions are more elegant than loop constructs.

Name: Anonymous 2015-11-07 1:00

>>2
Then why do the most influential schemers advocate loop constructs over tail-recursion? https://www.youtube.com/watch?v=PCzNwWmQdb0

Name: Anonymous 2015-11-07 1:36

Name: Anonymous 2015-11-07 6:46

>>3
Scheme is the emission of a minimalism worshipping circle jerk.

Once people decided to actually use it, it's obvious that the humans shouldn't be required to construct apple pies out of vague sub-atomic forces.

Name: Anonymous 2015-11-07 6:51

Scheme is good for domain-specific solutions, but it doesn't adequately address the issue of multiple inheritance out of the box.

Name: Anonymous 2015-11-07 10:36

>>3
Tail recursion is a property of the execution of a program, not a style of writing loops.
(let loop ((x 1)) der... (loop n)) is a loop construct, but it is essentially equivalent (i.e. macro-rewritable) to (let ((loop (lambda (x) der... (loop n)))) (loop 1)) in the same way that unlabelled let and lambda are related.

Name: Anonymous 2015-11-08 2:07

>>3
Most languages don't tail-call-optimize recursion. Of course, Scheme does, so there's no reason not to use recursive functions in it.

Name: Anonymous 2015-11-10 3:48

Scheme with syntax for structs would be amazing.

Name: Anonymous 2015-11-10 4:58

>>9
Structs are not minimalistic, and therefore not Scheme, and therefore Scheme is not an acceptable Lisp.

Name: Anonymous 2015-11-10 19:14

>>9
Most Schemes have it. If not, all you have to do is write a macro.
(define-struct foo (a b c))
; ->
(define foo-id (gensym))
(define (foo a b c) (list foo-id a b c))
(define (foo? x) (eq? (car x) foo-id))
(define (foo-a x) (assert (foo? x)) (cadr x))
(define (foo-b x) (assert (foo? x)) (caddr x))
(define (foo-c x) (assert (foo? x)) (cadddr x))

Name: Anonymous 2015-11-10 20:50

>>11
assert (foo? x))
Hahaha unityped shit. Get a real type system.

Name: Anonymous 2015-11-10 21:09

>>12
That's a compile-time assertion. It is equivalent to a type annotation.

Name: Anonymous 2015-11-10 21:12

>>13
Nice try, Schemefag, but in order for it to be a compile-time assertion, Scheme would need type inference.

Name: Anonymous 2015-11-11 8:25

>>14
Just use the infer-types[1] macro.

__________________________________
[1]: Left as an exercise to the reader.

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