Re: [racket-users] Re: [ANN] Simple, Deterministic Dictionaries (ddict)

2017-01-23 Thread Andrew Kent
On Monday, January 23, 2017 at 4:27:56 PM UTC-5, Philip McGrath wrote:
> Have you considered implementing theĀ gen:dict generic interface?
> 
> 
> 
> -Philip
> 
> 
> 
> On Mon, Jan 23, 2017 at 7:58 AM, Greg Trzeciak  wrote:
> On Monday, January 23, 2017 at 2:18:53 PM UTC+1, Andrew Kent wrote:
> 
> 
> 
> > ddict seeks to mimic Racket's `hash` API as much as possible and is 
> > hopefully a a convenient "drop in" replacement for `hash` when you'd like 
> > deterministic iteration order.
> 
> 
> 
> Thank you, just when I need it!
> 
> One minor issue regarding the API - I understand you wanted to mimic hash api 
> but I personally wonder if moving away from keywordless api for both hash and 
> ddict wouldn't be a better idea.
> 
> 
> 
> 
> 
> --
> 
> 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.

Yes, the mutable and immutable ddict abstractions both implement the gen:dict 
interface currently.

-- 
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: [ANN] Simple, Deterministic Dictionaries (ddict)

2017-01-23 Thread Philip McGrath
Have you considered implementing the gen:dict generic interface?

-Philip

On Mon, Jan 23, 2017 at 7:58 AM, Greg Trzeciak  wrote:

> On Monday, January 23, 2017 at 2:18:53 PM UTC+1, Andrew Kent wrote:
>
> > ddict seeks to mimic Racket's `hash` API as much as possible and is
> hopefully a a convenient "drop in" replacement for `hash` when you'd like
> deterministic iteration order.
>
> Thank you, just when I need it!
> One minor issue regarding the API - I understand you wanted to mimic hash
> api but I personally wonder if moving away from keywordless api for both
> hash and ddict wouldn't be a better idea.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to racket-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

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


Re: [racket-users] Safely using port->string where nothing has been written to the port

2017-01-23 Thread David Storrs
Hi Sean,

Does (byte-ready?) work for your case?

https://docs.racket-lang.org/reference/Byte_and_String_Input.html?q=peek#%28def._%28%28quote._~23~25kernel%29._byte-ready~3f%29%29

On Mon, Jan 23, 2017 at 6:05 AM, Sean Kemplay 
wrote:

> Hello,
>
> I am using the URL library to interact with a REST API.
>
> One of the Endpoints sends returns no content for a POST request with a
> status code of 204 (a little unusual however it is an external API so we
> have to cater to it).
>
> I can check the status code for 204 and only apply string->port if it
> isn't a 204 - however I was wondering if there is any check that can be
> made at the port level that no content will be written - in case we
> encounter a malformed response which does not send through a body.
>
> Currently without the checks port->string will hang on a 204 response.
>
> This would be good to know more generally when dealing with ports as well.
>
> Kind regards,
> Sean
>
> --
> You received this message because you are subscribed to the Google Groups
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to racket-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

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


[racket-users] Re: Client side web applications in Racket

2017-01-23 Thread Ethan Estrada
On Sunday, January 22, 2017 at 6:13:28 AM UTC-7, spdegabrielle wrote:
> Hi,
> 
> 
> What are my options for doing client side web applications in Racket ?
> 

There are far more client side options for general Scheme implementations that 
compile to or run in JS. There is a decent list here:

https://github.com/jashkenas/coffeescript/wiki/List-of-languages-that-compile-to-JS#scheme-like

They are not Racket and won't have access to all the Racket libraries, but 
something in the list may be good enough for your client side needs. If you use 
the `r5rs` lang server side in Racket (instead of `racket` or `racket/base`) 
you may even be able to share some code between the front and the back end 
using a more general Scheme implementation for the client side.

-- 
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] Mann-Whitney test?

2017-01-23 Thread Leif Andersen
You _could_ use the FFI, but you'd have to use the Racket FFI to go to C,
and then use R's FFI to go to C, and then coerce all of R's data to Racket
and all of Racket's data back to R.

Because of this (provided no one makes a #lang R first ;)  ), I think it
would be easier to just spawn up a new R process using something like
system* or process, and use pipes to send data back and forth directly.
Yes, all of the data would need to be serialized into streams, but you
would do an analogous process going from R to C to Racket.


~Leif Andersen

On Sun, Jan 22, 2017 at 12:19 AM, James  wrote:

>
> > Does anybody have an implementation of the Mann-Whitney U test (or the
> equivalent Wilcoxson Rank test) in Racket?  I imagine I could easily hack
> up my own, but somebody else may have done a better job of it already.
>
> I see that no one has answered this question yet.  This is something which
> I would do and have done in R.  So this brings me to a question I was going
> to ask anyway which is how to do multi-language development including
> Racket and R.  Would it be FFI from Racket to R?  I already have a body of
> R code of my own which I would like to be able to call from Racket.  The
> general idea is that It would be an application where things like the GUI
> and networking elements are done in Racket but computations are done in R.
>
> James
>
> --
> You received this message because you are subscribed to the Google Groups
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to racket-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

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


[racket-users] Re: [ANN] Simple, Deterministic Dictionaries (ddict)

2017-01-23 Thread Greg Trzeciak
On Monday, January 23, 2017 at 2:18:53 PM UTC+1, Andrew Kent wrote:

> ddict seeks to mimic Racket's `hash` API as much as possible and is hopefully 
> a a convenient "drop in" replacement for `hash` when you'd like deterministic 
> iteration order.

Thank you, just when I need it!
One minor issue regarding the API - I understand you wanted to mimic hash api 
but I personally wonder if moving away from keywordless api for both hash and 
ddict wouldn't be a better idea.

-- 
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] [ANN] Simple, Deterministic Dictionaries (ddict)

2017-01-23 Thread Andrew Kent
Good day all!

I just wanted to announce that I threw together a simple, deterministic 
dictionary package: ddict.

ddict seeks to mimic Racket's `hash` API as much as possible and is hopefully a 
a convenient "drop in" replacement for `hash` when you'd like deterministic 
iteration order.

If you're interested, read more here:

http://docs.racket-lang.org/ddict/index.html

and you can contribute here:

github.com/pnwamk/ddict

Best,
Andrew

-- 
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] Safely using port->string where nothing has been written to the port

2017-01-23 Thread Sean Kemplay
Hello,

I am using the URL library to interact with a REST API. 

One of the Endpoints sends returns no content for a POST request with a status 
code of 204 (a little unusual however it is an external API so we have to cater 
to it).

I can check the status code for 204 and only apply string->port if it isn't a 
204 - however I was wondering if there is any check that can be made at the 
port level that no content will be written - in case we encounter a malformed 
response which does not send through a body. 

Currently without the checks port->string will hang on a 204 response.

This would be good to know more generally when dealing with ports as well.

Kind regards,
Sean

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