Re: [racket-dev] What is the policy on what is included in the core libraries?
2015-02-17 14:26 GMT+01:00 Robby Findler ro...@eecs.northwestern.edu: I don't think the libraries are sufficient as is, but I would resist adding aliases. A alternative: Added the word zip to the documentation index, link it to map and have an example where in (map list ...) is used. Also: Isn't zip in srfi/1 ? /Jens Axel -- You received this message because you are subscribed to the Google Groups Racket Developers group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-dev+unsubscr...@googlegroups.com. To post to this group, send email to racket-...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/racket-dev/CABefVgz2g3svHzxg55Y11DWi%3DAKqm21YRvu777owxi4p_tqNNg%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
[racket-dev] Literal constants
This program returns #f - I was expecting to see #t. #lang racket (define a '(1 2 3)) (define b '(1 2 3)) (eq? a b) Why not guarantee uniqueness of literals occurring in the same module? /Jens Axel _ Racket Developers list: http://lists.racket-lang.org/dev
Re: [racket-dev] Build error
It worked. Thanks! 2015-01-07 18:45 GMT+01:00 Matthew Flatt mfl...@cs.utah.edu: I wasn't able to replicate the problem, but I think I see what could go wrong. I've pushed an attempt at a repair. At Wed, 7 Jan 2015 18:31:35 +0100, Jens Axel Søgaard wrote: Hi All, I got a contract when I tried to build racket. Any ideas? The main error is below. Entire log is here: https://gist.github.com/soegaard/aa8ea014e043a899a5a2 /Jens Axel package-source-name+type: contract violation expected: (or/c #f (or/c (quote name) (quote file) (quote dir) (quote git) (quote github) (quote clone) (quote file-url) (quote dir-url) (quote link) (quote static-link))) given: 'catalog in: the 2nd argument of (-* (string? (or/c #f (or/c 'name 'file 'dir 'git 'github 'clone 'file-url 'dir-url 'link'static-link))) more contract from: collects/pkg/name.rkt blaming: collects/pkg/private/install.rkt (assuming the contract is correct) at: collects/pkg/name.rkt:11.3 context...: /Users/soegaard/racket-from-plt-git/plt/racket/collects/racket/contract/private/ blame.rkt:143:0: raise-blame-error16 /Users/soegaard/racket-from-plt-git/plt/racket/collects/racket/contract/private/ arrow-val-first.rkt:283:3 /Users/soegaard/racket-from-plt-git/plt/racket/collects/pkg/private/install.rkt: 925:2: update-loop /Users/soegaard/racket-from-plt-git/plt/racket/collects/racket/list.rkt:429:2: append-map /Users/soegaard/racket-from-plt-git/plt/racket/collects/pkg/private/install.rkt: 1097:0: pkg-update195 /Users/soegaard/racket-from-plt-git/plt/racket/collects/racket/file.rkt:368:8 /Users/soegaard/racket-from-plt-git/plt/racket/collects/racket/file.rkt:357:0: call-with-file-lock40 /Users/soegaard/racket-from-plt-git/plt/racket/collects/pkg/main.rkt:307:16 (submod /Users/soegaard/racket-from-plt-git/plt/racket/collects/pkg/main.rkt main): [running body] /Users/soegaard/racket-from-plt-git/plt/racket/collects/pkg/raco.rkt: [traversing imports] /Users/soegaard/racket-from-plt-git/plt/racket/collects/raco/raco.rkt: [running body] /Users/soegaard/racket-from-plt-git/plt/racket/collects/raco/main.rkt: [running body] make[2]: *** [plain-in-place] Error 1 make[1]: *** [cpus-in-place] Error 2 make: *** [in-place] Error 2 -- -- Jens Axel Søgaard _ Racket Developers list: http://lists.racket-lang.org/dev -- -- Jens Axel Søgaard _ Racket Developers list: http://lists.racket-lang.org/dev
[racket-dev] Build error
Hi All, I got a contract when I tried to build racket. Any ideas? The main error is below. Entire log is here: https://gist.github.com/soegaard/aa8ea014e043a899a5a2 /Jens Axel package-source-name+type: contract violation expected: (or/c #f (or/c (quote name) (quote file) (quote dir) (quote git) (quote github) (quote clone) (quote file-url) (quote dir-url) (quote link) (quote static-link))) given: 'catalog in: the 2nd argument of (-* (string? (or/c #f (or/c 'name 'file 'dir 'git 'github 'clone 'file-url 'dir-url 'link'static-link))) more contract from: collects/pkg/name.rkt blaming: collects/pkg/private/install.rkt (assuming the contract is correct) at: collects/pkg/name.rkt:11.3 context...: /Users/soegaard/racket-from-plt-git/plt/racket/collects/racket/contract/private/blame.rkt:143:0: raise-blame-error16 /Users/soegaard/racket-from-plt-git/plt/racket/collects/racket/contract/private/arrow-val-first.rkt:283:3 /Users/soegaard/racket-from-plt-git/plt/racket/collects/pkg/private/install.rkt:925:2: update-loop /Users/soegaard/racket-from-plt-git/plt/racket/collects/racket/list.rkt:429:2: append-map /Users/soegaard/racket-from-plt-git/plt/racket/collects/pkg/private/install.rkt:1097:0: pkg-update195 /Users/soegaard/racket-from-plt-git/plt/racket/collects/racket/file.rkt:368:8 /Users/soegaard/racket-from-plt-git/plt/racket/collects/racket/file.rkt:357:0: call-with-file-lock40 /Users/soegaard/racket-from-plt-git/plt/racket/collects/pkg/main.rkt:307:16 (submod /Users/soegaard/racket-from-plt-git/plt/racket/collects/pkg/main.rkt main): [running body] /Users/soegaard/racket-from-plt-git/plt/racket/collects/pkg/raco.rkt: [traversing imports] /Users/soegaard/racket-from-plt-git/plt/racket/collects/raco/raco.rkt: [running body] /Users/soegaard/racket-from-plt-git/plt/racket/collects/raco/main.rkt: [running body] make[2]: *** [plain-in-place] Error 1 make[1]: *** [cpus-in-place] Error 2 make: *** [in-place] Error 2 -- -- Jens Axel Søgaard _ Racket Developers list: http://lists.racket-lang.org/dev
Re: [racket-dev] crash running raco setup with racket 6.1
Hi David, FWIW here is how I built the libraries for DrRacket from scratch on OS X. I found out that it was important that the libcairo loaded by DrRacket was built with the same versions of the helper libraries that DrRacket loads. The readme has the details: https://github.com/soegaard/racket-osx-libs It might me worth doubling checking that the versions of the shared libaries that Racket loads matches your expectations. Then again, maybe there were an API change in Cairo that caused the problem - and if so the above is irrelevant. /Jens Axel 2014-10-23 12:46 GMT+02:00 David Bremner da...@tethera.net: David Bremner da...@tethera.net writes: As a point of information, I can duplicate the crash with yesterdays snapshot (20141022-d9f2a84). I didn't bother getting a backtrace there, but I can if it would help. I verified that the version of libcairo2 is what makes a difference. Installing Debian version 1.12.16-5 made the racket build work again both for 6.1 and for the snapshot. Alas that's not going to be a feasible strategy for the official Debian builds. d _ Racket Developers list: http://lists.racket-lang.org/dev -- -- Jens Axel Søgaard _ Racket Developers list: http://lists.racket-lang.org/dev
Re: [racket-dev] [racket] lab notebook on learning process (was: Re: Macros baffle me)
2014-05-06 23:48 GMT+02:00 Stephen Chang stch...@ccs.neu.edu: How about an extra button, a Run Benchmark button? You can already get this with the benchmark package, from pkg.racket-lang. A builtin button will hopefully make it obvious even for non-DrRacket users, that Run is not intended for benchmarks. For those shopping around for a language or an implementation it needs to be painfully clear, what to do in order to get a fair measurement. /Jens Axel 2014-05-06 19:43 GMT+02:00 Sam Tobin-Hochstadt sa...@cs.indiana.edu: On Tue, May 6, 2014 at 12:14 PM, Matthias Felleisen matth...@ccs.neu.edu wrote: Why does he think Performance sucks? Because here's the list of things that are slow DrRacket is an operating system running on top of your other OS to make life for Racket developers simple. It was originally developed for beginners, but I eat my own dog food, and I find it good (tm) for every day Racket work. To evaluate performance, run the programs at the command line. Measure there. Compare with other dynamically typed languages and report back what you find. If you still report performance problems, try to be precise. We are proud of Matthew and how far he has pushed Racket's performance on real software, the kind you use on a daily basis, not just minibenchmarks. I think ultimately that this answer isn't enough. If everyone who tries out Racket in the way we suggest comes away with the impression that it's really slow, suggestions on the mailing list to measure differently won't eliminate the negative first impression, let alone for all the people who _don't_ ask about it. Could we - warn people when they use `time` in DrRacket? - provide a performance mode that runs programs out-of-process, or just in another place? - something else? Sam _ Racket Developers list: http://lists.racket-lang.org/dev -- -- Jens Axel Søgaard _ Racket Developers list: http://lists.racket-lang.org/dev -- -- Jens Axel Søgaard _ Racket Developers list: http://lists.racket-lang.org/dev
Re: [racket-dev] [racket] lab notebook on learning process (was: Re: Macros baffle me)
Sam: Could we - warn people when they use `time` in DrRacket? - provide a performance mode that runs programs out-of-process, or just in another place? - something else? I like this. DrRacket has a performance mode already (disable profiling and debugging) in the (hidded part) of the language dialog. The casual beginner is not likely to recognize it as such though. How about an extra button, a Run Benchmark button? /Jens Axel 2014-05-06 19:43 GMT+02:00 Sam Tobin-Hochstadt sa...@cs.indiana.edu: On Tue, May 6, 2014 at 12:14 PM, Matthias Felleisen matth...@ccs.neu.edu wrote: Why does he think Performance sucks? Because here's the list of things that are slow DrRacket is an operating system running on top of your other OS to make life for Racket developers simple. It was originally developed for beginners, but I eat my own dog food, and I find it good (tm) for every day Racket work. To evaluate performance, run the programs at the command line. Measure there. Compare with other dynamically typed languages and report back what you find. If you still report performance problems, try to be precise. We are proud of Matthew and how far he has pushed Racket's performance on real software, the kind you use on a daily basis, not just minibenchmarks. I think ultimately that this answer isn't enough. If everyone who tries out Racket in the way we suggest comes away with the impression that it's really slow, suggestions on the mailing list to measure differently won't eliminate the negative first impression, let alone for all the people who _don't_ ask about it. Could we - warn people when they use `time` in DrRacket? - provide a performance mode that runs programs out-of-process, or just in another place? - something else? Sam _ Racket Developers list: http://lists.racket-lang.org/dev -- -- Jens Axel Søgaard _ Racket Developers list: http://lists.racket-lang.org/dev
Re: [racket-dev] actionable items, was: comments on comments on learning Racket
2014-04-28 16:12 GMT+02:00 Matthias Felleisen matth...@ccs.neu.edu: SAM: Also, I think that in almost every course using DrRacket, the students will need to learn how to choose languages, because they will switch from one teaching language to the next. So I think this won't be unfriendly. I am not sure this is true for simple high school courses or anyone who wants to run Bootstrap 2 off-line. In a high school context the teacher will typically show the students how to install DrRacket and then guide them through their first example. Starting the program with #lang beginner would not be a problem, as far as I can see. /Jens Axel _ Racket Developers list: http://lists.racket-lang.org/dev
[racket-dev] Refactoring Idea
From time to time the topic of refactoring pop up on the mailing list. Here is one feature I'd like: After renaming an exported identifier in a module foo, any references to the identifier in external modules need to be renamed too. DrRacket could after renaming in foo is done, ask for a folder in which to search for module that require foo and rename the identifier in those modules. -- Jens Axel Søgaard _ Racket Developers list: http://lists.racket-lang.org/dev
[racket-dev] Missing match-expander? export from racket/match
It seems racket/match exports prop:match-expander, but not match-expander? . Is that on purpose? https://github.com/plt/racket/blob/master/racket/collects/racket/match/match.rkt https://github.com/plt/racket/blob/master/racket/collects/racket/match/stxtime.rkt /Jens Axel _ Racket Developers list: http://lists.racket-lang.org/dev
Re: [racket-dev] Can't change plot in DrRacket without getting link errors
Try this: - open the menu Language in DrRacket - choose the menu item Choose language... - click the button Show details - remove the tick in Populate 'compiled' directories (for faster loading) /Jens Axel 2014/1/4 Neil Toronto neil.toro...@gmail.com: I do this: * In DrRacket, open pkgs/plot-pkgs/plot-lib/plot/private/common/draw.rkt * Make a small change, save * At the command line, racket/bin/raco setup --no-docs -l plot * Run a test file in another tab in DrRacket that has (require plot) I wait a long time (I think it's recompiling) and get this error: link: bad variable linkage; reference to a variable that has the wrong procedure or structure-type shape reference phase level: 0 variable module: /home/neil/plt/pkgs/plot-pkgs/plot-lib/plot/private/common/draw.rkt variable phase: 0 reference in module: /home/neil/plt/pkgs/plot-pkgs/plot-gui-lib/plot/private/gui/plot2d.rkt in: draw-bitmap So I remove the compiled directory and try again. Same problem. Here's the kicker: I always get link errors *until I close draw.rkt in DrRacket*. After that, I can remove the compiled directory, rebuild, and run the program without errors. Does anybody know what's going on? Neil ⊥ _ Racket Developers list: http://lists.racket-lang.org/dev -- -- Jens Axel Søgaard _ Racket Developers list: http://lists.racket-lang.org/dev
[racket-dev] Documentation
In cases where the semantics of constructs are changed, should the documentation have a margin note stating the version number of the change? I am in particular thinking of case: http://docs.racket-lang.org/reference/case.html#%28form._%28%28lib._racket%2Fprivate%2Fmore-scheme..rkt%29._case%29%29 /Jens Axel _ Racket Developers list: http://lists.racket-lang.org/dev
Re: [racket-dev] Huh?
Thanks for the tip on renaming. Just what I needed. /Jens Axel 2013/12/3 Eli Barzilay e...@barzilay.org: 6 hours ago, Jens Axel Søgaard wrote: In DrRacket 6.0.0.1 open pkgs/draw-pkgs/draw-lib/racket/draw/private/record-dc.rkt and then click Run. I see: define-values: assignment disallowed; cannot re-define a constant constant: get-recorded-command1.1 Why? That's not new -- usually when you run the code you get a clean environment with the old instantiation gone, but some core files are shared across runs, so it's like trying to redefine things that are already defined. Many files in racket/* will do the same. To debug this kind of stuff it can be helpful to work on a copy of the file that you want to edit, and rename it back over the original (and recompile) when it's working. -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://barzilay.org/ Maze is Life! -- -- Jens Axel Søgaard _ Racket Developers list: http://lists.racket-lang.org/dev
[racket-dev] Huh?
In DrRacket 6.0.0.1 open pkgs/draw-pkgs/draw-lib/racket/draw/private/record-dc.rkt and then click Run. I see: define-values: assignment disallowed; cannot re-define a constant constant: get-recorded-command1.1 Why? I tried the exact same experiment with record-dc.rkt in version 5.3.4 with the same result. /Jens Axel _ Racket Developers list: http://lists.racket-lang.org/dev
Re: [racket-dev] cairo_recording_surface_create
2013/12/1 Matthew Flatt mfl...@cs.utah.edu: What happens if you run `drracket` directly from the command line, instead of using `open`? Then I get to see that the error message, that tells me that that I forgot to run make (well it says bytecode file needs re-compile). And indeed I did forget to run make. After running make, everything works as expected. For the future I will use bin/drracket rather than open DrRacket.app. Thanks. /Jens Axel _ Racket Developers list: http://lists.racket-lang.org/dev
Re: [racket-dev] Racket Guide chapter on concurrency
If you need examples, take a look at: The Little Book of Semaphores http://www.greenteapress.com/semaphores/downey05semaphores.pdf /Jens Axel 2013/10/6 David T. Pierson d...@mindstory.com: Hi all, At the hackathon Asumu helped me work on a Guide chapter on concurrency. Thanks Asumu! Since then I've fleshed it out some more and pushed a commit to github. https://github.com/davidtpierson/racket/commit/d2fb857efec8ce508ac6f76afa845d788edab4c1 It probably needs more work. I would love some feedback before I dare to submit a pull request. Some of my concerns, in no particular order: 1) Should it be broken into separate pages? 2) It starts out with the basics of threads. Is this too trivial to cover? 3) There are lots of ways to synchronize Racket threads. I try to cover them broadly, but don't really delve into which ones are best. Parts seem like they are just restating information from the reference. Should there be more prescriptive text? 4) Some of the examples feel clumsy. Contriving concurrency examples that are both simple and meaningful was hard. I'm not sure I succeeded. Thanks for any feedback (on the above issues or anything else.) David _ Racket Developers list: http://lists.racket-lang.org/dev -- -- Jens Axel Søgaard _ Racket Developers list: http://lists.racket-lang.org/dev
Re: [racket-dev] generic binding forms
Does anyone think this is useful? Or is it just a lot of work to save a little bit of typing? Has anyone tried something like this before? It's still very much a work in progress but I figure I would ask for some feedback earlier rather than too later, in case there is something that makes this infeasible. Brave souls can look at the hackery here: https://github.com/stchang/generic-bind/blob/master/generic-bind.rkt (Warning: I'm still trying to figure out all the toys in the Racket macro toolbox. For the most part, everything still looks like a syntax-rule/case/parse/-datum nail to my hammer.) Technical question: I couldn't figure out a nice way to implement ~let. Essentially, I want a let form where some clauses are let-values and some are match-let, but I need to bind them all at the same time, like let. I can't define a ~lambda that works with values because functions in racket can't receive values. Anyone have any ideas? Side observation: Trying to get things to work with multiple return values was a pain because they don't compose (as in, functions can produce them but can't receive them). Not sure if anything can be done about this though. _ Racket Developers list: http://lists.racket-lang.org/dev -- -- Jens Axel Søgaard _ Racket Developers list: http://lists.racket-lang.org/dev
Re: [racket-dev] raco pkg and github
2013/2/1 Asumu Takikawa as...@ccs.neu.edu: On 2013-02-01 06:23:06 -0700, Jay McCarthy wrote: I had originally tried to do that, but Github wasn't providing tar balls for anything other than branch HEADs and tags. I'm surprised that it works for you and not for me. Am I just crazy or did you set something on your repository to make it work? Maybe it's a new feature they added recently? I think Jens was saying on IRC that it wasn't documented in the API. It was about 6-7 months ago I checked, and back then I couldn't find anything. Now I see it here: http://developer.github.com/v3/repos/contents/#get-archive-link The v3 API was in beta from June, so I might have been looking at the v2 API back then. Anyways, great find Asumu. /Jens Axel _ Racket Developers list: http://lists.racket-lang.org/dev
Re: [racket-dev] case- and for/sum:
2013/1/3 Neil Toronto neil.toro...@gmail.com: I solved it by not using `for/sum' and writing this ridiculous function for the recursive base case and the initial values in `x': (: zero-of (case- (Real - Real) (Number - Number))) (define (zero-of x) 0) Fortunately, it should get inlined. I also renamed `U' to `V', because it was overshadowing the type name. Thanks for the solution. I am very fond of for and friends in Racket code, and it annoys me to port these constructs to Typed Racket. I know the goal is for Typed Racket to use the output of the macro expansion of for and friends, but maybe it is worth the effort to implement Typed Racket versions of the most used for-variants? /Jens Axel _ Racket Developers list: http://lists.racket-lang.org/dev
Re: [racket-dev] case- and for/sum:
2013/1/4 Neil Toronto neil.toro...@gmail.com: I gave `for/sum:' a little thought recently, though, and I couldn't think of how to make it work without annotations. Maybe you'll have more success. I'm less motivated to fix `for/sum:' than you are. :D Here is my attempt. The only problem, is that when type checking fails, the set! expression is blamed instead of user code. /Jens Axel for-sum.rkt Description: Binary data _ Racket Developers list: http://lists.racket-lang.org/dev
Re: [racket-dev] case- and for/sum:
This version blames the correct expression. The error message itself is however in terms of the expanded code and I see why that is a key problem. /Jens Axel for-sum.rkt Description: Binary data _ Racket Developers list: http://lists.racket-lang.org/dev
Re: [racket-dev] case- and for/sum:
Ignore the previous example. Here is the example again, now with correct usage of case-lambda. The for/sum problem remains. /Jens Axel #lang typed/racket (require math) (: matrix-solve-upper (All (A) (case- ((Matrix Real) (Matrix Real) - (Matrix Real)) ((Matrix Real) (Matrix Real) (- A) - (U A (Matrix Real))) ((Matrix Number) (Matrix Number)- (Matrix Number)) ((Matrix Number) (Matrix Number) (- A) - (U A (Matrix Number)) (define matrix-solve-upper ; solve the equation Ux=b ; using back substitution (case-lambda [(U b) (define (default-fail) (raise-argument-error 'matrix-solve-upper The upper triangular matrix is not invertible. 0 U)) (matrix-solve-upper U b default-fail)] [(U b fail) (define m (matrix-num-rows U)) (define x (make-vector m 0)) (for ([i (in-range (- m 1) -1 -1)]) (define bi (matrix-ref b i 0)) (define Uii (matrix-ref U i i)) (when (zero? Uii) (fail)) (define x.Ui (for/sum ([j (in-range (+ i 1) m)]) (* (matrix-ref U i j) (vector-ref x j (vector-set! x i (/ (- bi x.Ui) Uii))) (vector-matrix m 1 x)])) (define U (matrix [[4 -1 2 3] [0 -2 7 -4] [0 0 6 5] [0 0 0 3]])) (define b (col-matrix [20 -7 4 6])) b ; expected (define x (solve-upper-triangular U b)) (matrix* U x) _ Racket Developers list: http://lists.racket-lang.org/dev
Re: [racket-dev] [plt] Push #25941: master branch updated
2012/12/22 ntoro...@racket-lang.org: 1aebd17 Neil Toronto ntoro...@racket-lang.org 2012-12-21 22:59 | * Specialized row reduction for determinants; removed option to not do | partial pivoting (it's never necessary otherwise) Partial pivoting is used to reduce round-off error. If the matrix consists of integers or fraction, then due to exact arithmetic, there is no need to do partial pivoting. And it gets worse. It is subtle though. Consider matrices with (exact) integer entries and Gauss elimination with partial pivoting, the result will be a matrix with fractions. For each division a gcd computation is needed to reduce the fraction. This hidden cost is can be large in some cases. According to https://www.cs.drexel.edu/~wan/publications/thesis.pdf page 33 Gauss elimation turns onto a O(n^4) algorithm. (Geddes mentions the same issue in relation to Gaussian elimination over a general ring). Related: The Sage documentation on LU factorization, imply that besides no-pivoting, the first-non-zero-variant is useful too: http://www.sagemath.org/doc/reference/sage/matrix/matrix2.html In fact the partial pivoting is not used as the default. /Jens Axel _ Racket Developers list: http://lists.racket-lang.org/dev
[racket-dev] Sorry.
Hi All, I made a mistake pushing some commits. Rather than mess things more up, I hope some one has enough git-fu to undo the commit. Normally push refused to do anything but fast-forward commits, but the commit looks wrong on Github. /Jens Axel (with red ears) _ Racket Developers list: http://lists.racket-lang.org/dev
Re: [racket-dev] Implementation of bit vectors
Hi Pierpaolo, 2012/11/27 Pierpaolo Bernardi olopie...@gmail.com: Any comments on the implementation and documentation are welcome. The bit vector is represented as a vector of fixnums (packaged in a struct of course). I seem to understand that you do not exploit the packed representation of bits in the iteration construct, is this right? In in-bit-vector could be improved. Currently it just calls bit-vector-ref repeatedly. Also, you store and retrieve booleans, not bits, so the name 'bit-vector' is misleading. Potato / Potato :-) http://wiki.call-cc.org/eggref/4/iset 'find' and 'count' operations optimized for the representation would be a useful addition. Good idea. I better rename the current count to size, and then use count to count ones. -- Jens Axel Søgaard _ Racket Developers list: http://lists.racket-lang.org/dev
Re: [racket-dev] Implementation of bit vectors
2012/11/27 J. Ian Johnson i...@ccs.neu.edu: As I intend to use bitvectors to do fast set operations, and cardinality is a set operation, I wrote up a fast count bits function that should be rolled in for the vector implementation: https://gist.github.com/4154642 I have used your code to add a function bit-vector-count that count the number of set bits in the bit-vector. There is an issue of potential confusion over names though. In the data collection, the -count suffix normally returns the size of the data structure. For vectors the suffix -length is normally used. -- Jens Axel Søgaard _ Racket Developers list: http://lists.racket-lang.org/dev
Re: [racket-dev] Implementation of bit vectors
Hi All, I have implemented an alternative version of bit-vectors using bignums to represent the bits. As is the bignum implementation is much slower, than the vector-of-fixnum one. The main reason as far as I can tell is due to bit-vector-set! . Since bignums aren't mutable I can not simply flip a bit and need to compute a new bignum. Unless bignums are sharing limbs this will be slow for large bit-vectors. Another possibility is that I have missed something obvious. The functions bit-vector-set! is here: (define (bit-vector-set! bv n b) ; bv is a bit-vector ; n is the bit number ; b is #f or #t (define bits (bit-vector-bits bv)) (define mask (arithmetic-shift 1 n)) (cond [b (set-bit-vector-bits! bv (bitwise-ior bits mask))] [(bitwise-bit-set? bits n) (set-bit-vector-bits! bv (bitwise-xor bits mask))] [else (void)])) The entire implementation is here: https://github.com/soegaard/racket/blob/4b299ea66a77100538940794cd799cb88929b7e3/collects/data/bit-vector-bignum.rkt The benchmark is here: https://github.com/soegaard/racket/blob/4b299ea66a77100538940794cd799cb88929b7e3/collects/data/benchmark-bit-vector-representations.rkt -- Jens Axel Søgaard _ Racket Developers list: http://lists.racket-lang.org/dev
[racket-dev] Implementation of bit vectors
Hi All, I have written an implementation of bit vectors intended to be part of the data collection. https://github.com/plt/racket/pull/176 Any comments on the implementation and documentation are welcome. The bit vector is represented as a vector of fixnums (packaged in a struct of course). -- Jens Axel Søgaard _ Racket Developers list: http://lists.racket-lang.org/dev
[racket-dev] Old pull requests on Github
Hi All, I notice that there a few old pull requests on Github without any form of comments. Even a we will look at this later comment looks better to out siders, than none at all. https://github.com/plt/racket/pulls Any thoughts? /Jens Axel _ Racket Developers list: http://lists.racket-lang.org/dev
Re: [racket-dev] Math library pushed
Hi All, Thanks to Asumu, Erich and a few others on the irc channel I got it working. I tried rebasing, but couldn't make it work. I am not sure why. The resulting pull request still had the entire history. Then I tried making a new branch. Reseting to a point before Neils initial commit. Then fetching and merging the plt/racket repository and finally cherry-picking the commits I needed. -- Jens Axel Søgaard _ Racket Developers list: http://lists.racket-lang.org/dev
Re: [racket-dev] Math library pushed
2012/11/16 Matthew Flatt mfl...@cs.utah.edu: * require: unknown module module name: #resolved-module-path:(submod /Users/mflatt/proj/plt/collects/math/special-functions.rkt typed-module5) So far, this one looks like a problem with finding a submodule in a .zo file --- that is, a bug that I will have to track down and fix. This is the error, I ran into, when I tried to merge in documentation for the number theory functions. Is there a workaround? -- Jens Axel Søgaard _ Racket Developers list: http://lists.racket-lang.org/dev
Re: [racket-dev] Math library pushed
A fix is even better! Thanks, Jens Axel 2012/11/16 Matthew Flatt mfl...@cs.utah.edu: At Fri, 16 Nov 2012 21:21:29 +0100, Jens Axel Søgaard wrote: 2012/11/16 Matthew Flatt mfl...@cs.utah.edu: * require: unknown module module name: #resolved-module-path:(submod /Users/mflatt/proj/plt/collects/math/special-functions.rkt typed-module5) So far, this one looks like a problem with finding a submodule in a .zo file --- that is, a bug that I will have to track down and fix. This is the error, I ran into, when I tried to merge in documentation for the number theory functions. Is there a workaround? Unfortunately, I don't see a workaround for older versions. I've fixed it in the current git master, though. -- -- Jens Axel Søgaard _ Racket Developers list: http://lists.racket-lang.org/dev
Re: [racket-dev] Character classification
Since the R5RS version of char-numeric? (according to the documentation) tests for the ten digits, you can use: (require (only-in r5rs char-numeric?)) /Jens Axel 2012/9/4 Pierpaolo Bernardi olopie...@gmail.com: The non-cooperation between char-numeric? and string-number is very annoying. I had to resort to: (define (my-char-numeric? c) (char=? #\0 c #\9)) Maybe I am missing a function similar to my-char-numeric? somewhere in the Racket docs? FWIW, my humble opinion is that char-numeric? should be defined as the my- version above. The Unicode category, if that's what one wants, can be accessed with char-general-category. Cheers P. _ Racket Developers list: http://lists.racket-lang.org/dev -- -- Jens Axel Søgaard _ Racket Developers list: http://lists.racket-lang.org/dev
Re: [racket-dev] Character classification
2012/9/4 Pierpaolo Bernardi olopie...@gmail.com: On Tue, Sep 4, 2012 at 3:11 PM, Jens Axel Søgaard jensa...@soegaard.net wrote: Since the R5RS version of char-numeric? (according to the documentation) tests for the ten digits, you can use: (require (only-in r5rs char-numeric?)) Thanks Jens Axel. However, the r5rs version appears to be the same as the Racket version. I consider that a bug. http://docs.racket-lang.org/r5rs-std/r5rs-Z-H-9.html?q=char-numeric%3F#%_idx_490 The numeric characters are the ten decimal digits. Note that meaning changed in R6RS: A character is numeric if it has the Unicode “Numeric” property. So the current Racket behaviour matches R6RS. /Jens Axel Tested with: #lang r5rs (define (test) (let again ((i 0)) (cond (( i #xD800) (let ((c (integer-char i))) (cond ((char-numeric? c) (display (list i c)) (newline))) (again (+ i 1))) -- -- Jens Axel Søgaard _ Racket Developers list: http://lists.racket-lang.org/dev
Re: [racket-dev] Wrapping loops for TR isn't working, and the type annotations are for the wrong value
2012/8/15 Neil Toronto neil.toro...@gmail.com: Other options: 1. Raise an error when the vector isn't filled. 2. Return a (Vectorof (U T #f)) (better than (Vectorof (U T 0))?). 3. Always return a vector whose length is the number of iterations. Or a variation of 2.: 4. Let the user supply the value to fill the vector with. This could be relevant in cases where less than the #:length specified number of values is produced. (for/vector #:length 10 ([i 5]) i) '#(0 1 2 3 4 0 0 0 0 0) /Jens Axel _ Racket Developers list: http://lists.racket-lang.org/dev
Re: [racket-dev] Wrapping loops for TR isn't working, and the type annotations are for the wrong value
There is a similar problem with for/product: . The initial 1 is that an integer, a real or a complex? (for/product: : Real ([i : Integer (in-range 0 5)]) (/ i)) Type Checker: Expected Integer, but got Exact-Rational in: (for/product: : Real ((i : Integer (in-range 0 5))) (/ i)) It does not help to change the type of i to Real : (for/product: : Real ([i : Real (in-range 0 5)]) (/ i)) Type Checker: Expected Integer, but got Real in: (for/product: : Real ((i : Real (in-range 0 5))) (/ i)) /Jens Axel /Jens Axel _ Racket Developers list: http://lists.racket-lang.org/dev
Re: [racket-dev] Sublinear functions of superfloat numbers
Is the following a fair summary? The idea is to divide the real axis in three parts. x y z Here x is a real (double), y is a slightly larger than +max.0, and z is a very large. Now sqrt(x) is just a real (double). Let y be an exact integer only slightly larger than +max.0. Even though y is larger than +max.0 the true sqrt of y is actually smaller than +max.0 and thus representable as a float. It is therefore possible to extend the standard sqrt function to numbers slightly above +max.0. For very large numbers z where sqrt(x) is larger than +max.0 return +inf.0 unless z happens to be a perfect square. The sqrt function is a sublinear function. This extension is also possible for other members of this class such as the logarithms. How to extend the function depend on the function. The other example, the periodic trigonometric functions is slighly different. Here the problem is that the argument must be reduced before the actual computation can take place. The reduction is simple in principle - just subtract the period repeatedly until the argumet is so small the standard function works However the period irrational, so in order to avoid loss of precision, one must compute the period with an appropriate number of decimals compared to the argument before the reduction can take place. /Jens Axel _ Racket Developers list: http://lists.racket-lang.org/dev
Re: [racket-dev] Using licensed code
Hi, 2012/7/1 Eli Barzilay e...@barzilay.org Three hours ago, Neil Toronto: [*] Unfortunately, the `science' collection has a license problem: the stated license (LGPL) at the top any of its files can't be the actual license if the file was derived from the Gnu Science Library (GSL), which is GPL. Most of the files I'm interested in converting to Typed Racket are from the GSL. GPL is a problem. I would absolute *love* to get proper linear algebra libraries. With proper I mean that areas such as eigenvalue computations and singular value decomposition is included. The license of GSL is of course a problem. The readline solution doesn't really fit well in this context. However GSL is not the only matrix library out there. LAPACK ( http://www.netlib.org/lapack/) has license that fits better. The code is in Fortran 90 though, so it might be harder to translate directly. That said, it might make sense to go the FFI-route for matrix computations. Getting the details right for the more advanced algorithms is hard, very hard. -- Jens Axel Søgaard _ Racket Developers list: http://lists.racket-lang.org/dev
Re: [racket-dev] Potential search improvement
2012/5/29 Eli Barzilay e...@barzilay.org: I have made a possibly useful improvement to the JS search code. It's not pushed, yet, but I dropped the revised JS code on the pre-built pages so you can try it out here: http://pre.racket-lang.org/docs/html/search/ and compare searches with the usual page: http://docs.racket-lang.org/search/ I'd appreciate people playing with it to find about potential problems with the ordering and possibly with different browsers. I like it. A quick note: I searched for Scribble and didn't get the main manual. The reason is that is named: Scribble: The Racket Documentation Tool in scribble This case could be solved by renaming it: Scribble - The Racket Documentation Tool in scribble Or by stripping punctuation in manual titles. Stripping other things than manual titles would be a bad idea (in case actual identifiers were involved), but it it seems that the manual titles doesn't contain any: http://pre.racket-lang.org/docs/html/index.html The thing is that they used to be lumped to 2 groups with exact matches first. Now I made each of these be in its own group, so there's a little more order. To see an example that works nicely now try splay. Sweet! I am undecided on the following: Try a search for list. The results are a bunch of places where list is exported from. It would be nice to see the these more prominently displayed: List Filtering in reference List Iteration in reference List Iteration from Scratch in guide List Operations in reference It won't take long, before 20 modules export list, and the reference and guide results disappear from the front page. Hmm. How about displaying a yellow box at the top of the results saying x hits from guide and y hits from reference, click here to see them. This way the guide and reference hits are in your face for beginners. The actual results for list: list provided from racket/base, racket list provided from r5rs list provided from rnrs/base-6 list provided from lang/htdp-advanced list provided from lang/htdp-beginner list provided from lang/htdp-beginner-abbr list provided from lang/htdp-intermediate list provided from lang/htdp-intermediate-lambda list provided from deinprogramm/DMdA-advanced list provided from deinprogramm/DMdA-assignments list provided from deinprogramm/DMdA-vanilla list provided from lazy list provided from srfi/1 List provided from typed/racket/base, typed/racket list box in gui List Filtering in reference List Iteration in reference List Iteration from Scratch in guide List Operations in reference list patterns in syntax /Jens Axel _ Racket Developers list: http://lists.racket-lang.org/dev
Re: [racket-dev] OS X 10.8 includes new restrictions on running apps
The tech press reports that the default is to medium i.e. applications downloaded from the mac app store and from identified developers (that is signed applications) are allowed to run. /Jens Axel 2012/2/21 Robby Findler ro...@eecs.northwestern.edu I'm hoping that there will be some backlash from this and we'll not actually see a high setting being the default in 10.8 Robby On Tue, Feb 21, 2012 at 3:56 PM, John Clements cleme...@brinckerhoff.org wrote: In a move that I find not even slightly surprising, the new Apple operating system (10.8, out soon?) includes new features that make it harder for developers to deploy their code on user machines. http://tidbits.com/article/12795 Specifically, the technology is called Gatekeeper, and it allows users to choose between various levels of security. At the highest level, you can choose to run only programs distributed through Apple's App Store. Bleah. There is also a next level down, though, that runs any program that has acquired a signing certificate from Apple. It's free... if you're a member of Apple's developer program, which appears to currently be $99/year. I'm also curious/worried about what the terms of the agreement are; as with any development environment, Racket can *certainly* be used to run ill-behaved programs; if acquiring the certificate means signing something accepting legal liability for harm done by users of the application, Racket is a non-starter. Anyhow, just something else to be aware of. John _ Racket Developers list: http://lists.racket-lang.org/dev _ Racket Developers list: http://lists.racket-lang.org/dev -- -- Jens Axel Søgaard _ Racket Developers list: http://lists.racket-lang.org/dev
Re: [racket-dev] new logo
2012/2/12 Eli Barzilay e...@barzilay.org An hour ago, Michael W wrote: Or something with the parenthesis echo motif on the main site: http://img513.imageshack.us/img513/5233/lambdarechopng.jpg This one is great! Here's a rough sketch that shows what I'm thinking of (using the shiny bg): http://tmp.barzilay.org/cr.png From all the suggestions so far, this is the concept I like the best. (Imagine it rendered in the style of the new r-logo). Pros: * it is clear it is an R * it is clear R builds on lambda * a black and white version is easy to make * it will work in small sizes too Who cares about unbalanced parentheses in logos? -- Jens Axel Søgaard _ Racket Developers list: http://lists.racket-lang.org/dev
Re: [racket-dev] feature request: gcd, lcm for rationals
2011/12/10 Stephen Bloch sbl...@adelphi.edu On Dec 9, 2011, at 3:31 PM, Daniel King wrote: On Fri, Dec 9, 2011 at 15:27, Carl Eastlund c...@ccs.neu.edu wrote: What does divides even mean in Q? I think we need David to explain what his extension of GCD and LCM means here, in that divisors and multiples are fairly trivial things in Q. I don't suppose to understand all the math on this page, but I think it uses the same definition that dvh is using. http://mathworld.wolfram.com/GreatestCommonDivisor.html Interesting: the Mathematica people have extended the gcd function from the integers to the rationals, not by applying the usual definition of gcd to Q (which would indeed be silly, as everything except 0 divides everything else), but by coming up with a different definition which, when restricted to integers, happens to coincide with the usual definition of gcd. If we for rational numbers x and y define x divides y to mean y/x is an integer, then I believe the definition d is a gcd of x and y = i) d divides a and y ii) e divides x and y = d divides e coincides with the MathWorld definition. I would wonder: is this the ONLY reasonable function on rationals which, when restricted to integers, coincides with the usual definition of gcd? Not sure, but this seems relevant. http://trac.sagemath.org/sage_trac/ticket/10771 -- Jens Axel Søgaard _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/dev
Re: [racket-dev] Roogle?
2011/8/5 Stephen Chang stch...@ccs.neu.edu For online, full-text search, couldn't one just use google and add site:docs.racket-lang.org to the query? The Google stemmer is well-suited for natural languages. It sucks for Scheme/Racket identifiers. Try for example to find cons* or list? . /Jens Axel _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/dev
Re: [racket-dev] intro videos
Great initiative. Already subscribed. * the sound is good * the resolution (except the first one) is great * perhaps mention that option and command is called alt and mumble on Windows (or add an annotation (using the YouTube editor) to the video, so you don't have to reshoot) * If you are using ScreenFlow to record the videos, you could let it show the keyboard shortcuts. * the short length is good Do you happen to have a tablet? If so you could use together with OmniDazzle to write on top of the DrRacket screen. See for example http://www.youtube.com/watch?v=TVc2tmsZfFg where Paul Anderson uses it to write on top of a Keynote presentation. Keep 'em coming. -- Jens Axel Søgaard 2011/7/13 John Clements cleme...@brinckerhoff.org Frustrated by what I'm seeing on khanacademy.org, I've now recorded 8 *short* videos on getting started programming in DrRacket. http://www.youtube.com/playlist?list=PLD0EB7BC8D7CF739A It gets through about half of the first page of HtDP 2e. I'm trying to stress those things--interface details, understanding error messages--that are a better fit for video. Comments welcome. John _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/dev -- -- Jens Axel Søgaard _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/dev
Re: [racket-dev] planet-version follies with old planet packages
011/5/17 Robby Findler ro...@eecs.northwestern.edu: Oh, okay I'm caught up now and, as far as I can tell, the gzip.plt package needs to be updated. It has this: (define required-core-version 400.0) in the info.ss file: http://planet.racket-lang.org/package-source/soegaard/gzip.plt/2/0/info.ss and I think that needs to be this instead: (define required-core-version 4.0) I picked at random one of my other packages digest, and in its info.ss is says: (define required-core-version 369.8) And that seems to work fine: Welcome to DrRacket, version 5.0.99.6--2011-01-12(99d1cda/a) [3m]. Language: racket; memory limit: 256 MB. (require (planet digest.ss (soegaard digest.plt 1 2))) (bytes-hex-string (md5-bytes #abc)) 900150983cd24fb0d6963f7d28e17f72 So I am a little confused. Is it only the 4xx series, that where the form 400.0 doesn't work? I just grepped thru the source and, unless someone stuck a newline in the required-core-version spec, this is the only package on planet that has this problem. Jens Axel: do you have time to upload a version (2 1) of the gzip package that updates the required-core-version field? (I hope that's all that's needed?) I'll put it on my todo. -- Jens Axel Søgaard _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/dev
Re: [racket-dev] `cond' / `when' / `unless' / etc bodies
2010/10/10 Eli Barzilay e...@barzilay.org: I like mixing definitions and expressions -- maybe the bodies of `cond' etc should also allow it? In (define (foo x) (when (even? x) (define x (add1 x)) (printf increment\n)) x) is the scope of the definition (define x ...) the entire body of foo ? -- Jens Axel Søgaard _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/dev
Re: [racket-dev] P4P: A Syntax Proposal
2010/7/31 Eli Barzilay e...@barzilay.org: There's a whole bunch of these things (in CL and Scheme), and IIRC, Jens had something very well doone recently -- but they all suffer from requiring some ugly wrapper syntax around them. Indeed. In order to keep the wrapping at a minimum I contemplate hijacking strings starting with $, that is, if a string starts with $ then the remaining part of the string is parsed as an infix expression. I came to my senses eventually. http://planet.racket-lang.org/package-source/soegaard/infix.plt/1/0/planet-docs/manual/index.html -- Jens Axel Søgaard _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/dev
Re: [racket-dev] discussion of the release
2010/6/9 Sam Tobin-Hochstadt sa...@ccs.neu.edu: 4. We should have a Try Racket in the browser link, like this: http://tryruby.org/ Perhaps the IRC-bot thingie could be used as a starting point? -- Jens Axel Søgaard _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/dev