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

Pages: 1-

why does Lisp always have dyamic variables?

Name: Anonymous 2012-04-04 21:17

Is it possible to make a Lisp dialect that has static types? Why cant type inference be used in Lisp instead of dynamic typing.

Name: Anonymous 2012-04-04 21:24

no

Name: Anonymous 2012-04-04 21:27

Use Racket.

Name: Anonymous 2012-04-04 22:43

>>1
It could exist if you wanted to make one. The recognizable thing about lisp is its style of syntax, which could be used for any programming language.


(define (main (argc int) (argv (pointer (pointer char)))) int
  (printf "%s: Hello world!\n" (deref argv))
  (if (> argc 1)
    (printf "you passed %s for the first command line argument!\n" (deref (+ argv 1))))
  (return 0))


But it would be convenient to have some of the nice features when writing macros. It would be kind of annoying if you had to worry about freeing parts of the syntax tree that were not used or something.

Name: Anonymous 2012-04-05 1:30

>>4
(pointer (pointer char))

So... is that a **char, or secretly a *cons ?
What does (pointer (return 0)) or (pointer (puts "dicks")) do?

Name: Anonymous 2012-04-05 1:45

>>5
it's not because sexprs give you extra syntactic freedom that suddenly you can write nonsensical code

Name: Anonymous 2012-04-05 1:53

>>5
It's a type expression.

Name: Anonymous 2012-04-05 2:45

Lisp
GC is shit.

Name: Anonymous 2012-04-05 4:49

Lisp used to always have dynamic variables, but now it's standard to have lexically scoped variables. Many lisps still offer dynamic variables in one way or another.

There's nothing in the scheme standard prohibiting type inference by the interpreter/compiler for static type checking where possible, and I'd guess the same goes for Common Lisp.

Name: Anonymous 2012-04-05 5:56

Fuck yeah, type inference.
Try OCaml, it's nice.

Name: Anonymous 2012-04-05 6:31

Gradual typing.

Name: Anonymous 2012-04-05 6:41

>>10
OCaml
A cube undertook golf, ``please''!!

Name: bampu pantsu 2012-05-29 4:11

bampu pantsu

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