1. +1 on Neil's +sound and +set-position convention (as a private Racket 
citizen not the style guide author)

2. When I find myself writing such code now, I often write a syntactic 
extension that gives me some flexibility in how I want to do it: 

(commands 
 (sound ...)
 (set-position ...) 
 ...)

which I can then expand to 

(let* ([L '()]
       [L (cons (sounds L ...) ...)] ;; <-- if L is needed for context (you say 
it isn't)
       [L (cons ...)]
       ...)
  L) ;; or (send-to some-address L)

Alternatively I use the obvious set! expansion. 

Either way hygienic expansion ensures that L isn't accidentally accessible, 
only to commands that need it (or none). 

-- Matthias










On Jul 3, 2015, at 12:32 PM, John Carmack <jo...@oculus.com> wrote:

> I am using a “cmd-name!” naming format for functions that are adding to the 
> command list that will be communicated to the host program.
>  
> (cmd-sound! WAV-FILE)
> (cmd-set-position! pos yaw-radians)
> Etc.
>  
> I am considering using a terser naming convention, perhaps “@name”, so you 
> would have:
> (@sound WAV-FILE)
> (@set-position pos yaw-radians)
> Etc.
>  
> I would argue that while they do mutate global state by sticking something on 
> a list, the list is never looked at except at the very end of the frame to 
> hand it over to the host system, so they are more like a display / log 
> function that a global state hazard, and having a syntax cue for functions 
> that are going to impact the sensory presentation may be useful.
>  
> Thoughts?  What symbols have the least historic baggage?
>  
>  
>  
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to racket-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to