3 ms·
The second example is more readable for several reasons. 1. You chose a better function name (hello0 looks a little confusing) 2. You [EDIT: actually Wikipedi
by brlewis 11y ago
The second example is more readable for several reasons.
1. You chose a better function name (hello0 looks a little confusing)
2. You [EDIT: actually Wikipedia] decided for whatever reason to use let rather than define in the Scheme example.
3. Dart's "print" function is more suitable for console output on a single line than Scheme's "display".
Here's the fix:
(define (print something)
(display something)
(newline))
(define (hello)
(print "Hello world"))
All of a sudden (f a b) doesn't seem way more complicated than f(a, b);.
- jcromartie 11y agoRacket has a displayln that is similar to puts or System.out.println.
- cmiles74 11y agoFor the sake of completion... (define (hello) (displayln "Hello world"))