Re: [racket-users] What do you use macros for?

2016-04-06 Thread Rickard Andersson
> What have you used them for? While it's certainly not the most impactful macro in the world, I was pretty pleased with being able to do this: https://github.com/GoNZooo/gonz/blob/master/gonz/define-test.rkt It's a macro that allows me to bundle expected inputs with expected outputs for those i

[racket-users] quoting in posts to this email list

2016-04-06 Thread Neil Van Dyke
I suggest that people posting replies to posts on this email list try to *minimize* quoting of the previous post(s). A sufficiently good discussion of this is at: https://en.wikipedia.org/wiki/Posting_style#Trimming_and_reformatting Neil V. -- You received this message because you are subscr

Re: [racket-users] What do you use macros for?

2016-04-06 Thread David Storrs
Nice. Thank you, Asumu. That helps. On Wed, Apr 6, 2016 at 5:39 PM, Asumu Takikawa wrote: > Hi David, > > On 2016-04-06 17:19:05 -0700, David Storrs wrote: > >Macros are one of the biggest features that people list as the > advantages > >of LISP / Scheme, and I don't really understand

Re: [racket-users] macros within expressions.

2016-04-06 Thread Alex Knauth
> On Apr 6, 2016, at 8:29 PM, Matthew Butterick wrote: > So you can repair your macro by matching to `y-coord` as a pattern: > > ;;; > > #lang racket > (require rackunit) > > (define-syntax y-coord > (syntax-id-rules () > [y-coord point-y])) > > (struct point (x y)) > (defi

Re: [racket-users] What do you use macros for?

2016-04-06 Thread Asumu Takikawa
Hi David, On 2016-04-06 17:19:05 -0700, David Storrs wrote: >Macros are one of the biggest features that people list as the advantages >of LISP / Scheme, and I don't really understand them.  I get the basics -- >they can create new code structures -- but not the implications  What have

Re: [racket-users] macros within expressions.

2016-04-06 Thread Matthew Butterick
> Expanding `y-coord` by itself leads to the error. I've tripped over this, so just to elaborate slightly. `syntax-id-rules` will work, but your current macro: ;;; (define-syntax y-coord (syntax-id-rules (map) [(map y-coord lst) (map (lambda (p) (

[racket-users] 2d animations with 2k+ polygons?

2016-04-06 Thread 'John Clements' via Racket Users
I’m trying to create a simple fixed animation with about 2k polygons moving on a simple background. Not surprisingly, things start to slow down pretty badly once I’m animating 2k polygons at a time, even when every one of these polygons is (freeze (rectangle 5 5 ‘solid ‘blue)). My question is th

[racket-users] What do you use macros for?

2016-04-06 Thread David Storrs
Hi folks, Macros are one of the biggest features that people list as the advantages of LISP / Scheme, and I don't really understand them. I get the basics -- they can create new code structures -- but not the implications What have you used them for, and what do they do that a function couldn't?

Re: [racket-users] mode-lambda example doesn't work?

2016-04-06 Thread 'John Clements' via users-redirect
> On Apr 6, 2016, at 2:43 AM, Jay McCarthy wrote: > > Hi John, > > I'd like to debug the glClear error with you. I'll have to look up the error > to figure out where to go on it though, so I'll get back to you. > > However, the screen you see is expected. The demo has a few modes and the > d

Re: [racket-users] Playing sound

2016-04-06 Thread 'John Clements' via Racket Users
> On Apr 6, 2016, at 4:31 PM, Jordan Johnson wrote: > > On Apr 6, 2016, at 15:18, John Clements wrote: >> 1) The “stop” procedure is a giant end-of-the-world hammer; I wouldn’t >> expect it to be useful while a program is running. > > OK. It had that feel. > >> 2) I hesitate to suggest this,

Re: [racket-users] Playing sound

2016-04-06 Thread Jordan Johnson
On Apr 6, 2016, at 15:18, John Clements wrote: > 1) The “stop” procedure is a giant end-of-the-world hammer; I wouldn’t expect > it to be useful while a program is running. OK. It had that feel. > 2) I hesitate to suggest this, but there is a “pstream-set-volume!” function > that can silence a

Re: [racket-users] Playing sound

2016-04-06 Thread 'John Clements' via Racket Users
> On Apr 6, 2016, at 11:26 AM, Jordan Johnson wrote: > > Hey, so I’m now looking at how to set up background music in rsound with the > ability to switch tracks. Below is the suggestion from John Clements that > seems right: >>> I’m guessing you’re looking for an imperative API that looks some

Re: [racket-users] 6.4 + universe has mouse-based hiccups

2016-04-06 Thread 'John Clements' via Racket Users
> On Apr 6, 2016, at 9:02 AM, Matthew Flatt wrote: > > If the problem happens after DrRacket has been running for a while, > then that's good information and definitely a problem to investigate. I can confirm that (after 3-5 hours of development work) the problem is back. I also shortened the

Re: [racket-users] macros within expressions.

2016-04-06 Thread Vincent St-Amour
Adding `(define y-coord points-y)` should make the original example work as-is. Vincent On Wed, 06 Apr 2016 15:45:56 -0500, Daniel Prager wrote: > > (map point-y points) gives the expected result without recourse to a > macro. > > Or is y-coord intended as a simplified example of something els

Re: FW: [racket-users] macros within expressions.

2016-04-06 Thread Benjamin Greenman
This is "bad syntax" for the same reason that `(map or '())` is "bad syntax". When the macro expander sees `(map y-coord points)`, it recognizes `map` as a variable binding and then tries expanding each argument to `map`. Expanding `y-coord` by itself leads to the error. You could instead define `

FW: [racket-users] macros within expressions.

2016-04-06 Thread Jos Koot
Oops, forgot to include the users list. _ From: Jos Koot [mailto:jos.k...@gmail.com] Sent: miércoles, 06 de abril de 2016 23:03 To: 'Richard Adler' Subject: RE: [racket-users] macros within expressions. You don't need a macro here. Why not simply: (map point-y points) May be your ex

Re: [racket-users] macros within expressions.

2016-04-06 Thread Daniel Prager
(map point-y points) gives the expected result without recourse to a macro. Or is y-coord intended as a simplified example of something else? Dan -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving

[racket-users] macros within expressions.

2016-04-06 Thread 'Richard Adler' via Racket Users
I am trying to use a macro, y-coord, in the following way: (struct point (x y)) (define points (list (point 25 25) (point 33 54) (point 10 120)) (map y-coord points) I am expecting the result: '(25 54 120) and the error is "y-coord: bad syntax in: y-coord Here is the macro: (define-syntax y-c

Re: [racket-users] Playing sound

2016-04-06 Thread Jordan Johnson
Hey, so I’m now looking at how to set up background music in rsound with the ability to switch tracks. Below is the suggestion from John Clements that seems right: >> I’m guessing you’re looking for an imperative API that looks something like >> this: >> >> (start-playing! stream sound at-time

Re: [racket-users] Case and eof

2016-04-06 Thread Jay McCarthy
You would want (== eof), because 'eof' is just an identifier, so you're binding x to eof. Jay On Wed, Apr 6, 2016 at 12:05 PM, rom cgb wrote: > On Monday, April 4, 2016 at 10:44:46 PM UTC+2, Alex Knauth wrote: >> I'm convinced that implicit quotes are the root of almost all evil in lisp >> prog

Re: [racket-users] Case and eof

2016-04-06 Thread rom cgb
On Monday, April 4, 2016 at 10:44:46 PM UTC+2, Alex Knauth wrote: > I'm convinced that implicit quotes are the root of almost all evil in lisp > programming languages. That's a big reason why I like the teaching languages > better in terms of things making sense. > > It's also why I normally use

Re: [racket-users] 6.4 + universe has mouse-based hiccups

2016-04-06 Thread Matthew Flatt
At Wed, 06 Apr 2016 11:56:51 -0400, "John Clements" wrote: > > > On Apr 6, 2016, at 7:35 AM, Matthew Flatt wrote: > > > > I haven't been able to replicate the problem, so far, even though my > > machine and installation is similar to yours. > > > > Do you have a Racket installation on a differe

Re: [racket-users] 6.4 + universe has mouse-based hiccups

2016-04-06 Thread 'John Clements' via Racket Users
> On Apr 6, 2016, at 7:35 AM, Matthew Flatt wrote: > > I haven't been able to replicate the problem, so far, even though my > machine and installation is similar to yours. > > Do you have a Racket installation on a different machine that you can > check? Whatever the problem is, my guess is tha

Re: [racket-users] drracket / postgresql error when opening connection for syntax

2016-04-06 Thread Matthew Flatt
I think `(system-type 'machine)` should use the root security guard when trying to start "/bin/uname". I'll make that change unless someone sees a problem with it. At Wed, 6 Apr 2016 17:08:00 +0200, Sam Tobin-Hochstadt wrote: > If you're getting the error in the status line, but not when you hit >

Re: [racket-users] drracket / postgresql error when opening connection for syntax

2016-04-06 Thread Tim Brown
Sensible. Thanks all. Tim On 06/04/16 16:08, Sam Tobin-Hochstadt wrote: > If you're getting the error in the status line, but not when you hit > the Run button, then it's because background expansion in DrRacket is > run in a sandbox that can't execute programs (among other things). > > Sam >

Re: [racket-users] drracket / postgresql error when opening connection for syntax

2016-04-06 Thread Sam Tobin-Hochstadt
If you're getting the error in the status line, but not when you hit the Run button, then it's because background expansion in DrRacket is run in a sandbox that can't execute programs (among other things). Sam On Wed, Apr 6, 2016 at 5:05 PM, Tim Brown wrote: > Not so quick! :-) > > I’m allowed t

Re: [racket-users] drracket / postgresql error when opening connection for syntax

2016-04-06 Thread Tim Brown
Not so quick! :-) I’m allowed to run /bin/uname (-rwxr-xr-x permissions) So why do I get a permissions error from racket? Tim On 06/04/16 14:43, Ryan Culpepper wrote: > The problem was a use of (system-type 'machine) in racket/unix-socket. > I've pushed a fix. > > Ryan > > > On 04/06/2016 08

Re: [racket-users] drracket / postgresql error when opening connection for syntax

2016-04-06 Thread Tim Brown
Thanks Ryan On 06/04/16 14:43, Ryan Culpepper wrote: > The problem was a use of (system-type 'machine) in racket/unix-socket. > I've pushed a fix. > > Ryan > > > On 04/06/2016 08:06 AM, WarGrey Gyoudmon Ju wrote: >> I met this problem before. >> (system-type 'machine) uses the output of `uname

Re: [racket-users] 6.4 + universe has mouse-based hiccups

2016-04-06 Thread Matthew Flatt
I haven't been able to replicate the problem, so far, even though my machine and installation is similar to yours. Do you have a Racket installation on a different machine that you can check? Whatever the problem is, my guess is that it's specific to OS X (but that's just a guess). Does it matter

Re: [racket-users] drracket / postgresql error when opening connection for syntax

2016-04-06 Thread Ryan Culpepper
The problem was a use of (system-type 'machine) in racket/unix-socket. I've pushed a fix. Ryan On 04/06/2016 08:06 AM, WarGrey Gyoudmon Ju wrote: I met this problem before. (system-type 'machine) uses the output of `uname`. On Wed, Apr 6, 2016 at 5:47 PM, Tim Brown mailto:tim.br...@cityc.co.

Re: [racket-users] drracket / postgresql error when opening connection for syntax

2016-04-06 Thread WarGrey Gyoudmon Ju
I met this problem before. (system-type 'machine) uses the output of `uname`. On Wed, Apr 6, 2016 at 5:47 PM, Tim Brown wrote: > Folks, > > I’m experimenting with creating functions from a PostgreSQL database. > [Frankly, I’m still getting my head around what I _actually_ want to do > here, but.

[racket-users] drracket / postgresql error when opening connection for syntax

2016-04-06 Thread Tim Brown
Folks, I’m experimenting with creating functions from a PostgreSQL database. [Frankly, I’m still getting my head around what I _actually_ want to do here, but...] When I load the following into DrRacket: ;; - #lang racket/base (require (for-syntax db racket/ba

Re: [racket-users] "table" data structure in Racket

2016-04-06 Thread Konrad Hinsen
On 05/04/2016 21:12, Asumu Takikawa wrote: I haven't built anything like that, but I was hoping that we could get a GSoC student for it (that didn't pan out though obviously). The idea was to use packages from Python/Julia/R as inspiration: http://pandas.pydata.org/pandas-docs/stable/index.h

[racket-users] Managed Languages Conference: PPPJ 2016 Call for Papers

2016-04-06 Thread Andrea Rosà
PPPJ '16 13th International Conference on Principles and Practices of Programming on the Java Platform: Virtual Machines, Languages, and Tools August 29 - September 2, 2016 Lugano, Switzerland http://manlang16.inf.usi.ch/pppj In-cooperation with ACM SIGPLAN, SIGSOFT, SIGAPP and SPEC RG PPPJ '1