3 ms·
Racket lets you use infix operators if you want: (5 . * . 3) ; 15 (5 . > . 3) ; #t As a bonus, you even get more verbose syntax as in other langua
by brudgers 13y ago
Racket lets you use infix operators if you want:
(5 . * . 3) ; 15
(5 . > . 3) ; #t
As a bonus, you even get more verbose syntax as in other languages, because Racket, being a Lisp will let you write code any old which way so long as there is a macro available to parse it.
- kroger 13y agoThere are many infix macros for Common Lisp. This one [1], for instance, allows you to write: #I( x^^2 + y^^2 ) And, naturally, you can macroexpand the macro. [1] ftp://ftp.cs.cmu.edu/user/ai/lang/lisp/code/syntax/infix/infix.cl
- brudgers 13y agoThe difference, if there is one, is that Racket provides an infix syntax as part of its definition, i. e. there is a standard notation. I''ve seen it used in the reference documentation for the -> operator when writing contracts.
- kroger 13y agoRacket is a scheme, but this infix notation is unique to racket, i.e. it's not in the scheme specification. In fact, there are other proposals for infix notation for scheme, such as http://srfi.schemers.org/srfi-105/srfi-105.html http://srfi.schemers.org/srfi-105/srfi-105.html