Re: [racket-users] reading code

2019-11-11 Thread Robby Findler
On Mon, Nov 11, 2019 at 10:30 AM Hendrik Boom  wrote:
>
> On Fri, Oct 25, 2019 at 11:31:41AM +0200, Niklas Larsson wrote:
> > Hi!
> >
> > If you right click on an identifier in drracket you get “jump to binding 
> > occurrence” and “jump to definition” (if it’s defined in another file). 
> > Don’t those do what you want?
>
> Close.
>
> Using "jump to binding occurrence" gets me to the require
> line that provides me the symbol.  I can then ask it to open
> that file, but if the other file just imports a number of other
> modules and provides all-from-out it still leaves me a bit lost.
>
> I turn out not to have "jump to definition" but
> "open defining file", which creates a new tab.  Then I still
> have to search for the name I was looking for.  But at least
>  can find it.

That menu item will become "jump to definition" if the file is already
open in another tab (and check syntax has had time to analyze that
tab's content).

Robby

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAL3TdOPYu3cxJ8jm%3DCgMKso37wSS54A0a6KjdpuX9XJ%3DN-pseg%40mail.gmail.com.


Re: [racket-users] What’s everyone working on this week (46/2019)?

2019-11-11 Thread Christopher Lemmer Webber
Hendrik Boom writes:

> On Mon, Nov 11, 2019 at 05:09:47AM -0800, Stephen De Gabrielle wrote:
>> New week, new Racket! What are you folks up to? Answer here or over at 
>> /r/racket  !
>
> Trying to figure out pict3d's use of opengl.
> There seems to be a lot of useful code there for openGL buffer
> management, which I'm still finding incomprehensible.
>
> I want texture mapping.  At least texture mapping onto a flat 
> 2D rectangle in 3D space..
>
> Maybe all I'll accomplish this month is a bit of Pict3D internal
> documentation.  Maybe that'll count as a game writing tool for the 
> contest, maybe not.  But I need it for the world-generation I want.
>
> Maybe I'll not even accomplish that.
>
> -- hendrik

Really happy to hear about more eyes on Pict3d.  Really interesting
project that I'd like to see succeed.

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/87imnqgt2t.fsf%40dustycloud.org.


Re: [racket-users] What’s everyone working on this week (46/2019)?

2019-11-11 Thread Stephen De Gabrielle
Nice! Documentation improvements ALWAYS count. I can't tell you how much I
appreciate documentation. Every single line you add is one I don have to
work out or sift through rubbish on SO.

Stephen

On Mon, Nov 11, 2019 at 2:18 PM Hendrik Boom  wrote:

> On Mon, Nov 11, 2019 at 05:09:47AM -0800, Stephen De Gabrielle wrote:
> > New week, new Racket! What are you folks up to? Answer here or over at
> > /r/racket  !
>
> Trying to figure out pict3d's use of opengl.
> There seems to be a lot of useful code there for openGL buffer
> management, which I'm still finding incomprehensible.
>
> I want texture mapping.  At least texture mapping onto a flat
> 2D rectangle in 3D space..
>
> Maybe all I'll accomplish this month is a bit of Pict3D internal
> documentation.  Maybe that'll count as a game writing tool for the
> contest, maybe not.  But I need it for the world-generation I want.
>
> Maybe I'll not even accomplish that.
>
> -- hendrik
> >
> > --
> > 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.
> > To view this discussion on the web visit
> https://groups.google.com/d/msgid/racket-users/2b96b79f-442a-4000-8147-1b1ff3ea5147%40googlegroups.com
> .
>
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAGHj7-Lp2mSfAvUnJ4oC8RyZ2ZAZJTFsCHpjvinv3tRxHgiATA%40mail.gmail.com.


Re: [racket-users] reading code

2019-11-11 Thread Hendrik Boom
On Fri, Oct 25, 2019 at 11:31:41AM +0200, Niklas Larsson wrote:
> Hi!
> 
> If you right click on an identifier in drracket you get “jump to binding 
> occurrence” and “jump to definition” (if it’s defined in another file). Don’t 
> those do what you want?

Close.

Using "jump to binding occurrence" gets me to the require
line that provides me the symbol.  I can then ask it to open
that file, but if the other file just imports a number of other
modules and provides all-from-out it still leaves me a bit lost.

I turn out not to have "jump to definition" but
"open defining file", which creates a new tab.  Then I still
have to search for the name I was looking for.  But at least
 can find it.

-- hendrik

> 
> Regards,
> Niklas
> 
> > 24 okt. 2019 kl. 17:46 skrev Hendrik Boom :
> > 
> > What tools are there to help understand large Racket programs?
> > 
> > I'm trying to grok the innards of Pict3D, which is, I believe, typed 
> > Racket.
> > 
> > But I have difficulty finding bindings of symbols across many complex 
> > require's and provide's through many directories of source code.
> > 
> > I'm looking for tools that work on a Linux system.  I know that in 
> > principle I could install something like Microsoft's big fat 
> > development environment (which may have a plugin for Racket)
> > but it would surpise me if there wasn't something relevant within the 
> > Racket ecosystem.
> > 
> > If DrRacket already does this, I haven't found it.  It does lovely 
> > graphics do show bindings, but I don't see how to follow those lines 
> > even to parts of the same file that happen to be out of the window 
> > area, let alone to other files.
> > 
> > Does DrRacket also show the types of symbols or expressions in typed 
> > Racket?
> > 
> > -- hendrik
> > 
> > -- 
> > 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.
> > To view this discussion on the web visit 
> > https://groups.google.com/d/msgid/racket-users/20191024154608.f3n3parggb2t5ckj%40topoi.pooq.com.
> 
> -- 
> 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.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/racket-users/3B855EDE-EE87-4D96-A6F3-35C5BCFF2D0A%40gmail.com.

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/2019162958.ybiunmwlvj2hqj23%40topoi.pooq.com.


Re: [racket-users] Evaluating to get the output with a specific lang

2019-11-11 Thread Christopher Lemmer Webber
Jay McCarthy writes:

> I feel like I might not understand what you want, but it feels like
> you just want to use `make-module-evaluator` from `racket/sandbox`:
>
> ```
> #lang racket/base
> (require racket/sandbox)
>
> (define (read-script s)
>   (((make-module-evaluator s) 'script) 5))
>
> (module+ test
>   (read-script
>"#lang racket/base
> (provide script)
> (define (script x) (add1 x))")
>   (read-script
>"#lang typed/racket/base
> (provide script)
> (: script (-> Number Number))
> (define (script x) (add1 x))"))
> ```
>
> You may want to set the `#:language` argument to control the language.
> And you will also want to set `sandbox-namespace-specs` to link up
> your internal data-structure providing modules so you can communicate.
> But other than those two things, it should be pretty straightforward.
> What is different about this than what you are trying to do?
>
> Jay

I think you're right, the sandbox code is fine enough to use.  I was
trying to remember why I hadn't been exploring this method, but quickly
rediscovered it:

racket-sandbox.rkt> (define evalu8
  (make-evaluator 'racket/base))

; current-load-relative-directory: `exists' access denied for 
/home/cwebber/sandbox/
; Context:
;  
/gnu/store/8iy4dl15yl016vgkd040njzf9351hh7j-racket-7.3/share/racket/pkgs/sandbox-lib/racket/sandbox.rkt:716:0
 evaluate-program
;  
/gnu/store/8iy4dl15yl016vgkd040njzf9351hh7j-racket-7.3/share/racket/pkgs/sandbox-lib/racket/sandbox.rkt:853:2
 user-process

Looks like this is because I'm running Racket on Guix; the other source
I can find of this coming up is
  
https://users.racket-lang.narkive.com/A6CLMoNo/question-about-sandbox-rktl-failing-its-unit-test
and it would indeed make sense if it *was* related to symbolic links,
since Guix makes heavy use of symlinks for its functional package
management.

Looks like the problem is security guards really:

racket-sandbox.rkt> (parameterize ([sandbox-security-guard  
(current-security-guard)])
  (define evalu8
(make-evaluator 'racket/base))
  (evalu8 '(+ 1 2 3)))
6

Anyway that's an unrelated bug, but probably one I should file.
Nonetheless I think even in the interim I have a way to move forward,
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/87k186gz2v.fsf%40dustycloud.org.


Re: [racket-users] Anyone who has mastered DrRacket

2019-11-11 Thread David Storrs
Hi Mahmmadullah,

It sounds like you're asking for help with homework. I suspect there will
be general reluctance to help you with that in more than general terms, and
also reluctance to provide a personal contact address. Why don't you try
asking the list directly, without including actual scans?

To have the best chance of getting answers, your questions should:

- Be clear and simple
- Be general. Avoid "what is the result of this expression" questions.
- Include details about what you've already tried and any error messages
you got.

Some examples:

Bad: "Here is a specification. Please give me code."

Probable answer: Total silence.


Better: "I'm building a simple webserver and having trouble with HTML
parsing. I can't figure out how to handle attributes. Any suggestions?"

Probable answer: "Take a look at the html-parsing package or one of the
equivalents. Alternatively, if you are required to write it yourself, try
accumulating them together using 'for/hash'."


Best: "I'm building a simple webserver and when I try to connect it throws
exn: network:foo and spits out the following error stack. I think the issue
is in the chunk of code I've included below, but I have no idea what it
might be in particular. Help?"

Probable answer: "You didn't  and here is some code to fix it. Also,
you could simplify things like this . Don't forget about ; you can find more in ."





On Mon, Nov 11, 2019, 7:56 AM Mahmmadullah Obaidi 
wrote:

> Hello I am a computer engineering student studying DrRacket. I need
> someone who can help me out in worksheets anyone can give his/her number so
> I can send my worksheet photos to them. Thanks in advance
>
> --
> 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.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/racket-users/daaa7c79-9876-4285-abe1-a4d83533a896%40googlegroups.com
> .
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAE8gKodAYx%3DwDZSamkORAt57-PQLz9HyymHMqrHhhxtqu_3L2g%40mail.gmail.com.


Re: [racket-users] What’s everyone working on this week (46/2019)?

2019-11-11 Thread Hendrik Boom
On Mon, Nov 11, 2019 at 05:09:47AM -0800, Stephen De Gabrielle wrote:
> New week, new Racket! What are you folks up to? Answer here or over at 
> /r/racket  !

Trying to figure out pict3d's use of opengl.
There seems to be a lot of useful code there for openGL buffer
management, which I'm still finding incomprehensible.

I want texture mapping.  At least texture mapping onto a flat 
2D rectangle in 3D space..

Maybe all I'll accomplish this month is a bit of Pict3D internal
documentation.  Maybe that'll count as a game writing tool for the 
contest, maybe not.  But I need it for the world-generation I want.

Maybe I'll not even accomplish that.

-- hendrik
> 
> -- 
> 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.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/racket-users/2b96b79f-442a-4000-8147-1b1ff3ea5147%40googlegroups.com.

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/2019141833.dzb2wxoclj74b6au%40topoi.pooq.com.


[racket-users] drrracket night mode too bright

2019-11-11 Thread Hendrik Boom
Last night a 4 AM I fount DrRacket's night mode too bright.
The code in the code pane would hve been quite readable (blue and 
green on a black background), but the framing was blindingly bright.
That's everything from the bright menu bar to th list of tabs.

Would it be possible  to include these in night mode as well?

Not to mention the window frame itself, which you may not have much 
control over, and about which I'll have to sweet-talk my window manager.

I'm running a daily build from a few months ago on Devuan beowulf on a 
Purism AMD64 laptop.

-- hendrik

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/2019140151.hbm52wozxjudx4k2%40topoi.pooq.com.


Re: [racket-users] Evaluating to get the output with a specific lang

2019-11-11 Thread David Storrs
Don't forget to handle multiple value return. What will you do if the last
line in the file is (values a b)?

Also, side effects. Do you care if someone includes a print/write/display
statement? You mentioned that the code would be safe, so presumably
tcp-connect and sqlite3-connect are not issues.

On Sun, Nov 10, 2019, 4:44 PM Christopher Lemmer Webber <
cweb...@dustycloud.org> wrote:

> Well, I think I figured out how to get further:
>
> with example1.rkt being:
>
> ```
> #lang racket/base
> ;; #lang dungeon/misery
>
> (define ((make-start-game read-save-file) player-name)
>   (list 'running-this-read-save-file: read-save-file
> 'on-player-name: player-name
> 'result: (read-save-file player-name)))
>
> (define (entrypoint read-save-file)
>   (make-keyword-procedure
>(lambda (kws kw-args method-name . args)
>  (define method
>(case method-name
>  ['start-game (make-start-game read-save-file)]
>  ['what-is-make-start-game (lambda () make-start-game)]
>  ['throw-error
>   (lambda ()
> (error "oh no :("))]
>  [else (error "owch!")]))
>  (keyword-apply method kws kw-args args
>
> (provide entrypoint)
> ```
>
> It seems I'm able to read things in:
>
> ```
> read-example.rkt> (parameterize ([current-namespace
>(module->namespace 'racket/base)]
>   [read-accept-reader #t])
>  (define stx
>(call-with-input-file "example1.rkt"
>  (lambda (ip)
>(read-syntax 'my-module ip
>  (eval stx)
>  (eval '(require 'example1))
>  (dynamic-require ''example1 'entrypoint))
> #
> ```
>
> I know that's kludgy, but it seems closer to being on track.  Thanks to
> everyone who has responded.
>
> --
> 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.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/racket-users/87sgmvh0dr.fsf%40dustycloud.org
> .
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAE8gKofVBFEgZGeVEdKE4-gi3j-Bca4j7%2BMEx3qgu6Q9L2A71w%40mail.gmail.com.


[racket-users] What’s everyone working on this week (46/2019)?

2019-11-11 Thread Stephen De Gabrielle
New week, new Racket! What are you folks up to? Answer here or over at 
/r/racket  !

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/2b96b79f-442a-4000-8147-1b1ff3ea5147%40googlegroups.com.


[racket-users] Anyone who has mastered DrRacket

2019-11-11 Thread Mahmmadullah Obaidi
Hello I am a computer engineering student studying DrRacket. I need someone who 
can help me out in worksheets anyone can give his/her number so I can send my 
worksheet photos to them. Thanks in advance 

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/daaa7c79-9876-4285-abe1-a4d83533a896%40googlegroups.com.