; A teachpack with a couple slight helpers for comp210, 02fall, lab06. (module lab06-lib mzscheme (provide display-string (rename nuline newline)) ;; nuline: string ;; The one-character string with a carriage-return. ;; (define nuline "\n") ;; display-string: string -> true ;; Display the given string in a text-box. ;; Always returns true. ;; (define (display-string str) (unless (string? str) (raise-type-error 'display-string "string" str)) (display str) #t) ) #| ; Example: (define limmy (string-append "There once was a man from Dundee," newline "Whose limerick stopped at line three." newline "You'd think it just started --")) (display-string limmy) |# #| A note on making your own teachpacks: "lab06-lib" is the name of this module, which should match the filename it's kept in (up to ".ss"). "mzscheme" is the language-level this module is written in. "provide" starts the list of exported names. The "(rename nwline newline)" form means, "take the value 'nwline' and export it, but as the name 'newline'". (We need to use it because the name "newline" is already defined inside of the mzscheme language-level.) In helpdesk, look up "module" for further info. |#