Anthony Carrico | 7 Jul 04:04 2015

stops in Macros that Work Together

I've been working through Macros that Work Together (on my way to
working through Sets-of-Scopes). I've come across something that is
slightly unclear to me in the section on local-expand:

  E ::= a mapping from name to transform

I don't believe that E is a stack (right?). If it isn't, then in
jfp12-draft2-fcdf.pdf page 26:

  nostops[E]={var->transform | E(var) = transform and transform != Stop}

  Estops = nostops[E]+{resolve[idstop]->Stop} ...

This will clear out the stops of the outer macro and then install the
stops of the inner macro. My concern is that nostops does nothing to
reinstall the original transformers of the cleared stops. Shouldn't it?

-- 
Anthony Carrico

--

-- 
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+unsubscribe@...
For more options, visit https://groups.google.com/d/optout.
Alexander D. Knauth | 7 Jul 03:50 2015

How to specify fallbacks for generic interfaces without going into an infinite loop?

What is the proper way to do this?

This goes into an infinite loop:

#lang racket/base

(require racket/generic)

(define-generics foo
  (a foo) (b foo) (c foo)
  #:fallbacks
  [(define (a foo)
     (displayln "a-fallback")
     (b foo))
   (define (b foo)
     (displayln "b-fallback")
     (a foo))])

(struct foo-struct ()
  #:methods gen:foo
  [(define (a foo) 1)])

(b (foo-struct))

--

-- 
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+unsubscribe@...
For more options, visit https://groups.google.com/d/optout.

(Continue reading)

P J Moy | 7 Jul 01:22 2015
Picon

F1 question

Hello. In DrRacket, whenever I place the cursor on a keyword and press F1, the W8.1 help screen/system comes
up (with absolutely useless Windows documentation.) (I've searched for an hlp file, and nothing.

Any ideas on what is wrong? Any help would be appreciated. Tx.

--

-- 
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+unsubscribe@...
For more options, visit https://groups.google.com/d/optout.
Russ Abbott | 6 Jul 23:50 2015
Picon

Directory not accessible

I installed Racket in a directory for which I have access. Yet when I attempted to run the example code on the
Racket Home page:

(for ([path (in-directory)]
      #:when (regexp-match? #rx"[.]rkt$" path))
  (printf "source file: ~a\n" path))

I got this error message.

Racket\collects\racket\private\for.rkt:1973:2: directory-list: could not open directory
  path: C:\Users\facuser\AppData\Local\Application Data
  system error: Access is denied.; errno=5

I have access to everything on the path except Application Data.

How can I get this to run?  

If special permissions are needed, why is this example shown so prominently?

Thanks.

--

-- 
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+unsubscribe@...
For more options, visit https://groups.google.com/d/optout.
John Carmack | 6 Jul 16:56 2015

API design 2 -- variadic styles

A primary goal of the scripting work is that it should be easy to do easy things.  You shouldn’t have to specify all the options if you just want to play a sound or show a picture, but you should still be able to get at them when you need them.

 

For the case of a sound effect, all of the following data may be specified:

 

Wav file – URI to a .wav file with audio samples.

Volume – Scale factor for the wav samples.

Position – 3D point for HRTF spatialized audio processing.

Looping – Flag to cause the wav file to loop continuously.

Name – An identifier to allow the parameters on a playing sound to be updated later.

Time – Absolute time for the sound to start, necessary for synced background audio in drop-in multiplayer servers and glitch free transitioning between wav files.

 

There are four broad strategies for exposing all that.

 

Multiple functions for different sets of parameters:

(+sound wav-string)

(+sound-positioned Wav-string position-vec3)

(+named-sound wav-string position-vec3 sound-name)

(+sound-update sound-name new-position-vec3)

 

This has a combinatorial explosion problem.

 

Optional parameter count with implicit type by position, C++ style:

(+sound wav-string position-vec3 name-int volume-float looping-bool time-float)

 

Need to define special values for parameters that are essentially skipped – POSITION_NONE, NAME_NONE, etc, since it is possible to want to set later values without all the preceding ones.  Not very self-documenting, and not feasible for large numbers of options like GPU state.

 

Keyword delimited parameters, command line parsing style:

(+sound ‘wav wav-string ‘position position-vec3 ‘name name-int ‘volume volume-float ‘looping looping-bool ‘time time-float)

 

A typo in an option symbol name will not be detected at compile time if done as a function, but I guess that is a good argument for a macro.

 

Option functions:

(+sound (opt-wav wav-string) (opt-position position-vec3) (opt-name name-int) (opt-volume volume-float) (opt-looping looping-bool) (opt-time time-float))

 

Simple to do transformations or validation on the inputs, but the most verbose.

Bad option names will be detected at compile time, but you could still compile, say, graphics options into a sound command, which would have been detected with the keyword delimited parameters.

 

In some cases, parameters can be inferred by type.  For sounds, a parameter that is a string is the wav, a float is the volume, a bool is looping, a vec3 is position, an int is name.  That is sheer luck – other commands would very likely have multiple parameters with common types, and even here there would be an ambiguity with time.  Still, it would be possible to go type-system-happy and explicitly have types for everything.  I suppose that would syntactically degenerate to option functions.

 

It is tempting to use flags that are just signaled by their presence – just add ‘looping instead of ‘looping #t or (looping #t), but that can be awkward when the state of a flag is programmatically evaluated.

 

Currently I am using a hybrid form, where the first parameter is an implicit type (and second parameter for gfx commands), and all following parameters are evaluated and appended as options.

--
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+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
For more options, visit https://groups.google.com/d/optout.

Emmanuel Oga | 6 Jul 05:05 2015
Picon

Two issues in Racket 6.11/6.2 Win64: can't reindent, notepad used for opening html pages

Hi,

I'm having two issues in Racket 6.11 and 6.2, Win64:

1) I can't re-indent:

* The Tab key over a highlighted selection doesn't work.
* Ctrl-I or menu Racket > Re-indent All does nothing, with and without code being selected
* I manually broke the indentation in hideous ways to make sure the auto-indenter should do something :-)

2) Any time I open something that is implemented as HTML, Notepad is used to show me the page (e.g. if I go to
Help > Racket Documentation).

I can't find a way to change the browser, to select, say, Chromium instead of Firefox.

Thanks!

--

-- 
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+unsubscribe@...
For more options, visit https://groups.google.com/d/optout.
Matthew Butterick | 6 Jul 01:51 2015

how to add file types to `raco test`?

`raco test` will automatically test every .rkt and .scrbl file in a directory. Suppose I make `#lang foo` and thus many of my test files end with .foo. I would want all .foo files to be automatically tested as well. Is there a way to use "info.rkt" to tell `raco test` to add file types? (Should there be?) 

Of course the workaround is just to make a .rkt file that runs the files, but it seems like "info.rkt" is the better place (inasmuch as this op is the inverse of `test-omit-paths`)

--
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+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
For more options, visit https://groups.google.com/d/optout.
Neil Van Dyke | 4 Jul 23:26 2015
Picon

garbage collection

Any plans for new interesting GC/memory features in Racket?

For example, being able to inhibit GC for a time, being able to adjust 
the GC trigger parameters dynamically, different ways to minimize GC 
pauses or slowdown in the app behavior, real-time constraints on GC, 
special support to help programmers avoid/reduce garbage generation, etc.?

Neil V.

--

-- 
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+unsubscribe@...
For more options, visit https://groups.google.com/d/optout.

Neil Van Dyke | 4 Jul 23:17 2015
Picon

SteamOS / Steam Machine

Just out of curiosity, anyone planning to use Racket somehow work on 
SteamOS, that you can say?

(I'm idly toying with a moonlighting indie game idea that initially 
would target Steam Machines, because it needs monetization and 
console-type controllers, Valve seems like a good company to work with, 
SteamOS isn't saturated with top games like the current consoles and 
Windows, and the capital investment would be small enough that SteamOS 
revenue alone might be fine.  That's just a 5-second impression, biased 
by wanting a Valve console to work; I haven't done the financial due 
diligence yet.  The action part of the game would be twitchy fast 3D 
online multiplayer, so I don't know how much Racket could be used at run 
time for this kind of game, but maybe a winning opportunity would come 
up, like for the non-action game modes, or for end user extensibility.)

Neil V.

--

-- 
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+unsubscribe@...
For more options, visit https://groups.google.com/d/optout.

marcio esper | 4 Jul 00:30 2015
Picon

questions about racket [new user]

Hello,

I am new here. using racket a very short time.

I install racket on linux mint 17 64bit, I was using it on windows 7 The deb package work fine, more fast than in
windows. very good version.

When I create a executable on linux, it create a tgz archive with the bin and libs inside.

In windows, its ok, it create a exe with the dll, to use is like any win program.
My question is regarding a linux use of the programs.
The package, for spread it with others users, how will be the procedure to user of archive in a machine with
linux without racket? just unpack the archive in home ?

It will work in androide too?

Question 2.

You have plans to port racket to AmigaOS 4.x too?
Thank you for attention.

Best Regards,

--

-- 
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+unsubscribe@...
For more options, visit https://groups.google.com/d/optout.
mazert | 3 Jul 22:06 2015
Picon

variadic function who use parameters from a mother variadic function

Hello,

To directly go to the essential : here is an example :

(define (foo . L)
   (let ([bar (string-join (build-list (length L) (λ (x) "~a")) "")])
     (format bar (apply values L))))

Globally, I want to use a function who has variable parameters within a 
function who has variable parameters too.

It is possible ?
Thanks in advance.

--

-- 
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+unsubscribe@...
For more options, visit https://groups.google.com/d/optout.


Gmane