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

lol MIT

Name: Anonymous 2011-01-18 11:18

Input: print 5 == 5.0

Output: True1

--
1Scheme (the initial language taught at MIT before Python) took type to an extreme. 5.0 and 5 were not considered equal because one was an integer and the other was a float. You weren’t even allowed to do (4 + 6.0.) Python is more rational – it treats the two values as equal.

Name: Anonymous 2011-01-18 16:58

>>18
Racket's magic macros
Oh, yeah, you mean the #%expression thing? I forgot about it. It's not necessary, it's there to just make define-like forms fail.

a common but non-standard define-syntax extension
(define-syntax (id stx) ...) instead of (define-syntax id (lambda (stx) ...))?

and this would be portable+standards-compliant.
AFAIK #' is non-standard.

Using syntax-rules would make it portable to R5RS too.
I would use syntax-rules, but it gave me an error (quite strange, actually: # reference to an identifier before its definition: ~, where ~ should be the syntax of the macro. With syntax-case just works.)

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