<?xml version='1.0' encoding='utf-8' ?>

<rss version='2.0' xmlns:lj='http://www.livejournal.org/rss/lj/1.0/' xmlns:atom10='http://www.w3.org/2005/Atom'>
<channel>
  <title>jack</title>
  <link>https://jack.dreamwidth.org/</link>
  <description>jack - Dreamwidth Studios</description>
  <lastBuildDate>Tue, 31 Jul 2012 12:04:47 GMT</lastBuildDate>
  <generator>LiveJournal / Dreamwidth Studios</generator>
  <lj:journal>jack</lj:journal>
  <lj:journaltype>personal</lj:journaltype>
  <image>
    <url>https://v2.dreamwidth.org/5140256/61366</url>
    <title>jack</title>
    <link>https://jack.dreamwidth.org/</link>
    <width>100</width>
    <height>41</height>
  </image>

<item>
  <guid isPermaLink='true'>https://jack.dreamwidth.org/773188.html</guid>
  <pubDate>Tue, 31 Jul 2012 12:04:47 GMT</pubDate>
  <title>Pylogram arrays</title>
  <link>https://jack.dreamwidth.org/773188.html</link>
  <description>I&apos;ve also added arrays, so you can do:&lt;br /&gt;&lt;pre&gt;
# Warning, untested
fib = Arr(10,Var)
for a,b,c in fib.adj_objs(3):
 c = a + b
fib[0] = fib[1] = 1
assert fib == (1, 1, 2, 3, 5, 8, 13, 21, 34, 55)

graph = Arr(10,Point)
for x,(pt,f) in enumerate(zip(graph,fib)):
 pt.x = 10 * x
 pt.y = 150 - 2 * f&lt;/pre&gt;But I really wanted to give an alternative to the &quot;for ... in&quot; syntax, something like:&lt;br /&gt;&lt;pre&gt;
 fib_pts = Arr(10,Point)
 fib.each() = fib.prev() + fib.prev(2)&lt;/pre&gt;or maybe:&lt;br /&gt;&lt;pre&gt;
 fib[pyl.idx] = fib[pyl.idx-1] + fib[pyl.idx-2]
&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;img src=&quot;https://www.dreamwidth.org/tools/commentcount?user=jack&amp;ditemid=773188&quot; width=&quot;30&quot; height=&quot;12&quot; alt=&quot;comment count unavailable&quot; style=&quot;vertical-align: middle;&quot;/&gt; comments</description>
  <comments>https://jack.dreamwidth.org/773188.html</comments>
  <category>array</category>
  <category>pylogram</category>
  <category>tech</category>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
</channel>
</rss>
