How to spec a vector of custom spec'ed mapsTraversing a list of mapsClojure - extract values from a vector of hashmapsParsing with clojure.specMetaprogramming with clojure.spec values?Exercising macros with named arguments through Clojure SpecClojure Spec for a map with non-keyword keysWhy is Clojure Spec going into an infinite loop here?Clojure: Transform nested maps into custom map keeping only specific attributesClojure Domain Modeling: Spec vs. ProtocolsSyntax error macroexpanding clojure.core/let

Inadvertently nuked my disk permission structure - why?

Does academia have a lazy work culture?

Why was Sauron preparing for war instead of trying to find the ring?

Giant space birds hatching out of planets; short story

Area of parallelogram = Area of square. Shear transform

At what rate does the volume (velocity) of a note decay?

Convert every file from JPEG to GIF in terminal

A planet illuminated by a black hole?

Why isn't there a ";" after "do" in sh loops?

How to judge a Ph.D. applicant that arrives "out of thin air"

Anybody know what this small Nintendo stand is for?

Why are off grid solar setups only 12, 24, 48 VDC?

Spoken encryption

Why did Germany launch its spy satellites from Russia?

AC contactor 1 pole or 2?

TSA asking to see cell phone

What is the difference between 1/3, 1/2, and full casters?

Why not use a diode instead of a resistor for current sense circuits?

How do I generate distribution of positive numbers only with min, max and mean?

Assuring luggage isn't lost with short layover

Examples of simultaneous independent breakthroughs

Why is drive/partition number still used?

How do I stop my characters falling in love?

Is it legal for private citizens to "impound" e-scooters?



How to spec a vector of custom spec'ed maps


Traversing a list of mapsClojure - extract values from a vector of hashmapsParsing with clojure.specMetaprogramming with clojure.spec values?Exercising macros with named arguments through Clojure SpecClojure Spec for a map with non-keyword keysWhy is Clojure Spec going into an infinite loop here?Clojure: Transform nested maps into custom map keeping only specific attributesClojure Domain Modeling: Spec vs. ProtocolsSyntax error macroexpanding clojure.core/let






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








0















I have a spec for a custom map named ::cell, let's say



(s/def ::attr-1 int?)
(s/def ::attr-2 int?)
(s/def ::cell :req-un [::attr-1 ::attr-2])


Now I want another spec ::grid for a custom vector that consists of only these ::cell maps. As an example, a grid might look like this:



(let grid [:attr-1 11, :attr-2 12 :attr-1 21 :attr-2 22])


Is it possible to create a spec for this requirement using the specification of ::cell?



(s/def ::grid ???)









share|improve this question




























    0















    I have a spec for a custom map named ::cell, let's say



    (s/def ::attr-1 int?)
    (s/def ::attr-2 int?)
    (s/def ::cell :req-un [::attr-1 ::attr-2])


    Now I want another spec ::grid for a custom vector that consists of only these ::cell maps. As an example, a grid might look like this:



    (let grid [:attr-1 11, :attr-2 12 :attr-1 21 :attr-2 22])


    Is it possible to create a spec for this requirement using the specification of ::cell?



    (s/def ::grid ???)









    share|improve this question
























      0












      0








      0








      I have a spec for a custom map named ::cell, let's say



      (s/def ::attr-1 int?)
      (s/def ::attr-2 int?)
      (s/def ::cell :req-un [::attr-1 ::attr-2])


      Now I want another spec ::grid for a custom vector that consists of only these ::cell maps. As an example, a grid might look like this:



      (let grid [:attr-1 11, :attr-2 12 :attr-1 21 :attr-2 22])


      Is it possible to create a spec for this requirement using the specification of ::cell?



      (s/def ::grid ???)









      share|improve this question














      I have a spec for a custom map named ::cell, let's say



      (s/def ::attr-1 int?)
      (s/def ::attr-2 int?)
      (s/def ::cell :req-un [::attr-1 ::attr-2])


      Now I want another spec ::grid for a custom vector that consists of only these ::cell maps. As an example, a grid might look like this:



      (let grid [:attr-1 11, :attr-2 12 :attr-1 21 :attr-2 22])


      Is it possible to create a spec for this requirement using the specification of ::cell?



      (s/def ::grid ???)






      clojure clojure.spec






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Mar 26 at 17:30









      idleherbidleherb

      9358 silver badges19 bronze badges




      9358 silver badges19 bronze badges






















          1 Answer
          1






          active

          oldest

          votes


















          2














          You can use tuple:



          (s/def ::grid (s/tuple ::cell ::cell ::cell))


          or coll-of specifying the kind and count:



          (s/coll-of ::cell :kind vector? :count 3)





          share|improve this answer























          • Thank you! I wasn't aware of the fact that a spec like ::grid could be used as the first argument to s/coll-of!

            – idleherb
            Mar 26 at 17:41










          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/3.0/"u003ecc by-sa 3.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%2f55363047%2fhow-to-spec-a-vector-of-custom-speced-maps%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














          You can use tuple:



          (s/def ::grid (s/tuple ::cell ::cell ::cell))


          or coll-of specifying the kind and count:



          (s/coll-of ::cell :kind vector? :count 3)





          share|improve this answer























          • Thank you! I wasn't aware of the fact that a spec like ::grid could be used as the first argument to s/coll-of!

            – idleherb
            Mar 26 at 17:41















          2














          You can use tuple:



          (s/def ::grid (s/tuple ::cell ::cell ::cell))


          or coll-of specifying the kind and count:



          (s/coll-of ::cell :kind vector? :count 3)





          share|improve this answer























          • Thank you! I wasn't aware of the fact that a spec like ::grid could be used as the first argument to s/coll-of!

            – idleherb
            Mar 26 at 17:41













          2












          2








          2







          You can use tuple:



          (s/def ::grid (s/tuple ::cell ::cell ::cell))


          or coll-of specifying the kind and count:



          (s/coll-of ::cell :kind vector? :count 3)





          share|improve this answer













          You can use tuple:



          (s/def ::grid (s/tuple ::cell ::cell ::cell))


          or coll-of specifying the kind and count:



          (s/coll-of ::cell :kind vector? :count 3)






          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Mar 26 at 17:39









          LeeLee

          123k15 gold badges181 silver badges251 bronze badges




          123k15 gold badges181 silver badges251 bronze badges












          • Thank you! I wasn't aware of the fact that a spec like ::grid could be used as the first argument to s/coll-of!

            – idleherb
            Mar 26 at 17:41

















          • Thank you! I wasn't aware of the fact that a spec like ::grid could be used as the first argument to s/coll-of!

            – idleherb
            Mar 26 at 17:41
















          Thank you! I wasn't aware of the fact that a spec like ::grid could be used as the first argument to s/coll-of!

          – idleherb
          Mar 26 at 17:41





          Thank you! I wasn't aware of the fact that a spec like ::grid could be used as the first argument to s/coll-of!

          – idleherb
          Mar 26 at 17:41








          Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.







          Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.



















          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%2f55363047%2fhow-to-spec-a-vector-of-custom-speced-maps%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

          Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

          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

          은진 송씨 목차 역사 본관 분파 인물 조선 왕실과의 인척 관계 집성촌 항렬자 인구 같이 보기 각주 둘러보기 메뉴은진 송씨세종실록 149권, 지리지 충청도 공주목 은진현