{"id":5320,"date":"2014-03-30T20:41:05","date_gmt":"2014-03-30T20:41:05","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/is-everything-a-list-in-scheme-collection-of-common-programming-errors\/"},"modified":"2014-03-30T20:41:05","modified_gmt":"2014-03-30T20:41:05","slug":"is-everything-a-list-in-scheme-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/is-everything-a-list-in-scheme-collection-of-common-programming-errors\/","title":{"rendered":"Is everything a list in scheme?-Collection of common programming errors"},"content":{"rendered":"<p>Not <em>everything<\/em> is a list in Scheme. I&#8217;m a bit surprised that the example you&#8217;re showing actually <em>works<\/em>, in other Scheme interpreters it will fail, as <code>first<\/code> is usually an alias for <code>car<\/code>, and <code>car<\/code> is defined only for <strong><code>cons<\/code> pairs<\/strong>. For example, in Racket:<\/p>\n<pre><code>(first 'hello)\n&gt; first: expected argument of type ; given 'hello\n\n(car 'hello)\n&gt; car: expects argument of type ; given 'hello\n<\/code><\/pre>\n<p>Scheme&#8217;s basic data structure is the cons pair, with it it&#8217;s possible to build arbitrarily linked data structures &#8211; in particular, singly-linked lists. There are other data structures supported, like vectors and hash tables. And of course there are primitive types &#8211; booleans, symbols, numbers, strings, chars, etc. So it&#8217;s erroneous to state that <em>&#8220;everything is a list&#8221;<\/em> in Scheme.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Not everything is a list in Scheme. I&#8217;m a bit surprised that the example you&#8217;re showing actually works, in other Scheme interpreters it will fail, as first is usually an alias for car, and car is defined only for cons pairs. For example, in Racket: (first &#8216;hello) &gt; first: expected argument of type ; given [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-5320","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/5320","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=5320"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/5320\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=5320"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=5320"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=5320"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}