Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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);.


For the sake of completion...

  (define (hello)
    (displayln "Hello world"))


Racket has a displayln that is similar to puts or System.out.println.




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: