Thanks David and Neil for your answers.  My question was prompted simply by
curiosity. I downloaded and installed Racket having had no previous
experience with it. Simply as a way to try something I copied the code from
the Home page just to see what would happen. What happened was that I got a
confusing error message.  The point, as David suggests, is that code like
that shouldn't be on the Home page! That was my original point also.


On Mon, Jul 6, 2015 at 9:51 PM David T. Pierson <d...@mindstory.com> wrote:

> On Mon, Jul 06, 2015 at 11:53:38PM -0400, Neil Van Dyke wrote:
> > David T. Pierson wrote on 07/06/2015 11:27 PM:
> > >As a side note, I tried using file-or-directory-permissions [3] to avoid
> > >recursing into directories with no read or execute permission, but it
> >
> > BTW, before anyone does a lot more work on filesystem access control
> > semantics... I think the usual case with filesystems is that there's no
> > point to asking whether you have permission to do an operation, as
> opposed
> > to just attempting the operation you want to do.  Even if you check what
> you
>
> Good point; I agree.  But then is in-directory too blunt a tool?  Well,
> I suppose you could specify a use-dir? function that attempts a
> directory-list and returns #f if an exception occurs:
>
> (define (descend? path)
>   (with-handlers ([void (lambda (exn) #f)])
>     (directory-list path)))
>
> (for ([path (in-directory #f descend?)]
>       #:when (regexp-match? #rx"[.]rkt$" path))
>   (printf "source file: ~a\n" path))
>
> Having to generate the directory listing twice for each subdirectory is
> a little unfortunate, but in cases where efficiency is critical a more
> discriminatory approach could be used.
>
> But to go back to the OP: is this example too error-prone to have on the
> home page?
>
> David
>
> --
> 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/lJ_5bPhRD2o/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.

Reply via email to