From bil at ccrma.Stanford.EDU Thu Feb 4 02:48:13 2021 From: bil at ccrma.Stanford.EDU (bil at ccrma.Stanford.EDU) Date: Thu, 04 Feb 2021 02:48:13 -0800 Subject: [CM] Snd 21.1 Message-ID: Snd 21.1: s7: s7_hash_code and hash-code (like CL's sxhash) s7_define_semisafe_typed_function checked: notcurses 2.1.6, sbcl 2.1.1 Thanks!: Massimiliano Gubinelli, IOhannes m zmoelnig From j_hearon at hotmail.com Fri Feb 5 18:51:05 2021 From: j_hearon at hotmail.com (James Hearon) Date: Sat, 6 Feb 2021 02:51:05 +0000 Subject: [CM] polyshape Message-ID: Hi, I'm getting confused on make-polyshape and partials->polynomial. re: sndclm manual partials->polynomial takes a list or float-vector of partial numbers and amplitudes and returns the Chebyshev polynomial coefficients that produce that spectrum. These coefficients can be passed to polyshape (the coeffs argument), or used directly by polynomial... ex. (partials->polynomial '(1 1 3 2 6 1)) ;(-1.0 -5.0 18.0 8.0 -48.0 0.0 32.0) I'm trying to figure out how to use the coefficients, but I get an "attempt to apply a real -1.0, etc. error" when I plugin the float vector to the coeffs parameter. (with-sound () (let ((gen (make-polyshape 400.0 :coeffs (-1.0 -5.0 18.0 8.0 -48.0 0.0 32.0)))) (do ((i 0 (+ i 1))) ((= i 88200)) (outa i (* .5 (polyshape gen 0.25)))))) How do you go about applying the partials->polynomial output to make-polyshape? I couldn't seem to grep an example of that in the code. Thank you, Jim -------------- next part -------------- An HTML attachment was scrubbed... URL: From k.s.matheussen at gmail.com Sat Feb 6 01:12:38 2021 From: k.s.matheussen at gmail.com (Kjetil Matheussen) Date: Sat, 6 Feb 2021 10:12:38 +0100 Subject: [CM] polyshape In-Reply-To: References: Message-ID: > I'm trying to figure out how to use the coefficients, but I get an "attempt to apply a real -1.0, etc. error" when I plugin the float vector to the coeffs parameter. > > (with-sound () > (let ((gen (make-polyshape 400.0 :coeffs (-1.0 -5.0 18.0 8.0 -48.0 0.0 32.0)))) Hi, there seems to be a missing single quote before the list: '(-1.0 -5.0 18.0 8.0 -48.0 0.0 32.0) From j_hearon at hotmail.com Sat Feb 6 10:51:07 2021 From: j_hearon at hotmail.com (James Hearon) Date: Sat, 6 Feb 2021 18:51:07 +0000 Subject: [CM] make-polyshape Message-ID: Hi, I think I figured that out by locating an ex. in test.scm. (partials->polynomial '(1 1 3 2 6 1)) ;(-1.0 -5.0 18.0 8.0 -48.0 0.0 32.0) instead of using the resulting eval of (partials->polynomial) as input to coeffs: (set! gen1 (make-polyshape 440.0 :coeffs '(-1.0 -5.0 18.0 8.0 -48.0 0.0 32.0)))) It rather seems to want the whole function call: (set! gen1 (make-polyshape 440.0 :coeffs (partials->polynomial '(1 1)))) or (set! gen1 (make-polyshape 440.0 :coeffs (partials->polynomial '(1 1 3 2 6 1)))) nice. Thanks, Jim -------------- next part -------------- An HTML attachment was scrubbed... URL: From iainduncanlists at gmail.com Sat Feb 6 17:06:01 2021 From: iainduncanlists at gmail.com (Iain Duncan) Date: Sat, 6 Feb 2021 17:06:01 -0800 Subject: [CM] something like let-set! for undefined vars? Message-ID: Hi folks, I've been digging into S7s environment support and loving it. I have implemented a really convenient pseudo-inheritance-through-delegation setup for my process objects, and one thing I'm using is the let-set! function to allow updating internal variables from outside if desired. My little method looks like this (in side of a let inside a function) (define (set sym val) ;; TODO this doesn't allow setting values that are not yet set ;; need to check if symbol is in let and then set it (let-set! proc-env sym val)) However, this of course errors if I try to use if and sym is not defined. I tried mucking about with the defined? predicate, but got confused by the docs. If anyone can tell me how I can easily add to the above the following, that would be lovely: - if sym not defined in proc-env, define sym to val iain -------------- next part -------------- An HTML attachment was scrubbed... URL: From iainduncanlists at gmail.com Sat Feb 6 20:57:55 2021 From: iainduncanlists at gmail.com (Iain Duncan) Date: Sat, 6 Feb 2021 20:57:55 -0800 Subject: [CM] something like let-set! for undefined vars? In-Reply-To: References: Message-ID: Answering myself! Just didn't understand the docs properly, got it all working nicely with varlet. Though I am curious to know whether my way of iterating through a keyword assoc list in a constructor is reasonable. This is what I'm doing, feedback most welcome: ; loop through the init-args keyword arg list, which is an assoc list of sym/value to set ; this allows setting any instance vars from keyword list to constructor (let* init-loop ((args init-args)) (if (not (null? args)) (begin (varlet env (car args) (cadr args)) (init-loop (cddr args))))) On Sat, Feb 6, 2021 at 5:06 PM Iain Duncan wrote: > Hi folks, I've been digging into S7s environment support and loving it. I > have implemented a really convenient pseudo-inheritance-through-delegation > setup for my process objects, and one thing I'm using is the let-set! > function to allow updating internal variables from outside if desired. My > little method looks like this (in side of a let inside a function) > > (define (set sym val) > ;; TODO this doesn't allow setting values that are not yet set > ;; need to check if symbol is in let and then set it > (let-set! proc-env sym val)) > > However, this of course errors if I try to use if and sym is not defined. > I tried mucking about with the defined? predicate, but got confused by the > docs. If anyone can tell me how I can easily add to the above the > following, that would be lovely: > > - if sym not defined in proc-env, define sym to val > > iain > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tito.01beta at gmail.com Sun Feb 7 00:34:00 2021 From: tito.01beta at gmail.com (Tito Latini) Date: Sun, 7 Feb 2021 09:34:00 +0100 Subject: [CM] make-polyshape In-Reply-To: References: Message-ID: <20210207083400.GA1733@vis.roboris> On Sat, Feb 06, 2021 at 06:51:07PM +0000, James Hearon wrote: > [...] > It rather seems to want the whole function call: > (set! gen1 (make-polyshape 440.0 :coeffs (partials->polynomial '(1 1)))) > > or > (set! gen1 (make-polyshape 440.0 :coeffs (partials->polynomial '(1 1 3 2 6 1)))) Generally, it works with a float-vector, for example #r(-1.0 -5.0 18.0 8.0 -48.0 0.0 32.0) or (float-vector -1.0 -5.0 18.0 8.0 -48.0 0.0 32.0) The output of partials->polynomial is a float-vector: (partials->polynomial '(1 1 3 2 6 1)) ;; => #r(-1.0 -5.0 18.0 8.0 -48.0 0.0 32.0) From chris.actondev at gmail.com Sun Feb 7 01:23:44 2021 From: chris.actondev at gmail.com (Christos Vagias) Date: Sun, 7 Feb 2021 10:23:44 +0100 Subject: [CM] something like let-set! for undefined vars? In-Reply-To: References: Message-ID: Hi Iain! Indeed lets are amazingly powerful :) I think what you're looking for here is (apply varlet env args) On Sun, Feb 7, 2021, 05:58 Iain Duncan wrote: > Answering myself! Just didn't understand the docs properly, got it all > working nicely with varlet. > > Though I am curious to know whether my way of iterating through a keyword > assoc list in a constructor is reasonable. This is what I'm doing, feedback > most welcome: > > ; loop through the init-args keyword arg list, which is an assoc list > of sym/value to set > ; this allows setting any instance vars from keyword list to > constructor > (let* init-loop ((args init-args)) > (if (not (null? args)) > (begin > (varlet env (car args) (cadr args)) > (init-loop (cddr args))))) > > > > > On Sat, Feb 6, 2021 at 5:06 PM Iain Duncan > wrote: > >> Hi folks, I've been digging into S7s environment support and loving it. I >> have implemented a really convenient pseudo-inheritance-through-delegation >> setup for my process objects, and one thing I'm using is the let-set! >> function to allow updating internal variables from outside if desired. My >> little method looks like this (in side of a let inside a function) >> >> (define (set sym val) >> ;; TODO this doesn't allow setting values that are not yet set >> ;; need to check if symbol is in let and then set it >> (let-set! proc-env sym val)) >> >> However, this of course errors if I try to use if and sym is not defined. >> I tried mucking about with the defined? predicate, but got confused by the >> docs. If anyone can tell me how I can easily add to the above the >> following, that would be lovely: >> >> - if sym not defined in proc-env, define sym to val >> >> iain >> >> _______________________________________________ > Cmdist mailing list > Cmdist at ccrma.stanford.edu > https://cm-mail.stanford.edu/mailman/listinfo/cmdist > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bil at ccrma.Stanford.EDU Sun Feb 7 07:11:08 2021 From: bil at ccrma.Stanford.EDU (bil at ccrma.Stanford.EDU) Date: Sun, 07 Feb 2021 07:11:08 -0800 Subject: [CM] =?utf-8?q?something_like_let-set!_for_undefined_vars=3F?= In-Reply-To: References: Message-ID: <0a65add71e47aa1309b042d25811db9c@ccrma.stanford.edu> Another possibility: (let init-loop ((args init-args)) (unless (null? args) ((if (defined? (car args) env) let-set! varlet) env (car args) (cadr args)) (init-loop (cddr args))))) varlet adds a new binding to the let even if one already exists for the symbol (shadowing the old one). From iainduncanlists at gmail.com Sun Feb 7 08:28:10 2021 From: iainduncanlists at gmail.com (Iain Duncan) Date: Sun, 7 Feb 2021 08:28:10 -0800 Subject: [CM] something like let-set! for undefined vars? In-Reply-To: <0a65add71e47aa1309b042d25811db9c@ccrma.stanford.edu> References: <0a65add71e47aa1309b042d25811db9c@ccrma.stanford.edu> Message-ID: Thanks Bill, I shall use your example! I'm loving the environment flexibility. I got so excited making my algorithmic process object hierarchy I went and ordered "The Art of the Meta-object Protocol", haha. I don't think I'll be able to happily use a language that tells me how objects *must* work anymore... :-) iain On Sun, Feb 7, 2021 at 7:11 AM wrote: > Another possibility: > > (let init-loop ((args init-args)) > (unless (null? args) > ((if (defined? (car args) env) let-set! varlet) env (car args) > (cadr args)) > (init-loop (cddr args))))) > > varlet adds a new binding to the let even if one already > exists for the symbol (shadowing the old one). > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From j_hearon at hotmail.com Sun Feb 7 11:52:59 2021 From: j_hearon at hotmail.com (James Hearon) Date: Sun, 7 Feb 2021 19:52:59 +0000 Subject: [CM] make-polyshape In-Reply-To: References: Message-ID: Hi, re: make-polyshape Very cool. At least three ways to get the coeffs parameter working. I don't why I couldn't figure that out earlier. Thanks JIm (with-sound () (let ((gen (make-polyshape 400.0 :coeffs (float-vector -1.0 -5.0 18.0 8.0 -48.0 0.0 32.0) ))) (do ((i 0 (+ i 1))) ((= i 88200)) (outa i (* .5 (polyshape gen 0.25)))))) (with-sound () (let ((gen (make-polyshape 400.0 :coeffs #r(-1.0 -5.0 18.0 8.0 -48.0 0.0 32.0) ))) (do ((i 0 (+ i 1))) ((= i 88200)) (outa i (* .5 (polyshape gen 0.25)))))) (with-sound () (let ((gen (make-polyshape 400.0 :coeffs (partials->polynomial '(1 1 3 2 6 1) mus-chebyshev-second-kind)))) (do ((i 0 (+ i 1))) ((= i 88200)) (outa i (* .5 (polyshape gen 0.25)))))) ________________________________ -------------- next part -------------- An HTML attachment was scrubbed... URL: From treegestalt at gmail.com Fri Feb 12 06:53:44 2021 From: treegestalt at gmail.com (Forrest Curo) Date: Fri, 12 Feb 2021 06:53:44 -0800 Subject: [CM] to use musx in realtime? Message-ID: I'm looking for ways to do this on my own system. Has anyone else gotten started in this direction? What's needed to put the output of a generator into notes directly to a midi out port? -------------- next part -------------- An HTML attachment was scrubbed... URL: From iainduncanlists at gmail.com Fri Feb 12 12:31:04 2021 From: iainduncanlists at gmail.com (Iain Duncan) Date: Fri, 12 Feb 2021 12:31:04 -0800 Subject: [CM] Notes From the Metalevel, ebook? future of? Message-ID: Hi Rick, and anyone else who might know, do you know if there is a legally and currently available e-book version of "Notes From the Metalevel"? Or if there is likely to be one in the future? I would like to recommend it as a learning resource for Scheme For Max, but I see it's no longer available in print. Any info on future availability would be great! thanks iain -------------- next part -------------- An HTML attachment was scrubbed... URL: From iainduncanlists at gmail.com Sat Feb 13 17:03:22 2021 From: iainduncanlists at gmail.com (Iain Duncan) Date: Sat, 13 Feb 2021 17:03:22 -0800 Subject: [CM] Object systems in S7? (CLOS, MOPs, etc) Message-ID: Hi everyone, I've been mucking around with various strategies for inheritance/delegation of some of my temporal-recursive players and have come to the conclusion that I should spend some time reading prior art before going further... . Elegant dispatch is tricky. :-) So, I'm wondering if anyone on the list has tried any of the CLOS or metaobject protocol related projects out on S7? As in TinyCLOS, or Meroon, etc? Or alternately, if you think there is something else I should be looking at instead? thanks! iain -------------- next part -------------- An HTML attachment was scrubbed... URL: From bil at ccrma.Stanford.EDU Sun Feb 14 02:33:08 2021 From: bil at ccrma.Stanford.EDU (bil at ccrma.Stanford.EDU) Date: Sun, 14 Feb 2021 02:33:08 -0800 Subject: [CM] =?utf-8?q?Object_systems_in_S7=3F_=28CLOS=2C_MOPs=2C_etc=29?= In-Reply-To: References: Message-ID: <2fd2e97a15869679a41e8f0e91d26223@ccrma.stanford.edu> stuff.scm has define-class and friends with some examples in s7test.scm. It has some similarities to CLOS. From iainduncanlists at gmail.com Sun Feb 14 08:17:28 2021 From: iainduncanlists at gmail.com (Iain Duncan) Date: Sun, 14 Feb 2021 08:17:28 -0800 Subject: [CM] Object systems in S7? (CLOS, MOPs, etc) In-Reply-To: <2fd2e97a15869679a41e8f0e91d26223@ccrma.stanford.edu> References: <2fd2e97a15869679a41e8f0e91d26223@ccrma.stanford.edu> Message-ID: Oh great, I hadn'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) iain On Sun, Feb 14, 2021 at 2:33 AM wrote: > stuff.scm has define-class and friends with some examples > in s7test.scm. It has some similarities to CLOS. > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bil at ccrma.Stanford.EDU Sun Feb 14 09:41:13 2021 From: bil at ccrma.Stanford.EDU (bil at ccrma.Stanford.EDU) Date: Sun, 14 Feb 2021 09:41:13 -0800 Subject: [CM] =?utf-8?q?Object_systems_in_S7=3F_=28CLOS=2C_MOPs=2C_etc=29?= In-Reply-To: References: <2fd2e97a15869679a41e8f0e91d26223@ccrma.stanford.edu> Message-ID: <0b4f2d7051e7ea90b292b8be3cb60ef8@ccrma.stanford.edu> I wrote that about a decade ago, but as far as I can remember, I just wrote it from scratch. I used CLOS (in cmn) back in the early 90's, so I had some idea what I wanted. From iainduncanlists at gmail.com Sun Feb 14 09:47:22 2021 From: iainduncanlists at gmail.com (Iain Duncan) Date: Sun, 14 Feb 2021 09:47:22 -0800 Subject: [CM] Nice resource for folks wanting to learn S7 Message-ID: Hi Bill and others, I just thought I'd share a neat finding. I'm preparing some resources for new programmers to learn Scheme for Max, and Matt Wright from CCRMA pointed me the book he did with Brian Harvey, "Simply Scheme". As it turns out, the prelude needed to use the book works fine on S7 with no alterations, and also exists for running on Dr Racket over R5RS. The book is very beginner friendly, and available free. I've worked through the first 9 chapters to test the examples so far, and all work without issue on Scheme for Max, with the exception of things that use read-line (which work on Dr Racket) So I'll be making a video/webpage suggesting it as a good way for new programmers to learn. Book here: https://people.eecs.berkeley.edu/~bh/ss-toc2.html Just thought I'd share the info! iain -------------- next part -------------- An HTML attachment was scrubbed... URL: From iainduncanlists at gmail.com Sun Feb 14 09:43:24 2021 From: iainduncanlists at gmail.com (Iain Duncan) Date: Sun, 14 Feb 2021 09:43:24 -0800 Subject: [CM] Object systems in S7? (CLOS, MOPs, etc) In-Reply-To: <0b4f2d7051e7ea90b292b8be3cb60ef8@ccrma.stanford.edu> References: <2fd2e97a15869679a41e8f0e91d26223@ccrma.stanford.edu> <0b4f2d7051e7ea90b292b8be3cb60ef8@ccrma.stanford.edu> Message-ID: Thanks for the background Bil, I'll check it out. Got my copy of the Art of the Metaobject Protocol now, so between you're code, SiCP, and that, I ought to be able to get something good working! :-) iain On Sun, Feb 14, 2021 at 9:41 AM wrote: > I wrote that about a decade ago, but as far as I can > remember, I just wrote it from scratch. I used CLOS > (in cmn) back in the early 90's, so I had some idea > what I wanted. > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From taube at illinois.edu Sun Feb 14 10:07:57 2021 From: taube at illinois.edu (Taube, Heinrich K) Date: Sun, 14 Feb 2021 18:07:57 +0000 Subject: [CM] Object systems in S7? (CLOS, MOPs, etc) In-Reply-To: References: <2fd2e97a15869679a41e8f0e91d26223@ccrma.stanford.edu> Message-ID: <17164F3D-FD00-4EBA-A15A-16DBDC53A08D@illinois.edu> 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. C Side... pattern_tag = s7_make_c_type(s7, ""); s7_define_function(s7, "make-pattern", ffi_make_pattern, 14, 0, false, "pattern constructor?); [...] Scheme Side... (define-record pattern flags data length datum period value state repeat returning counting traversing next mapr cache) (define (%alloc-pattern) ;; flags data length datum period value state limit returning counting traversing next mapr cache (make-pattern 0 (list) #f +nad+ #f +nad+ +nad+ most-positive-fixnum #f #:periods #:depth-first #f #f #f)) (define (initialize-pattern obj data for rep flags len dper getr mapr) (pattern-data-set! obj data) (pattern-length-set! obj len) (pattern-mapr-set! obj mapr) (pattern-next-set! obj getr) ;; map data to see if it is constant data or has subpatterns (let ((con? #t)) (map-pattern-data (lambda (x) (if (pattern? x) (set! con? #f))) obj) (if con? (set! flags (logior flags +constant-data+)))) [...] ) [...] (define (make-cycle data . args) (unless (pair? data) (set! data (list data))) (with-optkeys (args for limit) (let ((obj (%alloc-pattern)) (flags 0) (len (length data))) (initialize-pattern obj (cons data data) for limit flags len len next-in-cycle (lambda (fn obj) (for-each fn (car (pattern-data obj))))) obj))) [...] On Feb 14, 2021, at 10:17 AM, Iain Duncan > wrote: Oh great, I hadn'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) iain On Sun, Feb 14, 2021 at 2:33 AM > wrote: stuff.scm has define-class and friends with some examples in s7test.scm. It has some similarities to CLOS. _______________________________________________ Cmdist mailing list Cmdist at ccrma.stanford.edu https://urldefense.com/v3/__https://cm-mail.stanford.edu/mailman/listinfo/cmdist__;!!DZ3fjg!vlx95wjWmKfGndRV-oOKnf1WnD1TzGmD7FIKM6HTtoIAyd5rLoZ3G8sO8ulQhA$ -------------- next part -------------- An HTML attachment was scrubbed... URL: From taube at illinois.edu Sun Feb 14 10:11:11 2021 From: taube at illinois.edu (Taube, Heinrich K) Date: Sun, 14 Feb 2021 18:11:11 +0000 Subject: [CM] Notes From the Metalevel, ebook? future of? In-Reply-To: References: Message-ID: <89B9B91A-67EF-4F23-89DB-D9C46B1430DB@illinois.edu> Sorry There is no ebook version of the text. I am certainly willing to release the book but I would have to get the permission of the publisher. > On Feb 12, 2021, at 2:31 PM, Iain Duncan wrote: > > Hi Rick, and anyone else who might know, do you know if there is a legally and currently available e-book version of "Notes From the Metalevel"? Or if there is likely to be one in the future? I would like to recommend it as a learning resource for Scheme For Max, but I see it's no longer available in print. Any info on future availability would be great! > > thanks > iain From iainduncanlists at gmail.com Sun Feb 14 11:31:57 2021 From: iainduncanlists at gmail.com (Iain Duncan) Date: Sun, 14 Feb 2021 11:31:57 -0800 Subject: [CM] Notes From the Metalevel, ebook? future of? In-Reply-To: <89B9B91A-67EF-4F23-89DB-D9C46B1430DB@illinois.edu> References: <89B9B91A-67EF-4F23-89DB-D9C46B1430DB@illinois.edu> Message-ID: Hi RIck, I think it would be hugely helpful for Scheme for Max if you were able to do that (release the book), though of course I understand that the publisher has the final call there. Most of what is in there is directly applicable to Scheme For Max, and it's really well written. iain On Sun, Feb 14, 2021 at 10:11 AM Taube, Heinrich K wrote: > Sorry There is no ebook version of the text. I am certainly willing to > release the book but I would have to get the permission of the publisher. > > > On Feb 12, 2021, at 2:31 PM, Iain Duncan > wrote: > > > > Hi Rick, and anyone else who might know, do you know if there is a > legally and currently available e-book version of "Notes From the > Metalevel"? Or if there is likely to be one in the future? I would like to > recommend it as a learning resource for Scheme For Max, but I see it's no > longer available in print. Any info on future availability would be great! > > > > thanks > > iain > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From iainduncanlists at gmail.com Sun Feb 14 11:38:17 2021 From: iainduncanlists at gmail.com (Iain Duncan) Date: Sun, 14 Feb 2021 11:38:17 -0800 Subject: [CM] Object systems in S7? (CLOS, MOPs, etc) In-Reply-To: <17164F3D-FD00-4EBA-A15A-16DBDC53A08D@illinois.edu> References: <2fd2e97a15869679a41e8f0e91d26223@ccrma.stanford.edu> <17164F3D-FD00-4EBA-A15A-16DBDC53A08D@illinois.edu> Message-ID: 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. :-) On Sun, Feb 14, 2021 at 10:08 AM Taube, Heinrich K wrote: > 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. > > C Side... > > pattern_tag = s7_make_c_type(s7, ""); > > s7_define_function(s7, "make-pattern", ffi_make_pattern, 14, 0, false, "pattern > constructor?); > [...] > > Scheme Side... > > (define-record pattern flags data length datum period value state > repeat returning counting traversing next mapr cache) > > > (define (%alloc-pattern) > ;; flags data length datum period value state limit returning counting > traversing next mapr cache > (make-pattern 0 (list) #f +nad+ #f +nad+ +nad+ most-positive-fixnum #f > #:periods #:depth-first > #f #f #f)) > > (define (initialize-pattern obj data for rep flags len dper getr mapr) > (pattern-data-set! obj data) > (pattern-length-set! obj len) > (pattern-mapr-set! obj mapr) > (pattern-next-set! obj getr) > ;; map data to see if it is constant data or has subpatterns > (let ((con? #t)) > (map-pattern-data (lambda (x) (if (pattern? x) (set! con? #f))) > obj) > (if con? (set! flags (logior flags +constant-data+)))) > [...] > ) > [...] > (define (make-cycle data . args) > (unless (pair? data) (set! data (list data))) > (with-optkeys (args for limit) > (let ((obj (%alloc-pattern)) > (flags 0) > (len (length data))) > (initialize-pattern obj (cons data data) for limit > flags len len next-in-cycle > (lambda (fn obj) > (for-each fn (car (pattern-data obj))))) > obj))) > > [...] > > > On Feb 14, 2021, at 10:17 AM, Iain Duncan > wrote: > > Oh great, I hadn'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) > > iain > > > > > > On Sun, Feb 14, 2021 at 2:33 AM wrote: > >> stuff.scm has define-class and friends with some examples >> in s7test.scm. It has some similarities to CLOS. >> >> _______________________________________________ > Cmdist mailing list > Cmdist at ccrma.stanford.edu > > https://urldefense.com/v3/__https://cm-mail.stanford.edu/mailman/listinfo/cmdist__;!!DZ3fjg!vlx95wjWmKfGndRV-oOKnf1WnD1TzGmD7FIKM6HTtoIAyd5rLoZ3G8sO8ulQhA$ > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From treegestalt at gmail.com Sun Feb 14 12:48:45 2021 From: treegestalt at gmail.com (Forrest Curo) Date: Sun, 14 Feb 2021 12:48:45 -0800 Subject: [CM] confusing musx results Message-ID: documentation says: >>> [jumble ([1,2,3]) for _ in range(5)] [1, 1, 3, 2, 3] but I'm getting: >>> [musx.jumble([1,2,3,4]) for _ in range(7)] [, , , , , , ] ? -------------- next part -------------- An HTML attachment was scrubbed... URL: From taube at illinois.edu Sun Feb 14 13:36:55 2021 From: taube at illinois.edu (Taube, Heinrich K) Date: Sun, 14 Feb 2021 21:36:55 +0000 Subject: [CM] confusing musx results In-Reply-To: References: Message-ID: yikes that is a documentation error, thanks for finding it! jumble() returns a python generator and so the example needs to use next() to read values from the generator: % python3.9 >>> from musx import jumble >>> x = jumble([1,2,3]) >>> [next(x) for _ in range(5)] [3, 2, 1, 2, 1] i will release a new version in the next day or two. On Feb 14, 2021, at 2:48 PM, Forrest Curo > wrote: documentation says: >>> [jumble([1,2,3]) for _ in range(5)] [1, 1, 3, 2, 3] but I'm getting: >>> [musx.jumble([1,2,3,4]) for _ in range(7)] [, , , , , , ] ? _______________________________________________ Cmdist mailing list Cmdist at ccrma.stanford.edu https://urldefense.com/v3/__https://cm-mail.stanford.edu/mailman/listinfo/cmdist__;!!DZ3fjg!r_XLOy0Q_kK-SX2m4TbaaasUtzVByuEg8n01o7XptHli-jvQsIe6iD8etLI6DA$ -------------- next part -------------- An HTML attachment was scrubbed... URL: From dbrooks at runforyourlife.org Sun Feb 14 18:09:46 2021 From: dbrooks at runforyourlife.org (Dudley Brooks) Date: Sun, 14 Feb 2021 18:09:46 -0800 Subject: [CM] Nice resource for folks wanting to learn S7 In-Reply-To: References: Message-ID: <13406a8f-b436-e594-bce0-3a51885e1346@runforyourlife.org> On 2/14/21 9:47 AM, Iain Duncan wrote: > Hi Bill and others, I just thought I'd share?a neat finding. I'm > preparing some resources for new programmers to learn Scheme for Max, > and Matt Wright from CCRMA pointed me the book he did with Brian > Harvey, "Simply Scheme". I took the introductory CS class for CS majors at UC Berkeley in 1989 from Brian Harvey.? At that time the class used Scheme, and Abelson and Sussman's excellent book "Structure and Interpretation of Computer Programs".? (The class is now taught in Python, last I heard.)? At that time the class was very unusual -- I think something like it was found only at Cal, Stanford, MIT, and Illinois.? I heard that it was so unusual that if you transferred into Cal's CS department you had to take it ... even if you were in grad school.? On the first day Brian Harvey said "This is probably the most interesting CS class you will ever take" ... and it was definitely extremely interesting. And Brian Harvey was one of the two best teachers I ever had in my entire academic career.? A model teacher!? So I'll bet that his book is excellent. > As it turns out, the prelude needed to use the book works fine on S7 > with no alterations, and also exists for running on Dr Racket?over > R5RS. The book is very beginner friendly, and available free. I've > worked through the first 9 chapters to test the examples so far, and > all work without issue on Scheme for Max, with the exception of things > that use read-line (which work on Dr Racket) So I'll be making a > video/webpage suggesting it as a good way for new programmers to learn. > > Book here: > https://people.eecs.berkeley.edu/~bh/ss-toc2.html > > Just thought I'd share the info! > iain > > _______________________________________________ > Cmdist mailing list > Cmdist at ccrma.stanford.edu > https://cm-mail.stanford.edu/mailman/listinfo/cmdist -------------- next part -------------- An HTML attachment was scrubbed... URL: From elronnd at elronnd.net Sun Feb 28 22:11:56 2021 From: elronnd at elronnd.net (Elijah Stone) Date: Sun, 28 Feb 2021 22:11:56 -0800 (PST) Subject: [CM] Untrusted code in s7 scheme Message-ID: Is there any allowance for running untrusted code under s7? I've disabled WITH_SYSTEM_EXTRAS and WITH_C_LOADER; is there anything else to watch out for? And, is there any way to limit the execution time of evaluations? (This bit is not quite so important, since it can be faked, but would be nice to have something that works OOTB.) -E