Re: [racket-users] Somewhere to keep racket snippets

2015-09-09 Thread Greg Hendershott
There's http://pasterack.org/ which is awesome. Folks frequently use it on #racket IRC. It can optionally evaluate the code, too. However: 1. I don't know its long-term retention intention (or reality). 2. I don't think it aspires to the discoverablity implied by your use case. 3. It doesn't supp

Re: [racket-users] Interaction between break and custodian-box

2015-09-02 Thread Greg Hendershott
Oops, I'd meant to copy the list. On Wed, Sep 2, 2015 at 6:46 PM, Greg Hendershott wrote: > Thanks for the quick reply! > > On Wed, Sep 2, 2015 at 5:28 PM, Matthew Flatt wrote: >> That looks like a bug in the scheduler to me. I don't think it's >> specific t

Re: [racket-users] http response 204 (no content) with content-encoding "gzip"

2015-09-02 Thread Greg Hendershott
Certain status codes "MUST NOT" include a response body, including 204 [0]. For those, you could say not even a `peek-byte` is necessary. Although I guess there wouldn't be any harm. Definitely for the other variants -- even "SHOULD NOT" -- then peek-byte makes sense. [0]: http://www.w3.org/Pro

[racket-users] Interaction between break and custodian-box

2015-09-02 Thread Greg Hendershott
When you break an expression in the REPL, currently racket-mode takes you out of the module/environment. I want to change that: https://github.com/greghendershott/racket-mode/issues/153 To do so, instead of grabbing the break using `with-handlers`, I'm using `call-with-exception-handler` and

Re: [racket-users] Frog/Scribble: h* tag substitution

2015-08-28 Thread Greg Hendershott
On Thu, Aug 27, 2015 at 5:52 PM, Jordan Johnson wrote: > What’s got me baffled is that if I try to access H1..H5 tags this way, other > tags get substituted. For example: > >> @(define h3 (tag-function "h3”)) >> ... >> @h3{Section 2} > > renders as > >> Section 2 > > > So far it’s just the H* tag

Re: [racket-users] Re: My son's game in Racket

2015-08-25 Thread Greg Hendershott
Although I'm not a game developer, I have a past life developing music/audio software commercially. We developed on Windows because that's where the vast majority of the customers were, and that was really the end of the discussion. Also, although I'm about to exaggerate, I think that for much aud

Re: [racket-users] macro making a struct with a macro

2015-08-18 Thread Greg Hendershott
Although maybe off-topic regarding macrology: You might want to consider factoring out the generally useful part, which I think is the less-verbose accessors. An already less verbose way is to use match-define or match-let, for example: (struct s (a b c)) (define x (s 1 2 3)) (match-define (s a

Re: [racket-users] Export indentation preferences in a package's info.rkt?

2015-08-11 Thread Greg Hendershott
In Emacs: - Emacs Lisp (Elisp) macros can use a `declare` form to attach metadata, including indentation info: https://www.gnu.org/software/emacs/manual/html_node/elisp/Declare-Form.html - Other (external) Lisp language modes have a convention that there's an Elisp {lisp,scheme,racket}-inden

Re: [racket-users] eval PSA (was Sending Closures to Places)

2015-08-05 Thread Greg Hendershott
I agree SQL is an interesting analogy but I draw the opposite conclusion, if I correctly remember what I did ~5 years ago. There is an eval-ish way of using SQL, such as forming SQL code out of strings. This tends to perform slower and is extremely vulnerable to injection and other unexpected beha

Re: [racket-users] Re: A couple of questions about Neil's html reader/writer

2015-07-28 Thread Greg Hendershott
Maybe a dumb question, but: Imagine conversion functions `xexpr->sxml` and `sxml->xexpr`. Would implementing them be any easier than unifying xexprs and sxml (or is it really just the same problem)? If it turns out there isn't any ideal implementation, is there at least some pragmatic implementa

Re: [racket-users] Emacs & Racket.

2015-07-19 Thread Greg Hendershott
> But still curios about using drracket-tool-lib Over time racket-mode has grown to use things like drracket/find-module-path-completions and drracket/check-syntax (thanks Robby!). As well as other "tooling" like errortrace, macro-debugger/analysis/check-requires, setup/xref, help/help-utils, gui

Re: [racket-users] Are there any BDD testing frameworks for Racket?

2015-07-12 Thread Greg Hendershott
By the way eCukes is here: https://github.com/ecukes/ecukes > ... At most I've been tempted > to poach some of the Elisp definitions underlying the Gherkin DSL and > use them directly. What I meant here is the step definitions in eSpuds: https://github.com/ecukes/espuds -- You received t

Re: [racket-users] Are there any BDD testing frameworks for Racket?

2015-07-11 Thread Greg Hendershott
Short version: I think it's a good idea. I don't know of anything like that, yet. I'm interested in BDD, but not so much a Gherkin style DSL. I've considered using eCukes for the Emacs Lisp part of racket-mode. After having seen it used in some contemporary Emacs packages. And after watching some

Re: [racket-users] API function naming

2015-07-03 Thread Greg Hendershott
es?) On Fri, Jul 3, 2015 at 12:41 PM, Greg Hendershott wrote: > I'd avoid @ because it's used for "at-expressions", e.g. #lang > scribble or even simply #lang at-exp racket. > > > On Fri, Jul 3, 2015 at 12:32 PM, John Carmack wrote: >> I am using a “

Re: [racket-users] API function naming

2015-07-03 Thread Greg Hendershott
I'd avoid @ because it's used for "at-expressions", e.g. #lang scribble or even simply #lang at-exp racket. On Fri, Jul 3, 2015 at 12:32 PM, John Carmack wrote: > I am using a “cmd-name!” naming format for functions that are adding to the > command list that will be communicated to the host prog

Re: [racket-users] help please on git/github pull request

2015-07-03 Thread Greg Hendershott
Once upon a time I forked a repo, committed against master, and couldn't figure out how to "re-sync" with upstream. I resorted to deleting the fork and starting over. I wanted a sure-fire recipe to avoid that. Although I know a bit more about git now, I still follow that recipe. So far when I've

Re: [racket-users] Emacs Lisp as a Racket Language?

2015-07-03 Thread Greg Hendershott
So I've spent a lot of time using both Racket and Elisp over the past couple years. My feeling: - Racket is much nicer. - Elisp is not nearly as bad as I first thought. Some other baseless opinions: 1. An "opposite" approach would be to put a more Rackety face on Elisp. But. I feel it's probabl

Re: [racket-users] try a new macro expander

2015-06-29 Thread Greg Hendershott
Oops, didn't Cc list: On Mon, Jun 29, 2015 at 12:13 PM, Greg Hendershott wrote: > On Mon, Jun 29, 2015 at 7:43 AM, Matthew Flatt wrote: >> I'll have to update the version number, so there's now a >> >>racket-current-x86_64-linux.sh >> >>

Re: [racket-users] right abstraction for this?

2015-06-11 Thread Greg Hendershott
IIUC in SQL this would simply be: SELECT student, AVG(rating) FROM scores GROUP BY student Apparently a DSL for querying tables can be handy. :) The Racket equivalent for the special case of a 2-column table (a hash-table) could be something like: (define (sql-ish-aggregate-group-by f xs) (f

Re: [racket-users] using something similar to grep for data extraction

2015-06-09 Thread Greg Hendershott
Given this example list: (define xs '("asdfadsf" "aasdf" ";begin" "xxx" "xxx" "xxx" ";end" "asdfasdf" "asdfasdfas")) And a couple predicates: (define (begin? s) (equal? s ";begin")) (define

Re: [racket-users] Get list of all predefined identifiers for use in vim syntax highlighting

2015-06-01 Thread Greg Hendershott
The syntax forms should be in the KEYWORDS list; try un-commenting that line. Some highlighters distinguish "keywords" and "builtins", so Jens' script generates those separately. If Vim doesn't care, you could combine them into one big list. (As my other post says, the distinction is kind of squ

Re: [racket-users] Get list of all predefined identifiers for use in vim syntax highlighting

2015-06-01 Thread Greg Hendershott
1. Jens' solution is good. I've used for the Pygments highlighter and for racket-mode. I recommend it! You may want to stop reading now. :) 2. Coincidentally very recently I've been taking a fresh look at this for racket-mode. I think a recent commit message sums it up pretty well: https://githu

Re: [racket-users] 2 point about sribble

2015-05-28 Thread Greg Hendershott
Matthew Butterick is the expert on this, but in the meantime here's some info I hope is mostly correct. The margin-note is "responsive", to use the latest Web 2.0 (or whatever verison we're up to now) jargon. If the page is wide enough, it will still appear to the right. (Try resizing the browser

Re: [racket-users] exn->string

2015-05-26 Thread Greg Hendershott
I was thinking the parameter could be a handy runtime switch, defaulting to "safe". However realistically there's probably a lot of other ground to cover when it comes to "debug" vs. "production" deployments. Maybe this needs a more comprehensive approach than nibbling away one switch at a time. M

Re: [racket-users] exn->string

2015-05-25 Thread Greg Hendershott
Maybe I'm over-thinking this and/or misunderstanding the use case, but: Should there maybe be a parameter to control whether exn->string returns anything interesting? And, should it be #f by default? Roughly, for example: ;; When current-exn->string-enabled? is #f -- the default -- ;; exn->stri

Re: [racket-users] Generic collections in Racket

2015-05-24 Thread Greg Hendershott
> Also, in my (admittedly limited) time so far with Clojure, I've > sometimes been confused when eager collections automagically change > into lazy sequences. If I add side effects (like debugging printfs) to > code I don't realize is lazy, I utter many WTFs. I'm not sure to what > extent that can

Re: [racket-users] Generic collections in Racket

2015-05-24 Thread Greg Hendershott
This is really exciting and you've obviously put a lot of time and thought into it! One part I'm not sure about is `conj`. I understand sometimes "whichever end is optimal" matters more than the order. But: 1. What if you do care about the order? IOW should there also be generic "cons" and "snoc

Re: [racket-users] test submodules vs tests in separate file

2015-05-21 Thread Greg Hendershott
> I thought that the compilded code would have fewer debugging information > (source code location etc) or not able to use the stepper. I have not > used the stepper in racket yet (but the stepper in gambit scheme which > is really useful at least for a beginner like me). Oh I see what you mean. N

Re: [racket-users] try a new macro expander

2015-05-21 Thread Greg Hendershott
Thanks to a pull request from Alexander Knauth, you can add a RACKET_VERSION = SCOPE_SNAPSHOT to your .travis.yml build matrix: https://github.com/greghendershott/travis-racket/blob/master/.travis.yml#L31 Also, as with RACKET_VERSION = HEAD, you can put this version into an allowed failures lis

Re: [racket-users] test submodules vs tests in separate file

2015-05-21 Thread Greg Hendershott
>> (Otherwise the .rkt file must be parsed and expanded each/every time >> you run. This includes test submodules, even though they won't be run. >> In addition, expansion time can be significant with non-trivial >> macros, including but not limited to Typed Racket.) > > Very interesting, this redu

Re: [racket-users] test submodules vs tests in separate file

2015-05-21 Thread Greg Hendershott
> Startup will be fastest if you `raco make` the foo.rkt file to a > compiled/foo.zo bytecode file. When you `racket foo.rkt` (directly or > via #!) it will load the compiled/foo.zo provided it's not older. Not "compiled/foo.zo"; it would be "compiled/foo_rkt.zo". -- You received this message b

Re: [racket-users] test submodules vs tests in separate file

2015-05-21 Thread Greg Hendershott
I usually prefer test submodules because I like the proximity to the code being tested. Plus in Emacs racket-mode I can fold/hide the test submodules if they ever become distracting. Exceptions to "usually": - Even with the ability to hide/fold tests, if the ratio of tests to tested is really lar

Re: [racket-users] pkg-build report for the v6.2 release candidate

2015-05-21 Thread Greg Hendershott
error to something different, such as >> `(module m rackjure ())`, behaves as I would expect. Does `eval` + >> `quote-syntax` do something strange with {} properties on syntax objects? >> >> Sam >> >> On Fri, May 15, 2015 at 1:53 PM Greg Hendershott >> wrot

Re: [racket-users] Strange behaviour of the eq? operator in racket repl

2015-05-18 Thread Greg Hendershott
In my early time learning Racket, I wish someone had given me the following advice: """ For now? Just use `equal?`. `equal?` will usually do the right thing, including for numbers, strings, symbols, immutable lists, and so on. A type-specific function like `=` or `string-=?` might be a bit faster

Re: [racket-users] pkg-build report for the v6.2 release candidate

2015-05-15 Thread Greg Hendershott
This is OT wrt deps and doc, but: I don't understand this reported test failure for rackjure, on both versions of Racket: test.rkt: raco test: non-empty stderr: #"\nFAILURE\nname: check-exn\nlocation: (# 68 2 2223 186)\nexpression: (check-exn exn:fail:syntax? (thunk (eva

Re: [racket-users] Re: Use Parsack to parse a #language?

2015-05-12 Thread Greg Hendershott
> On Mon, May 11, 2015 at 9:40 PM, Daniel Prager > wrote: I don't see Daniel's post yet. Is it just me, or is Google Groups delaying quite a few messages lately? > Greg Hendershott can probably fill you in on more unpleasantries, as > his markdown parser is the

Re: [racket-users] Re: web-server http-digest-auth: nonce has \r\n

2015-05-07 Thread Greg Hendershott
That sounds good. Although I haven't used it in awhile, I recall needing to slice that off more often than keeping it. On May 7, 2015 2:22 PM, "Tim Brown" wrote: > I wonder if base64-encode should rather be patched with a #:last-newline? > (Default #t) argument. > > Tim > > On 7 May 2015 17:37:18

Re: [racket-users] google groups transition pretty much done

2015-05-01 Thread Greg Hendershott
Thanks John!!! > - google groups still quarantines some things I wish it wouldn’t (just > approved 2 posts from sketchy-sounding “McCarthy” person) Ah, so that explains the only glitch I'd wondered about: Seeing someone reply to a message I hadn't yet got, but which shows up a day or two later.

Re: [racket-users] Add margin note for exn:break-continuation?

2015-04-28 Thread Greg Hendershott
Ah, of course, that makes sense. Thanks for the suggestion how to explore this using with-continuation-mark. I just submitted a pull request updating the exn:break-continuation documentation with a note/tip. -- You received this message because you are subscribed to the Google Groups "Racket

[racket-users] Add margin note for exn:break-continuation?

2015-04-28 Thread Greg Hendershott
#lang racket/base ;;; Note: Run the following from command-line Racket (not DrRacket or ;;; racket-mode). ;;; [0] Something that runs long enough to give you a chance to break (define (long-loop) (displayln "Starting loop. Press CONTROL+C...") (for/sum ([i (in-range 10)]) 1)) ;;;

Re: [racket-users] Debugging Clojure in Racket

2015-04-19 Thread Greg Hendershott
I spent some of my time at Recurse Center (formerly Hacker School) getting hands-on with Clojure. I wrote five blog posts. The first of the series is here: http://www.greghendershott.com/2014/10/hands-on-with-clojure.html -- You received this message because you are subscribed to the Google Gr

Re: [racket-users] Organizing tests

2015-04-19 Thread Greg Hendershott
That's the --submodule or -s flag. I did `raco help test` just now and discovered even more options than I remembered. Including fun things like running tests in parallel, printing a summary table, and so on. racket-mode has a couple features related to tests and coverage. They currently assume

Re: [racket-users] DrRacket plugin to remove trailing whitespace on save?

2015-04-13 Thread Greg Hendershott
>> > Another approach would be to add a mode that colors trailing >> > whitespace in that ugly greeny/yellowy color that DrRacket uses for >> > the "your code is more than 102 columns" warning. >> >> +1 to this. I think I’d definitely like this independent of a mechanism to >> trim on save. > > +1

Re: [racket-users] ANN: Gregor, a date and time library

2015-03-26 Thread Greg Hendershott
>> - Assuming that "periods" are useful, what operations on them do we >> want? Arithmetic, probably; maybe the `period->nanoseconds` function I >> just mentioned; maybe convenience functions based on the current time >> (e.g., `ago`, `from-now`). Anything else? 1. For scheduling apps people often

Re: [racket-users] Projects (was: the Racket manifesto)

2015-03-26 Thread Greg Hendershott
I didn't understand the manifesto as saying Racket should try to be a lisp machine or OS (we already have Emacs for that :)) or that all external tools are bad (despite what I wrote quickly; sorry). Instead I understood it to mean, let's minimize gratuitous tools that do stuff that would be more na

Re: [racket-users] Projects (was: the Racket manifesto)

2015-03-25 Thread Greg Hendershott
My personal/casual take on this: There are language systems where you to need to run some make-a-new-project tool -- even for a single source file. In Racket you can create multi-file collections without needing such a tool. Only at the point where you want to package it share with others, do you

Re: [racket] Breaks always go to main thread?

2015-03-19 Thread Greg Hendershott
> That sounds very cool! If you can maybe keep some amount of model/view > abstraction going maybe we could get that into drr? I'll definitely keep that in mind; I'd like to help do that! Racket Users list: http://lists.racket-lang.org/users

Re: [racket] Breaks always go to main thread?

2015-03-19 Thread Greg Hendershott
Thank you, Robby. > Another approach that you might want to try is to catch the "c:c;c:c" > at the emacs level and instead of turning that into SIGINT (or > whatever signal it is) send an explicit message across to the "(sync > never-evt)" code that tells it to break the user's program's thread. >

Re: [racket] Breaks always go to main thread?

2015-03-19 Thread Greg Hendershott
> 2. exn:break, although I'm not yet sure how that will work. Actually, break on any uncaught exception. Racket Users list: http://lists.racket-lang.org/users

[racket] Breaks always go to main thread?

2015-03-18 Thread Greg Hendershott
Preface to avoid any "XY problem": I recently added errortrace support to racket-mode. But I noticed that C-c is bypassing this. Which is sad; definitely want good context for that -- not "running body". Digging in, it seems that exn:break is only ever given to the main thread. [This matters beca

Re: [racket] how to get line numbers on syntax errors on load?

2015-03-10 Thread Greg Hendershott
>> Is there a way to coerce racket to be more specific in its messages? Although I don't know if it would do better with this particular error, generally errortrace gives much better stack traces: http://docs.racket-lang.org/errortrace/quick-instructions.html It does so by instrumenting the co

Re: [racket] racket-mode

2015-02-28 Thread Greg Hendershott
> Don't make me want to go back to programming Racket in Emacs :-) > But thanks for mapping Emacs back into the fold. -- Matthias The more I do with racket-mode, the deeper my appreciation for everything that DrRacket does. It's really quite amazing. Also the more I program in Emacs Lisp, the mo

Re: [racket] try-racket alternative

2015-02-28 Thread Greg Hendershott
Wow. I like the design. I like that the design is not similar to the circle in The Hudsucker Proxy: "You know. For kids!" Sidenote: Lately my Twitter feed says people like Phil Hagelberg (aka Technomancy) and John Carmack (makes some games?) are teaching their kids how to code using Rack

Re: [racket] Bug with equal? and bit-vectors

2015-02-25 Thread Greg Hendershott
I'd submitted a PR to fix this, on the old mono repo: https://github.com/plt/racket/pull/756 Although the PR status is still "Open", actually it was merged to the new racket/data repo in October (shortly after the repo split): https://github.com/racket/data/commit/3653d4c561548f4bf00eefcfec5

[racket] racket-mode

2015-02-24 Thread Greg Hendershott
Just a heads-up on some progress with racket-mode over the last couple months: - Support for errortrace in error message stack traces. - A profile command that shows profile results in a major mode buffer and lets you view the source locations in the other window. You can also evaluate more e

Re: [racket] read-syntax for an entire .rkt file

2015-02-20 Thread Greg Hendershott
A few more points I've discovered: - If you might want source position info, you need to use `port-count-lines!`. - If the file has relative requires -- e.g. `(require "foo.rkt")` -- you need to set `current-load-relative-directory`. And you want to do the `expand` while this is set. - `wi

Re: [racket] Passing information between syntax classes

2015-02-12 Thread Greg Hendershott
Preface: Whenever I attempt to answer a question about macros, my secret agenda is that I'll be the main beneficiary... from someone else jumping in to correct my answer and teach me. So here goes. :) > I am trying to clean up some lengthy syntax-class definitions, but I > am running into a probl

Re: [racket] racket/serialize example in The Racket Guide does not work

2015-02-01 Thread Greg Hendershott
Huh. It seems to fail with a similar error message using pasterack.org: http://pasterack.org/pastes/72311 But it works for me on all the various Racket versions I happen to have installed on OS X (5.3.5, 6.0, 6.1.1, 6.1.16) as well as on 6.0.1 on Ubuntu. Racket Users list:

Re: [racket] terminal-color package - output colored text to the terminal - comments before release

2015-01-29 Thread Greg Hendershott
This is really cool. I agree that a `printf`-color` would be handy. I notice that adding it would require adding it 3 times, to each of the 3 plugins in private/. I wonder if each plugin could instead supply just its variation of `display-color`? Because IIUC `displayln-color`, `print-color`, a

Re: [racket] Typed Racket frustration

2015-01-24 Thread Greg Hendershott
> All that said, I keep using Typed Racket because the static typechecking is > invaluable to me. I use DrRacket rather than Emacs w/racket-mode, and I can > understand why people wouldn’t, but along with the type tooltips and > background expansion’s always-on program validation, it’s just a lot h

Re: [racket] Scribble and itemlists

2015-01-24 Thread Greg Hendershott
I'm not saying "omg this is impossible!" I'm pointing out that there's more work to do than updating some Scribble structures. There are a few renderers that would need to be updated, and in a way that gives satisfactory results in the messy real world. The HTML render should still work well in b

Re: [racket] Scribble and itemlists

2015-01-21 Thread Greg Hendershott
I wonder whether the various Scribble output formats can actually render it? I'm pretty sure that "standard" (ha ha ha) markdown doesn't support starting an ordered list with a specific number. Markdown like: 2. X 3. Y 4. Z Is rendered in HTML simply as XYZ. As for HTML, I think t

Re: [racket] Racket on Centos?

2015-01-17 Thread Greg Hendershott
Up through version 5.3.6 there was a Fedora build of Racket, and as of a couple years ago I used it on "Amazon Linux" (which IIUC is ~= CentOS). I vaguely recall needing to symlink one .so to the name Racket expected, but otherwise I don't remember any problems. (Although I'm not sure why Racket d

Re: [racket] The Racket package management model

2015-01-13 Thread Greg Hendershott
Thanks for the explanation and the work-around! Racket Users list: http://lists.racket-lang.org/users

Re: [racket] The Racket package management model

2015-01-10 Thread Greg Hendershott
Sorry if this is slightly OT, but: The blog post mentioned package suggestion support in DrR. I hadn't noticed that, yet. I was curious, thinking maybe I should add something like this to racket-mode. When I tried, I discovered it doesn't work for me with DrR from 6.1.1.6 snapshot: get-all-pkg-d

Re: [racket] Racketrivia: Using ' as an identifier suffix

2015-01-08 Thread Greg Hendershott
It's not as fun as the classic https://www.destroyallsoftware.com/talks/wat. But this is Racket not JavaScript. ;) Racket Users list: http://lists.racket-lang.org/users

Re: [racket] Racketrivia: Using ' as an identifier suffix

2015-01-08 Thread Greg Hendershott
> You are being so terribly tricked by the reader here. Thanks for the explanation! It all makes sense now. I'm not sure whether to be chagrined or perversely proud that I managed to stumble onto this sequence. :) Racket Users list: http://lists.racket-lang.org/users

[racket] Racketrivia: Using ' as an identifier suffix

2015-01-08 Thread Greg Hendershott
So Haskell conventionally uses ' as a suffix, prime. From what I've seen, Scheme and Racket tend to use * instead. At some point I "learned" that you cannot use ' as a suffix in Racket. Today I tried again, and was surprised to see that it works... somewhat. $ racket Welcome to Racket v6.1.1.6.

Re: [racket] show-requires isn't submodule-aware?

2015-01-08 Thread Greg Hendershott
I'm actually really curious how it works and tempted to try to fix it myself, because I expect I would learn so much. What I don't know is how much learning that would turn out to be, and how long it would take me. Especially if your intuition is that it might be hard, for you. :) In any case I do

[racket] show-requires isn't submodule-aware?

2015-01-08 Thread Greg Hendershott
Re https://github.com/greghendershott/racket-mode/issues/76 The underlying reason seems to be that `show-requires` from `macro-debugger/analysis/check-requires` doesn't consider submodules. Below is a tiny example with 2 source files and 1 checker file. Is this as-intended, or something I should

Re: [racket] Is there any particular reasons that Markdown-render does not deal with images?

2015-01-02 Thread Greg Hendershott
> As the title says. Why? > > At least something like ![](already-exists-image-url) is neccessary. Why: 1. I didn't know how. At the time, I wasn't sure how to handle Scribble images generally. And I wasn't aware of the special case you mention, that Scribble lets you link to external image URLs

Re: [racket] Performance help

2015-01-02 Thread Greg Hendershott
Hi, Jyotirmoy. >> When I make that change, my run time decreases from ~16s to ~10s, and >> produces the same output (which differs from output.txt in the same >> way I mentioned above). > >> In relative terms this would probably get it close to the Python version? > > I merged a pull request fro

Re: [racket] Performance help

2015-01-02 Thread Greg Hendershott
> Through the sophisticated profiling technique of commenting-out `or` > branches in `correct` Oh, I should mention that I did try Optimization Coach, which is a wonderful tool! It's given me many great suggestions. In this case it could only suggest some inlines that didn't help. But for anyone

Re: [racket] Performance help

2015-01-02 Thread Greg Hendershott
> Would it help to use an eq? hash and turn all of the strings into > symbols (hopefully up front)? That might make the hashing part faster > in the best-known function. Good idea. But unless I made a mistake, no, that's twice as slow, not faster. All the string->symbol conversions seem to outweig

Re: [racket] Performance help

2015-01-02 Thread Greg Hendershott
Although it can't hurt, I don't think `train` comes close to dominating the time? Through the sophisticated profiling technique of commenting-out `or` branches in `correct`, I got the sense that the third one is the issue: (define (correct m s) (let ([best-known (λ (xs) (best-known m xs))])

Re: [racket] Performance help

2015-01-01 Thread Greg Hendershott
Preface: 1. Your status quo version is about 16s on my laptop. 2. The output differs from your repo's output.txt on one item: It corrects "accesing" to "accusing" rather than "acceding". Next: (append-map edits1 (edits1 s)) is very large -- 40,000+ items for "cat". But it looks like Norvig pru

Re: [racket] why a segfault on the command line, but not in DrRacket?

2014-12-30 Thread Greg Hendershott
> OTOH I may be the one causing the memory-management problems. The issues are > arising in my typesetting program, which passes around some large data > structures as function inputs. By "large" I mean a list of 10e5 to 10e6 > structs, each with its own hashtable. Perhaps this is imprudent. It > c

Re: [racket] at-exp: is there any way to make it turn @list{A @"string" escape} into (list "A " "string" " escape") ?

2014-12-29 Thread Greg Hendershott
> But most of all, IMO it sounds like a bad idea since it tries to fight > the natural mixed-text-and-expressions and bend it into a > format-string-like thing. I'd go with something that avoids that and > uses @-expressions more naturally, as in: > > @my-error['f]{message >

Re: [racket] Permission errors with nightlies?

2014-11-04 Thread Greg Hendershott
> If you can tolerate errors provoked by bad snapshots, then I think > building against the snapshot is a good choice. I doubt that the error > rate has been as low as 1%, though Maybe it's higher, but fortunately my perceived rate is that rate multiplied the % of days Travis builds my projects, w

[racket] Permission errors with nightlies?

2014-11-04 Thread Greg Hendershott
Background: https://travis-ci.org/greghendershott/frog/jobs/39956106 I'm using http://www.cs.utah.edu/plt/snapshots/current/installers/racket-current-x86_64-linux-precise.sh on Travis CI. Suddenly I'm seeing dozens of error like this: open-output-file: cannot open output file path: /usr/rack

Re: [racket] aws/glacier: credential scope

2014-09-29 Thread Greg Hendershott
It looks like the package server did eventually refresh a few hours ago: Last Updated: 9/28/2014, 4:21:56 PM ;change on GitHub Last Checked: 9/29/2014, 7:51:37 AM ;pkgs.r-l.org refresh (I believe those times are US MT, -0600.) On Sun, Sep 28, 2014 at 6:10 PM, Greg Hendershott wrote

Re: [racket] aws/glacier: credential scope

2014-09-28 Thread Greg Hendershott
If you're in a hurry you could remove and re-install directly from GitHub: $ raco pkg remove aws $ raco pkg install git://github.com/greghendershott/aws On Sun, Sep 28, 2014 at 5:40 PM, Norman Gray wrote: > > On 2014 Sep 28, at 22:17, Greg Hendershott wrote: > >>>

Re: [racket] aws/glacier: credential scope

2014-09-28 Thread Greg Hendershott
>> I clicked "update" on pkgs.racket-lang.org. But it seems to be slower >> than usual to refresh. After it does, you can `raco pkg update aws` to >> get the fix. > > Something seems wrong/stuck on pkgs.racket-lang.org. The top of the page says: > > "update upload in progress: there may be incons

Re: [racket] aws/glacier: credential scope

2014-09-28 Thread Greg Hendershott
> I clicked "update" on pkgs.racket-lang.org. But it seems to be slower > than usual to refresh. After it does, you can `raco pkg update aws` to > get the fix. Something seems wrong/stuck on pkgs.racket-lang.org. The top of the page says: "update upload in progress: there may be inconsistencies

Re: [racket] aws/glacier: credential scope

2014-09-28 Thread Greg Hendershott
I pushed a fix, including running the tests across a few different AWS regions. They pass. I clicked "update" on pkgs.racket-lang.org. But it seems to be slower than usual to refresh. After it does, you can `raco pkg update aws` to get the fix. On Sun, Sep 28, 2014 at 4:01 PM, Greg H

Re: [racket] aws/glacier: credential scope

2014-09-28 Thread Greg Hendershott
Hi, Norman. I logged an issue for this: https://github.com/greghendershott/aws/issues/32 I see the problem (or at least the main problem) and will push a fix. The bug is embarrassing, not just because it's such a silly mistake, but it's something a unit test could have caught. (I could say th

Re: [racket] How `scribble` resolves relative paths

2014-09-07 Thread Greg Hendershott
>> Separately, I think one gotcha with your original macro will be if you >> use it more than once? I think you need to provide a fresh id to each >> define-runtime-path, like so: > > I thought that would be the case too, though it does work without > `generate-temporaries`. (Looking at the macro

Re: [racket] How `scribble` resolves relative paths

2014-09-07 Thread Greg Hendershott
If you don't mind requiring that `name` be supplied first, you could simply pass the remaining args through unchanged: (define-syntax (image/rp stx) (syntax-case stx () [(_ name xs ...) #'(begin (define-runtime-path id name) (image id xs ...))])) It's not ideal becaus

Re: [racket] recursion style question

2014-09-06 Thread Greg Hendershott
Well, I think you answer your own question with good reasons in the last paragraph. :) If `acc` is an implementation detail, let's not expose it as a parameter.[1] At least, let's not do this for a function provided by a module. Especially not a function with a contract and/or documentation. But

Re: [racket] Submodules can't be imported in same file?

2014-09-05 Thread Greg Hendershott
The following approach works for me. Would that do what you need? ;; - mod.rkt - #lang racket (module private racket (define (secret) 'foo) (provide secret)) (require 'private) (define (wrapper) (secret)) (provide (all-defined-out)) ;; Note that all-defined-out will not provi

Re: [racket] Best typed/racket representation for bitfield of width 125?

2014-09-04 Thread Greg Hendershott
Although I haven't tried data/bit-vector in Typed Racket, could you do something like the following? #lang typed/racket (require/typed data/bit-vector [#:opaque BitVector bit-vector?] [make-bit-vector (-> Index BitVector)] ... TO-DO ...) (define bv (make-bit-vector 125)) On Thu, Sep 4, 2

Re: [racket] fl vs. unsafe-fl

2014-09-01 Thread Greg Hendershott
In some applications a 7% speedup in numeric operations is welcome. I think the main issue with unsafe-fl ops is that they are unsafe. The best thing about Typed Racket is that you can delegate that problem. Not only do you not need to write unsafe-fl+, you don't even need to write fl+. You can w

Re: [racket] bug? bit-vector equal problem

2014-08-19 Thread Greg Hendershott
I submitted a PR with a suggested fix: https://github.com/plt/racket/pull/756 > Looking at bit-vector.rkt, it seems the problem might be the "TODO" > comment here: > > (serializable-struct bit-vector (words size) > > #:methods gen:equal+hash > [(define (equal-proc x y recursive-equal?)

Re: [racket] bug? bit-vector equal problem

2014-08-19 Thread Greg Hendershott
I can repro it on 6.1.0.3. Looking at bit-vector.rkt, it seems the problem might be the "TODO" comment here: (serializable-struct bit-vector (words size) #:methods gen:equal+hash [(define (equal-proc x y recursive-equal?) (let ([vx (bit-vector-words x)] [vy (bit-vector-

Re: [racket] Review request: Partially expanding to make "blue boxes"

2014-08-15 Thread Greg Hendershott
> [^1]: The local-expand docs actually say: "This procedure must be > called during the dynamic extent of a syntax transformer application > by the expander or while a module is visited". The latter possibility > sounds promising, but I don't understand how I would insinuate myself > into the proce

Re: [racket] Review request: Partially expanding to make "blue boxes"

2014-08-15 Thread Greg Hendershott
> (dynamic-require target-module 0) > (parameterize ([current-namespace (module->namespace target-module)]) > (expand-once a-module-level-stx)) > > Where a-module-level-stx is a form inside #%module-begin. Thanks for the idea! Unfortunately: 1. (expand-once #'(provide foo)) will fail with e.g.

[racket] Review request: Partially expanding to make "blue boxes"

2014-08-13 Thread Greg Hendershott
I was hoping someone more-experienced might have time to review something. For possible use in racket-mode, I've been experimenting with extracting "blue boxes" and "blue lines" from arbitrary Racket sources (not just functions with installed documentation): https://github.com/greghendershott/b

Re: [racket] Performance. Higher-order function

2014-08-09 Thread Greg Hendershott
Why isn't Optimization Coach one of the automatically-installed packages? Racket Users list: http://lists.racket-lang.org/users

Re: [racket] identifier-binding source-id vs. nominal-source-id

2014-07-22 Thread Greg Hendershott
> I also think, fwiw, that jumping to the contract is a Good Thing here > (and then you have to hit the key again on the identifier in > 'contract-out' form to jump to the definition of the identifier > without the contract). Interesting, that hadn't occurred to me. I like that. However there's a

Re: [racket] identifier-binding source-id vs. nominal-source-id

2014-07-22 Thread Greg Hendershott
not easy to do, or perhaps not feasible generally? On Tue, Jul 22, 2014 at 3:50 PM, Greg Hendershott wrote: > So for racket-mode I have a visit-definition feature. It takes you to > the definition of the symbol at point. > > I'm using identifier-binding to find the file and name, then

<    1   2   3   4   5   6   7   8   >