[plt-scheme] Beginner question

From: Anders Persson (anders.u.persson at telia.com)
Date: Thu Sep 29 09:15:30 EDT 2005


I am trying to learn PLT and yesterday i try to write
a program with 2 functions that asks for user namen
och write Hello + user namen

The code was
(define ask-user-name
  (display "Hi whats your name? ")

(define say-hello-to-user
  (lambda (name)
    (display "Hello ")
    (display name)))

(define name (string->symbol ask-user-name))
(say-hello-to-user name)

My qestion is this a good program or is there
some changes to make it a more professional look.

And som ting that puzzles me is the line

(define name (ask-user-name))

don't work but

(define name (string->symbol ask-user-name))

Works this is a try-and-error and i would like
som explanation way i have to konvert my
string to symbol, becurse i can write
(define name "Hello Anders")
but not
(define name (ask-user-name))

Best regards
Anders Persson

Posted on the users mailing list.