Jump to content

sockmonkey72

Members
  • Posts

    10
  • Joined

  • Last visited

Everything posted by sockmonkey72

  1. Argh. That's also what I wrote above. De facto, based on the published practice of Opusmodus as provided in the Tutorials and other educational materials, you are recommending using SETF on non-existent names. So what, in your opinion, is supposed to happen in that case? You do it all over the place, it is how you teach newcomers to use Opusmodus: you must have a clear idea of what is expected.
  2. I feel like you're not understanding my question, but I am probably not speaking the correct jargon for hardcore Lisp users, I apologize. In Opusmodus, evaluating (setf place value) creates a global "place" if "place" is undefined. True or false? That is the only explanation I can find for the fact that evaluating (setf pitches (gen-repeat 5 '((c4 cs4 fs4 g4 c5)))) results in the creation of a "pitches" variable which is available in other contexts (files, workspaces). I understand how setting a variable works, and I understand how values are associated with names. But variables (or "places") have scope in every programming language, and my question is about the scope of the automatically created "place" generated by the evaluation of SETF (which occurs if the "place doesn't already exist). Does that makes sense?
  3. Thank you, that all makes sense and corresponds to the documentation I've found in my searches online. The only part confusing me, why I wrote this post, is that `SETF` in Opusmodus is doing more than assigning a value to a designated place: it is creating a designated place (my observation: globally) if one is not yet defined. Lisp apparently provides mechanisms like: (LET (pitches (gen-repeat 5 '((c4 cs4 fs4 g4 c5))) ... ; some stuff ) if I need to control the scope of my variables, it seems. Anyway, I'm just trying to learn OMN and ran into this behavior, and erroneously reported a bug and felt bad, but also curious. So I wanted a definitive explanation before doing too deep down the rabbit hole.
  4. I am asking a general question about how the Opusmodus runtime environment is scoping variables, but if it helps: ;;;-------------------------------------------------------- ;;; Stage 5. List Processing ;;;-------------------------------------------------------- ... (setf pitches (gen-repeat 5 '((c4 cs4 fs4 g4 c5)))) (setf transposed-pitches (pitch-transpose -24 pitches)) (setf lengths (span pitches '(e))) (setf lengths-rests (length-weight lengths :weight '(3 1))) ... My observation is that `pitches`, `transposed-pitches`, `lengths` and `lengths-rests` are now global, once evaluated. If I open an unrelated file, a new file in a new workspace inside of the Opusmodus editor and evaluate: (princ pitches) The contents of the "pitches" variable will be printed, although that variable was evaluated in a different file, in a different workspace. This indicates to me that "setf" is creating a dynamically-scoped (global) variable behind the scenes, which is available to all of Opusmodus all at once. That's fine, of course, but it probably should be documented somewhere. I am coming from a primarily C++ background, some ECMAScript, some Lua, with virtually no Lisp, though, and I was surprised by this scoping behavior. The Common Lisp documentation indicates that calling `setf` without a `let` or a `defvar` is strictly speaking undefined, so if the runtime environment is doing something useful (like creating a global variable), it's important to know that. Because otherwise naive users will reuse variable names and may run into unexpected side effects (and needlessly report bugs as a result )
  5. or maybe another way to ask this question is: what is opmo's `setf` implementation doing behind the scenes? since a direct call to `setf` is the recommended style (no `defvar` or `let`), and since that is undefined in Common Lisp AFAICT, it would be nice to have explicit documentation of how this affects variable scope.
  6. While going through the tutorials, I recently ran into a behavior which surprised me a little bit. Two tutorials in a row used the same variable name, and the initialized value from the old tutorial persisted when I began the new one. Hilarity ensued. Do variables in opusmodus (or in this case, maybe in the underlying lisp VM?) have scope? Is there a way to manage this? I can imagine scenarios where global scope would be attractive or useful, but I was (apparently) expecting some kind of file-local sandbox for variables. Anyway, I am just wondering and didn't find an answer already in the forums... Thanks!
  7. Looks like in previous years there were occasional sales at OpMo. Are there any upcoming?
  8. Seriously? This is a one-man operation doing a major port of the software, not only to support a new hardware architecture, but also, as part of that, to completely swap out the underlying runtime backend. Give the guy a break, his job is hard enough without entitled people badgering him to get it done yesterday and criticizing his very efforts to communicate progress (before that, the criticism was that there wasn't any communication about it). What's "really going on"? Alien abduction? Coup attempt? Let the dev do his work.
×
×
  • Create New...

Important Information

Terms of Use Privacy Policy