Why does (condp contains? (:symbols xx) :a (prn “yes”)) give contains? not supported on type: clojure.lang.Keyword error?Why does Clojure have “keywords” in addition to “symbols”?How does Clojure ^:const work?Why does Clojure distinguish between symbols and vars?def'ine a value with a dynamic nameCryptic Clojure error: java.lang.UnsupportedOperationException: nth not supported on this type: SymbolWhat does this clojure.core.typed type error mean?Why does this midje test fail?How to send a postwalk-replace function to an agentHow to obtain Uppercase string from a sentence in clojure?Why does clojure attempt to resolve this symbol?

How can this Stack Exchange site have an animated favicon?

Safe to use 220V electric clothes dryer when building has been bridged down to 110V?

Why does (inf + 0j)*1 evaluate to inf + nanj?

Draw a table of clocks on a plane

Why did UK NHS pay for homeopathic treatments?

What exactly did this mechanic sabotage on the American Airlines 737, and how dangerous was it?

Excel Solver linear programming - Is it possible to use average of values as a constraint without #DIV/0! errors or sacrificing linearity?

What are the consequences of high orphan block rate?

Clear text passwords in Unix

Why did the Soviet Union not "grant" Inner Mongolia to Mongolia after World War Two?

Do we know the situation in Britain before Sealion (summer 1940)?

Quick Yajilin Puzzles: Scatter and Gather

A food item only made possible by time-freezing storage?

Would you write key signatures for non-conventional scales?

Problem using sed back reference

Lost Update Understanding

Do wheelchair-accessible aircraft exist?

Does the Horizon Walker ranger's Planar Warrior feature bypass resistance to non-magical attacks?

Could Apollo astronauts see city lights from the moon?

Can I enter the UK without my husband if we said we'd travel together in our visa application?

Can my former employer sue me if I don't give them the photos I took (taking pictures was not part of my job description)?

Reorder a matrix, twice

What does ubuntu server show on display under normal operation?

Is a Middle Name a Given Name?



Why does (condp contains? (:symbols xx) :a (prn “yes”)) give contains? not supported on type: clojure.lang.Keyword error?


Why does Clojure have “keywords” in addition to “symbols”?How does Clojure ^:const work?Why does Clojure distinguish between symbols and vars?def'ine a value with a dynamic nameCryptic Clojure error: java.lang.UnsupportedOperationException: nth not supported on this type: SymbolWhat does this clojure.core.typed type error mean?Why does this midje test fail?How to send a postwalk-replace function to an agentHow to obtain Uppercase string from a sentence in clojure?Why does clojure attempt to resolve this symbol?






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








1















I want to use condp for a problem.



This is what I am trying to checking using condp.



(def xx :symbols :a 1)

(contains? (:symbols xx) :a)

true


But I get this error



(condp contains? (:symbols xx) :a (prn "yes"))

IllegalArgumentException contains? not supported on type:
clojure.lang.Keyword clojure.lang.RT.contains









share|improve this question





















  • 1





    Please update your question with the value of xx

    – Alan Thompson
    Mar 28 at 18:09


















1















I want to use condp for a problem.



This is what I am trying to checking using condp.



(def xx :symbols :a 1)

(contains? (:symbols xx) :a)

true


But I get this error



(condp contains? (:symbols xx) :a (prn "yes"))

IllegalArgumentException contains? not supported on type:
clojure.lang.Keyword clojure.lang.RT.contains









share|improve this question





















  • 1





    Please update your question with the value of xx

    – Alan Thompson
    Mar 28 at 18:09














1












1








1








I want to use condp for a problem.



This is what I am trying to checking using condp.



(def xx :symbols :a 1)

(contains? (:symbols xx) :a)

true


But I get this error



(condp contains? (:symbols xx) :a (prn "yes"))

IllegalArgumentException contains? not supported on type:
clojure.lang.Keyword clojure.lang.RT.contains









share|improve this question
















I want to use condp for a problem.



This is what I am trying to checking using condp.



(def xx :symbols :a 1)

(contains? (:symbols xx) :a)

true


But I get this error



(condp contains? (:symbols xx) :a (prn "yes"))

IllegalArgumentException contains? not supported on type:
clojure.lang.Keyword clojure.lang.RT.contains






clojure






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 28 at 18:25







Snehaa Ganesan

















asked Mar 28 at 17:58









Snehaa GanesanSnehaa Ganesan

3409 bronze badges




3409 bronze badges










  • 1





    Please update your question with the value of xx

    – Alan Thompson
    Mar 28 at 18:09













  • 1





    Please update your question with the value of xx

    – Alan Thompson
    Mar 28 at 18:09








1




1





Please update your question with the value of xx

– Alan Thompson
Mar 28 at 18:09






Please update your question with the value of xx

– Alan Thompson
Mar 28 at 18:09













1 Answer
1






active

oldest

votes


















2
















This is due to the order of arguments being passed to contains? by condp — it's passing the keyword as the first argument. If you create an anonymous function that swaps the argument order, it'll do what you want:



user=> (def xx :symbols #:a :b)
user=> (condp #(contains? %2 %1) (:symbols xx) :a (prn "yes"))
"yes"
nil


This is the relevant line from the condp doc string explaining that argument-order behavior:




For each clause, (pred test-expr expr) is evaluated.







share|improve this answer

























  • Thank you for answering @TaylorWood !!

    – Snehaa Ganesan
    Mar 28 at 18:30













Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/4.0/"u003ecc by-sa 4.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);














draft saved

draft discarded
















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55404108%2fwhy-does-condp-contains-symbols-xx-a-prn-yes-give-contains-not-suppo%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









2
















This is due to the order of arguments being passed to contains? by condp — it's passing the keyword as the first argument. If you create an anonymous function that swaps the argument order, it'll do what you want:



user=> (def xx :symbols #:a :b)
user=> (condp #(contains? %2 %1) (:symbols xx) :a (prn "yes"))
"yes"
nil


This is the relevant line from the condp doc string explaining that argument-order behavior:




For each clause, (pred test-expr expr) is evaluated.







share|improve this answer

























  • Thank you for answering @TaylorWood !!

    – Snehaa Ganesan
    Mar 28 at 18:30















2
















This is due to the order of arguments being passed to contains? by condp — it's passing the keyword as the first argument. If you create an anonymous function that swaps the argument order, it'll do what you want:



user=> (def xx :symbols #:a :b)
user=> (condp #(contains? %2 %1) (:symbols xx) :a (prn "yes"))
"yes"
nil


This is the relevant line from the condp doc string explaining that argument-order behavior:




For each clause, (pred test-expr expr) is evaluated.







share|improve this answer

























  • Thank you for answering @TaylorWood !!

    – Snehaa Ganesan
    Mar 28 at 18:30













2














2










2









This is due to the order of arguments being passed to contains? by condp — it's passing the keyword as the first argument. If you create an anonymous function that swaps the argument order, it'll do what you want:



user=> (def xx :symbols #:a :b)
user=> (condp #(contains? %2 %1) (:symbols xx) :a (prn "yes"))
"yes"
nil


This is the relevant line from the condp doc string explaining that argument-order behavior:




For each clause, (pred test-expr expr) is evaluated.







share|improve this answer













This is due to the order of arguments being passed to contains? by condp — it's passing the keyword as the first argument. If you create an anonymous function that swaps the argument order, it'll do what you want:



user=> (def xx :symbols #:a :b)
user=> (condp #(contains? %2 %1) (:symbols xx) :a (prn "yes"))
"yes"
nil


This is the relevant line from the condp doc string explaining that argument-order behavior:




For each clause, (pred test-expr expr) is evaluated.








share|improve this answer












share|improve this answer



share|improve this answer










answered Mar 28 at 18:16









Taylor WoodTaylor Wood

13.1k1 gold badge9 silver badges27 bronze badges




13.1k1 gold badge9 silver badges27 bronze badges















  • Thank you for answering @TaylorWood !!

    – Snehaa Ganesan
    Mar 28 at 18:30

















  • Thank you for answering @TaylorWood !!

    – Snehaa Ganesan
    Mar 28 at 18:30
















Thank you for answering @TaylorWood !!

– Snehaa Ganesan
Mar 28 at 18:30





Thank you for answering @TaylorWood !!

– Snehaa Ganesan
Mar 28 at 18:30




















draft saved

draft discarded















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55404108%2fwhy-does-condp-contains-symbols-xx-a-prn-yes-give-contains-not-suppo%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

위키백과:대문 둘러보기 메뉴기부 안내모바일판 대문크리에이티브 커먼즈 저작자표시-동일조건변경허락 3.0CebuanoDeutschEnglishEspañolFrançaisItaliano日本語NederlandsPolskiPortuguêsРусскийSvenskaTiếng ViệtWinaray中文العربيةCatalàفارسیSrpskiУкраїнськаБългарскиНохчийнČeštinaDanskEsperantoEuskaraSuomiעבריתMagyarՀայերենBahasa IndonesiaҚазақшаBaso MinangkabauBahasa MelayuBân-lâm-gúNorskRomânăSrpskohrvatskiSlovenčinaTürkçe

용인 삼성생명 블루밍스 목차 통계 역대 감독 선수단 응원단 경기장 같이 보기 외부 링크 둘러보기 메뉴samsungblueminx.comeh선수 명단용인 삼성생명 블루밍스용인 삼성생명 블루밍스ehsamsungblueminx.comeheheheh