Re: [racket-users] Re: preferences file

2017-11-02 Thread Geoffrey Knauth
William, that's a neat idea, I'll try your package.  Thanks!  --Geoff

-- 
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] Re: preferences file

2017-11-02 Thread William G Hatch
Recent discussion thread: 
https://groups.google.com/forum/#!topic/racket-users/6hn9J-r0Nek


Since we're discussing dotfiles and I missed the previous thread, I'm
going to shamelessly promote my basedir package[1], which provides
functions for conveniently reading/writing config files according to
the XDG base directory specification (eg. in ~/.config/, or similar
directory on Windows) respecting the standard environment variables.
Using the standard also makes it more convenient for a user to have
parts of their configuration in multiple files, eg. having both public
and private components, as well as local and global components, and
have the parts composed together.

Let's not clutter up home directories anymore with one-off config
files or directories.  Let's let them live in a sane and configurable
space. 

[1] http://docs.racket-lang.org/basedir/index.html

--
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] Re: preferences file

2017-11-02 Thread Geoffrey Knauth
Awesome, Neil, great suggestions!

-- 
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] Re: preferences file

2017-11-02 Thread Neil Van Dyke
For a "home directory dotfile" kind of preferences file that's arbitrary 
Racket code, I'd do `dynamic-require` instead of `require`.


If you want to use `require` instead, maybe the application is a 
framework, and the user-specific `.rkt` file is the program that is run 
and is what `require`s the framework.


Recent discussion thread: 
https://groups.google.com/forum/#!topic/racket-users/6hn9J-r0Nek


If you don't want arbitrary code in your dotfile, then maybe use the 
Racket reader with some of the features disabled.  (When I've done this, 
I went through the current documentation for the reader, and wrote a 
procedure that does the read while explicitly disabling each reader 
feature that was problematic.)  But I prefer the programmer-centric 
arbitrary-code way for many purposes now, like I say in that earlier 
discussion thread.


--
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: preferences file

2017-11-02 Thread Geoffrey Knauth
The following seems to work for me:

  (require (file "~/.dbaccess.rkt"))

Is that normal / ok ?  Just wondering what other people do.

Geoff

On Thursday, November 2, 2017 at 12:35:25 PM UTC-4, Geoffrey Knauth wrote:
>
> Let's suppose I want to have a preferences file, e.g., "~/.dbaccess.rkt".  
> I used to have a module I would import via 
> "../some-relative-path/dbaccess.rkt", but I thought I would try 
> "~/.dbaccess.rkt" as a module path.  It turned out a module path cannot 
> begin with "/", which happens with the expansion of "~" (it seems).
>
> This leads me to the more general question, what do other people do, what 
> is the convention when, say, they will have a GitHub repo with generally 
> public code, but some private files with, say, database-access codes that 
> are specific to a person's use of a package?
>
> Geoff
>

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