<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p>I'm trying to figure out how to shape the (musical) data. In
everyday language, a musical idea has an architecture of formal
nested units and gestures made up of one or more events which have
sounds and silences. In Rust, the latter part of the above would
yield a statement like:</p>
<div style="color: #ffffff;background-color: #002451;font-family: Consolas, 'Courier New', monospace;font-weight: normal;font-size: 15px;line-height: 20px;white-space: pre;"><div><span style="color: #ffffff;">scoreIdea.gesture[iGesture</span><span style="color: #99ffff;">-</span><span style="color: #ffc58f;">1</span><span style="color: #ffffff;">].event[iEvent</span><span style="color: #99ffff;">-</span><span style="color: #ffc58f;">1</span><span style="color: #ffffff;">].sounds </span><span style="color: #99ffff;">+=</span><span style="color: #ffffff;"> </span><span style="color: #ffc58f;">1</span></div></div>
<div class="moz-cite-prefix"><br>
</div>
<div class="moz-cite-prefix">which is manageable. But when I think
about accessing data nested many levels deep in Erlang, I'm kinda
flummoxed. Instinctively, I don't think transliterating something
like this to records (or even maps?) is the way to go?</div>
<div class="moz-cite-prefix"><br>
</div>
<div class="moz-cite-prefix">All suggestions greatly appreciated.<br>
</div>
<div class="moz-cite-prefix"><br>
</div>
<div class="moz-cite-prefix">On 1/24/2019 6:11 AM, <a class="moz-txt-link-abbreviated" href="mailto:zxq9@zxq9.com">zxq9@zxq9.com</a>
wrote:<br>
</div>
<blockquote type="cite" cite="mid:1953348.hysP6hV7Y5@takoyaki">
<pre class="moz-quote-pre" wrap="">On 2019年1月24日木曜日 12時43分52秒 JST you wrote:
</pre>
<blockquote type="cite">
<pre class="moz-quote-pre" wrap="">I found that lenses gives reasonable good abstraction to deal with deeply nested structures.
</pre>
</blockquote>
<pre class="moz-quote-pre" wrap="">
That said, I find that very often things like lenses are "chindougu": Unuseless inventions.
They solve problems that would never have existed had more thought been given to the actual shape of data within the program in question.
That's not always true, but quite often it is.
Come to think of it, much of the most heavily hyped efforts in software are chindougu.
-Craig
_______________________________________________
erlang-questions mailing list
<a class="moz-txt-link-abbreviated" href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a>
<a class="moz-txt-link-freetext" href="http://erlang.org/mailman/listinfo/erlang-questions">http://erlang.org/mailman/listinfo/erlang-questions</a>
</pre>
</blockquote>
</body>
</html>