Hello,
I am now in the book How to design a programm second edition at the point I have to design functions.
Now I wonder if I understand this part right so I have made this function.
;String -> String
;This function takes out the first character of a given string with the name s
; given "roelof" expect "r"
; given "example" expect "e"
(define (string_first s)
( if (eq? (string? s) true) (string-ith s 0 )"You have not entered a string"))
So I hope somone can give me feedback on my first attempt so i can learn from it.
Regards,
Roelof
I am now in the book How to design a programm second edition at the point I have to design functions.
Now I wonder if I understand this part right so I have made this function.
;String -> String
;This function takes out the first character of a given string with the name s
; given "roelof" expect "r"
; given "example" expect "e"
(define (string_first s)
( if (eq? (string? s) true) (string-ith s 0 )"You have not entered a string"))
So I hope somone can give me feedback on my first attempt so i can learn from it.
Regards,
Roelof
____________________ Racket Users list: http://lists.racket-lang.org/users