(define (car op) (cond ((eq? op 'speed) 10) ((eq? op 'name) "ass"))) Compiles and works.
car "speed" = 10 car "name" = "ass" Does not compile and does not work.
Name:
♞2018-03-26 19:48
Scheme has a superior type system where car : (x : any) -> f(x) with (define (f op) (cond ((eq? op 'speed) integer) ((eq? op 'name) string)))
Name:
Anonymous2018-03-27 1:19
NO! NO! NO!
Name:
Super Hell!JM1IoNO1/U2018-03-27 1:59
>>1 lol those are not equivalent You should have used symbols instead of strings in Haskell. (Just googled and it seems like something similar to enums would work.) https://wiki.haskell.org/Quasiquotation
Name:
Anonymous2018-03-28 0:56
all the smart people use Haskell though
Scheme is used by freshmen in CS 101
Name:
Anonymous2018-03-28 0:57
>>4 (define (car op) (cond ((eq? op "speed") 10) ((eq? op "name") "ass"))) Better?
Name:
Anonymous2018-03-28 0:58
>>5 In our uni we learned Ocaml in the 1st year and Haskell in the 2nd year. We never learned Scheme.