Re: [racket-users] Re: raco distribute and runtime paths, conditioned on whether a package was installed at compile time

2019-11-12 Thread Jon Zeppieri
On Tue, Nov 12, 2019 at 10:13 PM Matthew Flatt  wrote:
>
> At Tue, 12 Nov 2019 19:46:01 -0700, Matthew Flatt wrote:
> > Although you can find the files using `find-share-dir` and/or
> > `find-user-share-dir`, adding a 'share mode to `define-runtime-path`
> > would make it possible for `raco distribute` to find and carry along a
> > directory/file when it's present, the same as 'so mode does.
>
> Added.
>

Wow, that was fast. Thanks!

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


Re: [racket-users] Re: raco distribute and runtime paths, conditioned on whether a package was installed at compile time

2019-11-12 Thread Matthew Flatt
At Tue, 12 Nov 2019 19:46:01 -0700, Matthew Flatt wrote:
> Although you can find the files using `find-share-dir` and/or
> `find-user-share-dir`, adding a 'share mode to `define-runtime-path`
> would make it possible for `raco distribute` to find and carry along a
> directory/file when it's present, the same as 'so mode does.

Added.

-- 
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/5dcb74d9.1c69fb81.90474.1a14SMTPIN_ADDED_MISSING%40gmr-mx.google.com.


Re: [racket-users] Re: raco distribute and runtime paths, conditioned on whether a package was installed at compile time

2019-11-12 Thread Matthew Flatt
At Tue, 12 Nov 2019 21:29:44 -0500, Jon Zeppieri wrote:
> I like the idea of installing the data to a "share" directory. I see
> that the `info.rkt` file for a collection has a `copy-shared-files`
> key. In my case, both the `tzinfo` package and the `tzdata` package
> contribute to the `tzinfo` collection. So, two questions: (1) Would it
> work just to add this to the collection-level `info.rkt` in the
> `tzdata` package? 

Yes. I think you'd want to copy the "zoneinfo" directory that way.

> (2) How do I locate these files after they're
> copied? Is this what the (notional) 'share mode for
> `define-runtime-path` would do?

Yes. Although you can find the files using `find-share-dir` and/or
`find-user-share-dir`, adding a 'share mode to `define-runtime-path`
would make it possible for `raco distribute` to find and carry along a
directory/file when it's present, the same as 'so mode does.

(I confused 'lib mode with 'so mode before. I think you want something
like 'so mode.)

-- 
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/5dcb6e6c.1c69fb81.19b8e.5cceSMTPIN_ADDED_MISSING%40gmr-mx.google.com.


Re: [racket-users] Re: raco distribute and runtime paths, conditioned on whether a package was installed at compile time

2019-11-12 Thread Jon Zeppieri
On Tue, Nov 12, 2019 at 2:09 PM Matthew Flatt  wrote:
>
> I'd say the problem is that "info.rkt" and `find-relevant-directories`
> are set up as Racket-installation concepts. They're not made to play
> well with standalone applications.
>
> The most similar concept that plays well with standard applications is
> libraries in the Racket "lib" directory. Having packages that supply
> timezone information install the timezone files to Racket's "lib" (in
> the same way that a package like "db-win32-x86_64" installs a library)
> might be a better approach in the long run.
>
> If I understand, these files would make more sense in a "share"
> directory than in the "lib" directory. If that distinction seems
> important, we could add a 'share mode to `define-runtime-path` that is
> similar to 'lib mode.
>
>
> I think your solution so far, which relies on compile-time checks, will
> not work right with packages that are distributed in "built" form. That
> creates a problem, in turn, for building a Racket distribution.
>

I hadn't thought of built packages, but, yes, that sounds like a problem.

I like the idea of installing the data to a "share" directory. I see
that the `info.rkt` file for a collection has a `copy-shared-files`
key. In my case, both the `tzinfo` package and the `tzdata` package
contribute to the `tzinfo` collection. So, two questions: (1) Would it
work just to add this to the collection-level `info.rkt` in the
`tzdata` package? (2) How do I locate these files after they're
copied? Is this what the (notional) 'share mode for
`define-runtime-path` would do?

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


Re: [racket-users] What is the best way to display styled text in a Racket GUI app?

2019-11-12 Thread Martin DeMello
I just figured this out for my current project; I'm not sure it's the best
way but it's a working way :) I have a subclass of text% that mixes in
html-text-mixin, and then I populate it via render-html-to-text. You can
see the code here:

https://github.com/martindemello/exolve-editor/blob/master/gui.rkt#L28

martin

On Tue, Nov 12, 2019 at 4:00 PM Andre Garzia  wrote:

> Hi Friends,
>
> Does anyone here know what is the best way to show styled text in a
> Racket GUI application?
>
> I've got some markdown that I wish to display but I can't find how to
> display any form of styled text, let alone markdown.
>
> I've started a little project to implement webviews but I think they are
> overkill for this project and to be honest, I couldn't figure out how to
> display a webview on windows.
>
> If anyone could point me into some module or direction, I'd really
> appreciate it.
>
> Best
>
> Andre
>
> --
> 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/a2d7247d-0ca7-faba-c346-3ce0cdd9f130%40andregarzia.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/CAFrFfuGB6q8R_h-8V27WpxNBEiiGRxZu_YjDP5RbZ-EK7pv_mQ%40mail.gmail.com.


[racket-users] What is the best way to display styled text in a Racket GUI app?

2019-11-12 Thread Andre Garzia

Hi Friends,

Does anyone here know what is the best way to show styled text in a 
Racket GUI application?


I've got some markdown that I wish to display but I can't find how to 
display any form of styled text, let alone markdown.


I've started a little project to implement webviews but I think they are 
overkill for this project and to be honest, I couldn't figure out how to 
display a webview on windows.


If anyone could point me into some module or direction, I'd really 
appreciate it.


Best

Andre

--
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/a2d7247d-0ca7-faba-c346-3ce0cdd9f130%40andregarzia.com.


Re: [racket-users] Problem building racket in-place

2019-11-12 Thread 'Reuben Thomas' via Racket Users
On Tue, 12 Nov 2019 at 17:53, Matthew Flatt  wrote:

> At Thu, 7 Nov 2019 23:14:52 +, "'Reuben Thomas' via Racket Users"
> wrote:
> > I have a CONFIG_SITE environment variable which contains the following
> line:
> >
> > test "$prefix" = NONE && prefix="$HOME_LOCAL"
> >
> > (HOME_LOCAL is set to $HOME/.local)
> >
> > Things then go wrong because racket/src/start/configure.ac code relies
> on
> > prefix still being set to NONE in order to finally set prefix to `cd
> > "${srcdfir}/.." && pwd`.
> >
> > Is there some reason that prefix cannot be passed in from the top-level
> > Makefile for an in-place build?
>
> I think it would be ok to add `--prefix=NONE` to `CONFIG_IN_PLACE_ARGS`
> in the top-level makefile (alongside `--enable-origtree`). Does that
> solve the problem?
>

Thanks for the suggestion! That doesn't work, because when configure is
run, it reads CONFIG_SITE, loads my config file that checks `$prefix =
NONE` (it is!), which thus overrides it.
Adding `--prefix=`cd ../.. && pwd` to `CONFIG_IN_PLACE_ARGS` works for
setting `prefix`, but of course configure will then fail to set
`inplacebuild`, because to do so it tests `${prefix} = "NONE"`. Is there
some reason configure can't test `enable_origtree`? Is there some time the
build system is supposed to build in-tree even without --enable-origtree?
If so, could it test `"${prefix}" = "NONE" -o "${enable_origtree}" = "yes"`?

-- 
https://rrt.sc3d.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/CAOnWdojw%2BpNP%2B%2BSjHqz5gbZwLuZcj7G97OG6zOG%3D168hnepe6g%40mail.gmail.com.


Re: [racket-users] Re: raco distribute and runtime paths, conditioned on whether a package was installed at compile time

2019-11-12 Thread Matthew Flatt
At Sun, 10 Nov 2019 15:26:58 -0500, Jon Zeppieri wrote:
> That is, the tzdata package defines, in an info.rkt file, a key named
> `tzdata-zoneinfo-module-path`. I use that to determine if the package
> is installed, and, if so, I create a runtime path for it and add that
> path to the head of a list of paths to search for zoneinfo files.

At Mon, 11 Nov 2019 00:00:37 -0500, Jon Zeppieri wrote:
> I found a version that works, though I still wonder if there'a a
> better approach:

I'd say the problem is that "info.rkt" and `find-relevant-directories`
are set up as Racket-installation concepts. They're not made to play
well with standalone applications.

The most similar concept that plays well with standard applications is
libraries in the Racket "lib" directory. Having packages that supply
timezone information install the timezone files to Racket's "lib" (in
the same way that a package like "db-win32-x86_64" installs a library)
might be a better approach in the long run.

If I understand, these files would make more sense in a "share"
directory than in the "lib" directory. If that distinction seems
important, we could add a 'share mode to `define-runtime-path` that is
similar to 'lib mode.


I think your solution so far, which relies on compile-time checks, will
not work right with packages that are distributed in "built" form. That
creates a problem, in turn, for building a Racket distribution.

-- 
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/5dcb035f.1c69fb81.7aec9.9a95SMTPIN_ADDED_MISSING%40gmr-mx.google.com.


Re: [racket-users] Problem building racket in-place

2019-11-12 Thread Matthew Flatt
At Thu, 7 Nov 2019 23:14:52 +, "'Reuben Thomas' via Racket Users" wrote:
> I have a CONFIG_SITE environment variable which contains the following line:
> 
> test "$prefix" = NONE && prefix="$HOME_LOCAL"
> 
> (HOME_LOCAL is set to $HOME/.local)
> 
> Things then go wrong because racket/src/start/configure.ac code relies on
> prefix still being set to NONE in order to finally set prefix to `cd
> "${srcdfir}/.." && pwd`.
> 
> Is there some reason that prefix cannot be passed in from the top-level
> Makefile for an in-place build?

I think it would be ok to add `--prefix=NONE` to `CONFIG_IN_PLACE_ARGS`
in the top-level makefile (alongside `--enable-origtree`). Does that
solve the problem?


Matthew

-- 
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/5dcaf1a7.1c69fb81.b447e.bfedSMTPIN_ADDED_MISSING%40gmr-mx.google.com.


Re: [racket-users] reading code

2019-11-12 Thread Shu-Hung You
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.
>
> -- hendrik
>

After opening the defining file and after a little green dot shows up
at the bottom-right corner in DrRacket, the "Open Defining File" menu
item will become "Jump to Definition (in Other File)". That will let
you directly jump to the definition site.

(Sadly contract-out identifiers will still defeat Check Syntax.)

Shu-Hung

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

-- 
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/CAMTzy%2BbtV6simooivDAdJCiX-wmR-4bDveEeTuoLnZwuiFLbuA%40mail.gmail.com.