Re: [racket-users] Rosetta Code: Level 1st (that's FIRST) with TCL

2015-05-04 Thread Gustavo Massaccesi
Too early. Tcl is (apparently) first again :( (I'm not sure how is the correct method to count them.) http://timb.net/popular-languages.html # Count Name 1 855 Tcl 2 852 Racket 3 842 Python 4 776 J In the Rosetta webpage # Count Name 1 851 Tcl 2 850 Racket 3 826 Python (???) 4 773 J Gustavo On

[racket-users] Regular expressions and Unicode categories

2015-05-05 Thread Gustavo Massaccesi
I was tiring to solve the extended version of a Rosetta code task, but I can't find the correct regexp to match accented letters and numbers: #lang racket (regexp-match #px\\.\\p{L}+$ zz.aBc) ;== '(.aBc) (regexp-match #px\\.\\p{L}+$ zz.ñéü) ;== '(.ñéü) (regexp-match #px\\.\\p{N}+$ zz.123) ;==

Re: [racket-users] Regular expressions and Unicode categories

2015-05-06 Thread Gustavo Massaccesi
, Gustavo Massaccesi пишет: I was tiring to solve the extended version of a Rosetta code task, but I can't find the correct regexp to match accented letters and numbers: #lang racket (regexp-match #px\\.\\p{L}+$ zz.aBc) ;== '(.aBc) (regexp-match #px\\.\\p{L}+$ zz.ñéü) ;== '(.ñéü) (regexp-match #px

Re: [racket-users] DrRacket stubbornly indents code as if it were Racket

2015-06-16 Thread Gustavo Massaccesi
You can select the text mode in the menu EditModes(near the bottom)Text mode It disables indentation, but it may disable too many features. For example it disables also parens matching :( . And it also disables background syntax expansion, but you can still use the check syntax button

Re: [racket-users] disappeeraing binding arrows

2015-05-22 Thread Gustavo Massaccesi
This is a minimized example (after expansions and simplifications): #lang racket (letrec-syntaxes+values ([(c) {lambda (stx) (let ([x #'0]) x)}]) () (c)) This prints correctly 0, but no identifier inside the curly {lambda ...} get any

Re: [racket-users] 6.2 regression in running tests?

2015-07-15 Thread Gustavo Massaccesi
, 'rep' is not long a singled used function. ... I must test this a little more ... Gustavo On Wed, Jul 15, 2015 at 4:14 AM, Ryan Davis zenspi...@gmail.com wrote: On Jul 14, 2015, at 20:19, Gustavo Massaccesi gust...@oma.org.ar wrote: Replacing the line 1758 of optimize.c - if ((info

Re: [racket-users] 6.2 regression in running tests?

2015-07-14 Thread Gustavo Massaccesi
I reduced it a little, it's a variation of the old ((lambda (x) (x x)) (lambda (x) (x x))) but there must be a problem in the inlining fuel. In my example, the ´dup´ definition is not necessary, but it makes it more clear. It can be copied by hand to the application point. I wrapped the

Re: [racket-users] 6.2 regression in running tests?

2015-07-14 Thread Gustavo Massaccesi
about the (info-inline_fuel = 0) in line 1872 and how that interacts with the if (noapp) in line 1876 ... Gustavo On Tue, Jul 14, 2015 at 8:38 PM, Gustavo Massaccesi gust...@oma.org.ar wrote: I reduced it a little, it's a variation of the old ((lambda (x) (x x)) (lambda (x) (x x))) but there must

Re: [racket-users] 6.2 regression in running tests?

2015-07-20 Thread Gustavo Massaccesi
a report of the errors that the next version of Racket would create, and you can send an early warning to the list. This will be helpfull to fix the errors before shipping. Gustavo On Wed, Jul 15, 2015 at 4:14 AM, Ryan Davis zenspi...@gmail.com wrote: On Jul 14, 2015, at 20:19, Gustavo

Re: [racket-users] racket users fight for their right to colon keywords

2015-10-16 Thread Gustavo Massaccesi
I agree. I think that :xyz doesn't look special enough, and with #:xyz is clear that the reader is doing something special. Gustavo On Thu, Oct 15, 2015 at 1:00 PM, Laurent wrote: > On Thu, Oct 15, 2015 at 3:25 PM, Deren Dohoda > wrote: >> >> I

Re: [racket-users] Separate compilation vs macros in signatures and compiler stacktraces (crashes?)

2015-10-08 Thread Gustavo Massaccesi
(Old thread ...) I only want to add an example of identifier capture. Here the identifier _it_ is not bound at the macro compiling time, but is bound at the final code. Note: Capture is discouraged in Racket. I think that 99% of the times, the unbound identifiers are just typos, like displyaln.

Re: [racket-users] Defining a symbol breaks symbols?

2015-10-18 Thread Gustavo Massaccesi
This "breaks" my old example: #lang hygienic-quote racket (define-syntax-rule (quasiquote x) (reverse 'x)) `(1 2 3 4) Nice idea! I found a strange side effect of the use of the marks. This compiles without error: #lang hygienic-quote racket (define 'x 5) (define 'x 5) '3 But I think it's

Re: [racket-users] help on coding finite state automata

2015-10-12 Thread Gustavo Massaccesi
Sorry for not testing before posting, but in this code: (define (randomise-over-fitness accumulated-payoff-percentage population speed) (for/list ([n (in-range speed)]) [define r (random)] (for/and ([p (in-list population)] [a (in-list accumulated-payoff-percentage)]

Re: [racket-users] help on coding finite state automata

2015-10-13 Thread Gustavo Massaccesi
write shuffle for imperative vectors. >> >> I have pulled out the population for now so that you can play with this: >> >> https://github.com/mfelleisen/sample-fsm >> >> It's easy to run now from the command line. >> >> >> >> On Oct 12, 2015, at

[racket-users] Rebuild html documentation

2015-07-07 Thread Gustavo Massaccesi
I'm trying a few changes in a .scrbl file of one package and I want to rebuild the .html files to be sure that the problem is fixed. I tried: raco setup and raco setup --doc-index but the documentation don't change. What command should I run? Gustavo -- You received this message

Re: [racket-users] Rebuild html documentation

2015-07-08 Thread Gustavo Massaccesi
Jul 2015 20:31:16 -0300, Gustavo Massaccesi wrote: I'm trying a few changes in a .scrbl file of one package and I want to rebuild the .html files to be sure that the problem is fixed. I tried: raco setup and raco setup --doc-index but the documentation don't change. What command

Re: Make, in place build, was Re: [racket-users] Racket v6.2

2015-09-11 Thread Gustavo Massaccesi
I'm using: make in-place PKGS="racket-test-core" This install only a small set of packages, so the build time is short. Also, the time of "raco setup" is smaller. I usually add a few additional packages when I need them, for example "compiler-lib". Gustavo On Fri, Sep 11, 2015 at 12:06 AM,

Re: [racket-users] Failure when building a distributable application

2015-10-01 Thread Gustavo Massaccesi
I think that I will not be to able to fix this, but anyway I think that there is very little information here. Windows, OSX, Linux, or other? Version? Which DrRacket version are you using? Gustavo On Wed, Sep 30, 2015 at 5:54 AM, Byron Davies wrote: > How can one

Re: [racket-users] Re: typed/racket + rackunit = trouble

2015-09-19 Thread Gustavo Massaccesi
sely because it has to maintain the semantics that Robby doesn't > like :) > > Sam > > On Sat, Sep 19, 2015 at 5:38 PM, Gustavo Massaccesi <gust...@oma.org.ar> > wrote: >> There is something very strange with memq vs member: >> http://pasterack.org/pastes/80845

Re: [racket-users] Re: typed/racket + rackunit = trouble

2015-09-19 Thread Gustavo Massaccesi
There is something very strange with memq vs member: http://pasterack.org/pastes/80845 (note: I added one 0 to the loop constants) I used two mutable variables eq?? and equal?? to avoid (most of) the optimizations and I get that the time with equal? is 2x than the time with eq?. This is closer

Re: [racket-users] memq vs member [was: typed/racket + rackunit = trouble]

2015-09-20 Thread Gustavo Massaccesi
I've done a few experiments with a easy version of , that never has a third argument. (It's wrong, but it's useful to estimate how much better the final version could be.) https://github.com/gus-massa/racket/commit/cd35e0dc3db474f8dc31fea170d1bc2900f2e338 I simplified the use of the macros, but

Re: [racket-users] Re: Typed Racket: Is (- 1 1) equivalent to (- 2 2)?

2015-12-10 Thread Gustavo Massaccesi
IIRC, the only numeric type that are singletons are Zero and One, so this also typechecks: (+ 1 (if (= 0 (- 0 0)) 1 "x")) On a related note, the (untyped)Racket optimizer has constant folding, so in (untyped)Racket all these expressions are compiled to 2. I don't know if it's possible to add

Re: [racket-users] [racket] suggestions on scribble/example

2016-01-09 Thread Gustavo Massaccesi
In TravisCI, building with the "main-distribution" packge, the versions in linux that don't have "--disable-jit" finish corretly just a minutes after an hour. (I think the official max time is 1 hour, but apparently there are some bonus minutes.) The versions with "--disable-jit" take longer and

Re: [racket-users] Rust vs. C as a complement to Racket?

2015-11-19 Thread Gustavo Massaccesi
> I did *some* hand optimizing. Here's the code for the soundex and some string > helper functions I created: > > https://gist.github.com/lojic/1deba97f2e2eb2fe3fc0 > I'm optimistic and I think that there is still some room for micro-optimizations (for example, replace the set!'s, but I didn't

Re: [racket-users] Case vs. Match

2016-06-04 Thread Gustavo Massaccesi
one (add a `pretty-write` if you're running in cmd-line racket). >> >> #lang racket >> (syntax->datum >> (expand >> #'(case x >> [(1 2 3 4 5 6 7 8 9 10) 1] >> [(a b c d e f g h i j k l m n o p q r s t) 2]))) >> >> &g

Re: [racket-users] Case vs. Match

2016-06-03 Thread Gustavo Massaccesi
> [...] I saw in the docs that case specifically mentions it can distribute in log(n) time [...] I think it's strange. I found the reference in https://docs.racket-lang.org/reference/case.html but it's very strange. Is it true??? For example, I tried with ;--- #lang racket (lambda (x) (case

Re: [racket-users] Racket performance tips

2016-01-18 Thread Gustavo Massaccesi
I have a few minor stile comments: *** I'd replace (define backslash 92) with (define backslash (char->integer #\\)) to improve legibility. And do the same replacement for other magic numbers. After optimization, both versions are identical. [The only site where this would cause a

Re: [racket-users] building openwrt .ipk for racket

2016-02-13 Thread Gustavo Massaccesi
The scripts are slightly different. Is it necessary or it' enough to change the version and md5? Gustavo On Fri, Feb 12, 2016 at 11:36 PM, Neil Van Dyke wrote: > I dumped onto the Web the files I used to build OpenWrt packages for Racket: >

[racket-users] Chaperone of immutable hash

2016-02-13 Thread Gustavo Massaccesi
I want to make a test with a chaperone of an immutable hash, but the signature of make-chaperone-hash has too many parts. Do anyone have an example of use of make-chaperone-hash. If possible, the chaperone that does nothing, only forward the values. Gustavo -- You received this message because

[racket-users] Try-Raket is not working

2016-01-29 Thread Gustavo Massaccesi
From: http://try-racket.org/ > Exception > The application raised an exception with the message: > resolver: undefined; > cannot reference an identifier before its definition > in module: "/usr/share/racket/collects/planet/private/resolver.rkt" I don't know the email of the owner, but I

Re: [racket-users] backwards-incompatible change to in-vector

2016-01-19 Thread Gustavo Massaccesi
I couldn't write an example that is not obvious, but this programs looks ok to me: ;--- #lang racket (define (display-vector v) (for ([x (in-vector v 0 (vector-length v))]) (display x))) (display-vector (vector 1 2 3)) (newline) (display-vector (vector)) (newline) ;--- And I also like

Re: [racket-users] Places performance & channel capacity

2016-01-22 Thread Gustavo Massaccesi
>In hindsight, I guess that's not too surprising since the majority of work is copying byte from >one place to another anyway (soundex isn't that slow), so if the parallel version has to copy >the line twice when the work is ~ copying the line once, it's going to be expensive getting >the data

Re: [racket-users] DrRacket Coverage

2016-02-14 Thread Gustavo Massaccesi
I guess painting everything black is more confusing, because black is used to mark the uncovered parts. The students will think that everything is wrong. I think that a better possibility is to add a backcolor (and forecolor) to the code covered by the test. I vote for very light green, #C0FFC0,

Re: [racket-users] Re: (eqv? Racket-land Wonderland) -> #t

2016-02-15 Thread Gustavo Massaccesi
On Mon, Feb 15, 2016 at 6:26 AM, Saša Janiška wrote: > "Jos Koot" writes: > > Hello Jos, > >> I am a Racket-using hobbyist. It surprises me that, according to the >> observation, not many hobbyists are using Racket. > > Seeing so much proliferation of JS

Re: [racket-users] Chaperone of immutable hash

2016-02-14 Thread Gustavo Massaccesi
ues key (λ (h key val) val))) >> (λ (h key val) (values key val)) >> (λ (h key) key) >> (λ (h key) key) >> (λ (hash) 'okay) >> (λ (hash key) key)) >> >> >> >> >> On Sat, Feb 13, 2016 at 3:02 PM, Gustavo Massaccesi <gust...@oma.org

Re: [racket-users] macro stepper

2016-02-11 Thread Gustavo Massaccesi
I've seen similar errors many times too (perhaps it's more common in my machine that is slow and has windows ...) Once I tracked it, but I never got enough details to fix it. It was a few months ago, ... Perhaps it was another error, In case this is useful ... IIRC the problem is that two

Re: [racket-users] Re: Problem with # and mutable lists

2016-04-10 Thread Gustavo Massaccesi
The most literal translation is #lang racket (define select-room (lambda (number rooms) (let loop ((l (mcar rooms))) (if (not (null? l)) (if (= (mcar(mcar l)) number) (mcar l)

Re: [racket-users] Compiler question

2016-04-30 Thread Gustavo Massaccesi
> I tend to favor ((if x y z) foo) over (if x (y foo) (z foo)) because it avoids > redundancy and localizes the choice. Apparently, that's a pessimising > choice and I now don't feel like I have much intuition at all about how > things will perform. My recommendation is to write nice code,

[racket-users] Time of hash-ref when the key is (not) found

2016-08-11 Thread Gustavo Massaccesi
I have these strange times in a microbenchmark that compares the time to run hash-ref when the key is in the hash and when it is not there: ;--- #lang racket/base (define hash0 #hash((0 . #t))) (define hash1 #hash((1 . #t))) (for ([rep (in-range 5)]) (display "h0: ") (time (for ([i

Re: [racket-users] Re: Time of hash-ref when the key is (not) found

2016-08-12 Thread Gustavo Massaccesi
t; (hash-ref hash-with-char bignum #f)) >(void)) > > (display "hash code not found: ") > (time >(for ([i (in-range 1000)]) > (hash-ref hash-with-other bignum #f)) >(void)) > ) > > At Fri, 12 Aug 2016 17:27:29 -0300, Gustavo Mas

Re: [racket-users] Re: Time of hash-ref when the key is (not) found

2016-08-12 Thread Gustavo Massaccesi
I think it's something more subtle. With this definitions: (define long-assoc (for/list ([i (in-range 64 (+ 64 1024))]) (cons i #t))) (define hash0 (make-immutable-hash (cons '(0 . #t) long-assoc))) (define hash1 (make-immutable-hash (cons '(1 . #t) long-assoc))) With 5

Re: [racket-users] Racket v6.8

2017-01-25 Thread Gustavo Massaccesi
Is it possible to offer to run the migrate process automatically during the setup? I guess most users (i.e. me) expect and want it. It would be also useful to check that the user had at least installed one package in the previous version. For multiuser installations, perhaps also offer to migrate

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

2017-02-21 Thread Gustavo Massaccesi
I'm not sure if this changed. To get a #t with equal? you can add #:transparent . But be careful because #:transparent is more powerful than what I expected. For example, it makes available the constructor of the struct. #lang racket (define-struct foo (a b)) (make-foo 3 4) ; ==>

Re: [racket-users] Help needed in file processing idioms

2016-08-19 Thread Gustavo Massaccesi
Minor fix: In the first function "read-on-row" you must replace for/first with for/last. Gustavo PS for Pekka: In this case it's better to use for/last and for/or, but in more complicated cases you can try with for/fold. On Fri, Aug 19, 2016 at 10:34 AM, WarGrey Gyoudmon Ju

Re: [racket-users] Do I need a critical section here ... and if so, how to?

2016-09-01 Thread Gustavo Massaccesi
What about box-cas! ? https://docs.racket-lang.org/reference/boxes.html#%28def._%28%28quote._~23~25kernel%29._box-cas%21%29%29 Something like: ;--- #lang racket (define handle-counter (box 1)) (define (new-handle) (define old (unbox handle-counter)) (define new (add1 old)) (unless

Re: [racket-users] Re: lambda and the equivalent define / "defun"

2016-09-04 Thread Gustavo Massaccesi
I hope these examples are enough to help with your problem: ;-- #lang racket (define (negative . s) (map - s)) (negative 1 2 3 -4) ; ==> '(-1 -2 -3 4) (define (multiply-by n . s) (map (lambda (x) (* n x)) s)) (multiply-by 5 1 2 3) ; ==> '(5 10 15) (define (count . s) (length s)) (count 1

Re: [racket-users] Trouble with recursive lambda macros, using Y combinator

2016-09-11 Thread Gustavo Massaccesi
Just a comment about how to compare identifiers. In some cases, using equal? and syntax-e gives the wrong result. It's better to use free-identifier=? . For example, in this program we can use three methods to compare identifiers (there are more!). The program has two macros: clasify-id: shows

Re: [racket-users] Trouble with recursive lambda macros, using Y combinator

2016-09-11 Thread Gustavo Massaccesi
In the first method, the problem is #%app https://docs.racket-lang.org/reference/application.html?q=%23%25app It's hidden by the default configuration of the macro stepper. Try changing the configuration to show it. The problem is that the expansion is: (substitute-term and or (and #t #f)) --->

Re: [racket-users] a litle help

2016-11-16 Thread Gustavo Massaccesi
The program has a few errors. For example, * (define O ( X0 Y0 )) should be something like (define O (make-point X0 Y0)) (define O (point X0 Y0)) (define O (vector X0 Y0)) I'm not sure because the first two don't exist and I guess the last one is not what you want, but you

Re: [racket-users] Creating a list of random things

2016-10-26 Thread Gustavo Massaccesi
An additional example, I hope it's useful. I think it's easy to explain if we replace (random) with a new function (get-counter!) that instead of generating a random number, it provides an increasing sequence. #lang racket (define secret-counter 0) (define (get-counter!)

Re: [racket-users] Re: Operations that create objects

2016-12-16 Thread Gustavo Massaccesi
Two examples: #lang racket (define (create-function-that-show-number n) (display "*") (lambda () (displayln n))) ;Create the function (define f7 (create-function-that-show-number 7)) ;Use it (displayln "Hello") (f7) (displayln "World!") ;--- ;Something more complex

Re: [racket-users] Predictable random...so to say

2016-12-02 Thread Gustavo Massaccesi
I suggest to use the current-pseudo-random-generator, because otherwise the shuffle/seed will change globally the random sequence of all the program. For example: ;--- #lang racket ;; shuffle/seed : list? integer -> list? (define (shuffle/seed lst seed) (random-seed seed) (shuffle lst))

Re: [racket-users] Narrow radix of string->number.

2017-01-04 Thread Gustavo Massaccesi
I'm still worried about bignums. So I borrowed the idea of Mathew of splitting the number in 1/2/3 digits chucks, but I use fixnum chunks. For each fixnum chunk I calculate the string representation as usual, but as most of the calculations involve only fixnum, then It's x4 faster for bignums.

Re: [racket-users] Narrow radix of string->number.

2016-12-29 Thread Gustavo Massaccesi
I'm not too worried about a x4 slowdown in number->string because I don't expect it to be in a tight loop, but it would be nice that it were faster. I made some tests. (You must change the 100 to number-to-convert in your sample program.) I made a new function number->string**, replacing

Re: [racket-users] IO in racket is painful

2017-07-21 Thread Gustavo Massaccesi
IIRC the previous discussion, one way to fix this problem is to make a package that can parse strings easily using a C like format, like the expected in the contests. Something like #lang racket (require compatibility/scanf) (let-values ([(x y) (scanf "%d %d" (read-line))]) (display (+ x y)))

Re: [racket-users] Re: Decision Tree in Racket - Performance

2017-07-27 Thread Gustavo Massaccesi
Functions with optional arguments are slow. They are expanded to a case-lambda and an if. This version with an auxiliary function is faster: #lang racket (define as (build-list 100 (λ (n) (random 100 (define bs (build-list 100 (λ (n) (random 100 (define (f/opt as bs [acc 0])

Re: [racket-users] Re: Decision Tree in Racket - Performance

2017-07-26 Thread Gustavo Massaccesi
I read the solution of Daniel Prager and I have a few minor changes. * First I added a test that repeats `build-tree` 20 times, so the run time is approximately 1-2 seconds. This is not necessary, but times smaller than 1 second are sometimes not reliable. I'm using: ;--- (random-seed 12345)

Re: [racket-users] R7RS implementation's installation

2017-06-27 Thread Gustavo Massaccesi
(Just guessing) Do you have a proxy in the university? Can you install other packages that are not part of the main distribution, for example https://pkgs.racket-lang.org/package/cond-strict ? Gustavo On Thu, Jun 22, 2017 at 6:44 PM, Jean-Michel HUFFLEN wrote: >Dear

Re: [racket-users] Re: Decision Tree in Racket - Performance

2017-07-27 Thread Gustavo Massaccesi
I agree with the in-list explanation, but I want to remark a few details. >> I don't really understand the (in-list ...) thing. This seems to be internal >> magic to me. `in-list` is not a function, it's a macro that looks like a function. `for` is another macro (that doesn't look like a

Re: [racket-users] Re: Decision Tree in Racket - Performance

2017-07-27 Thread Gustavo Massaccesi
I was convinced that case-lambas were much slower. I made some tests, but I replaced first/rest with car/cdr beause it's much faster. Also I repeated the call 1000 times. I got almost 1/2 second of difference. opt cpu time: 12266 real time: 12264 gc time: 0 acc cpu time: 11750 real time: 11745

Re: [racket-users] strange behaviour of procedure partitions

2017-11-12 Thread Gustavo Massaccesi
I can reproduce this error in Welcome to DrRacket, version 6.11 [3m]. Language: racket [custom]; memory limit: 2048 MB. but only if I use this configuration: [X] No debugging or profiling [ ] Populate compiled directories (I didn't try enabling this) [??] Preserve stacktrace (error with or

Re: [racket-users] Re: Confirming when garbage collection runs

2017-12-21 Thread Gustavo Massaccesi
I'm not sure if this is the exact answer to your question, but I hope it helps. This program shows the content of the two vectors, (i.e. ) but when the first vector is freed it displays "goodbye" in the middle of the sequence. So you can see when it was

Re: [racket-users] Does Racket offer anything for implementing a language with its own GC that could manage GPU memory?

2018-02-15 Thread Gustavo Massaccesi
> Also I forgot to note that I also want my language to have indentation > sensitive syntax. Would that be doable in Racket? It's possible (but I never tried it). In the official distribution there are a few languages implemented in Racket that doesn't look like Racket at all. For example

Re: [racket-users] Re: Question about Racket design philosophy: returning (void)

2018-04-12 Thread Gustavo Massaccesi
For debuging I like (define (show x) (display x) x) (define (noshow x) x) For example in (define (average x) (/ (+ (car x) (show (cdr x))) 2)) noshow is useful to turn on/off them fast. But this is different from the convension of << in the streams of C, that return the

Re: [racket-users] Another pkgs badge improvement, re needing documentation

2018-03-26 Thread Gustavo Massaccesi
Just to repeat an idea of the mail of Jay McCarty ... I usualy work with minimal ammount of packages (probably 20, most of them installed because other packages require them).This is a very small instalation that can be recompiled quite fast and use very litle memory. If I add some of the

Re: [racket-users] Racket-on-Chez snapshots

2018-10-01 Thread Gustavo Massaccesi
I think that is is possible to add an unofficial CS target to travis-racket (https://github.com/greghendershott/travis-racket) using something similar to https://github.com/racket/racket/pull/2266 . For now it will be slow because it will have to install a normal Racket, ChezScheme and recompile

Re: [racket-users] hackernews

2018-12-17 Thread Gustavo Massaccesi
I agree that it would be much better to write good blog posts about Racket. They don't need to be fantastic, they don't need to be better than the documentation, they only has to be interesting. I usually prefer post with one or two big relevant graph (or photos when there is hardware involve), I

Re: [racket-users] minor doc change proposal?

2018-11-29 Thread Gustavo Massaccesi
This function is a already defined in a few libraries and it is called `true?` for example in https://docs.racket-lang.org/predicates/index.html?q=true#%28def._%28%28lib._predicates%2Fmain..rkt%29._true~3f%29%29 I think that `not-false?` is easier to understand, but `true?` is more idiomatic.

Re: [racket-users] cons-specific optimizations?

2018-11-28 Thread Gustavo Massaccesi
Some additional comments about this subject. A big difference is that in Chez Scheme the cons are mutable, and that makes it almost impossible to make any optimization with the lists at the Chez Scheme level. With the current Racket implementation there are a few reductions at compile time for

Re: [racket-users] cons-specific optimizations?

2018-11-28 Thread Gustavo Massaccesi
ner code will not be run anyway. I'll try to remember why I made this, and send a PR if necessary. On Wed, Nov 28, 2018 at 6:36 PM Gustavo Massaccesi wrote: > Some additional comments about this subject. > > A big difference is that in Chez Scheme the cons are mutable, and that >

Re: [racket-users] Can someone help me solve a raco mystery?

2019-03-23 Thread Gustavo Massaccesi
> 2) The error seems to happen on computers where I am switching some package > in the dependency graph from a catalog installation to a github repo installation. > I'm not sure if this could contribute to raco deciding that two packages with the > same name are actually different and, for some

Re: [racket-users] The distribution of numbers returned by (random)

2019-04-03 Thread Gustavo Massaccesi
The implementation is tricky, but you can understand the distribution looking at this "alternative" implementation: (define (myrandom) #;(/ (+ (random 4294967087) 1) (+ 4294967087 1)) (* (+ (random 4294967087) 1) 2.328306549295728e-10)) [it may have a tiny rounding difference] Gustavo

Re: [racket-users] How to fix typos in documentation?

2019-03-11 Thread Gustavo Massaccesi
I just want to clarify that if someone finds an error in the docs or a bug, it's perfectly fine to just send a bug report: * Inside Racket: Go to the menu > About > Submit Bug Report ... * In Github: Submit an "Issue" Please include enough information to reproduce the bug. For example for a

Re: [racket-users] Re: nested for loops and suggested alternatives

2019-02-10 Thread Gustavo Massaccesi
To understand the problem, it will be useful to understand the difference between -- (make-vector 5 (make-vector 5)) -- (build-vector 5 (lambda (_) (build-vector 5 (lambda (_) 0 -- (for/vector ([_ 5]) (for/vector ([_ 5]) 0)) Gustavo On Sun, Feb 10, 2019 at 7:24 AM wrote: > Yes, this was

Re: [racket-users] Collections and data structures wishlist?

2019-01-24 Thread Gustavo Massaccesi
I also like the idea of a contract like "tuple/c", perhaps with a more rackety name. Gustavo On Wed, Jan 23, 2019 at 12:02 PM Greg Hendershott wrote: > >> - A separation between using lists as homogeneous collections and using > lists as fixed-size tuples. So there'd be a separate `tuple?`

Re: [racket-users] Re: updated Racket-on-Chez status

2019-02-05 Thread Gustavo Massaccesi
I have been trying a few variations of the code. It would be nice to have a test branch that use only the data in the repository. I used some fake data instead. For the tests, I used the function *get-mean-max-bounds*

Re: [racket-users] Python's append vs Racket's append and helping novices understand the implications

2019-02-04 Thread Gustavo Massaccesi
For some reason, the Racket vs Python performance is a question that arise from time to time in Hacke News (like 2 or 3 times per year). Last time I asked if it was possible to add a direct comparison in The Computer Language Benchmarks Game and the owner/maintainer added that page. The results

Re: [racket-users] Program aborts except when there are no previously compiled .zo files

2019-04-12 Thread Gustavo Massaccesi
It would be good if you can share a link to the code. It is difficult to guess where is the problem is with this information. Is there an online public repository with the code? If not, can you make a minimized version without all the classified/secret parts of the code? With a version of the

Re: [racket-users] From HtDP to Racket

2019-04-26 Thread Gustavo Massaccesi
There is a TOC at the beginning of the post, but I'd add a link to the next post at the end. Something like: "Next article in the series: From HtDP to Racket. Racket (2): only-in, rackunit, test submodules" I'd put one at the very end and other just before the code. Gustavo PS: As other user

Re: [racket-users] Defeating Racket’s separate compilation guarantee

2019-04-24 Thread Gustavo Massaccesi
We can extract an feature request from the end of the post: Make the module that define `set` a cross-phase persistent module, so all the phases can share the `set`s. Gustavo On Sun, Apr 21, 2019 at 7:41 AM Alexis King wrote: > Hello all, > > I just published a blog post on defeating

Re: [racket-users] The case, and a proposal, for elegant syntax in #lang racket2

2019-07-16 Thread Gustavo Massaccesi
I always imagined racket2 as racket with a few minor backward incompatible changes, for example make `length` generic, drop `struct`, remove guarantees about freshness of results. I.E. Most of https://github.com/racket/racket/wiki/Racket2 I also don't like that `syntax-property` is used to get

Re: [racket-users] Re: The case, and a proposal, for elegant syntax in #lang racket2

2019-08-21 Thread Gustavo Massaccesi
The expander in racket adds something equivalent to [else (void)] if there is no else clause. (Try an example with the Macro Stepper.) So an explicit else clause would not change the speed of the programs. In some cases the compiler can prove that the else part is not necessary and drop it,

Re: [racket-users] Re: The case, and a proposal, for elegant syntax in #lang racket2

2019-08-22 Thread Gustavo Massaccesi
[I remember an old discussion about this, but I can't find the message.] For small number of clauses, case is expanded to a bunch of if. When there are more than ¿12? it may be use a hash table or binary search. It has a few tricks:

Re: [racket-users] detecting a recursive call?

2019-08-09 Thread Gustavo Massaccesi
If you don't want to use the package or you want other criteria for stooping, I think the correct way to do this are continuation marks, but an easier but more inefficient way is using a parameter (so it is thread safe). ;- #lang racket (define recursion-level (make-parameter 0)) (define (f

Re: [racket-users] scribble defproc looses parenthesis

2019-09-21 Thread Gustavo Massaccesi
It looks like an error to me. I made a bug report in https://github.com/racket/scribble/issues/211 because it is easy to track the problem there. You can subscribe to the issue to get any update, or I can try to remember to post any (big) update here. Gustavo On Sat, Sep 14, 2019 at 2:05 PM Jos

Re: [racket-users] How do I just run the type checker?

2020-02-26 Thread Gustavo Massaccesi
Another solution: If you are inside DrRacket, you can use the button "Check Syntax". Gustavo On Fri, Feb 21, 2020 at 2:13 PM Marc Kaufmann wrote: > Hi, > > the way I currently check my web server is by simply running `racket > server.rkt` on the command line. However, this also launches the

Re: [racket-users] Strange error in racket 7.5

2020-01-25 Thread Gustavo Massaccesi
It is an internal function of the math package https://github.com/racket/math/blob/cdc64390f1e7b75de9575a91f0ec3a31f7878530/math-lib/math/private/bigfloat/mpfr.rkt#L587that is used to show bigfloats. I can't reproduce the error in Windows, but it doesn't look like an error that is platform

Re: [racket-users] how to adapt BC code for Racket CS?

2020-02-23 Thread Gustavo Massaccesi
Some minor remarks: On Sun, Feb 23, 2020 at 9:58 AM Matthew Flatt wrote: > [Replying to three messages] > > At Sat, 22 Feb 2020 08:05:28 -0800, Matthew Butterick wrote: > > 1) As a package maintainer with zero exposure to Chez Scheme, how do I > start > > to optimize for Racket CS? Are there

[racket-users] Code Jam

2020-03-30 Thread Gustavo Massaccesi
Code Jam is in a few days, but Racket is not available :(. Anyone know how difficult is to add a new language to the list? (Probably for 2021.) Gustavo -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop

Re: [racket-users] Questions about working on DrRacket and gui

2020-05-05 Thread Gustavo Massaccesi
I try to encourage people to participate, but be careful because this task is probably too big for a first contribution. GUI is difficult, DrRacket has a lot of moving parts, and opening DrRacket inside DrRacket is possible but weird. I think the guess of Matthew is correct, it´s a problem with

Re: [racket-users] Questions about working on DrRacket and gui

2020-05-06 Thread Gustavo Massaccesi
f, and I’m enjoying > this very much. > > > > Cheers, > > > > Dex > > > > *From:* Robby Findler > *Sent:* Tuesday, May 5, 2020 6:18 PM > *To:* Gustavo Massaccesi > *Cc:* Dexter Lagan ; Matthew Flatt < > mfl...@cs.utah.edu>; Racket Users >

Re: [racket-users] Possible bug in vector-cas!

2020-05-30 Thread Gustavo Massaccesi
Does your computer have exactly 8 cores (or subcores or whatever is the official name of that hardware feaure)? What happens if you use 7 futures instead of 8? What happens if you use 9 (or 100) futures instead of 8? Gustavo PS: I don't know the low level details of the implementation of the

Re: [racket-users] Re: Racket CS release plan

2020-08-01 Thread Gustavo Massaccesi
The human friendly version of the bytecode is explained in https://docs.racket-lang.org/raco/decompile.html?q=decompile#%28mod-path._compiler%2Fdecompile%29 . The human friendly version looks similar to the expanded version of a program that you get with the Macro Debugger (when the macros are not

Re: [racket-users] invalid memory error from parameter with contracted guard

2021-06-23 Thread Gustavo Massaccesi
The list is fine, but sometimes messages are forgotten because it's difficult to track them. If you have a GitHub account, it's better to post is as an issue in https://github.com/racket/racket Gustavo El mié, 23 de jun. de 2021 a la(s) 23:31, David Storrs ( david.sto...@gmail.com) escribió:

Re: [racket-users] Word Count program/benchmark performance

2021-03-20 Thread Gustavo Massaccesi
With two additional tricks I saved like 100ms. * Saving the output port instead of reading the parameter implicitly each time. * Replacing (write (cdr p)) with (write-fx cdr p)) where (define (write-fx n [o (current-output-port)]) ; TODO: Add negatives :) (if (fx> n 0) (let loop ([n

Re: [racket-users] Incorrect value/typo in write-resource procedure documentation

2021-04-15 Thread Gustavo Massaccesi
It's merged in https://github.com/racket/racket/commit/28a46e36c6f02017d2430b973e0dc8a66b66c94b It's too late for the 8.1 version, but it will be included in the 8.2 version. Gustavo El mié, 14 de abr. de 2021 a la(s) 13:59, Gustavo Massaccesi ( gust...@oma.org.ar) escribió: > Tha

Re: [racket-users] Incorrect value/typo in write-resource procedure documentation

2021-04-14 Thread Gustavo Massaccesi
Thanks for the report. I think the fix is correct, but this is a part of the code I don't use too much. I made a pull request, https://github.com/racket/racket/pull/3785 so someone can confirm it's correct and the message is not lost. If you have an account in Github you can subscribe to this PR