diff options
author | elioat <elioat@tilde.institute> | 2022-11-30 20:14:38 -0500 |
---|---|---|
committer | elioat <elioat@tilde.institute> | 2022-11-30 20:14:38 -0500 |
commit | f63591010b418062d2f7af07a442d2e3da5b7dce (patch) | |
tree | e9842ea52ccd15ea73099df101430628b0fa6618 | |
parent | 7cced760536c89df8b7c4b8cc72263ee8ecbf51d (diff) | |
download | december-2022-f63591010b418062d2f7af07a442d2e3da5b7dce.tar.gz |
replace string-append with ~a to concatenate a number OR a string to a string
-rw-r--r-- | src/pokedex.rkt | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/pokedex.rkt b/src/pokedex.rkt index 0de0f4c..a9c7f89 100644 --- a/src/pokedex.rkt +++ b/src/pokedex.rkt @@ -14,10 +14,12 @@ ;; basic GET request (require net/url) +;; info about this form, +;; https://medium.com/chris-opperwall/practical-racket-using-a-json-rest-api-3d85eb11cc2d (define (get-pokemon id) - (call/input-url (string->url (string-append "https://pokeapi.co/api/v2/pokemon/" id)) ;; FIXME: this currently only works if the id is a string + (call/input-url (string->url (~a "https://pokeapi.co/api/v2/pokemon/" id)) get-pure-port port->string)) ;; (get-pokemon "ditto") -;; (get-pokemon 123) \ No newline at end of file +;; (get-pokemon 123) |