For pedagogical examples, you may like the games that go along with the
"Realm of Racket" book, which are also in the main Racket distribution. For
example, try "Open Require Path …" for `realm/chapter2/source`, or here is
the whole collection on GitHub: https://github.com/racket/realm

On Mon, Sep 9, 2019 at 12:35 PM Prokop Hapala <prokophap...@gmail.com>
wrote:

> how can user know that this directory was installed with racket?  DrRacket
> could have some link to this directory somewhere (e.g. under File > Open,
> or Package Manager ...)
>

"File > Open Require Path …" will let you open files with the same style of
path you would use for `require`, regardless of where they live on the file
system.

It is not very straightforward to run these examples. When I just hit "run"
> it does nothing. And it is not obvious what is the "entry point" ...
> something like "main" function in C/C++ ?
>

The `games/main` module (i.e. "/usr/share/racket/pkgs/games/main.rkt")
implements the "PLT Games" executable that is part of the Racket
distribution. Running it in DrRacket is a little non-obvious because of
this bit at the end of the file:

> ;; For test mode, check that we can at least start,
> ;; but exit right away:
> (module+ test
>   (queue-callback (lambda () (exit )) #f))
>

DrRacket runs `test` submodules by default (see the guide section
<https://docs.racket-lang.org/guide/Module_Syntax.html#%28part._main-and-test%29>),
so running this file will quickly call `exit`. You can adjust this in the
"Language > Choose Language …" dialog by clicking "Show Details" and
customizing the "Submodules to Run," but you could also just run one of
these at the command line:

   - racket --lib games
   - racket /usr/share/racket/pkgs/games/main.rkt
   - plt-games

 -Philip

-- 
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/CAH3z3gbBq%2BEmabZ6zaJqjDELd4t77FuNgFnqdXuun9kMiDQ4-w%40mail.gmail.com.

Reply via email to