Re: [racket-users] Typed Racket Type Annotations - Best Practices?

2017-06-29 Thread 'John Clements' via Racket Users
> On Jun 29, 2017, at 17:33, Zelphir Kaltstahl > wrote: > > A while ago I started looking at Typed Racket and today I took a look again. > > The documentation says: > >> Typed Racket provides modified versions of core Racket forms, which permit >> type

Re: [racket-users] Custom reader that's a strict subset of racket

2017-06-29 Thread Sam Waxman
On Thursday, June 29, 2017 at 11:17:12 PM UTC-4, Philip McGrath wrote: > I think you might be able to leave the reader as-is and just re-define > #%datum to reject whatever kinds of literal data you don't want to allow. > > > > -Philip > > > > On Thu, Jun 29, 2017 at 9:44 PM, Sam Waxman

Re: [racket-users] Custom reader that's a strict subset of racket

2017-06-29 Thread Philip McGrath
I think you might be able to leave the reader as-is and just re-define #%datum to reject whatever kinds of literal data you don't want to allow. -Philip On Thu, Jun 29, 2017 at 9:44 PM, Sam Waxman wrote: > Hello, > > I'm building a #lang, and I don't want it to have a few

Re: [racket-users] Missing request-post-data/raw (from web-server/http)

2017-06-29 Thread Philip McGrath
Thanks for your comments. The only legal files to upload in this case are plain text, so I'm not too worried about size. I'm relying on the web-server libraries to deal with any malicious attempts to send overwhelmingly large files (if that's a bad idea, I'd definitely appreciate hearing it!).

Re: [racket-users] Missing request-post-data/raw (from web-server/http)

2017-06-29 Thread Neil Van Dyke
I don't know the answer to your particular questions with `web-server` (I've made my own implementations of this in the past), and these comments might not apply to your particular application, but I'll mention here for whomever is interested... It sounds like you're using this, which might

[racket-users] Missing request-post-data/raw (from web-server/http)

2017-06-29 Thread Philip McGrath
I'm working on a Racket web application for which I need to proxy certain requests to a non-Racket service over HTTP. I've built a very basic proxy on top of http-sendrecv/url that works quite well for the most part. For POST requests, I pass the request-post-data/raw of the original request as

[racket-users] Typed Racket Type Annotations - Best Practices?

2017-06-29 Thread Zelphir Kaltstahl
A while ago I started looking at Typed Racket and today I took a look again. The documentation says: > Typed Racket provides modified versions of core Racket forms, which permit > type annotations. Previous versions of Typed Racket provided these with a : > suffix, but these are now only

Re: [racket-users] Testing #langs

2017-06-29 Thread 'John Clements' via users-redirect
> On Jun 29, 2017, at 09:08, Sam Waxman wrote: > > On Thursday, June 29, 2017 at 11:49:49 AM UTC-4, 'John Clements' via > users-redirect wrote: >> Oops forgot to cc: list >> >>> On Jun 29, 2017, at 08:49, John Clements wrote: >>> On

Re: [racket-users] Is there a way to check whether syntax is an expression or a define statement?

2017-06-29 Thread Matthew Flatt
At Thu, 29 Jun 2017 09:32:24 -0700 (PDT), Sam Waxman wrote: > "The only way to check whether a form is an expression or definition is > to partially expand it and match on the form." > - This seems sort of rough to believe. If you shadow the syntax-rule for > define so that (define id binding)

Re: [racket-users] Hint on opening enclosing directory of current file from DrRacket

2017-06-29 Thread Tim Hanson
Heh, cool, Laurent! This dabbler had missed this until now -- I will read and probably use. Cheers, tim -- 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

Re: [racket-users] Is there a way to check whether syntax is an expression or a define statement?

2017-06-29 Thread Sam Waxman
On Thursday, June 29, 2017 at 11:47:00 AM UTC-4, Matthew Flatt wrote: > At Thu, 29 Jun 2017 08:10:25 -0700 (PDT), Sam Waxman wrote: > > One of my constructs, (func name(args) body), defines a function that's > > able > > to be called afterwards, and it desugars into a pretty regular define > >

Re: [racket-users] Testing #langs

2017-06-29 Thread Sam Waxman
On Thursday, June 29, 2017 at 11:49:49 AM UTC-4, 'John Clements' via users-redirect wrote: > Oops forgot to cc: list > > > On Jun 29, 2017, at 08:49, John Clements wrote: > > > >> > >> On Jun 29, 2017, at 08:30, Sam Waxman wrote: > >> > >> Hey

[racket-users] Re: Checking if two lists contain a word

2017-06-29 Thread philipp . thiess1999
Am Sonntag, 25. Juni 2017 19:40:08 UTC+2 schrieb philipp.t...@gmail.com: > Hello its me again, > > I have the task to make a funcition who checks if two lists contain a word. > > I made a function which does that with one lst but I dont find a way to do it > with two lists. There must be some

Re: [racket-users] Testing #langs

2017-06-29 Thread 'John Clements' via users-redirect
Oops forgot to cc: list > On Jun 29, 2017, at 08:49, John Clements wrote: > >> >> On Jun 29, 2017, at 08:30, Sam Waxman wrote: >> >> Hey all, >> >> I've been running into a lot of major roadblocks when it comes to writing >> good tests for

Re: [racket-users] on the name of a data structure

2017-06-29 Thread David Storrs
Looks sort of like a quaternary tree to me. It's the same definition as your BinaryTree except that there are four branches on each level. They are in substructures, so maybe it's indirect-quaternary-tree? As an aside, instead of CamelCase and UPPERCASE, Racket typically names things in all

Re: [racket-users] Is there a way to check whether syntax is an expression or a define statement?

2017-06-29 Thread Matthew Flatt
At Thu, 29 Jun 2017 08:10:25 -0700 (PDT), Sam Waxman wrote: > One of my constructs, (func name(args) body), defines a function that's able > to be called afterwards, and it desugars into a pretty regular define > statement. [...] > > While I don't want this to be allowed, I'd like to catch this

Re: [racket-users] Is there a way to check whether syntax is an expression or a define statement?

2017-06-29 Thread Sam Waxman
On Thursday, June 29, 2017 at 11:22:38 AM UTC-4, David K. Storrs wrote: > On Thu, Jun 29, 2017 at 11:10 AM, Sam Waxman wrote: > Hey all, > > > > I'm writing a #lang and am trying to raise my own errors instead of having > racket throw any errors of its own. > > > > One

Re: [racket-users] Defining new exception types with guards and default messages

2017-06-29 Thread David Storrs
Good to know. I'll do it that way. On Thu, Jun 29, 2017 at 11:26 AM, Philip McGrath wrote: > Note, though, (having tried this) that putting a contract on the guard > will give you undesirable blame behavior unless you use any/c for all the > domain contracts as

[racket-users] Testing #langs

2017-06-29 Thread Sam Waxman
Hey all, I've been running into a lot of major roadblocks when it comes to writing good tests for some #langs that I've made, for a number of reasons. Ideally, I want a function called (check-eq-program? "program1" "program2") That will run each program in a fresh module of my #lang, check what

Re: [racket-users] Defining new exception types with guards and default messages

2017-06-29 Thread Philip McGrath
Note, though, (having tried this) that putting a contract on the guard will give you undesirable blame behavior unless you use any/c for all the domain contracts as Matthias did. The guard must be able to accept all arguments, so the server module will be blamed if a client calls the constructor

Re: [racket-users] Is there a way to check whether syntax is an expression or a define statement?

2017-06-29 Thread David Storrs
On Thu, Jun 29, 2017 at 11:10 AM, Sam Waxman wrote: > Hey all, > > I'm writing a #lang and am trying to raise my own errors instead of having > racket throw any errors of its own. > > One of my constructs, (func name(args) body), defines a function that's > able to be called

Re: [racket-users] DrRacket Font Selection

2017-06-29 Thread Lehi Toskin
Now that I have figured out how to get `force-cache` to run through alternate means (using the scroll wheel) and have my preferred font selected, I think I'll be okay until a fix has been added. I think this started to happen when I upgraded to v6.9 and then downgraded to v6.8. I couldn't say

Re: [racket-users] Defining new exception types with guards and default messages

2017-06-29 Thread David Storrs
On Thu, Jun 29, 2017 at 9:50 AM, Matthias Felleisen wrote: > > > On Jun 29, 2017, at 9:21 AM, David Storrs > wrote: > > > > I'd like to create a new exception type, 'exn:fail:insufficient-space', > something like this: > > > > (struct

[racket-users] Is there a way to check whether syntax is an expression or a define statement?

2017-06-29 Thread Sam Waxman
Hey all, I'm writing a #lang and am trying to raise my own errors instead of having racket throw any errors of its own. One of my constructs, (func name(args) body), defines a function that's able to be called afterwards, and it desugars into a pretty regular define statement. As a result, I

Re: [racket-users] Defining new exception types with guards and default messages

2017-06-29 Thread Matthias Felleisen
> On Jun 29, 2017, at 9:21 AM, David Storrs wrote: > > I'd like to create a new exception type, 'exn:fail:insufficient-space', > something like this: > > (struct exn:fail:insufficient-space exn:fail (requested available source)) > > I would like to do two things: > >

[racket-users] Defining new exception types with guards and default messages

2017-06-29 Thread David Storrs
I'd like to create a new exception type, 'exn:fail:insufficient-space', something like this: (struct exn:fail:insufficient-space exn:fail (requested available source)) I would like to do two things: 1) Make the exn-message field be standardized so that the person throwing the exception doesn't

Re: [racket-users] Hint on opening enclosing directory of current file from DrRacket

2017-06-29 Thread Laurent
(yet another shameless self-promotion, but hopefully this can be of some help.) If you really want to add menu items for such small tasks, you can use the script-plugin [1] which adds a easily modifiable Scripts menu item. There's already a "Scripts/Utils/Open file directory" menu item there.