Re: [racket-users] with-syntax, format-id, and ellipses

2018-09-28 Thread Dan Liebgold
Perfect, thank you!

On Friday, September 28, 2018 at 12:35:50 PM UTC-7, Jay McCarthy wrote:
>
> The upcoming ~indexed form would make this easier, I think --- 
> https://github.com/racket/racket/pull/2262 
>
> But for now, you'll need to expand it yourself a bit. Line 26 would be 
>
> [constructors 
>  (for/list ([o (in-list (syntax->list #'(fs.o ...)))]) 
>(format-id #'name "create-~a-~a" #'name o))] 
>
> On Fri, Sep 28, 2018 at 2:21 PM, Dan Liebgold  > wrote: 
> > Hi, 
> > 
> > I'm trying to use with-syntax to create a series of new identifiers by 
> > breaking apart syntax and gluing bits together using format-d, but I 
> can't 
> > get the ellipses syntax quite right. 
> > 
> > Here's my code: 
> > 
> >   http://pasterack.org/pastes/81271 
> > 
> > Line 26 contains the issue... I can't get the format-id expression to 
> repeat 
> > properly. 
> > 
> > Thanks for any assistance! 
> > Dan 
> > 
> > -- 
> > 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...@googlegroups.com . 
> > For more options, visit https://groups.google.com/d/optout. 
>
>
>
> -- 
> -=[ Jay McCarthy   http://jeapostrophe.github.io]=- 
> -=[ Associate ProfessorPLT @ CS @ UMass Lowell ]=- 
> -=[ Moses 1:33: And worlds without number have I created; ]=- 
>

-- 
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.


[racket-users] with-syntax, format-id, and ellipses

2018-09-28 Thread Dan Liebgold
Hi, 

I'm trying to use with-syntax to create a series of new identifiers by 
breaking apart syntax and gluing bits together using format-d, but I can't 
get the ellipses syntax quite right.

Here's my code:

  http://pasterack.org/pastes/81271

Line 26 contains the issue... I can't get the format-id expression to 
repeat properly.

Thanks for any assistance!
Dan

-- 
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.


[racket-users] Re: How to improve compile times?

2017-04-28 Thread Dan Liebgold
Is all your code (and the racket distro) on a local SSD? We've found that 
file/network IO during startup and require can certainly impact performance.

-- 
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.


[racket-users] raco test

2017-03-27 Thread Dan Liebgold
Hi, 

I'd like to invoke 'raco test' with additional collection paths passed in via 
the command line.  I'm trying this:  racket.exe -S  -l- raco test , 
but that -S parameter doesn't seem to take effect.

Thanks,
Dan

-- 
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.


[racket-users] getting info from parallel-compile

2017-03-20 Thread Dan Liebgold
Hi -

I have code to precompile a set of files that looks like this:

  http://pasterack.org/pastes/97351

Note in this example the given file doesn't exist.

How can I get better info from the build process?  Is my logging mechanism 
broken? It doesn't ever get any messages back.

And, relatedly, is there a way to get a proper error from the invalid file?

Thanks,
Dan

-- 
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.


Re: [racket-users] minimal vs full racket performance issues

2017-03-16 Thread Dan Liebgold
On Thursday, March 16, 2017 at 3:30:56 PM UTC-7, Sam Tobin-Hochstadt wrote:
> Just installing rackunit-lib will avoid the docs and tests, which should 
> substantially reduce the footprint.
> 

That's a fix for rackunit... I'm also using Jay's awesome job-queue package, 
which pulls in scribble which seems to pull in gui stuff... but it doesn't not 
have a -lib version.

-- 
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.


Re: [racket-users] minimal vs full racket performance issues

2017-03-16 Thread Dan Liebgold
On Thursday, March 16, 2017 at 3:48:34 PM UTC-7, Vincent St-Amour wrote:
> `raco pkg remove rackunit && raco pkg remove --auto` should do it.
> 

"raco pkg remove --auto -i"  did it.

-- 
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.


Re: [racket-users] minimal vs full racket performance issues

2017-03-16 Thread Dan Liebgold
On Thursday, March 16, 2017 at 3:30:56 PM UTC-7, Sam Tobin-Hochstadt wrote:
> Just installing rackunit-lib will avoid the docs and tests, which should 
> substantially reduce the footprint.
> 
> Sam
> 

Very cool now, say I've already gone and installed rackunit. How can I 
remove all those dependant packages it installed? 

-- 
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.


[racket-users] minimal vs full racket performance issues

2017-03-16 Thread Dan Liebgold
Hi -

(This is a continuation of some discussions I've had on the dev list a couple 
years ago.)

We continue to have performance issues stemming from Racket's runtime file 
system usage. Hopefully someone can shed some more light on the issues so we 
can adjust our usages...

We use a minimal install of Racket because we see a significant increase in 
performance over the full installation. It seems like the large source of 
performance issues is that Racket will routinely (perhaps during requires?) 
grovel over all the files in the pkgs directory -- maybe looking at all the 
info.rkt files?  This is very slow (compared to everything else we're doing), 
even on a local SSD.

First question: Is there a different way to do this? Perhaps freezing the 
package information in place so that file enumeration doesn't have to take 
place at runtime?


Also, the minimal install of Racket is missing some features we'd like, for 
example "rackunit". But when I install rackunit, my pkgs directory goes from 15 
or so packages up to about 120 packages!  So using rackunit at all requires us 
to sacrifice most of the performance gain we need...

Is there a way to do minimal installs of packages?  I imagine skipping any gui 
elements would cut down the dependencies quite a bit.

Thanks for any help,
Dan



-- 
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.


[racket-users] reference before definition vs unbound

2017-03-15 Thread Dan Liebgold
Hi -

Is there are a reason the error for referring to an identifier before it's 
definition doesn't get location info, whereas in an otherwise identical case 
the unbound identifier error does?

e.g.:

  asdf: undefined;
   cannot reference an identifier before its definition
in module: (submod "file.rkt" test)

vs

  file.rkt:87:16: asdf: unbound identifier in module
in: asdf


Thanks,
Dan

-- 
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.


Re: [racket-users] Re: syntax expands to define syntax, problems with ...

2017-03-15 Thread Dan Liebgold
On Wednesday, March 15, 2017 at 9:36:19 AM UTC-7, Sam Tobin-Hochstadt wrote:
> You need to escape the ... with another ..., like this:
> 

That's what I forgot.  Is there any other case where things are escaped in this 
manner?  It's a little surprising...

Thanks,
Dan

-- 
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.


[racket-users] Re: syntax expands to define syntax, problems with ...

2017-03-15 Thread Dan Liebgold
Here's what works, not using the inner ellipses:

http://pasterack.org/pastes/34338

But I'd prefer to use the ellipses..

-- 
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.


[racket-users] Re: syntax expands to define syntax, problems with ...

2017-03-15 Thread Dan Liebgold

Oops, try this link instead (that one had simple mistakes):

http://pasterack.org/pastes/68032

On Wednesday, March 15, 2017 at 9:22:24 AM UTC-7, Dan Liebgold wrote:
> I feel like I'm forgetting something basic, but how can I have a syntax 
> transformer expand to a define-syntax, both using ellipses?
> 
> http://pasterack.org/pastes/27441
> 
> pasterack doesn't seem to return the error, which is
> 
>   syntax: no pattern variables before ellipsis in template in: ...
> 
> at the second "...".
> 
> Thanks,
> Dan

-- 
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.


[racket-users] syntax expands to define syntax, problems with ...

2017-03-15 Thread Dan Liebgold
I feel like I'm forgetting something basic, but how can I have a syntax 
transformer expand to a define-syntax, both using ellipses?

http://pasterack.org/pastes/27441

pasterack doesn't seem to return the error, which is

  syntax: no pattern variables before ellipsis in template in: ...

at the second "...".

Thanks,
Dan

-- 
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.


[racket-users] help with splicing syntax class error report

2017-03-14 Thread Dan Liebgold
Hi -

I have some legacy code syntax I'm retrofitting with syntax-parse. Is there a 
simple way to have this type of syntax error report a better error message:

http://pasterack.org/pastes/59739

I'd like it to point directly to ":thung" and say it expected ":thing" or 
nothing there if possible.

Thanks,
Dan

-- 
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.


Re: [racket-users] refactoring help/tools?

2017-03-13 Thread Dan Liebgold
On Monday, March 13, 2017 at 10:40:15 AM UTC-7, Robby Findler wrote:
> Not the same thing, but if you mouse over the requires in DrRacket, it
> will put a red background on the ones that have no apparent use (of
> course, requires may have an effect too; neither tool picks that up,
> IIUC).
> 

That is useful... I hadn't realized that.  It would be nice if there were some 
indication that DrRacket is still background compiling, because I tend to not 
get arrows for awhile and usually chalk it up to my files being in a bad state.

-- 
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.


Re: [racket-users] refactoring help/tools?

2017-03-13 Thread Dan Liebgold
raco check-requires does the job.

I use emacs racket-mode, but it's hobbled in ways I haven't investigated -- 
e.g. when I try to use tidy or trim requires it gives me a "Can't do, source 
file has error" when it doesn't, or at least not in a way I can see.

-- 
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.


[racket-users] refactoring help/tools?

2017-03-13 Thread Dan Liebgold
Hi -

In refactoring a some Racket code I'd love to have a "require and provide only 
what you need" tool to help trim down the require and provide lists. Is there 
such a thing? Or at least a better approach for this than inspection or trial 
and error?

Thanks,
Dna

-- 
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.


Re: [racket-users] create a new provide syntax

2017-03-10 Thread Dan Liebgold
On Friday, March 10, 2017 at 10:43:25 AM UTC-8, Stephen Chang wrote:
> 
> (define-provide-syntax my-out
>   (syntax-parser
> [(_ name:id)
>  #:with mk-name (format-id #'name "make-~a" #'name)
>  #'(combine-out name mk-name)]))
> 

That does it. I guess define-provide-syntax *is* up to the job.

Thanks,
Dan

-- 
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.


[racket-users] create a new provide syntax

2017-03-10 Thread Dan Liebgold
Hi - 

I'd like to create a new provide syntax that essentially turns this:

  (provide (my-out name))

into this:

  (provide name make-name)

where 'name' and 'make-name' are defined in the surrounding context. It looks 
like define-provide-syntax isn't up to the task, so I used 
'make-provide-transformer' directly, like so:

(define-syntax my-out
  (make-provide-transformer
   (lambda (stx modes)
 (syntax-parse stx
   ((_ name:id)
(let ([nt #'name]
  [c (format-id #'name "make-~a" (syntax-e #'name))])
  (list (make-export nt (syntax-e nt) 0 #f nt)
(make-export c (syntax-e c) 0 #f c)
)))


Is there a more concise way of doing this?

Thanks,
Dan

-- 
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.


Re: [racket-users] losing syntax context

2017-03-08 Thread Dan Liebgold
On Wednesday, March 8, 2017 at 11:14:53 AM UTC-8, Jay McCarthy wrote:
> 
> (let ([name-i-want (lambda args body)]) name-i-want)
> 

Yup, that does it. Thanks!

> Jay

-- 
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.


Re: [racket-users] losing syntax context

2017-03-08 Thread Dan Liebgold
On Wednesday, March 8, 2017 at 10:56:48 AM UTC-8, Jay McCarthy wrote:
> You want to use syntax/loc. The error message comes from the lambda,
> not from the keyword argument. It could be possible to change where
> 

Yup, that fixes it. Thanks!   I experimented with syntax/loc in various places, 
but didn't try that spot.

Now, for a bonus, is there a way to assign a name to the lambda that the error 
message will use?  Right now it just shows the file and line number...

> -- 
> -=[ Jay McCarthy   http://jeapostrophe.github.io]=-
> -=[ Associate ProfessorPLT @ CS @ UMass Lowell ]=-
> -=[ Moses 1:33: And worlds without number have I created; ]=-

-- 
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.


[racket-users] losing syntax context

2017-03-08 Thread Dan Liebgold
I have a syntax transformer that loses enough syntax context that it's error 
message points to the transformer rather than the usage. Here's an example of 
what it should do: 

http://pasterack.org/pastes/89138

This one gives correct syntax in the error message (not in pasterack, but in Dr 
Racket), but I have code that appears identical in all important ways that only 
gives context inside transformer.

What could cause this usage to lose context?

Thanks,
Dan

-- 
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.


[racket-users] Re: create keyword in syntax

2017-03-03 Thread Dan Liebgold
On Friday, March 3, 2017 at 3:47:15 PM UTC-8, Dan Liebgold wrote:
> Is there something like format-id that can create a keyword in a syntax 
> transformer?
> 

Searching the interwebs yielded this:

  ;; identifier->keyword : Identifer -> (Syntaxof Keyword)
  (define (identifier->keyword id)
(datum->syntax id (string->keyword (symbol->string (syntax-e id))) id id))

which does what I need.

-- 
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.


[racket-users] create keyword in syntax

2017-03-03 Thread Dan Liebgold
Is there something like format-id that can create a keyword in a syntax 
transformer?

Thanks,
Dan

-- 
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.


[racket-users] make-directory race condition fix?

2017-02-16 Thread Dan Liebgold
Hi -

I have a few racket process running on Windows that need to each ensure the 
same directory structure exists. I have code like this:

(unless (directory-exists? dir)
  (make-directory dir))

Well, since they're running in parallel occasionally they race and try to make 
the directory after another has done so, resulting in an exception.

How can I rewrite this so that it either eats the exception or is atomic?

Thanks,
Dan

-- 
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.


[racket-users] splicing syntax surprise

2017-02-09 Thread Dan Liebgold
Hi all -

So, this is a simplified version of something we ran into: 
http://pasterack.org/pastes/70121

It was surprising that thing0 in the output template for read-thing was put in 
a list. Is this a feature of the splicing syntax?  Is there an automatic 
attribute that doesn't put it in a list (so the result would be '(foo bar))?

Thanks,
Dan

-- 
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.


Re: [racket-users] Fun with keyword-apply

2017-02-08 Thread Dan Liebgold
On Wednesday, February 8, 2017 at 2:08:49 PM UTC-8, Ryan Culpepper wrote:
> 
>(require (for-syntax syntax/parse/experimental/template))
>(define-syntax (test-syntax stx)
> 
>  (define-splicing-syntax-class spec
> as in your original version )
> 
>  (syntax-parse stx
>([_ s:spec ...]
> (template
>  (test (?@ s.key s.value) ...)
> 

That is pretty cool... I didn't think that was possible. It's a little 
concerning that its experimental, but I'm guessing it'll be incorporated into 
the syntax/parse lib (or lower down) at some point.

-- 
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.


[racket-users] Fun with keyword-apply

2017-02-08 Thread Dan Liebgold
Hi all -

I have an odd syntax I'm trying to maintain backward compatibility with, but 
I'd like to take advantage of keyword parameters to accommodate the 
presence/absence/ordering of those parameters.

Here's an example of what I'm trying to do: http://pasterack.org/pastes/88615

Can you think of a better way to translate the syntax to function application?  
Note that I must do a little processing of the parameters in my syntax 
(represented here by the multiplications).

Thanks,
Dan

-- 
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.


Re: [racket-users] link: bad variable linkage

2017-02-03 Thread Dan Liebgold
On Saturday, March 26, 2016 at 4:53:51 PM UTC-7, Robby Findler wrote:
> Matthew and I have figured out one way in which DrRacket could go
> wrong here and implemented a better strategy. The problem we
> identified doesn't explain the symptoms expressed here in this thread
> exactly, but it is a complex system and maybe there was some piece
> missing from the explanations that I didn't think to ask about.
> Finger's crossed that it helps!
> 

I was getting this error and variations on it somewhat often in version 6.5. Do 
you think upgrading to 6.8 will help?

Thanks,
Dan

-- 
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.


Re: [racket-users] Can’t get `raco setup --mode errortrace` to work

2017-02-01 Thread Dan Liebgold
On Wednesday, February 1, 2017 at 11:52:22 AM UTC-8, Alexis King wrote:
> 
> Yes, good suggestion; it seems like maybe --mode doesn’t work with
> the parallel build. However, using -j 1 produces an error:
> 

Actually I mean -j to racket.exe, as in --no-jit (for your last invocation)

-- 
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.


Re: [racket-users] implementing make in racket

2017-02-01 Thread Dan Liebgold
On Wednesday, November 30, 2016 at 10:38:05 AM UTC-8, Jay McCarthy wrote:
> The typed-racket code returns a value from the job, whereas this code
> assumes the job is fully self-contained. Perhaps job-queue should
> protect itself from job exceptions.
> 

BTW, how would you recommend returning a value from a job in job-queue?

-- 
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.


[racket-users] Re: Can’t get `raco setup --mode errortrace` to work

2017-02-01 Thread Dan Liebgold
On Tuesday, January 31, 2017 at 10:52:38 PM UTC-8, Alexis King wrote:
> 
> $ racket -l errortrace -l test-pkg
> qux: kaboom!
>   errortrace...:
> 

Out of curiosity, does the -j option help here?

-- 
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.


Re: [racket-users] DrRacket debugger

2017-01-31 Thread Dan Liebgold
On Monday, January 30, 2017 at 1:43:06 PM UTC-8, Robby Findler wrote:

The simple program seems to work ok.

It appears my problem is related to bytecode compilation (this occurs on a 
smallish program that pulls in a large library)... it takes awhile for the 
buttons to respond, and it seems like I'm able to more easily get it into a bad 
state?


> It isn't an issue I know about.
> 
> I don't see that with this simple program:
> 
> #lang racket
> (let loop () (loop))
> 
> Do you?
> 
> Robby
> 

-- 
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.


[racket-users] DrRacket debugger

2017-01-30 Thread Dan Liebgold
I'm having trouble with the debugger in DrRacket: I'll start it and the 
debugger buttons available at the top will stay "Go" and "Step" even as my 
program is clearly running (even stuck in a loop).

Is this a known issue?

-- 
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.


[racket-users] parameterize during compile

2017-01-20 Thread Dan Liebgold
Hi -

I have a module "env" that is required for-syntax by several other modules. I'd 
like to precompile those other modules into .zo files, but my initial 
for-syntax module ("env") has a parameter that I need to set (essentially I'm 
writing my own 'require' lines at compile-time, and I need to parameterize a 
list of directories to choose from for the require-spec).

Is there a way to compile my other modules while setting a parameter to be used 
by "env"? Currently I'm trying something like this:

  (parameters ([*dirs* my-dir])
(parallel-compile-files paths ...))


...but the *dirs* parameter doesn't get set.

Thanks,
Dan

-- 
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.


Re: [racket-users] parameterize working across dynamic-require and phase change

2016-12-07 Thread Dan Liebgold
On Tuesday, December 6, 2016 at 5:00:47 PM UTC-8, Robby Findler wrote:
> 
> Perhaps there is another way to achieve the effect you want in a way
> that is more friendly to creating .zo files?
> 

Yes, this is the crux of the issue. In my case I have a system that deals with 
modules that may or may not have .zo files. I'm try to parameterize something 
at compile time for generating the .zo and also at dynamic-require time (when 
the required module may or may not have the corresponding .zo file).

The best solution would be to simplify the compile-time logic such that the 
parameterization isn't required...  until then I may have to fix the system to 
parameterize the phases separately.

-- 
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.


[racket-users] parameterize working across dynamic-require and phase change

2016-12-06 Thread Dan Liebgold

Hi -

I've asked this question privately of Matthew Flatt, but I'll throw it out to 
the group in case anyone else wants a crack at it.

If I do this:

(parameterize ([a 3])
  (dynamic-require "module.rkt" 'func)
  (func))


...where the current module and "module.rkt" both require in parameter "a", and 
func uses the value "a" during the syntax phase -- (a) will not be 3... it will 
be the value bound during parameter creation.

Is there a way to parameterize a in this case?

Thanks,
Dan

-- 
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.


Re: [racket-users] Reducing Program Startup Time

2016-12-05 Thread Dan Liebgold
Ok, those tests aren't particularly illumating (at least they were easy!)

Is your Racket distribution on a local drive?  Network performance can make a 
big difference.

We've also found that the minimal Racket distribution can be quite a bit 
quicker when pulling in packages outside the main collects directory  
there's racket code that enumerates files and the main distribution installs 
thousands of files you may not need. Even local SSD file systems have a 
noticeable lag doing that.




On Monday, December 5, 2016 at 2:25:24 PM UTC-8, Lehi Toskin wrote:
> These first two tests are with the lazy-require code.
> 
> If I add '-c':
> $ time racket -c -- main.rkt -V
> Ivy 1.2
> 
> real  2m17.134s
> user  2m13.646s
> sys   0m2.394s
> 
> With '-j':
> $ time racket -j -- main.rkt -V
> Ivy 1.2
> 
> real  0m4.369s
> user  0m2.851s
> sys   0m0.155s
> 
> 
> These next two tests are with the usual require.
> 
> With '-c':
> $ time racket -c -- main.rkt -V
> Ivy 1.2
> 
> real  3m58.587s
> user  3m53.370s
> sys   0m5.080s
> 
> With '-j':
> $ time racket -j -- main.rkt -V
> Ivy 1.2
> 
> real  0m2.645s
> user  0m2.526s
> sys   0m0.115s

-- 
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.


Re: [racket-users] Reducing Program Startup Time

2016-12-05 Thread Dan Liebgold
Are you sure you have up to date .zo files for all your .rkt files?

How's the timing if you add '-c' to your Racket commandline?  How about '-j'?

On Sunday, December 4, 2016 at 4:11:51 PM UTC-8, Lehi Toskin wrote:
> ...

-- 
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.


Re: [racket-users] implementing make in racket

2016-11-30 Thread Dan Liebgold
On Wednesday, November 30, 2016 at 1:49:04 PM UTC-8, Jay McCarthy wrote:
> I just pushed a fix for this, btw.
> 
> 

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


Re: [racket-users] implementing make in racket

2016-11-30 Thread Dan Liebgold
On Wednesday, November 30, 2016 at 10:38:05 AM UTC-8, Jay McCarthy wrote:
> The typed-racket code returns a value from the job, whereas this code
> assumes the job is fully self-contained. Perhaps job-queue should
> protect itself from job exceptions.
> 

Probably a good idea. I got confused working on my thunk... I'm spawning a 
subprocess that errors out.  I was using an asynchronous spawn (process/ports) 
and it caused a silent hang in (stop-job-queue! jq). I switched to system* for 
other reasons and since that is synchronous is handles the exception 
differently such that it never escapes my thunk ... so things work.

-- 
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.


Re: [racket-users] implementing make in racket

2016-11-30 Thread Dan Liebgold
On Tuesday, November 29, 2016 at 6:30:08 PM UTC-8, David K. Storrs wrote:
> 
> Can you simply catch it and handle it inside the thunk?
>  

That's probably best. I was looking at the machinery to serialize exceptions in 
type racket* and thinking I needed that


*: 
https://github.com/racket/typed-racket/blob/master/typed-racket-test/send-places.rkt

-- 
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.


Re: [racket-users] implementing make in racket

2016-11-29 Thread Dan Liebgold
On Tuesday, November 29, 2016 at 3:32:48 PM UTC-8, Jay McCarthy wrote:
> Wow, that's a lame error that has been there for a LONG time. I just
> pushed a fix.
> 

Got it.

Any advice for how to handle when a job thunk raises an exception?  Currently 
(stop-job-queue! jq) waits forever...

-- 
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.


Re: [racket-users] implementing make in racket

2016-11-29 Thread Dan Liebgold
On Tuesday, November 29, 2016 at 12:23:32 PM UTC-8, Jay McCarthy wrote:
> DrDr uses job-queue for a similar process
> 
> http://docs.racket-lang.org/job-queue/index.html
> 

Looks promising. However, the docs say that stop-job-queue! will block until 
jobs are done... and this code doesn't wait: http://pasterack.org/pastes/29869

Did I miss something?

Thanks,
Dan

-- 
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.


[racket-users] parameters across dynamic-require

2016-11-28 Thread Dan Liebgold

If I do a dynamic-require inside a (parameterize (...) ...), should the 
required module receive those bound parameters?

(and if not, is there a way make that happen?)

Thanks,
Dan

-- 
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.


Re: [racket-users] dynamic-require of a string

2016-11-18 Thread Dan Liebgold
On Friday, November 18, 2016 at 4:46:38 PM UTC-8, Sam Tobin-Hochstadt wrote:
> You'll need to use `eval` to evaluate the module.
> 

Interesting...  If I want to add more context (for errors and such), is there a 
good way to use read-syntax and eval-syntax?

-- 
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.


[racket-users] dynamic-require of a string

2016-11-18 Thread Dan Liebgold
I have an odd use case, but is there any way to supply a string of the contents 
of a module to something like require or dynamic-require?

An example of my desired usage: http://pasterack.org/pastes/38798

Thanks,
Dan

-- 
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.


Re: [racket-users] syntax-class that is just a set of literals

2016-11-18 Thread Dan Liebgold


Urg... google groups behaved oddly for me... I posted this original thread but 
it never showed up for me, so I posted a 2nd thread (the one you linked to).

I'm not sure what actually happened, but at least the other thread has lots of 
good info.

-- 
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.


[racket-users] syntax-class that is just a set of literals

2016-11-18 Thread Dan Liebgold
Hi, 

A couple questions regarding literals in syntax-parse:

First, I'm trying to define a syntax-class that is just a set of literals, and 
I'm wondering if there is a slightly better way that this: 

 * http://pasterack.org/pastes/86722

I'd just prefer to not repeat all the literal definitions.


Second, I'm wondering if it'd be possible to implement a #:datum-literal-set 
option for syntax-classes, as I'd like to also share a list of literals (that 
are not bound ids) among multiple classes.

Thanks,
Dan

-- 
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.


Re: [racket-users] syntax-class composed of literals

2016-11-16 Thread Dan Liebgold
> FWIW, Eric Dobson wrote a very nice `define-literal-syntax-class` macro
> that is used extensively inside TR.
> 
>
> https://github.com/racket/typed-racket/blob/master/typed-racket-lib/typed-racket/utils/literal-syntax-class.rkt
> 

Hmm... I can't quite figure that one out. Maybe with some examples?  How does 
the ":spec" in the pattern work?  It's just a class specified

The examples in TR seem to declare classes one literal at a time?

> Its companion `define-merged-syntax-class` is quite nice too.
> 
>
> https://github.com/racket/typed-racket/blob/master/typed-racket-lib/typed-racket/optimizer/utils.rkt#L110
> 

I was just looking for exactly that... very useful.

-- 
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.


Re: [racket-users] syntax-class composed of literals

2016-11-16 Thread Dan Liebgold
> 
> Literal sets can include datum-literals:
> 
>(define-literal-set lits #:datum-literals (a b c) (d e))
> 

Ah, oops I missed that keyword parameter.

> For question 1, that's probably the best way. If you want to suppress 
> the printing of all of the datum literals in error messages, you can 
> mark the syntax class as `#:opaque`.
> 

I was more wanting to avoid keeping two lists of the literals in the source... 
I *do* want the error to enumerate possibilities.

> In principle, you could also use `literal-set->predicate`, but I just 
> discovered it ignores the datum literals. I'll push a fix.
> 

I saw that... assuming it worked, I'm not sure how/where I would put that..

-- 
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.


[racket-users] syntax-class composed of literals

2016-11-16 Thread Dan Liebgold
Hi,

A couple questions about literals in syntax-parse:

1. I'd like to make a syntax-class that is just a set of literals (with a clear 
error for something not matching any literal). Is there a better way than this:

http://pasterack.org/pastes/86722

I need to ignore the bindings for those identifiers, and I need to preserve the 
syntax context.

2. Is there any plan or easy way to implement #:datum-literal-sets  for 
syntax-classes?  It'd be nice to share a list of literals (with ignored 
bindings) among multiple classes.

Thanks,
Dan

-- 
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.


Re: [racket-users] Re: syntax-parse examples

2016-11-02 Thread Dan Liebgold
On Wednesday, November 2, 2016 at 5:25:03 AM UTC-7, Jay McCarthy wrote:
> 
> Another approach is to do something like:
> 
> 
> (define-syntax (myfor stx)
>   (syntax-parse stx
>     [(_ (clause:for-clause ...) body:expr)
>      (with-syntax ([(the-ast ...) (attribute clause.ast)])
>        #''(the-ast ... body))]))
> 

This seems promising, but I'm not sure how to access the contents of structure 
referred to by the-ast (or clause.ast)... it seems like the struct bindings 
need to be accessible at both syntax and runtime phases?

> 
> As for examples, one of my favorite ones is this regular expression compiler 
> implemented as a syntax-class where each attribute is kind of like a "method" 
> that is called on the sub-components during the compilation:
> 
> 
> https://github.com/jeapostrophe/automata/blob/master/automata-lib/re-compile.rkt
> 

This is interesting, and seems to point the way to implementing more logic in 
the syntax phase. I'm wondering if this is how the examples from the docs would 
be best completed...

-- 
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.


[racket-users] Re: syntax-parse examples

2016-11-01 Thread Dan Liebgold
On Tuesday, November 1, 2016 at 3:01:44 PM UTC-7, Dan Liebgold wrote:
>
> - 
> https://docs.racket-lang.org/syntax/varied-meanings.html?q=define-syntax-class#%28part._.Non-syntax-valued_.Attributes%29
> 

For example, I can't seem to access the "ast" attribute in this particular 
example without a "bad attribute value for syntax template" error...

http://pasterack.org/pastes/55006

-- 
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.


[racket-users] syntax-parse examples

2016-11-01 Thread Dan Liebgold

I'm working with syntax-parse, and the examples in the docs are quite useful, 
but several seem stop before they get to the good part. Is there any way 
someone could supply examples of using the syntax classes developed in these 
sections:

- 
https://docs.racket-lang.org/syntax/varied-meanings.html?q=define-syntax-class#%28part._.Non-syntax-valued_.Attributes%29

- 
https://docs.racket-lang.org/syntax/More_Keyword_Arguments.html?q=define-syntax-class

I'm a little lost on how to properly access the attribute values in those 
classes...

Thanks,
Dan

-- 
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.


Re: [racket-users] Re: racket command line parameter

2016-10-25 Thread Dan Liebgold
On Tuesday, October 25, 2016 at 3:20:47 PM UTC-7, Alexis King wrote:
>
> Note that if you have a #lang that provides a custom reader, I don’t
> think this will work quite right. However, if you have a configure-runtime

Fortunately my language uses "#lang s-exp syntax/module-reader" as it's reader 
-- and everything appears to work.

-- 
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.


Re: [racket-users] Re: racket command line parameter

2016-10-25 Thread Dan Liebgold
On Tuesday, October 25, 2016 at 2:09:59 PM UTC-7, Ryan Culpepper wrote:
> 
>racket -e '(enter! "your-module.rkt")' -i
> 

BTW, any luck putting a line like this in csh shell script, alias, or windows 
batch file?

-- 
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.


Re: [racket-users] Re: racket command line parameter

2016-10-25 Thread Dan Liebgold
On Tuesday, October 25, 2016 at 2:09:59 PM UTC-7, Ryan Culpepper wrote:
> 
>racket -e '(enter! "your-module.rkt")' -i
> 

That's it. 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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Re: racket command line parameter

2016-10-25 Thread Dan Liebgold
On Tuesday, October 25, 2016 at 2:09:59 PM UTC-7, Ryan Culpepper wrote:
> On 10/25/2016 04:57 PM, Dan Liebgold wrote:
> > On Tuesday, October 25, 2016 at 1:43:28 PM UTC-7, Alexis King wrote:
> > bound...
> >>
> >> You need to put the -i flag first, so the command should look like:
> >>
> >>   racket -iI  -l 
> >>
> >
> > Hmm... that give the REPL the proper language but no access to the contents 
> > of ...
> 
> It sounds like you want the behavior of the `enter!` command. You can 
> kind of do that from the command line like this:
> 
>racket -e '(enter! "your-module.rkt")' -i
> 
> Ryan

That's it.  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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Re: racket command line parameter

2016-10-25 Thread Dan Liebgold
On Tuesday, October 25, 2016 at 1:43:28 PM UTC-7, Alexis King wrote:
bound... 
> 
> You need to put the -i flag first, so the command should look like:
> 
>   racket -iI  -l 
> 

Hmm... that give the REPL the proper language but no access to the contents of 
...

-- 
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.


Re: [racket-users] racket command line parameter

2016-10-25 Thread Dan Liebgold
On Tuesday, October 25, 2016 at 1:28:08 PM UTC-7, Alexis King wrote:
> The short answer is “no, but you can use -I to achieve a similar
> effect for some languages”.
> 

This is unfortunate.  Ideally, I'd replicate Dr Racket's interactions window 
after running a module.

-- 
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.


[racket-users] Re: racket command line parameter

2016-10-25 Thread Dan Liebgold
On Tuesday, October 25, 2016 at 1:33:18 PM UTC-7, Dan Liebgold wrote:
> I use -I, -l, then -i but the resulting REPL has no #%top-interaction bound...

Hrm.. -I and -l look pretty much identical... is there a guide to formatting 
these posts?

-- 
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.


[racket-users] Re: racket command line parameter

2016-10-25 Thread Dan Liebgold
On Tuesday, October 25, 2016 at 1:06:17 PM UTC-7, Dan Liebgold wrote:
> Is there a racket command line parameter that will enable me to start a REPL 
> (using -i) within a module context?  Specifically I'd like the REPL to star 
> as if within a certain "#lang ".
> 

Ok, I've used the -I parameter to successfully set the language.  Is there a 
way to set the language, read in library or script file, then start the REPL?

I use -I, -l, then -i but the resulting REPL has no #%top-interaction bound... 

-- 
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.


[racket-users] racket command line parameter

2016-10-25 Thread Dan Liebgold
Is there a racket command line parameter that will enable me to start a REPL 
(using -i) within a module context?  Specifically I'd like the REPL to star as 
if within a certain "#lang ".

Thanks,
Dan

-- 
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.


[racket-users] Re: Error messages in DSL implementations

2016-10-24 Thread Dan Liebgold
On Monday, October 24, 2016 at 6:25:07 AM UTC-7, Konrad Hinsen wrote:
>
> I can think of a few approaches, such as redefining 
> error-display-handler in the expanded code, but I suspect that others 
> have already found better solutions to this problem. I'd be grateful for 
> any pointers.
> 
> Konrad.

I think the syntax/parse module is your best answer. Implement your macros as a 
proper compiler front end (which syntax/parse can do) and suss out as many 
errors there as you can, because threading context throughout your syntax 
transformers can be quite difficult.

-- 
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.


[racket-users] unit testing syntax errors

2016-10-24 Thread Dan Liebgold
Hi -

Could someone point me to an example of using a test submodule and rackunit to 
verify a correctly raised syntax-error in the syntax phase?

Here's an example of the kind of code I have: http://pasterack.org/pastes/82067

(Uncomment the last expression in the test submodule to see the exception I'd 
like to test. The test is runtime, but the exception is raised at syntax time, 
so it doesn't work...  I see a way to fix this, but it seems complicated? Maybe 
there's a simple example...)

Thanks,
Dan

-- 
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.


Re: [racket-users] degenerate performance in syntax-parse

2016-10-24 Thread Dan Liebgold
On Monday, October 24, 2016 at 2:07:16 PM UTC-7, Ryan Culpepper wrote:
> 
> It might make sense for syntax-parse to offer something like Redex's 
> `variable-not-otherwise-mentioned`, which would behave like you 
> expected. I think it would have to be a baked-in special case, but it 
> might be useful enough to justify that.
> 

I'm trying using keywords (i.e. changing 'blend' to '#:blend'). It'll also help 
the readability of this DSL, since it's already quite Racket-like.  The only 
issue is converting our mountain of code that uses the old syntax (more than 
40,000 lines, if you can believe it). 

-- 
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.


Re: [racket-users] degenerate performance in syntax-parse

2016-10-24 Thread Dan Liebgold
On Sunday, October 23, 2016 at 1:14:56 PM UTC-7, Ryan Culpepper wrote:
> 
> 
> The easiest fix is to add the #:commit option to the `remap-entry` 
> syntax class. Then when `remap-entry` succeeds the first time, it throws 
> away the choice points it created, so the repeated pattern is never 
> considered.
> 

Ok that makes sense and I hadn't realized it. Easy fix!

[...]
> 
> 1. A term like `(a <- blend)` will match the first pattern and treat 
> `blend` as a `remap:id`. If you don't want that to happen, there are two 
> ways to prevent it. One is to define a syntax class like `id` that 
> excludes all of the reserved words like `<-` and `blend` and use that 
> for pattern variables like `remap`. The other is to reorder the patterns 
> and use cut (~!):
> 
>(pattern (source:id <- blend ~! remap:id 
> extras:remap-entry-extra-params))
>(pattern (source:id <- remap:id extras:remap-entry-extra-params))
> 

This one is surprising. I thought that listing 'blend' as a datum-literal would 
prevent the more general 'remap:id from matching it.

It's easy to re-order the patterns, fortunately.

> 2. `format-id` is useful for creating identifiers.
> 

Ah, yes, awareness of 'format-id' is low among us here, I'll introduce it.


> Ryan

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


[racket-users] degenerate performance in syntax-parse

2016-10-21 Thread Dan Liebgold
Hi all -

In the process of putting together a somewhat complex application using 
syntax-parse, I discovered that when I specified a repeated pattern in a 
syntax-class (which was incorrect) AND I had a certain usage of the syntax 
transformer with an error, it would lead to degenerate performance (Racket 
would run out of memory or it would need to be killed. 

Please see this example and uncomment the last non-paren line to see it fall 
down:

http://pasterack.org/pastes/50261

Thanks,
Dan

-- 
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.


[racket-users] Re: Gear VR

2015-07-01 Thread Dan Liebgold
On Tuesday, June 23, 2015 at 4:36:12 PM UTC-7, John Carmack wrote:
 The intersection of Gear VR owners and Racket users may consist of just me at 
 the moment, but if anyone else here is interested in discussing the work I am 
 doing with driving VR by Racket/Scheme, I would welcome the input.  Would 
 that be
  an appropriate topic on the list?
 
  

Hey John -

I'm glad to see another game industry pro discover the value of Racket. We use 
it extensively here at Naughty Dog for tools and scripting (since the days of 
MzSchem back in 2005), and have great interest in the production aspects of the 
Racket ecosystem.

Dan

-- 
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.