<div dir="ltr">Fantastic, thanks Rick! I continue to be so happy I chose S7 for this project. Being able to build on the Common Music work is great. :-)</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Feb 14, 2021 at 10:08 AM Taube, Heinrich K &lt;<a href="mailto:taube@illinois.edu">taube@illinois.edu</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">



<div style="overflow-wrap: break-word;">
FWIW The Common Music 2 code base is 100% CLOS.  The Grace code base uses Bil’s record structure to implement its Scheme pattern objects and it works quite well.
<div><br>
</div>
<div><span style="background-color:rgb(255,255,255)"><font face="Menlo">C Side...</font></span><br>
<div><br>
<div>
<div style="margin:0px;font-stretch:normal;line-height:normal;font-family:Menlo;color:rgb(38,71,75);background-color:rgb(255,255,255)">
<span style="color:rgb(63,110,116)">pattern_tag</span><span style="color:rgb(0,0,0)"> =
</span>s7_make_c_type<span style="color:rgb(0,0,0)">(s7, </span><span style="color:rgb(196,26,22)">&quot;&lt;pattern&gt;&quot;</span><span style="color:rgb(0,0,0)">);</span></div>
<div style="margin:0px;font-stretch:normal;line-height:normal;font-family:Menlo;background-color:rgb(255,255,255);min-height:14px">
<br>
</div>
<div style="margin:0px;font-stretch:normal;line-height:normal;font-family:Menlo;color:rgb(196,26,22);background-color:rgb(255,255,255)">
<span style="color:rgb(38,71,75)">s7_define_function</span><span style="color:rgb(0,0,0)">(s7,
</span>&quot;make-pattern&quot;<span style="color:rgb(0,0,0)">, </span><span style="color:rgb(38,71,75)">ffi_make_pattern</span><span style="color:rgb(0,0,0)">,
</span><span style="color:rgb(28,0,207)">14</span><span style="color:rgb(0,0,0)">,
</span><span style="color:rgb(28,0,207)">0</span><span style="color:rgb(0,0,0)">,
</span><span style="color:rgb(170,13,145)">false</span><span style="color:rgb(0,0,0)">,
</span>&quot;pattern constructor”<span style="color:rgb(0,0,0)">);</span></div>
</div>
<div style="margin:0px;font-stretch:normal;line-height:normal;background-color:rgb(255,255,255)">
<span style="font-family:Menlo">[...]</span></div>
<div style="margin:0px;font-stretch:normal;line-height:normal;background-color:rgb(255,255,255)">
<font face="Menlo"><br>
</font></div>
<div style="margin:0px;font-stretch:normal;line-height:normal;font-family:Menlo;background-color:rgb(255,255,255)">
Scheme Side...</div>
<div style="margin:0px;font-stretch:normal;line-height:normal;font-family:Menlo;background-color:rgb(255,255,255)">
<br>
</div>
<div>
<div style="margin:0px;font-stretch:normal;line-height:normal;font-family:Menlo;background-color:rgb(255,255,255)">
(define-record pattern flags data length datum period value state </div>
<div style="margin:0px;font-stretch:normal;line-height:normal;font-family:Menlo;background-color:rgb(255,255,255)">
  repeat returning counting traversing next mapr cache)</div>
<div style="margin:0px;font-stretch:normal;line-height:normal;font-family:Menlo;background-color:rgb(255,255,255);min-height:14px">
<br>
</div>
<div style="margin:0px;font-stretch:normal;line-height:normal;font-family:Menlo;background-color:rgb(255,255,255)">
<br>
</div>
<div style="margin:0px;font-stretch:normal;line-height:normal;font-family:Menlo;background-color:rgb(255,255,255)">
<div style="margin:0px;font-stretch:normal;line-height:normal">(define (%alloc-pattern)</div>
<div style="margin:0px;font-stretch:normal;line-height:normal">  ;; flags data length datum period value state limit returning counting traversing next mapr cache</div>
<div style="margin:0px;font-stretch:normal;line-height:normal">  (make-pattern 0 (list) #f +nad+ #f +nad+ +nad+ most-positive-fixnum #f #:periods #:depth-first</div>
<div style="margin:0px;font-stretch:normal;line-height:normal"><span style="white-space:pre-wrap"></span>#f #f #f))</div>
<div style="margin:0px;font-stretch:normal;line-height:normal"><br>
</div>
<div style="margin:0px;font-stretch:normal;line-height:normal">(define (initialize-pattern obj data for rep flags len dper getr mapr)</div>
<div style="margin:0px;font-stretch:normal;line-height:normal">  (pattern-data-set! obj data)</div>
<div style="margin:0px;font-stretch:normal;line-height:normal">  (pattern-length-set! obj len)</div>
<div style="margin:0px;font-stretch:normal;line-height:normal">  (pattern-mapr-set! obj mapr)</div>
<div style="margin:0px;font-stretch:normal;line-height:normal">  (pattern-next-set! obj getr)</div>
<div style="margin:0px;font-stretch:normal;line-height:normal">  ;; map data to see if it is constant data or has subpatterns</div>
<div style="margin:0px;font-stretch:normal;line-height:normal">  (let ((con? #t))</div>
<div style="margin:0px;font-stretch:normal;line-height:normal">    (map-pattern-data (lambda (x) (if (pattern? x) (set! con? #f))) </div>
<div style="margin:0px;font-stretch:normal;line-height:normal"><span style="white-space:pre-wrap"></span>      obj)</div>
<div style="margin:0px;font-stretch:normal;line-height:normal">    (if con? (set! flags (logior flags +constant-data+))))</div>
<div>   [...]</div>
<div>)</div>
</div>
<div style="margin:0px;font-stretch:normal;line-height:normal;font-family:Menlo;background-color:rgb(255,255,255)">
[...]</div>
<div>
<div style="margin:0px;font-stretch:normal;line-height:normal;font-family:Menlo;background-color:rgb(255,255,255)">
(define (make-cycle data . args)</div>
<div style="margin:0px;font-stretch:normal;line-height:normal;font-family:Menlo;background-color:rgb(255,255,255)">
  (unless (pair? data) (set! data (list data)))</div>
<div style="margin:0px;font-stretch:normal;line-height:normal;font-family:Menlo;background-color:rgb(255,255,255)">
  (with-optkeys (args for limit)</div>
<div style="margin:0px;font-stretch:normal;line-height:normal;font-family:Menlo;background-color:rgb(255,255,255)">
    (let ((obj (%alloc-pattern))</div>
<div style="margin:0px;font-stretch:normal;line-height:normal;font-family:Menlo;background-color:rgb(255,255,255)">
<span style="white-space:pre-wrap"></span>  (flags 0)</div>
<div style="margin:0px;font-stretch:normal;line-height:normal;font-family:Menlo;background-color:rgb(255,255,255)">
<span style="white-space:pre-wrap"></span>  (len (length data)))</div>
<div style="margin:0px;font-stretch:normal;line-height:normal;font-family:Menlo;background-color:rgb(255,255,255)">
      (initialize-pattern obj (cons data data) for limit</div>
<div style="margin:0px;font-stretch:normal;line-height:normal;font-family:Menlo;background-color:rgb(255,255,255)">
<span style="white-space:pre-wrap"></span>  flags len len next-in-cycle</div>
<div style="margin:0px;font-stretch:normal;line-height:normal;font-family:Menlo;background-color:rgb(255,255,255)">
<span style="white-space:pre-wrap"></span>  (lambda (fn obj) </div>
<div style="margin:0px;font-stretch:normal;line-height:normal;font-family:Menlo;background-color:rgb(255,255,255)">
<span style="white-space:pre-wrap"></span>    (for-each fn (car (pattern-data obj)))))</div>
<div style="margin:0px;font-stretch:normal;line-height:normal;font-family:Menlo;background-color:rgb(255,255,255)">
      obj)))</div>
<div style="margin:0px;font-stretch:normal;line-height:normal;font-family:Menlo;background-color:rgb(255,255,255)">
<br>
</div>
<div style="margin:0px;font-stretch:normal;line-height:normal;font-family:Menlo;background-color:rgb(255,255,255)">
[...]</div>
<div style="margin:0px;font-stretch:normal;line-height:normal;font-family:Menlo;background-color:rgb(255,255,255)">
<br>
</div>
<div style="margin:0px;font-stretch:normal;line-height:normal;font-family:Menlo;background-color:rgb(255,255,255)">
<br>
</div>
<blockquote type="cite">
<div>On Feb 14, 2021, at 10:17 AM, Iain Duncan &lt;<a href="mailto:iainduncanlists@gmail.com" target="_blank">iainduncanlists@gmail.com</a>&gt; wrote:</div>
<br>
<div>
<div dir="ltr">Oh great, I hadn&#39;t looked there yet. Thanks! Is there any particular implementation or resource you based the class system in there on? (ie, place to read more about how you did it)
<div><br>
</div>
<div>iain<br>
<div><br>
</div>
<div><br>
<div><br>
</div>
<div><br>
</div>
</div>
</div>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">On Sun, Feb 14, 2021 at 2:33 AM &lt;<a href="mailto:bil@ccrma.stanford.edu" target="_blank">bil@ccrma.stanford.edu</a>&gt; wrote:<br>
</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
stuff.scm has define-class and friends with some examples<br>
in s7test.scm.  It has some similarities to CLOS.<br>
<br>
</blockquote>
</div>
_______________________________________________<br>
Cmdist mailing list<br>
<a href="mailto:Cmdist@ccrma.stanford.edu" target="_blank">Cmdist@ccrma.stanford.edu</a><br>
<a href="https://urldefense.com/v3/__https://cm-mail.stanford.edu/mailman/listinfo/cmdist__;!!DZ3fjg!vlx95wjWmKfGndRV-oOKnf1WnD1TzGmD7FIKM6HTtoIAyd5rLoZ3G8sO8ulQhA$" target="_blank">https://urldefense.com/v3/__https://cm-mail.stanford.edu/mailman/listinfo/cmdist__;!!DZ3fjg!vlx95wjWmKfGndRV-oOKnf1WnD1TzGmD7FIKM6HTtoIAyd5rLoZ3G8sO8ulQhA$</a>
<br>
</div>
</blockquote>
</div>
<br>
</div>
</div>
</div>
</div>

</blockquote></div>