This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2015-11-19
Channels
- # admin-announcements (8)
- # beginners (90)
- # boot (69)
- # bristol-clojurians (3)
- # cider (32)
- # cljs-dev (2)
- # cljsrn (22)
- # clojure (45)
- # clojure-art (2)
- # clojure-poland (102)
- # clojure-russia (91)
- # clojurescript (38)
- # cursive (27)
- # datomic (45)
- # devcards (7)
- # emacs (45)
- # gorilla (25)
- # hoplon (3)
- # jobs (1)
- # ldnclj (7)
- # off-topic (4)
- # om (176)
- # onyx (3)
- # portland-or (7)
- # re-frame (12)
- # reagent (64)
- # yada (26)
why does the contents of final-body-parts not get printed on line 7 of this code : http://lpaste.net/145556
@roelof: surely that must give an error. Watch your use of parentheses. (println (["foo" "bar"]))
is essentially what you're calling right now.
oke, what is then the best way to print the contents of the final-body-parts. I have to use println because otherwise cursive will not give output
and to be painfully explicit, this is because (println (final-body-parts))
will try to call final-body-parts
as a function (as PersistentVector
implements IFn
), and you actually get an ArityException thrown. one would hope that would be apparent through some means with cursive, but I've never used it.
FROM binduwavell/codenvy-alfresco-base:0.3 MAINTAINER Bindu Wavell <[email protected]> RUN sudo apt-get update && \ sudo apt-get install -y emacs && \ sudo apt-get clean && \ sudo rm -rf /var/lib/apt/lists/ /tmp/ /var/tmp/* RUN mkdir /home/user/bin ENV PATH /home/user/bin:$PATH RUN echo "export PATH=$PATH" >> /home/user/.bashrc RUN wget https://raw.githubusercontent.com/technomancy/leiningen/stable/bin/lein -O /home/user/bin/lein && \ chmod 755 /home/user/bin/lein && \ /home/user/bin/lein && \ timeout 30 /home/user/bin/lein repl :headless ; \ /bin/cat /dev/null RUN wget https://github.com/boot-clj/boot-bin/releases/download/2.4.2/boot.sh -O /home/user/bin/boot && \ chmod 755 /home/user/bin/boot && \ /home/user/bin/boot && \ /home/user/bin/boot ENV CODENVY_APP_BIND_DIR /home/user/application VOLUME ["/home/user/application"] ENV CODENVY_APP_PORT_8080_HTTP 8080 EXPOSE 8080 CMD sleep 365d
(defproject app "0.1.0-SNAPSHOT" :description "FIXME: write description" :url "http://example.com/FIXME" :license {:name "Eclipse Public License" :url "http://www.eclipse.org/legal/epl-v10.html"} :dependencies [[org.clojure/clojure "1.7.0"]] :main ^:skip-aot app.core :target-path "target/%s" :profiles {:uberjar {:aot :all}})
(ns app.core (:gen-class)) (defn -main "I don't do a whole lot ... yet." [& args] (println "Hello, World!"))
but when I do lein run I see this error message : no :main namespace specified in the project.clj
I have now this code : http://lpaste.net/145565
http://lpaste.net/145565 (also, why use a haskell-oriented paste service? do you have a haskell background?)
http://refheap.com is nice.
it's an open source clojure pasting service made by a pretty active member of the clojure community.
https://github.com/Raynes/refheap for the source, if you're curious.
oke, When you switch to this code : https://www.refheap.com/111861 , it works fine
yes the println is away and I use another function to call the right function with the right arguments
correct, but the function needs a argument and it seems I forget to feed the right argument to the function
do you mean you were trying to call symmetrize-body-parts
with something other than asym-hobbit-body-parts
?
nope, that is what I mean , When you do say to clojure that the function needs the asym-hobbit-body-parts the output will be empty
so if you call (symmetrize-body-parts asym-hobbit-body-parts)
, it doesn't return anything?
then it will return the right answer. if you do not do use it this way the output is empty
symmetrize-body-parts takes a vector of maps, and the maps are expected to be of shape {:name s :size n}
if that were the case, symmetrize-body-parts
would need to know about asym-hobbit-body-parts
, and then the function and data are too closely related. at least as far as the author of CFTBAT is concerned (and most here would agree). it's almost always better if the function doesn't have intimate knowledge of other data in the program.
but I was curious if I could do the (println (symmetrize-body-parts asym-hobbit-body-parts)) hidden in a main function
(defn -main [& args] (println (symmetrize-body-parts asym-hobbit-body-parts)))
should be fine.
6.Create a function that generalizes symmetrize-body-parts and the function you created in Exercise 5. The new function should take a collection of body parts and the number of matching body parts to add. If
Somebody help me out pls...i tried to refresh my package list in emacs but it keeps hanging "Contacting Host: http://elpa.gnu.org:80"
@progzilla: Sometimes the sites go down. Go grab a coffee and try in 30 minutes? Also note that there is a specific #C099W16KZ channel.
@roelof: In your example, you rename things to right
, right-2
, etc. Is there a reason they can't just be renamed to 1-
and 2-
, e.g. 1-arm
, 2-leg
those are not valid symbols - can't start with a number
Oh, I may have missed the point
They’re not symbols but strings
I thought these were just strings
they are
then never mind :)
If that's the case, then something along the lines of (apply set part (map #(matching-part part (str %)) (range n)))
should help get you there. Could definitely use to be cleaned up, but that's the core of what you want.
If you really want to keep the right / left / center, I'd define another function that takes in a number and returns the prefix string.