This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;;; Program based on example code from composingprograms.com | |
;;; | |
;;; - Get a text document from the Web containing works of Shakespeare. | |
;;; - Count the words in the document and display the result. | |
;;; - Display the list of words that are six-letters long and that written | |
;;; backwards form a word that is also included in the document. | |
;;; | |
;;; NOTE: This code takes about 9 minutes to run in my machine. This is | |
;;; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Program based on example code from composingprograms.com | |
# | |
# - Get a text document from the Web containing works of Shakespeare. | |
# - Count the words in the document and display the result. | |
# - Display the list of words that are six-letters long and that written | |
# backwards form a word that is also included in the document. | |
# | |
# NOTE: This code takes about 6-8 seconds to run in my machine. | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
scheme@(guile-user)> (use-modules (rnrs io ports) (web client) (web response) (web uri)) | |
scheme@(guile-user)> (define text-url "http://composingprograms.com/shakespeare.txt") | |
scheme@(guile-user)> (define server-response (http-get (string->uri text-url) #:keep-alive? #true)) | |
scheme@(guile-user)> (get-string-all (response-body-port server-response)) | |
ERROR: In procedure string-index: | |
ERROR: In procedure string-index: Wrong type argument in position 1 (expecting string): #<eof> | |
Entering a new prompt. Type `,bt' for a backtrace or `,q' to continue. |