[racket-users] namespace-variable-value thinks functions are bound to syntax

2017-10-29 Thread Junsong Li
Hello list,

In the following program, racket thinks foo2, and foo3 are bound to
syntax. Is this expected behavior?

-- File: go.rkt

#lang racket

(module p racket
  (provide (all-defined-out))

  (define (foo0 a b)
(+ a b))
  (define (foo1 a b [c 3])
(+ a b c))
  (define (foo2 a b [c 3] #:kw1 kw1)
(+ a b c))
  (define (foo3 a b [c 3] #:kw1 kw1 #:kw2 [kw2 1])
(+ a b c))
  )

(require syntax/location)

(define ns (make-base-empty-namespace))
(parameterize ([current-namespace ns])
  (namespace-require (quote-module-path p)))

(namespace-variable-value 'foo0 #t #f ns) ; OK
(namespace-variable-value 'foo1 #t #f ns) ; OK
(namespace-variable-value 'foo2 #t #f ns) ; namespace-variable-value:
bound to syntax in: foo2
(namespace-variable-value 'foo3 #t #f ns) ; namespace-variable-value:
bound to syntax in: foo3

-- 
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] DrR compilation progress bar

2017-10-29 Thread Robby Findler
Yes, I can see that. That said, I think that good GUI design is
probably best conducted not in brainstorming sessions on a mailing
list, however.

At the risk of repeating myself, I think it makes sense to see if we
can get good information first and then decide where to put it second.
I still think there are lots of places where it could do and be
unobtrusive, but it will be easier to find a good one if we know what
kind of information we have.

Robby


On Sun, Oct 29, 2017 at 5:44 PM, 'John Clements' via Racket Users
 wrote:
>
>> On Oct 29, 2017, at 15:35, Robby Findler  wrote:
>>
>> On Sun, Oct 29, 2017 at 5:31 PM, John Clements
>>  wrote:
>>>
 On Oct 29, 2017, at 15:27, Robby Findler  
 wrote:

 I think it is a bad idea to dump output into the interactions that
 isn't being printed by the program.
>>>
>>> We currently print “Welcome to DrRacket” at the start of each interaction, 
>>> so it’s not as if *all* of the output is generated by the program.
>>
>> True. A little status bar that showed up there wouldn't be
>> objectionable if it were clearly not output, for example. That seems
>> against the ease (which seem to be the spirit of the suggestion), tho.
>>
>>> How about a “turn-down” arrow printed right before or after this message 
>>> that when opened will display this input? This turn-down arrow could have 
>>> state, so that if you opened it last time, it would stay open in future 
>>> runs.
>>
>> Well, the logging window is a lot like that, but you have to click a
>> menu item instead of turn-down something a triangle (which seems
>> better to me).
>
> Speaking only for myself, the logging window chews off a giant chunk of my 
> user interface; leaving it open makes me feel like I’m editing in a tiny 
> little window. Adding output to the top of the interactions window costs me 
> nothing, since it scrolls to disappear. Maybe I’m missing something?
>
> John
>
>>
>> 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.
> For more options, visit https://groups.google.com/d/optout.

-- 
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] DrR compilation progress bar

2017-10-29 Thread Neil Van Dyke
How about a progress bar in the status bar (like some Web browsers used 
to have, and Thunderbird still does), accept that it will be 
non-monotonic and not an accurate wall-clock-time % for some compilation 
tasks, and overlay it with some simple metric like "Compiled 8 / 12 
files..."?


If you can find a way to also visually fit in the filename(s) of the 
file(s) most immediately being compiled on the cores at that moment 
(some of the leaves in the tree of not-yet-finished-compiled 
dependencies), that might also be helpful.


More information, like what's being compiled, could be sent as `debug` 
to the logger, or maybe as `info` for whatever the compiler's logger.


A transient popup/dialog window, rather than status bar, might also 
work, but DrRacket is nicely tile-ly, and a transient frame for this 
little status indicator might not be the best UI.  (An app startup 
splash screen is different.)


--
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] DrR compilation progress bar

2017-10-29 Thread 'John Clements' via Racket Users

> On Oct 29, 2017, at 15:35, Robby Findler  wrote:
> 
> On Sun, Oct 29, 2017 at 5:31 PM, John Clements
>  wrote:
>> 
>>> On Oct 29, 2017, at 15:27, Robby Findler  
>>> wrote:
>>> 
>>> I think it is a bad idea to dump output into the interactions that
>>> isn't being printed by the program.
>> 
>> We currently print “Welcome to DrRacket” at the start of each interaction, 
>> so it’s not as if *all* of the output is generated by the program.
> 
> True. A little status bar that showed up there wouldn't be
> objectionable if it were clearly not output, for example. That seems
> against the ease (which seem to be the spirit of the suggestion), tho.
> 
>> How about a “turn-down” arrow printed right before or after this message 
>> that when opened will display this input? This turn-down arrow could have 
>> state, so that if you opened it last time, it would stay open in future runs.
> 
> Well, the logging window is a lot like that, but you have to click a
> menu item instead of turn-down something a triangle (which seems
> better to me).

Speaking only for myself, the logging window chews off a giant chunk of my user 
interface; leaving it open makes me feel like I’m editing in a tiny little 
window. Adding output to the top of the interactions window costs me nothing, 
since it scrolls to disappear. Maybe I’m missing something?

John

> 
> 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.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Open source projects

2017-10-29 Thread Neil Van Dyke
When you're first learning Racket, wanting to contribute to the 
community is very admirable, but I think your *first* priority should be 
to get experience with Racket.  I think this prioritization will tend to 
make you more useful to everyone, sooner.


I suggest getting experience with Racket by making things that you want 
to make, and playing with language features that you want to understand.


Maybe you want to make a particular GUI app that you'd use, or a syntax 
extension you find yourself wanting, or a neat string manipulation 
function that you want for practical use or to see whether it can be 
done, or a tiling X window manager, or an IRC bot that `PRIVMSG`s nasty 
dotcom/logger bots that they should feel bad, or an IMAP&SMTP email 
program (warning: working well with a diversity of servers is much more 
work than you'd think), or a Racket implementation of your beloved first 
programming language, or see how you might express concepts from any of 
your school classes computationally in Racket.  (This is not a list of 
things to do, but off-the-cuff examples that might spark a line of 
thought that gets you inspired to something you want to do.  You can 
understand the problem domain and your requirements, and pursue things 
that you're inspired to put work into, and keep it fun and rapid for 
now. Eventually, one or more of the things you make for yourself and 
learning might turn into something that others also want.)


While you're first learning Racket by using it, it might also be helpful 
to others if you kept written notes on things that you found confusing.  
Eventually, this list might help improve the documentation for others.


Exception: if you're an experienced programmer in some other languages, 
you might be able to recognize some package you'd like to have that 
Racket is missing, and to figure out how to get your feet wet with 
Racket by building a reusable, idiomatic, good-quality package that 
others will find it useful.


--
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] DrR compilation progress bar

2017-10-29 Thread Robby Findler
On Sun, Oct 29, 2017 at 5:31 PM, John Clements
 wrote:
>
>> On Oct 29, 2017, at 15:27, Robby Findler  wrote:
>>
>> I think it is a bad idea to dump output into the interactions that
>> isn't being printed by the program.
>
> We currently print “Welcome to DrRacket” at the start of each interaction, so 
> it’s not as if *all* of the output is generated by the program.

True. A little status bar that showed up there wouldn't be
objectionable if it were clearly not output, for example. That seems
against the ease (which seem to be the spirit of the suggestion), tho.

> How about a “turn-down” arrow printed right before or after this message that 
> when opened will display this input? This turn-down arrow could have state, 
> so that if you opened it last time, it would stay open in future runs.

Well, the logging window is a lot like that, but you have to click a
menu item instead of turn-down something a triangle (which seems
better to me).

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.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] `raco pkg install` from private GitHub repo?

2017-10-29 Thread Matthew Butterick
I think I found the problem. On this line:

https://github.com/racket/racket/blob/master/racket/collects/pkg/private/checkout-credentials.rkt#L10
 


The variable `credentials-list` starts out as

[credentials-list (cons #f (get-git-checkout-credentials))]

My correct checkout credentials do appear in `(get-git-checkout-credentials)`. 
But on the next line we have:

(define credentials (first credentials-list))

So the first value assigned to `credentials` is #f. This percolates through, 
and when I run this command:

raco pkg install https://github.com/mbutterick/app.git

The args received by `git-checkout` are:

host = "github.com"
repo = "mbutterick/app.git"
dest-dir = #f
transport = 'https
ref = "master"
given-depth = 1
initial-error = #
given-tmp-dir = #f
clean-tmp-dir? = #t
verify? = #t
given-port = #f
strict-links? = #f
username = #f
password = #f

Notice the username and password are #f.

But when I go back to "checkout-credentials.rkt" and change this expression:

[credentials-list (cons #f (get-git-checkout-credentials))]

To this:

[credentials-list (get-git-checkout-credentials)]

Then my username and password get passed to `raco pkg install 
https://github.com/mbutterick/app.git`, and everything works as expected:

host = "github.com"
repo = "mbutterick/app.git"
dest-dir = #f
transport = 'https
ref = "master"
given-depth = 1
initial-error = #
given-tmp-dir = #f
clean-tmp-dir? = #t
verify? = #t
given-port = #f
strict-links? = #f
username = "mbutterick"
password = "password"

Notice that the username and password now get passed through.





> On Oct 25, 2017, at 6:50 PM, Jay McCarthy  wrote:
> 
> Mmm, that SHOULD be the same code path as what `raco pkg` is using.
> Could you plop an eprintf on this line and see what arguments `raco
> pkg` is giving `git-checkout` and we can see what code is at fault?
> 
> https://github.com/racket/racket/blob/master/racket/collects/net/git-checkout.rkt#L54
> 
> On Wed, Oct 25, 2017 at 2:55 PM, Matthew Butterick  wrote:
>> The command seems to work when I remove the .git suffix:
>> 
>> racket -l net/git-checkout -- --https -u mbutterick -p password github.com 
>> /mbutterick/app test
>> 
>> Output:
>> 
>> Contacting github.com
>> Getting refs
>> Getting 24 objects
>> Applying deltas
>> Extracting tree to test
>> Cleaning up
>> "315d1dee1f9e3f90587171d13cc4477756156300"
>> 
>> 
>> 
>>> On Oct 25, 2017, at 10:08 AM, Jay McCarthy  wrote:
>>> 
>>> Will you try this first so we can debug the protocol level stuff?
>>> 
>>> racket -l net/git-checkout -- --https -u mbutterick -p password
>>> github.com /mbutterick/repo.git test
>>> 
>>> You may need to fiddle with the second to last argument.
>>> 
>>> On Tue, Oct 24, 2017 at 6:00 PM, Matthew Butterick  wrote:
 PS Same behavior on Ubuntu 14.04 or Mac OS 10.12.6, using Racket 6.10.1 in
 both cases.
 
 
 On Oct 24, 2017, at 2:57 PM, Matthew Butterick  wrote:
 
 Things seem to be on the right track, and then fail:
 
 Querying Git references for app at http://github.com/mbutterick/app.git
 ssl-connect: connect failed (error:140770FC:SSL
 routines:SSL23_GET_SERVER_HELLO:unknown protocol)
 [long traceback]
 
 
>>> 
>>> 
>>> 
>>> --
>>> -=[ Jay McCarthy   http://jeapostrophe.github.io]=-
>>> -=[ Associate ProfessorPLT @ CS @ UMass Lowell ]=-
>>> -=[ Moses 1:33: And worlds without number have I created; ]=-
>> 
> 
> 
> 
> -- 
> -=[ Jay McCarthy   http://jeapostrophe.github.io]=-
> -=[ Associate ProfessorPLT @ CS @ UMass Lowell ]=-
> -=[ Moses 1:33: And worlds without number have I created; ]=-

-- 
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] DrR compilation progress bar

2017-10-29 Thread 'John Clements' via Racket Users

> On Oct 29, 2017, at 15:27, Robby Findler  wrote:
> 
> I think it is a bad idea to dump output into the interactions that
> isn't being printed by the program.

We currently print “Welcome to DrRacket” at the start of each interaction, so 
it’s not as if *all* of the output is generated by the program.

How about a “turn-down” arrow printed right before or after this message that 
when opened will display this input? This turn-down arrow could have state, so 
that if you opened it last time, it would stay open in future runs.

John

> 
> There is a logging window, perhaps that can be used?
> 
> Robby
> 
> 
> On Sun, Oct 29, 2017 at 5:25 PM, 'John Clements' via Racket Users
>  wrote:
>> This is a great idea: I feel like this change would deliver 80% of what I 
>> want, and be easy to implement. It would give a concrete and recognizable 
>> visual “path” of the compilation. I would not be inclined to delete it when 
>> finished. Could it ever be long? Would it make other people unhappy to see 
>> this output (presumably not in teaching languages?)?
>> 
>> John
>> 
>>> On Oct 28, 2017, at 13:42, Ben Greenman  wrote:
>>> 
>>> I like the output `raco make -v ` gives on the command-line.
>>> 
>>> How about piping that into the interactions window?
>> 
>> 
>> 
>> --
>> 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.
> 
> -- 
> 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.



-- 
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] DrR compilation progress bar

2017-10-29 Thread Robby Findler
I think it is a bad idea to dump output into the interactions that
isn't being printed by the program.

There is a logging window, perhaps that can be used?

Robby


On Sun, Oct 29, 2017 at 5:25 PM, 'John Clements' via Racket Users
 wrote:
> This is a great idea: I feel like this change would deliver 80% of what I 
> want, and be easy to implement. It would give a concrete and recognizable 
> visual “path” of the compilation. I would not be inclined to delete it when 
> finished. Could it ever be long? Would it make other people unhappy to see 
> this output (presumably not in teaching languages?)?
>
> John
>
>> On Oct 28, 2017, at 13:42, Ben Greenman  wrote:
>>
>> I like the output `raco make -v ` gives on the command-line.
>>
>> How about piping that into the interactions window?
>
>
>
> --
> 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.

-- 
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] DrR compilation progress bar

2017-10-29 Thread 'John Clements' via Racket Users
This is a great idea: I feel like this change would deliver 80% of what I want, 
and be easy to implement. It would give a concrete and recognizable visual 
“path” of the compilation. I would not be inclined to delete it when finished. 
Could it ever be long? Would it make other people unhappy to see this output 
(presumably not in teaching languages?)?

John

> On Oct 28, 2017, at 13:42, Ben Greenman  wrote:
> 
> I like the output `raco make -v ` gives on the command-line.
> 
> How about piping that into the interactions window?



-- 
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] Open source projects

2017-10-29 Thread 'Royall Spence' via Racket Users
The docs are located in the main repository here:
https://github.com/racket/racket/tree/master/pkgs/racket-doc/scribblingsIt's 
not always easy to find the page you're looking for via the source
tree, so I recommend using a string search on Github to find the
sections of documentation you'd like to improve.

On Sun, Oct 29, 2017, at 05:35 PM, Guthrie Price wrote:
> It was recommended to me by a friend that while I am still learning
> Racket perhaps I can contribute to any documentation issues. This
> sounds like a good idea to me, but I am not sure how I can get
> started. Any help getting the ball rolling would be greatly
> appreciated.> 
> Thank you,
> Guthrie
> 
>  
> Virus-free. www.avast.com[1]
> 
> 
> On Tue, Oct 24, 2017 at 1:39 PM, Stephen De Gabrielle
>  wrote:>> I think the ‘doable exercise for a budding 
> Racket programmer‘ was
>> scoped to be an achievable, but important piece that someone else
>> could use to make a DrRacket plugin.(or more likely change
>> DrRacket core)>> 
>> Kind regards,
>> 
>> Stephen
>> 
>> On Tue, 24 Oct 2017 at 00:52, Guthrie Price
>>  wrote:>>> Thank you all so much for your comments 
>> (the resulting discussion
>>> was also entertaining and unexpected).>>> 
>>> If I were to implement path auto-completion, would it be useful if
>>> it wasn’t integrated into DrRacket? I am not precisely sure what I
>>> would be adding this functionality to if not DrRacket.>>> 
>>> 
>>> On Sunday, October 22, 2017, Neil Van Dyke 
>>> wrote: I could be missing something, but I think a filename completion
 procedure (not the DrRacket integration part) might be a doable
 exercise for a budding Racket programmer, so long as they already
 have a basic familiarity with using the filesystem and shell as a
 normal user. 
  Point them to the "Paths" and "Filesystem" sections of the Racket
  Reference, and tell them they just need a few procedures from each
  (probably including `split-path` and `directory-list`). 
  They might want to first make a procedure like this:
 
  (path-completions path-or-string?)
  ==> (listof completion-string)
 
  And then make a second procedure, which uses the first procedure,
  then adds an additional step, to let it return two values instead
  of one: 
  (path-completion-prefix-and-suffixes path-or-string?)
  ==> (values prefix-string-shared-by-all-completions
  (listof completion-remainder-after-any-shared-prefix-
  string)) 
  Then, when a user is interactively doing completion (like when
  they hit the Tab key in a shell), the first value returned by that
  second procedure is what would get added automatically to the
  path.  The second value is the list of possible completions
  following that shared prefix. 
  There are a few special cases to consider, but most should be easy
  to recognize and work through, just by thinking methodically about
  each point in your code.  For example, what do you do when the
  input path is relative, or when when there are no completions, or
  when the path is invalid or nonexistent or permissions-
  inaccessible, or when your path is already complete.  One case
  that's not obvious from the code: if the path is already complete
  and is a directory, a shell usually completes a directory
  separator, so consider whether you want to do that. 
  To make unit tests for these, they'll have to also look at more of
  the "Filesystem" section of the Racket Reference, to create and
  remove files and directories. 
  (I think wrapping a shell process, robustly, is much more
  difficult.) 
  -- 
 You received this message because you are subscribed to a topic in
 the Google Groups "Racket Users" group.  To unsubscribe from this 
 topic, visit
  
 https://groups.google.com/d/topic/racket-users/0sNHzZx3JPc/unsubscribe.
   To unsubscribe from this group and all its topics, send an email
  to racket-users+unsubscr...@googlegroups.com. 
 For more options, visithttps://groups.google.com/d/optout.
>>> 


>>> --
>>> 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.>> 
>> -- 
>> Kind regards,
>> Stephen
>> --
>> Ealing (London), UK
>> 
> 
> 


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


Links:

  1. 
https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-em

Re: [racket-users] Open source projects

2017-10-29 Thread Guthrie Price
It was recommended to me by a friend that while I am still learning Racket
perhaps I can contribute to any documentation issues. This sounds like a
good idea to me, but I am not sure how I can get started. Any help getting
the ball rolling would be greatly appreciated.

Thank you,
Guthrie


Virus-free.
www.avast.com

<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

On Tue, Oct 24, 2017 at 1:39 PM, Stephen De Gabrielle <
spdegabrie...@gmail.com> wrote:

> I think the ‘doable exercise for a budding Racket programmer‘ was scoped
> to be an achievable, but important piece that someone else could use to
> make a DrRacket plugin.(or more likely change DrRacket core)
>
> Kind regards,
>
> Stephen
>
> On Tue, 24 Oct 2017 at 00:52, Guthrie Price  wrote:
>
>> Thank you all so much for your comments (the resulting discussion was
>> also entertaining and unexpected).
>>
>> If I were to implement path auto-completion, would it be useful if it
>> wasn’t integrated into DrRacket? I am not precisely sure what I would be
>> adding this functionality to if not DrRacket.
>>
>>
>> On Sunday, October 22, 2017, Neil Van Dyke  wrote:
>>
>>> I could be missing something, but I think a filename completion
>>> procedure (not the DrRacket integration part) might be a doable exercise
>>> for a budding Racket programmer, so long as they already have a basic
>>> familiarity with using the filesystem and shell as a normal user.
>>>
>>> Point them to the "Paths" and "Filesystem" sections of the Racket
>>> Reference, and tell them they just need a few procedures from each
>>> (probably including `split-path` and `directory-list`).
>>>
>>> They might want to first make a procedure like this:
>>>
>>> (path-completions path-or-string?)
>>> ==> (listof completion-string)
>>>
>>> And then make a second procedure, which uses the first procedure, then
>>> adds an additional step, to let it return two values instead of one:
>>>
>>> (path-completion-prefix-and-suffixes path-or-string?)
>>> ==> (values prefix-string-shared-by-all-completions
>>> (listof completion-remainder-after-
>>> any-shared-prefix-string))
>>>
>>> Then, when a user is interactively doing completion (like when they hit
>>> the Tab key in a shell), the first value returned by that second procedure
>>> is what would get added automatically to the path.  The second value is the
>>> list of possible completions following that shared prefix.
>>>
>>> There are a few special cases to consider, but most should be easy to
>>> recognize and work through, just by thinking methodically about each point
>>> in your code.  For example, what do you do when the input path is relative,
>>> or when when there are no completions, or when the path is invalid or
>>> nonexistent or permissions-inaccessible, or when your path is already
>>> complete.  One case that's not obvious from the code: if the path is
>>> already complete and is a directory, a shell usually completes a directory
>>> separator, so consider whether you want to do that.
>>>
>>> To make unit tests for these, they'll have to also look at more of the
>>> "Filesystem" section of the Racket Reference, to create and remove files
>>> and directories.
>>>
>>> (I think wrapping a shell process, robustly, is much more difficult.)
>>>
>>> --
>>>
>> You received this message because you are subscribed to a topic in the
>>> Google Groups "Racket Users" group.
>>> To unsubscribe from this topic, visit https://groups.google.com/d/
>>> topic/racket-users/0sNHzZx3JPc/unsubscribe.
>>> To unsubscribe from this group and all its topics, send an email to
>>> racket-users+unsubscr...@googlegroups.com.
>>
>>
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>> --
>> 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.
>>
> --
> Kind regards,
> Stephen
> --
> Ealing (London), UK
>

-- 
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] namespace-require a submodule

2017-10-29 Thread Junsong Li
That explains. Thanks!

On Sun, Oct 29, 2017 at 11:20 AM, Sam Tobin-Hochstadt
 wrote:
> If you look at what `(quote-module-path food)` produces, it's just
> `(submod "/path/to/go.rkt" food)`. The issue is just that
> `namespace-require` needs a reference that it can resolve without
> knowing what file it's in -- `namespace-require`, unlike `require`, is
> a just a function and doesn't know anything about where it is in the
> source code. So you need to use something like `(quote-module-path)`
> that knows where it is.
>
> Sam
>
> On Sun, Oct 29, 2017 at 2:12 PM, Junsong Li  wrote:
>> Thanks! That works.
>>
>> I am still not sure what is the thing that I don't know. Why do we need a
>> compile-time reference here?
>>
>> On Sun, Oct 29, 2017 at 9:59 AM, Sam Tobin-Hochstadt 
>> wrote:
>>>
>>> I think you want to use `quote-module-path` here:
>>>
>>> #lang racket
>>>
>>> (require syntax/location)
>>>
>>> (module food racket
>>>   (provide apple)
>>> (define apple "pie"))
>>>
>>> (parameterize ([current-namespace (make-base-namespace)])
>>>   (namespace-require (quote-module-path food))
>>> (eval 'apple))
>>>
>>> On Sun, Oct 29, 2017 at 12:19 PM, Junsong Li 
>>> wrote:
>>> > Hello list,
>>> >
>>> > I am trying to do namespace-require to a submodule, racket complains
>>> > about
>>> > unknown module, as below:
>>> >
>>> > $ cat go.rkt
>>> > #lang racket
>>> >
>>> > (module food racket
>>> >   (provide apple)
>>> > (define apple "pie"))
>>> >
>>> > (parameterize ([current-namespace (make-base-namespace)])
>>> >   (namespace-require ''food)
>>> > (eval 'apple))
>>> >
>>> > $ racket go.rkt
>>> > require: unknown module
>>> >   module name: #
>>> >   context...:
>>> >
>>> >
>>> > Simply namespace-require food in toplevel has the same issue:
>>> >
>>> > #lang racket
>>> >
>>> > (module food racket
>>> >   (provide apple)
>>> > (define apple "pie"))
>>> >
>>> > (namespace-require ''food)
>>> >
>>> > Finally, the above code works if I type them in the interactive mode.
>>> >
>>> > I tried namespace-attach-module, and I understand why that failed: it
>>> > didn't
>>> > work because (module food racket ...) wouldn't instantiate the module,
>>> > and a
>>> > instantiated module is what namespace-attach-module wants.
>>> >
>>> > What is it that I am missing in above code to require a submodule in a
>>> > namespace? Why is submodule food invisible here?
>>> >
>>> >
>>> > - Junsong
>>> >
>>> > --
>>> > 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.
>>
>>
>> --
>> 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.

-- 
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] namespace-require a submodule

2017-10-29 Thread Sam Tobin-Hochstadt
If you look at what `(quote-module-path food)` produces, it's just
`(submod "/path/to/go.rkt" food)`. The issue is just that
`namespace-require` needs a reference that it can resolve without
knowing what file it's in -- `namespace-require`, unlike `require`, is
a just a function and doesn't know anything about where it is in the
source code. So you need to use something like `(quote-module-path)`
that knows where it is.

Sam

On Sun, Oct 29, 2017 at 2:12 PM, Junsong Li  wrote:
> Thanks! That works.
>
> I am still not sure what is the thing that I don't know. Why do we need a
> compile-time reference here?
>
> On Sun, Oct 29, 2017 at 9:59 AM, Sam Tobin-Hochstadt 
> wrote:
>>
>> I think you want to use `quote-module-path` here:
>>
>> #lang racket
>>
>> (require syntax/location)
>>
>> (module food racket
>>   (provide apple)
>> (define apple "pie"))
>>
>> (parameterize ([current-namespace (make-base-namespace)])
>>   (namespace-require (quote-module-path food))
>> (eval 'apple))
>>
>> On Sun, Oct 29, 2017 at 12:19 PM, Junsong Li 
>> wrote:
>> > Hello list,
>> >
>> > I am trying to do namespace-require to a submodule, racket complains
>> > about
>> > unknown module, as below:
>> >
>> > $ cat go.rkt
>> > #lang racket
>> >
>> > (module food racket
>> >   (provide apple)
>> > (define apple "pie"))
>> >
>> > (parameterize ([current-namespace (make-base-namespace)])
>> >   (namespace-require ''food)
>> > (eval 'apple))
>> >
>> > $ racket go.rkt
>> > require: unknown module
>> >   module name: #
>> >   context...:
>> >
>> >
>> > Simply namespace-require food in toplevel has the same issue:
>> >
>> > #lang racket
>> >
>> > (module food racket
>> >   (provide apple)
>> > (define apple "pie"))
>> >
>> > (namespace-require ''food)
>> >
>> > Finally, the above code works if I type them in the interactive mode.
>> >
>> > I tried namespace-attach-module, and I understand why that failed: it
>> > didn't
>> > work because (module food racket ...) wouldn't instantiate the module,
>> > and a
>> > instantiated module is what namespace-attach-module wants.
>> >
>> > What is it that I am missing in above code to require a submodule in a
>> > namespace? Why is submodule food invisible here?
>> >
>> >
>> > - Junsong
>> >
>> > --
>> > 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.
>
>
> --
> 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.

-- 
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] namespace-require a submodule

2017-10-29 Thread Junsong Li
Thanks! That works.

I am still not sure what is the thing that I don't know. Why do we need a
compile-time reference here?

On Sun, Oct 29, 2017 at 9:59 AM, Sam Tobin-Hochstadt 
wrote:

> I think you want to use `quote-module-path` here:
>
> #lang racket
>
> (require syntax/location)
>
> (module food racket
>   (provide apple)
> (define apple "pie"))
>
> (parameterize ([current-namespace (make-base-namespace)])
>   (namespace-require (quote-module-path food))
> (eval 'apple))
>
> On Sun, Oct 29, 2017 at 12:19 PM, Junsong Li 
> wrote:
> > Hello list,
> >
> > I am trying to do namespace-require to a submodule, racket complains
> about
> > unknown module, as below:
> >
> > $ cat go.rkt
> > #lang racket
> >
> > (module food racket
> >   (provide apple)
> > (define apple "pie"))
> >
> > (parameterize ([current-namespace (make-base-namespace)])
> >   (namespace-require ''food)
> > (eval 'apple))
> >
> > $ racket go.rkt
> > require: unknown module
> >   module name: #
> >   context...:
> >
> >
> > Simply namespace-require food in toplevel has the same issue:
> >
> > #lang racket
> >
> > (module food racket
> >   (provide apple)
> > (define apple "pie"))
> >
> > (namespace-require ''food)
> >
> > Finally, the above code works if I type them in the interactive mode.
> >
> > I tried namespace-attach-module, and I understand why that failed: it
> didn't
> > work because (module food racket ...) wouldn't instantiate the module,
> and a
> > instantiated module is what namespace-attach-module wants.
> >
> > What is it that I am missing in above code to require a submodule in a
> > namespace? Why is submodule food invisible here?
> >
> >
> > - Junsong
> >
> > --
> > 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.
>

-- 
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] namespace-require a submodule

2017-10-29 Thread Sam Tobin-Hochstadt
I think you want to use `quote-module-path` here:

#lang racket

(require syntax/location)

(module food racket
  (provide apple)
(define apple "pie"))

(parameterize ([current-namespace (make-base-namespace)])
  (namespace-require (quote-module-path food))
(eval 'apple))

On Sun, Oct 29, 2017 at 12:19 PM, Junsong Li  wrote:
> Hello list,
>
> I am trying to do namespace-require to a submodule, racket complains about
> unknown module, as below:
>
> $ cat go.rkt
> #lang racket
>
> (module food racket
>   (provide apple)
> (define apple "pie"))
>
> (parameterize ([current-namespace (make-base-namespace)])
>   (namespace-require ''food)
> (eval 'apple))
>
> $ racket go.rkt
> require: unknown module
>   module name: #
>   context...:
>
>
> Simply namespace-require food in toplevel has the same issue:
>
> #lang racket
>
> (module food racket
>   (provide apple)
> (define apple "pie"))
>
> (namespace-require ''food)
>
> Finally, the above code works if I type them in the interactive mode.
>
> I tried namespace-attach-module, and I understand why that failed: it didn't
> work because (module food racket ...) wouldn't instantiate the module, and a
> instantiated module is what namespace-attach-module wants.
>
> What is it that I am missing in above code to require a submodule in a
> namespace? Why is submodule food invisible here?
>
>
> - Junsong
>
> --
> 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.

-- 
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] namespace-require a submodule

2017-10-29 Thread Junsong Li
Hello list,

I am trying to do namespace-require to a submodule, racket complains about
unknown module, as below:

$ cat go.rkt
#lang racket

(module food racket
  (provide apple)
(define apple "pie"))

(parameterize ([current-namespace (make-base-namespace)])
  (namespace-require ''food)
(eval 'apple))

$ racket go.rkt
require: unknown module
  module name: #
  context...:


Simply namespace-require food in toplevel has the same issue:

#lang racket

(module food racket
  (provide apple)
(define apple "pie"))

(namespace-require ''food)

Finally, the above code works if I type them in the interactive mode.

I tried namespace-attach-module, and I understand why that failed: it
didn't work because (module food racket ...) wouldn't instantiate the
module, and a instantiated module is what namespace-attach-module wants.

What is it that I am missing in above code to require a submodule in a
namespace? Why is submodule food invisible here?


- Junsong

-- 
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] DrR compilation progress bar

2017-10-29 Thread Stephen De Gabrielle
What about a simple timer and an indicator of compilation time compared to
the previous compilation?
The reasoning is that for a small project compilation time is short so it
doesn’t matter that it will be wildly inaccurate, but for longer projects
where compilation time is long, the number of changes you make will be
proportionately smaller so you will at least have a rough estimate. I’m
guessing that sometimes this will be poor, but for most compilations it
will be okay.

Kr
Stephen
On Sat, 28 Oct 2017 at 22:15, Shu-Hung You <
shu-hung@eecs.northwestern.edu> wrote:

> I think printing which file is currently being loaded can also help,
> like the logs given by enter! #:verbose. These logs can also be
> printed to the interaction window and be erased after the loading
> process is finished. This can let the user know that something is
> actually running.
>
> --Shu-Hung
>
> On Sat, Oct 28, 2017 at 3:42 PM, Ben Greenman
>  wrote:
> > I like the output `raco make -v ` gives on the command-line.
> >
> > How about piping that into the interactions window?
> >
> > --
> > 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.
>
> --
> 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.
>
-- 
Kind regards,
Stephen
--
Ealing (London), UK

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