Re: [racket-users] Is there a way to return no value?

2015-12-11 Thread David Storrs
On Fri, Dec 11, 2015 at 2:32 PM, Jon Zeppieri <zeppi...@gmail.com> wrote: > On Fri, Dec 11, 2015 at 5:27 PM, David Storrs <david.sto...@gmail.com> > wrote: > > > > > > On Fri, Dec 11, 2015 at 1:53 PM, Matthew Butterick <chronf...@gmail.com> > > wro

Re: [racket-users] Is there a way to return no value?

2015-12-11 Thread David Storrs
On Fri, Dec 11, 2015 at 1:53 PM, Matthew Butterick wrote: > PS. I'm assuming that you're using `eq?` here in deliberate preference to > `equal?`. Because `eq?` is not reliable for string comparisons. > Ah. No, I did not realize that. I thought that Racket worked on a

Re: [racket-users] HTTPS problem with net/url

2016-01-06 Thread David Storrs
eb2/racket-x86_64-macosx-2.zip > > and copy the two ".dylib" files from the "racket" folder into > > /Applications/Racket_v6.3/lib/ > > Thanks for delaying this question until the first day that I know the > answer! > > At Wed, 6 Jan 2016 13:50:51 -08

Re: [racket-users] html parsing library does not handle 'article' tags -- any solutions?

2016-01-07 Thread David Storrs
So, I'm now doing this: (require (planet neil/html-parsing:3:0) (planet neil/xexp:2:0)) Those loaded just fine right off, although I needed to figure out raco pkg install sxml was necessary, but I got that. During the install, I got the following:

Re: [racket-users] html parsing library does not handle 'article' tags -- any solutions?

2016-01-07 Thread David Storrs
On Thu, Jan 7, 2016 at 3:25 PM, John Clements <cleme...@brinckerhoff.org> wrote: > > > On Jan 7, 2016, at 2:57 PM, David Storrs <david.sto...@gmail.com> wrote: > > > > So, I'm now doing this: > > > > (require (planet neil/html-parsing:3:0) (planet n

Re: [racket-users] html parsing library does not handle 'article' tags -- any solutions?

2016-01-07 Thread David Storrs
parsing" racket crashed. Text dump attached for reference. Dave > Jay > > On Thu, Jan 7, 2016 at 6:41 PM, David Storrs <david.sto...@gmail.com> > wrote: > > > > > > On Thu, Jan 7, 2016 at 3:25 PM, John Clements <cleme...@brinckerhoff.org >

Re: [racket-users] html parsing library does not handle 'article' tags -- any solutions?

2016-01-07 Thread David Storrs
On Thu, Jan 7, 2016 at 12:28 PM, Neil Van Dyke wrote: > I just checked that there wasn't a new bug in my old `html-parsing` > package, in case that's which package you meant. > Sorry, I should have been clearer. I'm talking about these: (require html xml), not yours.

[racket-users] html parsing library does not handle 'article' tags -- any solutions?

2016-01-07 Thread David Storrs
Hi folks, I'm using the html and xml libraries to parse a page that includes the following HTML: Message text here When I parse this, the 'article' tag simply isn't parsed -- it lists the contents of the messageContent div as just a series of PCDATA statements containing "\n" Is there

[racket-users] HTTPS problem with net/url

2016-01-06 Thread David Storrs
Hi folks, tl;dr: How do I make HTTPS calls from within Racket? Background: I co-write a play-by-post RPG ( https://forums.sufficientvelocity.com/threads/marked-for-death-a-rational-naruto-quest.24481/ -- stop by if you're curious; the barrier to entry is low). The players all vote to control

[racket-users] Simple regex question. How to match this: "[X] foo"

2016-01-08 Thread David Storrs
I'm having some trouble with the syntax for regexen, and the docs are a bit opaque on this point. Given this: (regex-match* #px"\[[xX\d]\]" "[1] foo \n [2] bar \n [x] baz \n [X] baz \n"") I'm expecting it to return: ( "[1]" "[2]" "[x]" "[X]") Instead it complains about undefined

Re: [racket-users] Simple regex question. How to match this: "[X] foo"

2016-01-08 Thread David Storrs
On Fri, Jan 8, 2016 at 10:56 PM, Neil Van Dyke <n...@neilvandyke.org> wrote: > David Storrs wrote on 01/09/2016 01:38 AM: > >> >> (regex-match* >> #px"\[[xX\d]\]" >> "[1] foo \n [2] bar \n [x] baz \n [X] baz \n"") >> &g

[racket-users] Problems with 'provide'

2015-12-23 Thread David Storrs
Hi folks, I have a file, "util.rkt", the complete text of which is: == QUOTE #lang racket (require racket/pretty) (define (print-prettier s) (parameterize ([pretty-print-columns 1]) (pretty-print s))) (define (hash-key-is? h k v) (and (hash-has-key? h k) (equal?

[racket-users] Re: Problems with 'provide'

2015-12-23 Thread David Storrs
Nope, only one. And I checked to make sure I was in the right directory. On Wednesday, December 23, 2015, Robby Findler <ro...@eecs.northwestern.edu> wrote: > Is it possible you have two util.rkt files and you are in the wrong > directory? > > Robby > > On Wednesday,

[racket-users] Code critique request: data/fetch, proc for walking hashes/lists

2016-01-10 Thread David Storrs
I feel like I'm starting to be somewhat functional with Racket, but I'd like to get more idiomatic. I'd appreciate it if people would critique the following code: (define (data/fetch s key-list) (if (or (empty? s) (nor (list? s) (hash? s))) s (let* ([key

[racket-users] Using Racket server in production?

2016-01-23 Thread David Storrs
Is anyone here using the Racket web server in production? If so, what's your experience with it? Specifically: Have you had any difficulty integrating it with outside systems? (e.g. Varnish, Redis, load balancer ooling, etc) Most of this I wouldn't expect to be an issue, but I figured I'd ask

Re: [racket-users] Using Racket server in production?

2016-01-24 Thread David Storrs
memory use and properly evict unneeded continuations. Keeping state on the > client works brilliantly. > > Using the Racket webserver has always been a breeze for me. It's easy to > do stuff that requires mucking with HTTP and it's easy to build complete, > reliable apps. This kind of fle

Re: [racket-users] What do you use macros for?

2016-04-07 Thread David Storrs
at documentation facilities, like > Scribble, as well as good macro constructs that will help you guide your > user through proper usage. > > On Wed, Apr 06, 2016 at 05:19:05PM -0700, David Storrs wrote: > > Hi folks, > > > > Macros are one of the biggest features that

Re: [racket-users] What do you use macros for?

2016-04-07 Thread David Storrs
That's very cool, Dan. Thanks for the example. (Although, shouldn't -4^2 + 4^2 = 32, not 31?) If/when you do the 'further challenges' section, could you post the result here? It looks like it would be useful. Dave On Thu, Apr 7, 2016 at 1:53 PM, Daniel Prager

[racket-users] What do you use macros for?

2016-04-06 Thread David Storrs
Hi folks, Macros are one of the biggest features that people list as the advantages of LISP / Scheme, and I don't really understand them. I get the basics -- they can create new code structures -- but not the implications What have you used them for, and what do they do that a function

Re: [racket-users] What do you use macros for?

2016-04-06 Thread David Storrs
Nice. Thank you, Asumu. That helps. On Wed, Apr 6, 2016 at 5:39 PM, Asumu Takikawa <as...@ccs.neu.edu> wrote: > Hi David, > > On 2016-04-06 17:19:05 -0700, David Storrs wrote: > >Macros are one of the biggest features that people list as the > advantages > &

[racket-users] Re: How to differentiate between files and directories?

2016-07-21 Thread David Storrs
docs.racket-lang.org/reference/booleans.html#%28def._%28%28quote._~23~25kernel%29._boolean~3f%29%29> > > path : path-string? > <http://docs.racket-lang.org/reference/Manipulating_Paths.html#%28def._%28%28lib._racket%2Fprivate%2Fmisc..rkt%29._path-string~3f%29%29> > > Returns

[racket-users] Re: How to differentiate between files and directories?

2016-07-21 Thread David Storrs
So there's no way to query the interface of a struct? On Thursday, July 21, 2016, Jon Zeppieri <zeppi...@gmail.com> wrote: > > > On Thu, Jul 21, 2016 at 2:44 PM, David Storrs <david.sto...@gmail.com > <javascript:_e(%7B%7D,'cvml','david.sto...@gmail.com');>> w

[racket-users] How to differentiate between files and directories?

2016-07-21 Thread David Storrs
Silly question: given a <#path>, how do I tell if it's to a file, directory, link, etc? I'd like to know this in general, although the proximate issue is that I would like to use (in-directory) to process all the files in a directory, but I need a way to ignore everything that isn't a file. I

[racket-users] Re: How to differentiate between files and directories?

2016-07-21 Thread David Storrs
Okay. Thanks for the help, all. On Thursday, July 21, 2016, Jon Zeppieri <zeppi...@gmail.com> wrote: > > > On Thu, Jul 21, 2016 at 3:59 PM, David Storrs <david.sto...@gmail.com > <javascript:_e(%7B%7D,'cvml','david.sto...@gmail.com');>> wrote: > >> S

Re: [racket-users] Is my model of (values) accurate?

2016-07-22 Thread David Storrs
*sigh* Just when I was feeling clever, I discover I missed the obvious. ;> Thanks, everyone. On Fri, Jul 22, 2016 at 8:05 PM, Ryan Culpepper <ry...@ccs.neu.edu> wrote: > On 07/22/2016 07:58 PM, David Storrs wrote: > >> Thanks Jon, I appreciate the clear explanation.

[racket-users] Is my model of (values) accurate?

2016-07-22 Thread David Storrs
I think I don't understand (values) very well. I expected the following to return '(1 2 3): -> (list (apply values '(1 2 3))) (list (apply values '(1 2 3))) ; result arity mismatch; ; expected number of values not received ; expected: 1 ; received: 3 ; [,bt for context] This, on the other

Re: [racket-users] Is my model of (values) accurate?

2016-07-22 Thread David Storrs
eri <zeppi...@gmail.com> wrote: > > > On Fri, Jul 22, 2016 at 6:30 PM, David Storrs <david.sto...@gmail.com> > wrote: > >> >> The best mental model I've been able to come up with is that (values) >> returns its results vertically but most functions

Re: [racket-users] How to dynamically generate top-level procedures?

2016-08-10 Thread David Storrs
Yes. Yes, that exactly solves my problem. *sheepish look* Thanks. On Tue, Aug 9, 2016 at 8:47 PM, Matthew Butterick <m...@mbtype.com> wrote: > > On Aug 9, 2016, at 7:52 PM, David Storrs <david.sto...@gmail.com> wrote: > > > This solves the problem of creating top

Re: [racket-users] How to dynamically generate top-level procedures?

2016-08-09 Thread David Storrs
l binding' the right term here?) > On Tue, Aug 9, 2016 at 5:20 PM, 'John Clements' via Racket Users < > racket-users@googlegroups.com> wrote: > >> >> > On Aug 9, 2016, at 4:46 PM, David Storrs <david.sto...@gmail.com> >> wrote: >> > >> >

Re: [racket-users] Iterating through a list more than one at a time

2016-08-10 Thread David Storrs
On Wed, Aug 10, 2016 at 5:50 AM, Greg Hendershott wrote: > > I feel like there should be a simpler way to do this, but I haven't found > > one despite much Googling and reading of docs about "for" and its > siblings. > > Can someone point me the right way? > > > > I'd

Re: [racket-users] How to dynamically generate top-level procedures?

2016-08-09 Thread David Storrs
On Tue, Aug 9, 2016 at 2:20 PM, John Clements wrote: > > Racket is essentially a lexically scoped language. That is: it should be > possible to look at a piece of code and figure out where the binding for a > given variable is. It does have a dynamic binding mechanism,

Re: [racket-users] Macros that use with-handlers

2016-07-16 Thread David Storrs
I see. Okay, thanks for clarifying. On Sat, Jul 16, 2016 at 8:05 PM, Alex Knauth <alexan...@knauth.org> wrote: > >> On Jul 16, 2016, at 7:18 PM, David Storrs <david.sto...@gmail.com> wrote: >> >> Wow, that is a lot of problems. Thanks for taking the time to &

Re: [racket-users] Macros that use with-handlers

2016-07-16 Thread David Storrs
On Sat, Jul 16, 2016 at 2:48 PM, William J. Bowman wrote: > To address the immediate problem, this `procedure?` test will always return > `#f`, since `#'pred` is a > syntax object and not a procedure. You need to do `(procedure? (syntax->datum > #'pred))`. Similarly >

Re: [racket-users] Macros that use with-handlers

2016-07-16 Thread David Storrs
Wow, that is a lot of problems. Thanks for taking the time to comment; this was in large part an effort to learn macros, so it's helpful to get this kind of feedback. On Sat, Jul 16, 2016 at 2:48 PM, Alex Knauth <alexan...@knauth.org> wrote: > >> On Jul 16, 2016, at 2:16 P

Re: [racket-users] Macros that use with-handlers

2016-07-16 Thread David Storrs
On Sat, Jul 16, 2016 at 2:48 PM, Alexis King wrote: > Of course, this makes sense, given that macros operate entirely at > compile-time. What you really want here is a function, not a macro. You > can write a simple function that will accept a procedure or a string and >

Re: [racket-users] Question on contracts -- check equal length of args

2016-07-15 Thread David Storrs
t; to use is `exact-integer?`. The `integer?` predicate accepts both exact and > inexact integers which can be a little strange at first. > > Dan > > > > On Fri, Jul 15, 2016 at 11:22 AM, David Storrs <david.sto...@gmail.com> > wrote: >> >> Hi folks, >>

[racket-users] Question on contracts -- check equal length of args

2016-07-15 Thread David Storrs
Hi folks, I'm writing a stats library (I'm sure there is already one out there; this is a learning exercise), and I'm currently implementing Kendall's Tau-a. I've got my head wrapped part of the way around contracts, but not all the way. I'd like to be able to express the following: (tau l m)

Re: [racket-users] Question on contracts -- check equal length of args

2016-07-15 Thread David Storrs
Thanks Jens! On Fri, Jul 15, 2016 at 1:00 PM, Jens Axel Søgaard <jensa...@soegaard.net> wrote: > 2016-07-15 18:22 GMT+02:00 David Storrs <david.sto...@gmail.com>: > >> >> On a separate question: How do I contribute to the docs? The >> contract docs are

[racket-users] Macros that use with-handlers

2016-07-16 Thread David Storrs
I'm trying to write a macro to test expected exceptions. I'd like it to have the following forms: (throws exception-generator-function proc msg) (throws exception-generator-function string msg) Where 'proc' would be something like exn:fail? and 'string' would be matched against the message

[racket-users] Writing Racket for iOS / Android

2016-07-10 Thread David Storrs
I need to build an app for iPhone and (later) Android, and I'd prefer to be able to write it in Racket but still get native interfaces. I searched through the list archives and found this thread https://lists.racket-lang.org/users/archive/2015-February/065929.html ("[racket] compiling Racket to

[racket-users] Iterating through a list more than one at a time

2016-08-04 Thread David Storrs
I feel like there should be a simpler way to do this, but I haven't found one despite much Googling and reading of docs about "for" and its siblings. Can someone point me the right way? I'd like to be able to iterate over a list N elements at a time -- e.g., grab elements 1 and 2, do something

Re: [racket-users] Iterating through a list more than one at a time

2016-08-04 Thread David Storrs
m> wrote: > > On Aug 4, 2016, at 3:10 PM, David Storrs <david.sto...@gmail.com> wrote: > > I'd like to be able to iterate over a list N elements at a time -- e.g., > grab elements 1 and 2, do something with them, grab 3 and 4, etc. > > Your technique seems fine. Yo

Re: [racket-users] Re: How to differentiate between files and directories?

2016-07-22 Thread David Storrs
e-", no > duplicates in the entire application. > > On Fri, Jul 22, 2016 at 3:59 AM, David Storrs <david.sto...@gmail.com> > wrote: >> >> So there's no way to query the interface of a struct? >> >> >> On Thursday, July 21, 2016, Jon Zeppieri <zeppi...@gma

[racket-users] How to dynamically generate top-level procedures?

2016-08-09 Thread David Storrs
In Perl it's possible to generate main-namespace functions like so: perl -E 'my $z = 1; for (qw/foo bar baz/) {my $x = $_; *$_ = sub{ say "$x: ", $z++ }}; foo(); bar(); baz();' This outputs: foo: 1 bar: 2 baz: 3 Note that it is generating top-level subroutines that can be called from

Re: [racket-users] How to watch the filesystem

2017-01-21 Thread David Storrs
Thanks, Dupéron, that's helpful. On Fri, Jan 20, 2017 at 8:35 PM, Dupéron Georges wrote: > Le vendredi 20 janvier 2017 19:47:11 UTC+1, David K. Storrs a écrit : >> I see that I can get the event telling me that something changed. As >> far as I can tell the event

Re: [racket-users] Thread and filesystem watching

2017-01-24 Thread David Storrs
On Tue, Jan 24, 2017 at 7:26 PM, Jon Zeppieri <zeppi...@gmail.com> wrote: > Hi David, > > On Tue, Jan 24, 2017 at 6:52 PM, David Storrs <david.sto...@gmail.com> > wrote: > >> [snip] >> >> - When I create the 'monitor this' event, I will need

Re: [racket-users] Stickers!

2017-01-27 Thread David Storrs
On Tue, Jan 24, 2017 at 4:15 PM, Ben Greenman wrote: > Hi Racket Users, > > I ordered a bunch of Racket stickers to celebrate the 6.8 release. Here's > proof: > http://www.ccs.neu.edu/home/types/resources/stickers.jpg > > If you send me your address, I will mail you

Re: [racket-users] Racket v6.8

2017-01-25 Thread David Storrs
Congratulations, everyone. I am frequently surprised and always impressed at how fast bugs are fixed and new versions released. On Wed, Jan 25, 2017 at 10:53 AM, Konrad Hinsen wrote: > Matthew Flatt writes: > > > There's a `raco pkg migrate`

Re: [racket-users] Thread and filesystem watching

2017-01-25 Thread David Storrs
Thanks, Matthew. That's reassuring. On Wed, Jan 25, 2017 at 8:20 AM, Matthew Flatt <mfl...@cs.utah.edu> wrote: > At Tue, 24 Jan 2017 18:52:43 -0500, David Storrs wrote: > > 1) How do I determine what a safe maximum number of threads is? > > For a typical program, 10k o

Re: [racket-users] Thread and filesystem watching

2017-01-25 Thread David Storrs
On Tue, Jan 24, 2017 at 7:26 PM, Jon Zeppieri <zeppi...@gmail.com> wrote: > Hi David, > > On Tue, Jan 24, 2017 at 6:52 PM, David Storrs <david.sto...@gmail.com> > wrote: > >> [snip] >> >> - When I create the 'monitor this' event, I will need

[racket-users] Creating and publishing modules

2017-01-20 Thread David Storrs
Since I'm going to need this filesystem-watching code, I figured I would package it up and make it available to other people as well. I know that planet is no longer the preferred package repository. Is this still the correct documentation for how to publish modules?:

[racket-users] Re: Creating and publishing modules

2017-01-20 Thread David Storrs
On Fri, Jan 20, 2017 at 3:01 PM, David Storrs <david.sto...@gmail.com> wrote: > Since I'm going to need this filesystem-watching code, I figured I > would package it up and make it available to other people as well. > > I know that planet is no longer the preferred

Re: [racket-users] Thread and filesystem watching

2017-01-26 Thread David Storrs
Thanks for the help, everyone. This works great. I especially like handle-evt -- I had seen it in the Reference when I was reading about events but didn't understand what it did. It really makes this easy. On Wed, Jan 25, 2017 at 8:17 PM, Jon Zeppieri wrote: > On Wed,

[racket-users] Thread and filesystem watching

2017-01-24 Thread David Storrs
I mentioned before that I'm writing a system to watch the filesystem for changes. I'm finishing that up and I have a few questions about concurrency issues. 1) How do I determine what a safe maximum number of threads is? 2) I think that (fold-files) is the best way to walk a directory tree,

Re: [racket-users] Re: get-file-list filter

2017-02-21 Thread David Storrs
You can also, as you pointed out, generate the string programmatically. If you do, you'll get mileage out of the string-upcase and string-downcase functions: (define basestr (string-join (map string-downcase '(...jpg jpeg etc)) ";") (define str (string-append basestr ";" (string-upcase

Re: [racket-users] Programming paradigms

2017-02-21 Thread David Storrs
On Mon, Feb 20, 2017 at 10:18 PM, Rusi Mody wrote: > On Thursday, February 16, 2017 at 9:46:53 PM UTC+5:30, David K. Storrs > wrote: > > I find PP to be a useful tool for thinking about programming, but not > terribly significant in everyday use -- my code will typically

[racket-users] Re: Why is this exception giving me an arity error?

2017-02-17 Thread David Storrs
tion-marks) "foo") (exn:fail:bmtc:unknownuser "msg" # ... "foo") Underscore also works: -> (struct exn:fail:bmtc:unknown_user exn:fail:bmtc (username) #:transparent) -> (exn:fail:bmtc:unknown_user "msg" # ... "foo") (exn:fail:bmtc:unknown_user "

Re: [racket-users] intensional equality and unit tests

2017-02-19 Thread David Storrs
On Sat, Feb 18, 2017 at 11:12 PM, 'John Clements' via Racket Users < racket-users@googlegroups.com> wrote: > (cc:ak) > > Okay, this sounds just crushingly obvious now that I say it, but honestly, > I don’t think it’s occurred to me: > > One reason that equality is such a nightmare in Java and

Re: [racket-users] How do I find where a module is located?

2017-02-14 Thread David Storrs
On Tue, Feb 14, 2017 at 11:41 AM, 'John Clements' via Racket Users < racket-users@googlegroups.com> wrote: > > > On Feb 14, 2017, at 8:36 AM, David Storrs <david.sto...@gmail.com> > wrote: > > > > I have murphy/protobuf installed and I'd like to look at the sou

[racket-users] How do I find where a module is located?

2017-02-14 Thread David Storrs
I have murphy/protobuf installed and I'd like to look at the source code. How do I find it? I tried: (find-system-path 'collects-dir) ;; yields ../collects, which is useless /Applications/Racket_v6.6/collects ;; nothing /Library/Application Support/ ;; no directory for Racket

Re: [racket-users] How do I find where a module is located?

2017-02-14 Thread David Storrs
On Tue, Feb 14, 2017 at 12:16 PM, David Christiansen < da...@davidchristiansen.dk> wrote: > On 02/14/2017 12:00 PM, David Storrs wrote: > >> >> I prefer Emacs to Dr Racket >> > > In that case, if you're using racket-mode, you can use > racket-open-requi

Re: [racket-users] make-directory race condition fix?

2017-02-16 Thread David Storrs
On Thu, Feb 16, 2017 at 2:33 PM, Dan Liebgold wrote: > Hi - > > I have a few racket process running on Windows that need to each ensure > the same directory structure exists. I have code like this: > > (unless (directory-exists? dir) > (make-directory dir)) > >

Re: [racket-users] Safely using port->string where nothing has been written to the port

2017-01-23 Thread David Storrs
Hi Sean, Does (byte-ready?) work for your case? https://docs.racket-lang.org/reference/Byte_and_String_Input.html?q=peek#%28def._%28%28quote._~23~25kernel%29._byte-ready~3f%29%29 On Mon, Jan 23, 2017 at 6:05 AM, Sean Kemplay wrote: > Hello, > > I am using the URL

Re: [racket-users] Paths in Dr Racket do not match paths in shell

2017-01-19 Thread David Storrs
hen I used the prior version. On Thu, Jan 19, 2017 at 12:52 PM, Robby Findler <ro...@eecs.northwestern.edu> wrote: > define-runtime-path is designed for this problem, IIUC. Let me know if > the docs don't help. > > Robby > > On Thu, Jan 19, 2017 at 11:47 AM, David Storrs <david.sto...@

Re: [racket-users] Paths in Dr Racket do not match paths in shell

2017-01-19 Thread David Storrs
For the record, I know I can pass an absolute path (defined with define-runtime-path) to load-initial-data. My question is more about "why is this different between the shell and Dr Racket?" On Thu, Jan 19, 2017 at 5:23 PM, David Storrs <david.sto...@gmail.com> wrote: >

[racket-users] How to watch the filesystem

2017-01-19 Thread David Storrs
I need to write something that will notice when a change happens in a directory (file added, delete, modified, etc) and let me take action based on that. I was excited when I saw Racket's "Detecting Filesystem Changes"

Re: [racket-users] Paths in Dr Racket do not match paths in shell

2017-01-19 Thread David Storrs
value as "echo $PATH" from the shell. Does Dr Racket have anything equivalent to a .bashrc file? > > > On Thu, Jan 19, 2017 at 4:36 PM, David Storrs <david.sto...@gmail.com> wrote: >> For the record, I know I can pass an absolute path (defined with &g

Re: [racket-users] Paths in Dr Racket do not match paths in shell

2017-01-20 Thread David Storrs
On Fri, Jan 20, 2017 at 10:02 AM, Robby Findler <ro...@eecs.northwestern.edu> wrote: > On Thu, Jan 19, 2017 at 7:29 PM, David Storrs <david.sto...@gmail.com> wrote: >> On Thu, Jan 19, 2017 at 6:45 PM, Robby Findler >> <ro...@eecs.northwestern.edu> wrote:

Re: [racket-users] How to watch the filesystem

2017-01-20 Thread David Storrs
. Is there a better way to do this? - Is there a way to monitor a directory and all its subdirs without creating separate event monitors for each one? On Thu, Jan 19, 2017 at 3:58 PM, Neil Van Dyke <n...@neilvandyke.org> wrote: > David Storrs wrote on 01/19/2017 03:08 PM: >> >>

[racket-users] Paths in Dr Racket do not match paths in shell

2017-01-19 Thread David Storrs
Short form: When using Dr Racket, how do I write something that says "Here is a path to a file that I care about. The path is relative to you, the script that is running the code" ? Long form: I have a file, testing_utils.rkt, that includes the following snippet of code: (define

[racket-users] racket-mode causes .emacs file to not load

2017-02-28 Thread David Storrs
I'm sending this to the list because I suspect I'm not the only one who will ever have this issue and the next person should now be able to google for it. GNU Emacs 24.5.1 Darwin MacBook-Pro.lan 15.5.0 Darwin Kernel Version 15.5.0: Tue Apr 19 18:36:36 PDT 2016;

Re: [racket-users] Re: racket-mode causes .emacs file to not load

2017-02-28 Thread David Storrs
*blink* It did not even occur to me that someone would give their library a one-character name -- I'd been assuming that it was mis-parsing the name of whatever it was trying to load. I should have checked that before asking. Thanks. On Tue, Feb 28, 2017 at 5:17 PM, Alex Harsanyi

[racket-users] Idiomatic way to include numbers in a map?

2017-03-02 Thread David Storrs
I'd like to be able to do something like this: (struct foo (a b c)) (define lst-A '(a b)) (define lst-B '(d e)) (map foo lst-A lst-B (in-naturals)) I'd expected this to produce: (foo 'a 'd 0) (foo 'b 'e 1), but instead it throws an exception "expected list, given stream". I

[racket-users] DrRacket says #%module-begin not a module

2016-09-03 Thread David Storrs
I typically use Emacs, but I thought I would experiment with DrRacket a bit. I'm on OSX 10.11 using DrRacket v6.6, freshly installed an hour ago. I started it up, File>New, typed this: #lang racket (displayln "hello world") and hit the Run button at top right. I get the following message at

Re: [racket-users] Spreadsheet widget?

2016-09-03 Thread David Storrs
Spiffy, thanks. Also, what license is your spreadsheet under? I'm building a for-commerce app and I don't want to step on your toes if you'd rather it not be used that way. Dave On Sat, Sep 3, 2016 at 10:03 AM, Dmitry Pavlov wrote: > David, > >invalid symbol:

Re: [racket-users] DrRacket says #%module-begin not a module

2016-09-03 Thread David Storrs
On Sat, Sep 3, 2016 at 6:03 PM, John Clements <cleme...@brinckerhoff.org> wrote: > > > On Sep 3, 2016, at 5:54 PM, David Storrs <david.sto...@gmail.com> wrote: > > > > The best would probably be if DrRacket's out-of-the-box language setting > was somet

[racket-users] Positioning GUI controls in contact with one another

2016-09-05 Thread David Storrs
How do I find the actual minimum size of a GUI control (e.g. a button) without the space around it? I'm on OSX 10.11. I'm working on a spreadsheet application, and my current plan is to have each cell be represented as a separate text control.[1] I need to have these controls be in contact

Re: [racket-users] Positioning GUI controls in contact with one another

2016-09-06 Thread David Storrs
h still not total. Dave > > Robby > > On Mon, Sep 5, 2016 at 4:23 PM, David Storrs <david.sto...@gmail.com> > wrote: > > How do I find the actual minimum size of a GUI control (e.g. a button) > > without the space around it? > > > > > > I'm on OSX

Re: [racket-users] Positioning GUI controls in contact with one another

2016-09-06 Thread David Storrs
Findler <ro...@eecs.northwestern.edu>: > >> I haven't seen buttons in spreadsheet cells in excel, but maybe I'm >> taking your words too literally? >> >> Have you considered using canvas% objects instead of buttons? They >> should give you the flexibility you're aft

[racket-users] Spreadsheet widget?

2016-08-29 Thread David Storrs
Is there a spreadsheet in Racket? I dug through the list and found a mailing list thread from 2008 but nothing since then. I also checked the Widget Gallery and didn't see

Re: [racket-users] Persisting large values for debugging long-running programs

2016-09-14 Thread David Storrs
Would a database work for you? SQLite ( https://docs.racket-lang.org/db/connect.html#%28def._%28%28lib._db%2Fmain..rkt%29._sqlite3-connect%29%29) is dead easy and very convenient. Their maximum DB size is 140TB, so they won't have an issue with a few gigs. Dave On Wed, Sep 14, 2016 at 12:38

Re: [racket-users] Urgent Need--Cloud Engineer---EAD or GC or Citizens only

2016-09-12 Thread David Storrs
Granted, it's annoying to get spammed by someone who thinks that sending email blasts full of buzzword bingo≥ to inappropriate lists is a good way to recruit. That said, I was amused by: A) That he's recruiting Java engineers on a Racket (aka Lisp) list B) This line: " *3) Must be comfortable

[racket-users] Trying to understand racket/gui and racket/draw

2016-09-15 Thread David Storrs
How do I draw into a canvas and have the results persist past the next call to paint-callback? Given the code below I was expecting to see: 1) A window opens with a diagonal green line on it 2) A vertical blue line appears, crossing with the green line 3) The window goes fullscreen, still

[racket-users] Taking hash of really big files

2016-09-24 Thread David Storrs
Is there a hashing function in Racket that will operate on a file without reading the entire thing into memory first? I need to verify that a file is unchanged after I break it into chunks and then put the chunks back together again. My plan is to take a (sha, md5, ...) hash of the file before

[racket-users] Re: Taking hash of really big files

2016-09-24 Thread David Storrs
Aaaand, no sooner do I send this than I discover openssl/sha1. Sorry to have wasted your time. On a separate topic, is it reasonable to assume that openssl/sha1 will work on any platform that Racket will run on? I'm specifically thinking of Windows here. On Sat, Sep 24, 2016 at 7:10 AM, David

Re: [racket-users] Twenty six low-risk ways to use Racket at work You can start right now

2016-09-29 Thread David Storrs
For the record: I am cofounder of a biotech startup, and we're writing the software in Racket. I hadn't actually thought to mention it here, but this seems like a good opportunity: we haven't launched yet, but we're looking to line up beta testers. The first piece we'll be releasing is a

[racket-users] Using schemas with the 'db' module

2016-10-06 Thread David Storrs
Is it possible to connect to a specific schema in a Postgres database, or to set the current schema of an existing connection? The 'postgresql-connect' function has no parameter for schema...in fact, the only mention of schemas in the docs for db is in the Database Catalog section (

Re: [racket-users] Using schemas with the 'db' module

2016-10-06 Thread David Storrs
. See > > https://www.postgresql.org/docs/current/static/ddl-schemas.html > https://www.postgresql.org/docs/current/static/sql-set.html > > Ryan > > On 10/06/2016 06:21 PM, Jon Zeppieri wrote: > >> Isn't the #:database parameter in postgresql-connect what y

[racket-users] Is there a predefined (define-runtime-path "this_file")?

2016-09-23 Thread David Storrs
Is there a Racket equivalent of Perl's __FILE__ token? In Perl I can do this: I'd like to be able to access files at runtime that have a path known in relation to the current file. I can do this: (define-runtime-path this-dir ".") (file-exists? (build-path this-dir

Re: [racket-users] Is there a predefined (define-runtime-path "this_file")?

2016-09-23 Thread David Storrs
Brilliant. Thanks, Alex. On Fri, Sep 23, 2016 at 8:15 AM, Alex Knauth <alexan...@knauth.org> wrote: > > > On Sep 23, 2016, at 10:53 AM, David Storrs <david.sto...@gmail.com> > wrote: > > > > Is there a Racket equivalent of Perl's __FILE__ token? >

Re: [racket-users] How to parse a html file into a sexpr?

2016-09-27 Thread David Storrs
Yep! The function is: html->xexp and it's in (require (planet neil/html-parsing:3:0)) Note that xexp isn't *exactly* the same as sexp, but after substantial messing with it myself I can guarantee that you will find it easier. Dave On Tue, Sep 27, 2016 at 11:50 AM, Lin Lee

[racket-users] Crosscompiling executables

2016-10-26 Thread David Storrs
I'm running Mac and would like to compile my code to a Windows executable. Is there a way to do this, or do I need to copy the code over to a Windows installation and compile it there? -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To

[racket-users] Re: Crosscompiling executables

2016-10-26 Thread David Storrs
I should add that I read the docs on raco exe and googled around, but the list post that I found was from 2013 and said that at the time it was not possible. On Wed, Oct 26, 2016 at 10:06 AM, David Storrs <david.sto...@gmail.com> wrote: > I'm running Mac and would like to compil

Re: [racket-users] Programmatically generating keywords

2016-10-26 Thread David Storrs
Thanks, Sam. That was exactly what I needed. Thanks, Matthas. The example was useful. On Wed, Oct 26, 2016 at 2:13 PM, Sam Tobin-Hochstadt <sa...@cs.indiana.edu> wrote: > I think `keyword-apply` is what you want. > > Sam > > On Wed, Oct 26, 2016 at 2:11 PM, Da

Re: [racket-users] Re: Crosscompiling executables

2016-10-26 Thread David Storrs
rm: > > http://download.racket-lang.org/releases/6.6/ > > Also, it's more likely to work than it was back in January. > > > At Wed, 26 Oct 2016 10:07:45 -0400, David Storrs wrote: >> I should add that I read the docs on raco exe and googled around, but the >> lis

[racket-users] Programmatically generating keywords

2016-10-26 Thread David Storrs
Is it possible to generate keywords for a call? For example, this works: (with-output-to-file (buildpath "." "foo") (lambda () (displayln "f!")) #:mode 'text #:exists 'replace) But this does not: (with-output-to-file (buildpath "." "foo") (lambda () (displayln "f!"))

Re: [racket-users] Re: Crosscompiling executables

2016-10-26 Thread David Storrs
On Wed, Oct 26, 2016 at 2:30 PM, Matthew Flatt <mfl...@cs.utah.edu> wrote: > At Wed, 26 Oct 2016 14:01:15 -0400, David Storrs wrote: >> That document talks about running raco pkg, although I would have >> expected raco exe. I'm guessing, but it seems like the process

Re: [racket-users] Structs vs Lists

2016-10-27 Thread David Storrs
You know, it's a very pleasant surprise to me how many messages I've recently seen on this list that began "I'm just getting started with Racket and" Great to see that the Racket community is growing. On Thu, Oct 27, 2016 at 2:42 PM, Jos Koot wrote: > Hi > > Lisp (and

Re: [racket-users] Re: Crosscompiling executables

2016-10-27 Thread David Storrs
On Thu, Oct 27, 2016 at 9:12 AM, Matthew Flatt <mfl...@cs.utah.edu> wrote: > At Wed, 26 Oct 2016 15:16:03 -0400, David Storrs wrote: >> On Wed, Oct 26, 2016 at 2:30 PM, Matthew Flatt <mfl...@cs.utah.edu> wrote: >> > At Wed, 26 Oct 2016 14:01:15 -0400, David Storrs

[racket-users] Trying to build 'routing' macro for dispatch-rules

2016-10-28 Thread David Storrs
I'm trying to build a macro that will generate routing rules for 'dispatch-rules'. (dispatch-rules) from web-server/dispatch has this form: (dispatch-rules (("announce-user") #:method post process-announce-user)) ...more routes here... ) This seems like it should be automatable, so I

  1   2   3   4   5   6   >