[racket-users] using #lang info copy-foreign-libs

2019-04-01 Thread Stephen De Gabrielle
Hi, I'm trying to work out how to use 'copy-foreign-libs' [1], but not having much luck. I believe the implementation of the collection using ' copy-foreign-libs' is correct because it works in '#lang video', but I've been unable to use it myself. I created a collection 'testffi-1' that would ma

Re: [racket-users] Emacs scribble-mode

2019-04-01 Thread Sam Tobin-Hochstadt
You might be interested in this scribble-mode as well: https://www.neilvandyke.org/scribble-emacs/ (which is quite incomplete -- a more comprehensive one would be great!) Sam On Sun, Mar 31, 2019 at 8:02 AM Alex Harsanyi wrote: > > I started writing Scribble documentation more often lately and E

Re: [racket-users] using #lang info copy-foreign-libs

2019-04-01 Thread Leif Andersen
A common cause of this is you don't have installed the libraries that the library you're trying to load depends on. Since you are using the libvid library it depends on libavutil, which is not (currently) listed as a dependency in the libvid-x86_64-macosx package[1]. Can you try installing the ff

Re: [racket-users] using #lang info copy-foreign-libs

2019-04-01 Thread Stephen De Gabrielle
Thanks Leif, On Mon, Apr 1, 2019 at 3:12 PM Leif Andersen wrote: > A common cause of this is you don't have installed the libraries that > the library you're trying to load depends on. > > Since you are using the libvid library it depends on libavutil, which > is not (currently) listed as a de

[racket-users] Is there any way to redefine printf in main.rkt ?

2019-04-01 Thread Chansey
My racket project consists of several module files (e.g.: "foo.rkt", "bar.rkt", ...). The entry module file is "main.rkt" These files call "printf" in different places of the code (But "printf" only can print messages to REPL). My question is: Is there any way to redefine "printf" in main.rk

[racket-users] Re: Is there any way to redefine printf in main.rkt ?

2019-04-01 Thread Chansey
I know this is not a good style, but is it possible to hack temporarily? On Tuesday, April 2, 2019 at 12:54:45 AM UTC+8, Chansey wrote: > > My racket project consists of several module files (e.g.: "foo.rkt", > "bar.rkt", ...). > > The entry module file is "main.rkt" > > These files call "printf

Re: [racket-users] Is there any way to redefine printf in main.rkt ?

2019-04-01 Thread George Neuner
On 4/1/2019 12:54 PM, Chansey wrote: My racket project consists of several module files (e.g.: "foo.rkt", "bar.rkt", ...). The entry module file is "main.rkt" These files call "printf" in different places of the code (But "printf" only can print messages to REPL). My question is: Is ther

Re: [racket-users] Is there any way to redefine printf in main.rkt ?

2019-04-01 Thread Chansey
I've found a way. Use (current-output-port out). On Tuesday, April 2, 2019 at 1:02:05 AM UTC+8, gneuner2 wrote: > > > On 4/1/2019 12:54 PM, Chansey wrote: > > My racket project consists of several module files (e.g.: "foo.rkt", > > "bar.rkt", ...). > > > > The entry module file is "main.rkt"

Re: [racket-users] Is there any way to redefine printf in main.rkt ?

2019-04-01 Thread George Neuner
On 4/1/2019 1:09 PM, Siyuan Chen wrote: Dear George, This means we must modify these module code? For example: suppose in foo.rkt #lang racket (provide ...) (require ...) (define (my-func-1 x) ...printf..) (define (my-func-2 x)   ...printf..) It must be modified to this? #lang racket (p

Re: [racket-users] Is there any way to redefine printf in main.rkt ?

2019-04-01 Thread George Neuner
On 4/1/2019 1:27 PM, Chansey wrote: I've found a way. Use (current-output-port out). That will work, but it's not a good idea except as a quick hack to test something.  Working in DrRacket, you may find that the output remains redirected after your program has ended (or crashed). If you

Re: [racket-users] Is there any way to redefine printf in main.rkt ?

2019-04-01 Thread Siyuan Chen
Dear George, I have just found a way to solve this problem. Use (current-output-port out). But still very thank you. On Tue, Apr 2, 2019 at 1:30 AM George Neuner wrote: > > On 4/1/2019 1:09 PM, Siyuan Chen wrote: > > Dear George, > > > > This means we must modify these module code? > > > > F

Re: [racket-users] Is there any way to redefine printf in main.rkt ?

2019-04-01 Thread Chansey
Dear George, Your method is also very well. Because using with-output-to-file to wrapper main.rkt is enough, not must in every module files. Thanks. On Tuesday, April 2, 2019 at 1:30:09 AM UTC+8, gneuner2 wrote: > > > On 4/1/2019 1:09 PM, Siyuan Chen wrote: > > Dear George, > > > > This mea

Re: [racket-users] Is there any way to redefine printf in main.rkt ?

2019-04-01 Thread Chansey
More elegant way is combining with-output-to-file with dynamic-require (with-output-to-file FILE (lambda () (dynamic-require "main.rkt" #f)) ) On Tuesday, April 2, 2019 at 1:53:47 AM UTC+8, Chansey wrote: > > Dear George, > > Your method is also very well. > > Because using with-outpu

[racket-users] Re: Example "RealWorld" web application

2019-04-01 Thread amz3
On Thursday, March 28, 2019 at 1:03:57 AM UTC+1, Philip McGrath wrote: > > The RealWorld project defines a simple but > realistic client–server web application (a Medium-like blogging platform) > for different front- and back-end frameworks to implement as an extended >

Re: [racket-users] Is there any way to redefine printf in main.rkt ?

2019-04-01 Thread 'John Clements' via Racket Users
Oog… I don’t really think dynamic-require is the right tool here at all. Setting the current-output-port seems vastly more reasonable. John > On Apr 1, 2019, at 12:19, Chansey wrote: > > More elegant way is combining with-output-to-file with dynamic-require > > (with-output-to-file FILE >

[racket-users] Racket News - Issue 5

2019-04-01 Thread 'Paulo Matos' via Racket Users
Issue 5 is here. https://racket-news.com/2019/04/racket-news-issue-5.html Come on - make a strong espresso today. You know you deserve it! -- Paulo Matos -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop

[racket-users] Generate really large random numbers in Racket

2019-04-01 Thread polarishehn
Hello everyone, It appears that the largest number returned by the random function in Racket is 4294967087-1 for a good reason. Are there any libraries or simple approaches to generate a number larger than that? Thanks, Shaobo -- You received this message because you are subscribed to the Goo

Re: [racket-users] Generate really large random numbers in Racket

2019-04-01 Thread Robby Findler
Generate multiples of those and combine them (shifting old ones over and adding new ones as the lowest digits)? I'm not sure of a good way to generate nats uniformly at random where you don't specify an upper bound, but Neil Toronto suggested something crazy we used this paper: http://users.cs.nor

Re: [racket-users] Generate really large random numbers in Racket

2019-04-01 Thread Shaobo He
Thank you for your reply. This is my thought too but I'm not sure if combining multiple random bits break any good properties of random number generators. Sorry I should've mentioned it. I was talking about bounded random numbers. Robby Findler 于2019年4月1日周一 下午3:35写道: > Generate multiples of thos

Re: [racket-users] Generate really large random numbers in Racket

2019-04-01 Thread Alex Harsanyi
You can use `crypto-random-bytes` to generate large random numbers, however, that function returns a string of bytes, which you have to combine into an integer: (define (random-bignum bits)

Re: [racket-users] Generate really large random numbers in Racket

2019-04-01 Thread WarGrey Gyoudmon Ju
Hi, I am writing SSH in pure typed racket, Generating a big random primes is one of the tasks and I just finished it. https://github.com/wargrey/lambda-shell/blob/master/ssh/digitama/algorithm/random.rkt https://github.com/wargrey/lambda-shell/blob/master/ssh/digitama/algorithm/rsa.rkt Before I w

Re: [racket-users] Generate really large random numbers in Racket

2019-04-01 Thread 'Paulo Matos' via Racket Users
Check the math library by Neil Toronto: https://docs.racket-lang.org/math/base.html?q=random#%28part._.Random_.Number_.Generation%29 (random-natural k) → Natural k : Integer Returns a random natural number less than k, which must be positive. Use (random-natural k) instead of (rand

Re: [racket-users] Generate really large random numbers in Racket

2019-04-01 Thread 'Paulo Matos' via Racket Users
On 01/04/2019 23:37, Robby Findler wrote: > Generate multiples of those and combine them (shifting old ones over > and adding new ones as the lowest digits)? > > I'm not sure of a good way to generate nats uniformly at random where > you don't specify an upper bound, but Neil Toronto suggested