Clojure building of URL from constituent parts

后端 未结 5 1196
余生分开走
余生分开走 2021-02-07 17:46

In Python I would do the following:

>>> q = urllib.urlencode({\"q\": \"clojure url\"})
>>> q
\'q=clojure+url\'

>>> url = \"http://sta         


        
5条回答
  •  野趣味
    野趣味 (楼主)
    2021-02-07 18:31

    A simple solution using str(ings):

    (def q (str "clojure+url"))
    (def url (str "http://stackoverflow.com/search?" q))
    

提交回复
热议问题