<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-2222092844258498904</id><updated>2024-10-24T13:49:13.571-07:00</updated><category term="clojure"/><category term="data structures"/><category term="factorial"/><category term="functional programming"/><category term="list"/><category term="map"/><category term="set"/><category term="sets"/><category term="vector"/><title type='text'>clojure</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://basicclojure.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2222092844258498904/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://basicclojure.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/08773422254713437884</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>3</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-2222092844258498904.post-5928346091296028671</id><published>2012-08-14T17:23:00.003-07:00</published><updated>2012-08-15T03:57:21.037-07:00</updated><title type='text'>Understanding/examples for features of clojure(Lisp dialect - functional programming language)</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Clojure is a Lisp dialect. After several repeated reading now I am getting what is data as a code, how does data structures act as &amp;nbsp;a code, following is the description of same.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;1&amp;gt; Data as a code.&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
In clojure &#39;if&#39; is a function(yes it is). It takes 2 or 3 arguments&lt;br /&gt;
(if A B C)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;ol style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;logical condition A&lt;/li&gt;
&lt;li&gt;if logical condition is true, this value will be returned B&lt;/li&gt;
&lt;li&gt;if logical condition is false, this value will be returned C&lt;/li&gt;
&lt;/ol&gt;
&lt;br /&gt;
&lt;br /&gt;
Here is a illustrative example,&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;user=&amp;gt; (+ 2 (if (= 1 3) 2 3))&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;5&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
In above example if is a function returns 2 or 3, depending upon evaluation of function (= 1 3).&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Now I can also write,&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;user=&amp;gt; (+ 2 (if (= 1 1) (first &#39;(2)) (last &#39;(3))))&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;4&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;user=&amp;gt; (+ 2 (if (= 1 3) (first &#39;(2)) (last &#39;(3))))&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;5&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Here, 2nd and 3rd arguments are actually functions.Instead of specifying B &amp;nbsp;and C as a &amp;nbsp;direct return value(data) you can place functions in the form of list.This is first significance of data as a code.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Also list, vectors, sets and maps are too considered as a functions. While list are the primary functions, lisp(list processing) will try to evaluate it as a function by taking first element as a operation and rest elements as a arguments to the functions. Again these arguments could be lists and evaluated recursively.&lt;/div&gt;
&lt;br /&gt;
Following are the examples how vector, set and map acts as if functions(data as a code).&lt;br /&gt;
&lt;br /&gt;
1&amp;gt; vectors when acts as a function returns element at index provided by first argumnet&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;user=&amp;gt; ( [:2 :3] 2)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;IndexOutOfBoundsException &amp;nbsp; clojure.lang.PersistentVector.arrayFor (PersistentVector.java:106)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;user=&amp;gt; ( [:2 :3] 1)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;:3&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;
2&amp;gt; Sets when act as a functions they return first argument if that is part of set.&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;user=&amp;gt; (def sampleSet #{:a :b :c :d :e})&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;#&#39;user/sampleSet&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;user=&amp;gt; (sampleSet :c)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;:c&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
Another example using the destructuring could be&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;user=&amp;gt; (def sam [&#39;(2 3 4 [3 #{a b}]) [2 3] (first &#39;(2 3))])&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;#&#39;user/sam&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;user=&amp;gt; (defn getEle [[_ _ c]] c)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;#&#39;user/getEle&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;user=&amp;gt; (getEle sam)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;2&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;user=&amp;gt; (def sam [&#39;(2 3 4 [3 #{a b}]) [2 3] (first &#39;(9 3))])&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;#&#39;user/sam&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;user=&amp;gt; (getEle sam)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;9&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;user=&amp;gt; (def sam [&#39;(2 3 4 [3 #{a b}]) [2 3] (rest &#39;(9 3 6 8))])&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;#&#39;user/sam&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;user=&amp;gt; (getEle sam)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;(3 6 8)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;user=&amp;gt; (defn getEle1[w] (let [[[_ _ _ [_ c1]]] w] c1))&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;#&#39;user/getEle1&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;user=&amp;gt; (getEle1 sam)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;#{a b}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;user=&amp;gt; (cons 1 &#39;(2 3))&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;(1 2 3)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;user=&amp;gt; (cons 1 &#39;(3 2 3))&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;(1 3 2 3)&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
And more simpler form of code as a data&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;user=&amp;gt; (def sam2 cons)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;#&#39;user/sam2&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;user=&amp;gt; (sam2 2 &#39;(3))&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;(2 3)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;user=&amp;gt; (def sam +)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;#&#39;user/sam&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;user=&amp;gt; (sam 2 3)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;5&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://basicclojure.blogspot.com/feeds/5928346091296028671/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://basicclojure.blogspot.com/2012/08/understandingexamples-for-features-of.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2222092844258498904/posts/default/5928346091296028671'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2222092844258498904/posts/default/5928346091296028671'/><link rel='alternate' type='text/html' href='http://basicclojure.blogspot.com/2012/08/understandingexamples-for-features-of.html' title='Understanding/examples for features of clojure(Lisp dialect - functional programming language)'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/08773422254713437884</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2222092844258498904.post-5099267767324970348</id><published>2012-07-26T09:34:00.000-07:00</published><updated>2012-07-28T21:39:08.967-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="clojure"/><category scheme="http://www.blogger.com/atom/ns#" term="factorial"/><category scheme="http://www.blogger.com/atom/ns#" term="functional programming"/><title type='text'>Factorial in clojure : my first program with clojure functional programming</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
There are multiple ways to write factorial program &amp;nbsp;in clojure, following is my implementation&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;A&amp;gt; Normal method&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;code&gt;
user=&amp;gt; (defn fact1&lt;br /&gt;
[n]&lt;br /&gt;
( if(= n 0) 1&lt;br /&gt;
(* n (fact1 (- n 1)))))&lt;br /&gt;
#&#39;user/fact1&lt;br /&gt;
user=&amp;gt; (fact1 10)&lt;br /&gt;
3628800&lt;br /&gt;
&lt;/code&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
here I have used recursion, well this not a good implementation, but its one of the simplest function i thought I could implement using clojure :)&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;
&lt;b&gt;B&amp;gt; Functional programming&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
I tried to implement factorial using loop-recur and functional programming but&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
as loop need vector to iterate over while i could not get success with functional programming&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
below is my function which uses functional programming&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;code&gt;
&lt;/code&gt;&lt;br /&gt;
&lt;div&gt;
&lt;code&gt;user=&amp;gt; (defn fact3&amp;nbsp;&lt;/code&gt;&lt;/div&gt;
&lt;code&gt;
&lt;/code&gt;&lt;br /&gt;
&lt;div&gt;
&lt;code&gt;&quot;function programmed factorial function&quot;&lt;/code&gt;&lt;/div&gt;
&lt;code&gt;
&lt;/code&gt;&lt;br /&gt;
&lt;div&gt;
&lt;code&gt;[inputNumber]&lt;/code&gt;&lt;/div&gt;
&lt;code&gt;
&lt;/code&gt;&lt;br /&gt;
&lt;div&gt;
&lt;code&gt;(defn factCore&amp;nbsp;&lt;/code&gt;&lt;/div&gt;
&lt;code&gt;
&lt;/code&gt;&lt;br /&gt;
&lt;div&gt;
&lt;code&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; [number, result]&lt;/code&gt;&lt;/div&gt;
&lt;code&gt;
&lt;/code&gt;&lt;br /&gt;
&lt;div&gt;
&lt;code&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; (if(= number 0) result&lt;/code&gt;&lt;/div&gt;
&lt;code&gt;
&lt;/code&gt;&lt;br /&gt;
&lt;div&gt;
&lt;code&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; (factCore (- number 1)(* result number))))&lt;/code&gt;&lt;/div&gt;
&lt;code&gt;
&lt;/code&gt;&lt;br /&gt;
&lt;div&gt;
&lt;code&gt;(factCore inputNumber 1)&lt;/code&gt;&lt;/div&gt;
&lt;code&gt;
&lt;/code&gt;&lt;br /&gt;
&lt;div&gt;
&lt;code&gt;)&lt;/code&gt;&lt;/div&gt;
&lt;code&gt;
&lt;div&gt;
#&#39;user/fact3&lt;/div&gt;
&lt;div&gt;
user=&amp;gt; (fact3 10)&lt;/div&gt;
&lt;div&gt;
3628800&lt;/div&gt;
&lt;div&gt;
user=&amp;gt; (fact3 5)&lt;/div&gt;
&lt;div&gt;
120&lt;/div&gt;
&lt;div&gt;
user=&amp;gt; (fact3 6)&lt;/div&gt;
&lt;div&gt;
720&lt;/div&gt;
&lt;div&gt;
user=&amp;gt; (fact3 8)&lt;/div&gt;
&lt;div&gt;
40320&lt;/div&gt;
&lt;div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/code&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;b&gt;C&amp;gt; By infinite sequences&lt;/b&gt;&lt;br /&gt;
This method uses infinite sequence, &amp;nbsp;first generate a incremental infinite sequence, then take only n elements and apply multiplication to all over them.&lt;br /&gt;
&lt;br /&gt;
&lt;code&gt;
user=&amp;gt; (defn factorial&lt;br /&gt;
&quot;factorial by infinite sequences&quot;&lt;br /&gt;
[n]&lt;br /&gt;
(apply * (take n (iterate inc 1))))&lt;br /&gt;
#&#39;user/factorial&lt;br /&gt;
user=&amp;gt; (factorial 4)&lt;br /&gt;
24&lt;br /&gt;
user=&amp;gt; (factorial 5)&lt;br /&gt;
120&lt;br /&gt;
user=&amp;gt; (factorial 6)&lt;br /&gt;
720&lt;br /&gt;
user=&amp;gt;&lt;br /&gt;
&lt;/code&gt;&lt;br /&gt;
&lt;div&gt;
&lt;code&gt;&lt;br /&gt;&lt;/code&gt;&lt;/div&gt;
&lt;code&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;/code&gt;
Hope you get it :)&lt;/div&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://basicclojure.blogspot.com/feeds/5099267767324970348/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://basicclojure.blogspot.com/2012/07/factorial-in-clojure-my-first-program.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2222092844258498904/posts/default/5099267767324970348'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2222092844258498904/posts/default/5099267767324970348'/><link rel='alternate' type='text/html' href='http://basicclojure.blogspot.com/2012/07/factorial-in-clojure-my-first-program.html' title='Factorial in clojure : my first program with clojure functional programming'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/08773422254713437884</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total><georss:featurename>National Highway 4, Kasba Peth, Pune, Maharashtra, India</georss:featurename><georss:point>18.5204303 73.8567437</georss:point><georss:box>17.5547478 72.59331619999999 19.4861128 75.1201712</georss:box></entry><entry><id>tag:blogger.com,1999:blog-2222092844258498904.post-4105439256931138391</id><published>2012-07-17T21:59:00.001-07:00</published><updated>2012-07-27T09:43:56.350-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="clojure"/><category scheme="http://www.blogger.com/atom/ns#" term="data structures"/><category scheme="http://www.blogger.com/atom/ns#" term="list"/><category scheme="http://www.blogger.com/atom/ns#" term="map"/><category scheme="http://www.blogger.com/atom/ns#" term="set"/><category scheme="http://www.blogger.com/atom/ns#" term="sets"/><category scheme="http://www.blogger.com/atom/ns#" term="vector"/><title type='text'>basic Clojure Data Structure operations</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
following is the summery of basic DS operations&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;A&amp;gt; List &#39;() or list()&lt;/b&gt;&lt;br /&gt;
first &lt;br /&gt;
last&lt;br /&gt;
rest&lt;br /&gt;
cons &amp;lt;element&amp;gt; &amp;lt;list&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;B&amp;gt; Vector []&lt;/b&gt;&lt;br /&gt;
first&lt;br /&gt;
last&lt;br /&gt;
nth &amp;lt;vector&amp;gt; &amp;lt;position&amp;gt;&lt;br /&gt;
concat&amp;nbsp; &amp;lt;v1&amp;gt; &amp;lt;v2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;C&amp;gt; Set #{}&lt;/b&gt;&lt;br /&gt;
count&lt;b&gt; &lt;/b&gt;&lt;br /&gt;
merge&lt;br /&gt;
sort&lt;br /&gt;
sorted-set&lt;br /&gt;
clojure.set/union&lt;br /&gt;
clojure.set/difference&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;D&amp;gt; Map{}&lt;/b&gt;&lt;br /&gt;
merge&lt;br /&gt;
merge-with+&lt;br /&gt;
&lt;br /&gt;
Description of operations&lt;br /&gt;
&lt;br /&gt;
First : returns 1st element in DS instance&lt;br /&gt;
last : returns last element in DS instance&lt;br /&gt;
rest : returns all elements except first, in order&lt;br /&gt;
&lt;br /&gt;
cons &amp;lt;element&amp;gt; &amp;lt;list&amp;gt;: adds element to the start of list&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
nth &amp;lt;vector&amp;gt; &amp;lt;position&amp;gt; : returns&amp;nbsp; element at position on vector&lt;br /&gt;
concat &amp;lt;v1&amp;gt; &amp;lt;v2&amp;gt; : concats v1 and v2&lt;br /&gt;
&lt;br /&gt;
count&amp;nbsp; : returns number of elements in set&lt;br /&gt;
merge&amp;nbsp; : merge two sets&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://basicclojure.blogspot.com/feeds/4105439256931138391/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://basicclojure.blogspot.com/2012/07/basic-clojure-data-structure-operations.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2222092844258498904/posts/default/4105439256931138391'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2222092844258498904/posts/default/4105439256931138391'/><link rel='alternate' type='text/html' href='http://basicclojure.blogspot.com/2012/07/basic-clojure-data-structure-operations.html' title='basic Clojure Data Structure operations'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/08773422254713437884</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total><georss:featurename>National Highway 4, Kasba Peth, Pune, Maharashtra, India</georss:featurename><georss:point>18.5204303 73.8567437</georss:point><georss:box>18.2794008 73.5408867 18.7614598 74.17260069999999</georss:box></entry></feed>