Re: [racket-users] hackernews

2018-12-16 Thread Alex Harsanyi


On Sunday, December 16, 2018 at 12:48:09 AM UTC+8, Peter Schmiedeskamp 
wrote:
>
> I’m probably guilty of already being part of this task-force. To add, I 
> wonder if there’d be value in some longer, blog-form replies to interesting 
> HackerNews queries. 
>
> For example, someone was extolling the virtues of some new system for 
> building and packaging simple GUI apps for Linux using Python. I’ve poked 
> around with the GUI and packaging facilities of Racket enough to feel like 
> Racket has a pretty good story to tell, at least for smaller cross-platform 
> apps. A short blog showing the end-to-end creation of a small GUI app, with 
> emphasis on showing the symbiosis of the GUI library and the excellent raco 
> packaging and distribution facilities would be a great “reply” to such an 
> article on HN. 


> I wonder if there's a way that these use cases could at least be 
> collected... maybe as an RFB—Request For Blog. Time is always at a premium, 
> but I could imagine picking off a blog post here and there even though I’m 
> a decidedly rank novice Racketeer. 
>
> Maybe there’s already a list somewhere? Maybe RFBs could be a section of 
> the Racket Blog? 
>


I have written a few blog posts on Racket GUI topics and I have a few more 
planned.  They cover some more advanced uses of the GUI library -- I think 
the basics are already well documented. You can find them here:

   https://alex-hhh.github.io/tags/racket.html

Alex.

-- 
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: hackernews

2018-12-16 Thread Will Jukes
Oh but that place just seems so awful.

On Thursday, December 13, 2018 at 6:53:41 PM UTC-5, Neil Van Dyke wrote:
>
> This might be a bad idea, and normally I disapprove of this sort of 
> thing, but... does anyone want to take on the job of RACKET EVANGELISM 
> STRIKE FORCE, among a concentration of startup-types and other software 
> practitioners? 
>
> Specifically, you'd participate regularly in Y Combinator's popular 
> "Hacker News" Web forum, "https://news.ycombinator.com/;, and, when the 
> not-unusual occasion to mention/show a strength of Racket presents 
> itself, do so. 
>
> I occasionally see Racket mentioned on HN, but not nearly as often as it 
> legitimately could be. 
>
> (There are also other strategic targets for the RACKET EVANGELISM STRIKE 
> FORCE operator or cell, and I recall Eli Barzilay and others active on a 
> lot of them years ago, but HN might be first priority right now.) 
>
>

-- 
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] with-input-from-file question

2018-12-16 Thread Jonathan Simpson
Ah, thanks!

On Sunday, December 16, 2018 at 3:53:06 PM UTC-5, Jon Zeppieri wrote:
>
>
> On Sun, Dec 16, 2018 at 2:59 PM Jonathan Simpson  > wrote:
>
>> What is the difference between this code, which reads and returns "#lang" 
>> from the file:
>> (define in-file (open-input-file "adventure.rkt"))
>> (parameterize ([current-input-port in-file]) (read-string 5))
>>
>> and this code which appears to still read from stdin:
>>
>> (with-input-from-file "adventure.rkt" (read-string 5))
>>
>> I thought with-input-from-file would set the current-input-port to the 
>> file in basically the same way as the first code segment.
>>
>> I see this behavior from both DrRacket and Emacs racket-mode.
>>
>>
> `with-input-from-file` takes a thunk (that is, a procedure of 0 
> parameters) as its second argument, so your code should be:
>
> (with-input-from-file "adventure.rkt" (λ () (read-string 5)))
>
> I'd expect your code to read from stdin but then raise a contract error 
> when checking the arguments to `with-input-from-file`.
>
> - Jon
>
>>
>>

-- 
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] with-input-from-file question

2018-12-16 Thread Jon Zeppieri
On Sun, Dec 16, 2018 at 2:59 PM Jonathan Simpson  wrote:

> What is the difference between this code, which reads and returns "#lang"
> from the file:
> (define in-file (open-input-file "adventure.rkt"))
> (parameterize ([current-input-port in-file]) (read-string 5))
>
> and this code which appears to still read from stdin:
>
> (with-input-from-file "adventure.rkt" (read-string 5))
>
> I thought with-input-from-file would set the current-input-port to the
> file in basically the same way as the first code segment.
>
> I see this behavior from both DrRacket and Emacs racket-mode.
>
>
`with-input-from-file` takes a thunk (that is, a procedure of 0 parameters)
as its second argument, so your code should be:

(with-input-from-file "adventure.rkt" (λ () (read-string 5)))

I'd expect your code to read from stdin but then raise a contract error
when checking the arguments to `with-input-from-file`.

- Jon

>
>

-- 
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: Are contracts incompatible with Typed Racket?

2018-12-16 Thread Jake Herrmann
I have the same understanding of when contracts and type annotations are 
checked. It seems like they would compliment each other quite nicely 
because you could catch all type errors at compile time and leave contracts 
for runtime. However, it seems that forms such as define/contract cannot be 
used with type annotations. I also noticed that both contracts and type 
annotations use the -> syntax; could that be related to why they don't work 
together?

On Sunday, December 16, 2018 at 2:09:05 AM UTC-9, Zelphir Kaltstahl wrote:
>
> As far as I know contracts in Racket are evaluated at run time, for 
> example when calling a procedure from another module and the module has a 
> contract for the procedure, while types of typed Racket are evaluated at 
> read time. They seem to be independent concepts. I am not sure how to use 
> both of them in the same project. However, I remember, that I also tried to 
> use contracts additionally when using typed Racket once or twice and ended 
> up having only contracts, because of some problem. What I do remember is, 
> that I had some typed Racket type inference problems, when I had some kind 
> of nested for loops. It might be, that this is, why I ended up using only 
> contracts and it might have been a solvable problem, had I saved that code 
> and asked here on the mailing list.
>
> > I recently started learning Racket and quickly switched to Typed Racket. 
> For the most part I've been very happy with it, but I'm unclear on whether 
> it's possible to create contracts in Typed Racket (for expressing 
> constraints other than type requirements). I've been unable to find an 
> explicit answer to my question in the docs for either contracts or Typed 
> Racket, but I've run several experiments and it seems that contracts are 
> incompatible with Typed Racket. This discussion 
> 
>  seems 
> to support my conclusion. 
>
> > If you can't create your own contracts in Typed Racket, are you meant to 
> limit all of your contract-related needs to type requirements? Or just use 
> vanilla Racket if you need a full-fledged contract system? Additionally, 
> could someone point me to the documentation that would have answered by 
> question (if it exists)?
>
> > 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] with-input-from-file question

2018-12-16 Thread Jonathan Simpson
What is the difference between this code, which reads and returns "#lang" 
from the file:
(define in-file (open-input-file "adventure.rkt"))
(parameterize ([current-input-port in-file]) (read-string 5))

and this code which appears to still read from stdin:

(with-input-from-file "adventure.rkt" (read-string 5))

I thought with-input-from-file would set the current-input-port to the file 
in basically the same way as the first code segment.

I see this behavior from both DrRacket and Emacs racket-mode.

Thanks,
Jonathan

-- 
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: Are contracts incompatible with Typed Racket?

2018-12-16 Thread Zelphir Kaltstahl
As far as I know contracts in Racket are evaluated at run time, for
example when calling a procedure from another module and the module has
a contract for the procedure, while types of typed Racket are evaluated
at read time. They seem to be independent concepts. I am not sure how to
use both of them in the same project. However, I remember, that I also
tried to use contracts additionally when using typed Racket once or
twice and ended up having only contracts, because of some problem. What
I do remember is, that I had some typed Racket type inference problems,
when I had some kind of nested for loops. It might be, that this is, why
I ended up using only contracts and it might have been a solvable
problem, had I saved that code and asked here on the mailing list.

> I recently started learning Racket and quickly switched to Typed
Racket. For the most part I've been very happy with it, but I'm unclear
on whether it's possible to create contracts in Typed Racket (for
expressing constraints other than type requirements). I've been unable
to find an explicit answer to my question in the docs for either
contracts or Typed Racket, but I've run several experiments and it seems
that contracts are incompatible with Typed Racket. This discussion

 seems
to support my conclusion.

> If you can't create your own contracts in Typed Racket, are you meant
to limit all of your contract-related needs to type requirements? Or
just use vanilla Racket if you need a full-fledged contract system?
Additionally, could someone point me to the documentation that would
have answered by question (if it exists)?

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