PasteRack.org
Paste # 86700
2021-11-24 09:16:42

Fork as a new paste.

Paste viewed 1148 times.


Embed:

Hello world

  1. #lang racket
  2.  
  3. (define my-language 'English)
  4.  
  5. (define translations
  6.   #hash([English . "Hello world"]
  7.         [French . "Bonjour le monde"]
  8.         [German . "Hallo Welt"]
  9.         [Greek . "Γειά σου, κόσμε"]
  10.         [Portuguese . "Olá mundo"]
  11.         [Spanish . "Hola mundo"]
  12.         [Thai . "สวัสดีชาวโลก"]))
  13.  
  14. (define my-hello-world
  15.   (hash-ref translations my-language
  16.             "hello world"))
  17.  
  18. (displayln my-hello-world)

=>

Hello world