Re: [racket-users] racket 6.7 minimal+prebuilt no raco make?

2017-01-10 Thread Deren Dohoda
Thanks, Sam. Got it.

On Tue, Jan 10, 2017 at 10:23 AM, Sam Tobin-Hochstadt 
wrote:

> The `compiler-lib` pkg will install the `raco make` command.
>
> Sam
>
> On Tue, Jan 10, 2017 at 10:21 AM, Deren Dohoda 
> wrote:
> > Basically the subject.
> >
> > Downloaded the source for 6.7 minimal with prebuilt packages, compiled. I
> > didn't see any errors. But apparently there's no "make" command for raco?
> > The docs don't indicate this disappeared so I am a little confused. raco
> > help indicates make is not a recognized command:
> >
> > -
> > root@foo:~# racket/racket-6.7/bin/raco help
> > Usage: raco   ...  ...
> >
> > Frequently used commands:
> >   setup   install and build libraries and documentation
> >   pkg manage packages
> >
> > All available commands:
> >   linkmanage library-collection directories
> >   pkg manage packages
> >   setup   install and build libraries and documentation
> >
> > A command can be specified by an unambiguous prefix.
> > See `raco help ' for help on a command.
> > -
> >
> > Did the install mess up? Is make some separate package I need to install
> > since this is "minimal"?
> >
> > Deren
> >
> > --
> > 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.
>

-- 
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 6.7 minimal+prebuilt no raco make?

2017-01-10 Thread Deren Dohoda
Basically the subject.

Downloaded the source for 6.7 minimal with prebuilt packages, compiled. I
didn't see any errors. But apparently there's no "make" command for raco?
The docs don't indicate this disappeared so I am a little confused. raco
help indicates make is not a recognized command:

-
root@foo:~# racket/racket-6.7/bin/raco help
Usage: raco   ...  ...

Frequently used commands:
  setup   install and build libraries and documentation
  pkg manage packages

All available commands:
  linkmanage library-collection directories
  pkg manage packages
  setup   install and build libraries and documentation

A command can be specified by an unambiguous prefix.
See `raco help ' for help on a command.
-

Did the install mess up? Is make some separate package I need to install
since this is "minimal"?

Deren

-- 
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] literals vs datum-literals in syntax-parse

2017-01-10 Thread Alexis King
Basically, the difference is as follows: #:literals compares
identifiers using free-identifier=?, but #:datum-literals compares
them by using syntax-e and eq?.

You can observe the difference using two extremely simple macros
that only differ in their use of #:literals or #:datum-literals:

  (define-syntax lit
(syntax-parser
  #:literals [add1]
  [(_ add1) #'"add1"]
  [(_ _)#'"something else"]))

  (define-syntax dat
(syntax-parser
  #:datum-literals [add1]
  [(_ add1) #'"add1"]
  [(_ _)#'"something else"]))

Observe the behavior of the `lit` macro:

  > (lit add1)
  "add1"
  > (let ([add1 #f])
  (lit add1))
  "something else"
  > (require (rename-in racket/base [add1 my-add1]))
  > (lit my-add1)
  "add1"

Contrast the results with the same examples using the `dat` macro
instead:

  > (dat add1)
  "add1"
  > (let ([add1 #f])
  (dat add1))
  "add1"
  > (require (rename-in racket/base [add1 my-add1]))
  > (dat my-add1)
  "something else"

By “recognize symbolically”, it means that #:datum-literals looks
at the name of the symbol and nothing else. In contrast, #:literals
is more advanced, since it looks for an identifier with the same
binding as the one specified.

In my opinion, when in doubt, prefer #:literals.

> On Jan 10, 2017, at 11:58 AM, Deren Dohoda 
> wrote:
> 
> I am still making most macros using syntax-rules and syntax-case
> because when I happened to learn macros these were the paths of
> least resistance. Every once in a while I try to learn a little
> more of syntax-parse since the few times I've tried it I really
> liked it.
> 
> It appears that, in general, syntax-rules and syntax-case use what
> syntax-parse considers "datum-literals", which the docs say are
> recognized "symbolically" versus actual literals which are recognized
> "by binding." The example in the documents for some reason clarifies
> nothing since both expressions are the same and give the same output,
> making this a distinction without an obvious difference.
> 
> Can someone explain the intention behind #:literals as opposed to
> #:datum-literals? In what cases should I consider #:literals? Why
> would I want to avoid #:datum-literals, or vice versa?
> 
> Thanks,
> Deren

-- 
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] literals vs datum-literals in syntax-parse

2017-01-10 Thread Deren Dohoda
I am still making most macros using syntax-rules and syntax-case because
when I happened to learn macros these were the paths of least resistance.
Every once in a while I try to learn a little more of syntax-parse since
the few times I've tried it I really liked it.

It appears that, in general, syntax-rules and syntax-case use what
syntax-parse considers "datum-literals", which the docs say are recognized
"symbolically" versus actual literals which are recognized "by binding."
The example in the documents for some reason clarifies nothing since both
expressions are the same and give the same output, making this a
distinction without an obvious difference.

Can someone explain the intention behind #:literals as opposed to
#:datum-literals? In what cases should I consider #:literals? Why would I
want to avoid #:datum-literals, or vice versa?

Thanks,
Deren

-- 
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] Slack discussion for Racket

2017-01-10 Thread Sam Tobin-Hochstadt
A while back, Jason Yeo created a Slack for talking about Racket at
https://racket.slack.com/ After talking with some other Racket
developers (and with Jason's permission), we're planning to make this
an official part of the project. So you may see more people there, and
it can be a place to talk with more Racket developers than previously.

To sign up, you'll need to go to: http://racket-slack.herokuapp.com/

Many thanks to Jason for creating this resource for the community!

This doesn't mean that the IRC channel is going away, for anyone that
likes it. That's also an important community resource, and a popular
one, and it will be maintained.

Also, I know the various limitations and problems with Slack. It's
something many of us are comfortable with, and it's successful for
many other open source projects.

Sam

-- 
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] Distinguishing between a virtual connection and an actual one

2017-01-10 Thread David Storrs
Assuming my function is given a database connection, is there a way to
distinguish an actual connection from a virtual one?  More
specifically, is there a way to tell if it's safe to use this
connection as part of a (prepare) call?

-- 
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] New packages: compose-app and retry

2017-01-10 Thread Jack Firth
I've added two new packages to the package catalog. The first, `compose-app`, 
provides a
simple #%app macro for composing single-argument functions together:

> (require compose-app)
> (map (add1 .. string->number) (list "1" "2" "3"))
(list 2 3 4)

Optionally, you can use the package with `fancy-app` to get both composition 
syntax and underscores-as-lambdas syntax:

> (require compose-app/fancy-app)
> (map (/ _ 2 .. string->number) (list "10" "20" "30"))
(list 5 10 15)

The second package, `retry`, provides "retryers" for repeating operations in 
the event of failure. To use, first construct retryers for each action you wish 
to do (e.g. sleep X seconds, log a message, etc.), then combine the retryers 
together with `retryer-compose`, then use `call/retry` or `with-retry` to 
evaluate something until it succeeds.

For more information, see:

- The `compose-app` docs: http://docs.racket-lang.org/compose-app/index.html
- The `retry` docs, including The Retry Guide and The Retry Reference: 
http://docs.racket-lang.org/retry/index.html
- The `compose-app` Github repo: https://github.com/jackfirth/compose-app
- The `retry` Github repo: https://github.com/jackfirth/racket-retry
- The `fancy-app` Github repo: https://github.com/samth/fancy-app/tree/master

Patches, issues, comments, musings, and lollipops are all welcome. Special 
thanks to Sam for fancy-app!

-- 
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: Distinguishing between a virtual connection and an actual one

2017-01-10 Thread David Storrs
On Tue, Jan 10, 2017 at 9:06 PM, George Neuner  wrote:
> On Tue, 10 Jan 2017 18:56:44 -0500, David Storrs
>  wrote:
>
>>Assuming my function is given a database connection, is there a way to
>>distinguish an actual connection from a virtual one?  More
>>specifically, is there a way to tell if it's safe to use this
>>connection as part of a (prepare) call?
>
> Prepare yields an error when called on a virtual connection.  As far
> as I am aware, that is the only _exposed_ way to tell whether or not a
> connection is virtual.

Yeah, that's what I was doing -- wrap a prepare in a with-handlers and
if it pops then the connection is virtual.  Seems awfully clumsy,
though.


> WRT prepared statements: they are connection specific, so even using
> "real" (non-virtual) connections, you must be careful not to close or
> otherwise relinquish the connection - e.g., back to a pool - between
> the prepare and execute.

Good to know.  Thanks.


> Hope this helps.
> George
>
> --
> 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: [racket-dev] Slack discussion for Racket

2017-01-10 Thread Asumu Takikawa
On 2017-01-10 16:48:42 -0500, Sam Tobin-Hochstadt wrote:
> This doesn't mean that the IRC channel is going away, for anyone that
> likes it. That's also an important community resource, and a popular
> one, and it will be maintained.

BTW, if there's anyone who likes IRC and wants to chat on #racket but the thing
that's keeping you away is the lack of a persistent web/mobile frontend (that's
also free software), check out Riot:

  https://riot.im/ 

It bridges to #racket if you join this room:

  https://riot.im/app/#/room/#freenode_#racket:matrix.org

(and in case you haven't seen it yet, relevant xkcd: https://xkcd.com/1782/)

Cheers,
Asumu

-- 
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] Futures vs Places?

2017-01-10 Thread Andreas Olsson
I've done implementations with both and start to wonder where futures excel 
over map and places. Ive done two map implementations using futures and places. 
In heavy computations places is unquestionably the best, map and futures has 
small difference. In lighter computation places aren't worth talking about, but 
as before futures has a slim victory over map.
The implementations I made I called pmapf and pmapp and works as map.

-- 
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 6.7 minimal+prebuilt no raco make?

2017-01-10 Thread Sam Tobin-Hochstadt
The `compiler-lib` pkg will install the `raco make` command.

Sam

On Tue, Jan 10, 2017 at 10:21 AM, Deren Dohoda  wrote:
> Basically the subject.
>
> Downloaded the source for 6.7 minimal with prebuilt packages, compiled. I
> didn't see any errors. But apparently there's no "make" command for raco?
> The docs don't indicate this disappeared so I am a little confused. raco
> help indicates make is not a recognized command:
>
> -
> root@foo:~# racket/racket-6.7/bin/raco help
> Usage: raco   ...  ...
>
> Frequently used commands:
>   setup   install and build libraries and documentation
>   pkg manage packages
>
> All available commands:
>   linkmanage library-collection directories
>   pkg manage packages
>   setup   install and build libraries and documentation
>
> A command can be specified by an unambiguous prefix.
> See `raco help ' for help on a command.
> -
>
> Did the install mess up? Is make some separate package I need to install
> since this is "minimal"?
>
> Deren
>
> --
> 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.