Re: [racket-users] map in typed/racket

2022-06-10 Thread Sorawee Porncharoenwase
You need to assist Typed Racket by using inst. #lang typed/racket ((inst map String (Listof String)) car '(("Eins" "One" "Un") ("Zwei" "Dos" "Two" "Deux") ("Drei" "Tres" "Trois"))) should work fine. By the way, we have practically moved the mailing list to https://racket.discourse.group/. You

Re: [racket-users] Apple Silicon build errors

2022-01-17 Thread Sorawee Porncharoenwase
Matthew's recommended commit and > yours (codesign.rkt imports compiler/private/mach-o). Does that sound > right, to use both patches? I was gonna try to get nixpkgs building 8.3. > > Thanks > > Nate > > > On Jan 17, 2022, at 10:56 AM, Sorawee Porncharoenwase < > sorawee.pw...

Re: [racket-users] Apple Silicon build errors

2022-01-17 Thread Sorawee Porncharoenwase
That particular issue is fixed by https://github.com/racket/racket/commit/3a8a7102abff334ee4e054c3597bebba32bda307, if I remember correctly. On Mon, Jan 17, 2022 at 8:50 AM Nathaniel W Griswold wrote: > Hm, Ok. The cherry-pick of 0a8b68b286 does in fact apply cleanly to the > v8.3 tag. > > I am

Re: [racket-users] Core Team: I need you decide what I should do about the spammer.

2021-12-19 Thread Sorawee Porncharoenwase
FWIW, here're the settings of racket-users from the About tab: Anyone on the web: can see group Group owners and managers: can view members Anyone on the web: can view conversations Group members: can post Invited users: can join group and here're the settings of racket-dev: Anyone on the web:

Re: [racket-users] Let over lambda and location information

2021-11-29 Thread Sorawee Porncharoenwase
If you simply want the source location to be the macro call site, one approach is finding where the source location currently is (in this case, it’s the lambda inside make-keyword-procedure). Then, you simply need to thread syntax/loc through macros to put the source location there. Here’s an

Re: [racket-users] Racket Discourse

2021-11-21 Thread Sorawee Porncharoenwase
t;> because we have semi-reasonable spam filters, but others are putting up >> with what looks like more than 50% spam on this list. That’s just not >> acceptable. >> >> John >> >> >> > On Nov 21, 2021, at 14:14, Sorawee Porncharoenwase < >>

Re: [racket-users] Racket Discourse

2021-11-21 Thread Sorawee Porncharoenwase
I could be in the minority here, but as an early proponent of Discourse to replace the mailing list (even before RacketCon), I feel reluctant to join it after observing it for a while. It has a very high traffic, with almost 100% of the contents being cross-posted everywhere else (and vice versa)

Re: [racket-users] confusion about real vs not real zero

2021-11-19 Thread Sorawee Porncharoenwase
ve > a separate implementation of integers that's not JS numbers (maybe JS > bigints would work). > > Sam > > > > > On Fri, Nov 19, 2021 at 3:08 PM Sorawee Porncharoenwase > > wrote: > > > > > > I had this exact same question when I lo

Re: [racket-users] confusion about real vs not real zero

2021-11-19 Thread Sorawee Porncharoenwase
I had this exact same question when I looked at the RacketScript issue lol. The answer is https://docs.racket-lang.org/reference/numbers.html: a complex number with an exact zero imaginary part is a real number. Since 0.0 is not exact, 0.0i is not a real number. On Fri, Nov 19, 2021 at 11:59

Re: [racket-users] Re: [ANN] fmt: a Racket code formatter

2021-10-19 Thread Sorawee Porncharoenwase
On Tue, Oct 19, 2021 at 7:01 AM Diego Crespo mycontributiontothewo...@gmail.com wrote: If you are curious about what the output looked like before, here is the > pasterack link of some of my code http://pasterack.org/pastes/23639. > Racket

Re: [racket-users] Re: [ANN] fmt: a Racket code formatter

2021-10-18 Thread Sorawee Porncharoenwase
Don't get used to it. It's a bug! Fixed in https://github.com/sorawee/fmt/commit/e056aee1e9a3ea0a72a4c85075426fa76f037852. Thanks for the report! On Mon, Oct 18, 2021 at 6:14 PM Diego Crespo < mycontributiontothewo...@gmail.com> wrote: > This is really cool. Between this, a Racket linter, and

Re: [racket-users] Rationale for package structure

2021-10-09 Thread Sorawee Porncharoenwase
I think it's so that `raco pkg install mypkg-lib` won't install `racket-doc` if you use Minimal Racket? If you don't split `mypkg` to `mypkg-lib` and `mypkg-doc`, but specify `deps` and `build-deps` correctly, `raco pkg install --binary mypkg` won't pull in `racket-doc` either. I don't know when

Re: [racket-users] Having trouble getting documentation to generate

2021-10-08 Thread Sorawee Porncharoenwase
And while we are at the package website issue, can someone please take a look at my PR to fix the blank package bug ( https://github.com/racket/pkg-index/pull/29)? On Fri, Oct 8, 2021 at 11:00 AM Sorawee Porncharoenwase < sorawee.pw...@gmail.com> wrote: > Here’s additional infor

Re: [racket-users] Having trouble getting documentation to generate

2021-10-08 Thread Sorawee Porncharoenwase
Here’s additional information: I uploaded pprint-compact on September 22. https://pkgs.racket-lang.org/ briefly shows the documentation for a few days. But after a package update around September 26, the website no longer lists the documentation. The doc is still actually available at

Re: [racket-users] Restarting loop from exception handler breaks with-handlers, Ctrl+C?

2021-10-07 Thread Sorawee Porncharoenwase
Typo: with-handlers* On Thu, Oct 7, 2021 at 5:52 PM Sorawee Porncharoenwase < sorawee.pw...@gmail.com> wrote: > I think you want with-handler*? According to the docs: > > with-handlers: > > Before any predicate or handler procedure is invoked, the continuation of >

Re: [racket-users] Restarting loop from exception handler breaks with-handlers, Ctrl+C?

2021-10-07 Thread Sorawee Porncharoenwase
I think you want with-handler*? According to the docs: with-handlers: Before any predicate or handler procedure is invoked, the continuation of the entire with-handlers

Re: [racket-users] Looking to trigger the end of a loop by the creation of a file.

2021-10-02 Thread Sorawee Porncharoenwase
What do you mean by "Tried using Racket function: filesystem-change-evt but that did not seem appropriate."? What's inappropriate about it? My first thought is to initialize a variable with `#f`. Spawn a thread before the loop that uses `filesystem-change-evt` so that when the event that you are

[racket-users] [ANN] fmt: a Racket code formatter

2021-09-28 Thread Sorawee Porncharoenwase
Announcing the pre-alpha version of fmt, a Racket code formatter. Code formatter is a tool that reformats your code so that it conforms to a style consistently. - Source: https://github.com/sorawee/fmt/ - Documentation and demo: https://docs.racket-lang.org/fmt/ As a part of this work, I

Re: [racket-users] Having trouble getting documentation to generate

2021-09-28 Thread Sorawee Porncharoenwase
> > When I manually run > > $ cd try-catch/scribblings/ && scribble try-catch.scbl > > I get the try-catch.html file as expected but racket/base functions such > as with-handlers are not properly linked -- i.e. they appear in blue with a > red line under them and are not links. > - As I

Re: [racket-users] What is the correct name for non-list parenthesized forms?

2021-09-24 Thread Sorawee Porncharoenwase
It's usually called "binding pair". See also https://docs.racket-lang.org/syntax/stxparse-intro.html which defines a syntax class describing the said structure. On Fri, Sep 24, 2021 at 10:25 AM David Storrs wrote: > Racket has a number of forms that include what look like lists of lists > but

Re: [racket-users] Is it possible to capture a the value of a variable inside a macro?

2021-09-17 Thread Sorawee Porncharoenwase
> > 2) (card (line . xs)) has only one field, xs. Of course, you could also > define it as a normal field which contains a list, but there's some other > scenarios where I found it more elegant to represent it as a dotted > argument (like representing s-expressions as a struct). > Oh sorry, that

Re: [racket-users] Is it possible to capture a the value of a variable inside a macro?

2021-09-17 Thread Sorawee Porncharoenwase
; (card (hola a #:b b)) > > (card hola (ciao c)) ;;; should expand to (define (ciao a #:b b c) > ...), among other things > > (ciao 1 #:b 2 3) > (ciao 1 #:b 2 3) > > On Thu, 16 Sept 2021 at 22:35, Sorawee Porncharoenwase < > sorawee.pw...@gmail.com> wrote: > >

Re: [racket-users] Is it possible to capture a the value of a variable inside a macro?

2021-09-16 Thread Sorawee Porncharoenwase
In general, it would be helpful to provide an example of the macro use, so that we know what you want to do. If it doesn't work, it would be helpful to provide the buggy program and an error message so that we can help with the issue that you are encountering. >From my guess, you have a variable

Re: [racket-users] New module log-bracketed; should probably be something else

2021-09-02 Thread Sorawee Porncharoenwase
Thoughts: - Perhaps the logger should be optional. The default value would be (current-logger). - The event name (like on-complete) could also be optional. The default would be the source location of the macro invocation site - Instead of “time: ~a”, I think it would be nice to

Re: [racket-users] gen:custom-write macro

2021-09-01 Thread Sorawee Porncharoenwase
There are positions that macros can’t operate. https://lexi-lambda.github.io/blog/2018/10/06/macroexpand-anywhere-with-local-apply-transformer/ explains this issue really well, so I recommend you to read it. There’s also another issue, which is that you want write-proc to be named write-proc, but

Re: [racket-users] Context aware macro

2021-08-30 Thread Sorawee Porncharoenwase
> > But what surprises me the most is that it only works at the top level: > assign.rkt> > assign.rkt> (assign foo 3) > assign.rkt> (assign (bar x) (assign foo 7) (* x foo)) > assign.rkt> (bar 1) > 7 > assign.rkt> global > '#hash((bar . (λ (x) (assign foo 7) (* x foo))) (foo . 3)) > Interesting.

Re: [racket-users] Can raco install old packages with a specific version?

2021-08-18 Thread Sorawee Porncharoenwase
s/could/should/ On Wed, Aug 18, 2021 at 3:07 PM Sorawee Porncharoenwase < sorawee.pw...@gmail.com> wrote: > Oh, and to install from source, go in the project directory, which could > contain the file info.rkt. Run raco pkg install. > > > On Wed, Aug 18, 2021 at 3:05 PM So

Re: [racket-users] Can raco install old packages with a specific version?

2021-08-18 Thread Sorawee Porncharoenwase
Oh, and to install from source, go in the project directory, which could contain the file info.rkt. Run raco pkg install. On Wed, Aug 18, 2021 at 3:05 PM Sorawee Porncharoenwase < sorawee.pw...@gmail.com> wrote: > Hi Kiwan, > > There are many possibilities that you

Re: [racket-users] Can raco install old packages with a specific version?

2021-08-18 Thread Sorawee Porncharoenwase
Hi Kiwan, There are many possibilities that you can do. One is to download the source code of a version that you want from https://github.com/emina/rosette/releases and then install from source. Another is to find a commit that you want from GitHub and use the command line like raco pkg install

Re: [racket-users] Doc pages search engine difficulties

2021-08-17 Thread Sorawee Porncharoenwase
Google for this. I’ll look at the code just > so I understand. > > Dex > > On Aug 17, 2021, at 5:27 PM, Sorawee Porncharoenwase < > sorawee.pw...@gmail.com> wrote: > >  > > FWIW, you can use Google to do that. The search query > > site:docs.racket-lang.org

Re: [racket-users] Doc pages search engine difficulties

2021-08-17 Thread Sorawee Porncharoenwase
FWIW, you can use Google to do that. The search query site:docs.racket-lang.org file browser dialog shows https://docs.racket-lang.org/mrlib/Path_Dialog.html as the first search result. The page also has a link to get-file and put-file. On Tue, Aug 17, 2021 at 7:34 AM Dexter Lagan wrote: >

Re: [racket-users] Find the source location of the syntax error in DrRacket

2021-08-13 Thread Sorawee Porncharoenwase
Isn’t that a matter of putting more syntax/loc? I tried: (-define-syntax let-syntaxes (lambda (stx) (syntax-case stx () [(_ ([(id ...) expr] ...) body1 body ...) (with-syntax ([((tmp ...) ...) (map generate-temporaries (syntax->list (syntax

Re: [racket-users] Rosette variable definitions from an s-expression (I'm new to Rosette)

2021-07-12 Thread Sorawee Porncharoenwase
The recommended way is to write an interpreter to interpret your s-exp. E.g., #lang rosette (define vars (make-hash)) (define (lookup v) (hash-ref! vars v (λ () (define-symbolic* a-var integer?) a-var))) (define (interp e) (match e [(? symbol?

Re: [racket-users] Trying to specify resize-border for instance of dialog

2021-06-25 Thread Sorawee Porncharoenwase
It should be 'resize-border. Notice the single quote character in front of “resize-border”. FWIW, if you want to ask multiple short questions, you could also use the Racket Slack channel. The sign up link: https://racket-slack.herokuapp.com/ The channel: https://racket.slack.com/ On Fri, Jun

Re: [racket-users] Using get-file in racket/gui ...

2021-06-10 Thread Sorawee Porncharoenwase
The Racket Reference has a section on the notation used in documentations: https://docs.racket-lang.org/reference/notation.html But yes, what you said is correct: you are forced to specify every prior optional positional argument. This is why I think optional positional arguments are bad in

Re: [racket-users] Computed properties for a struct?

2021-06-04 Thread Sorawee Porncharoenwase
I think you can create a custom accessor, and use macros to avoid the Royal Pain. One question is, is the derived field expensive to compute? If not, your custom accessor can just compute the output every time it’s called. But if it’s expensive, you can use memoization. Both approaches have the

Re: [racket-users] defmodule question

2021-04-25 Thread Sorawee Porncharoenwase
It looks like you are implying that @(defmodule circuit-simulation/circuits #:packages ()) doesn’t work locally on your computer, but it should (provided that you raco pkg install it properly). On Sun, Apr 25, 2021 at 9:05 PM Jacob Jozef wrote: > Hi > > > > I have a #lang scribble/manual module

Re: [racket-users] New package announce: value-evt

2021-04-01 Thread Sorawee Porncharoenwase
Oops, accidentally submitted the email before finishing writing. Have you tried `raco docs value-evt`? On Fri, Apr 2, 2021 at 12:10 AM Sorawee Porncharoenwase < sorawee.pw...@gmail.com> wrote: > `raco setup` does render the doc on my computer. I install Racket via git, > so for

Re: [racket-users] New package announce: value-evt

2021-04-01 Thread Sorawee Porncharoenwase
`raco setup` does render the doc on my computer. I install Racket via git, so for me, the doc is located at `/path/to/racket/racket/doc/value-evt/index.html`. Yours might be in a different location. So I think you just need to wait for the package server to build your documentation. On Thu, Apr

Re: [racket-users] Why are there seemingly unnecessary if expressions shown by the Macro stepper?

2021-03-21 Thread Sorawee Porncharoenwase
That’s not the job of the macro expander. And the Racket optimizer does reduce (if '#t (#%app not '#f) '#f) — in fact to #t. If you use Racket CS, try running: PLT_LINKLET_SHOW_CP0=1 racket file.rkt where file.rkt is #lang racket (displayln (if #t (not #f) #f)) Here’s the optimized program:

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

2021-03-18 Thread Sorawee Porncharoenwase
string-split always uses regex. I wonder if a fast path when the splitter is a regular string will be worth it. On Fri, Mar 19, 2021 at 4:19 AM Pawel Mosakowski wrote: > Hi Bogdan, > > This is a brilliant solution and also completely over my head. It finishes > in ~3.75s on my PC and is faster

Re: [racket-users] Unusual check-expect results for images in Racket 8.0: getting #

2021-03-14 Thread Sorawee Porncharoenwase
Yes, this was reported at https://github.com/racket/htdp/issues/135. It's now fixed. You can either download a snapshot version ( http://snapshot.racket-lang.org/) or downgrade to 7.9 to make it work properly meanwhile. On Mon, Mar 15, 2021 at 8:43 AM Peijing Teh wrote: > Hi, > > I am working

Re: [racket-users] fluent: unix style pipes and lambda shorthand to make your code more readable

2021-03-12 Thread Sorawee Porncharoenwase
> > There is probably a solution to this problem. I'm just not seeing it yet. > Yeah, syntax parameters are not really relevant here. A way to make rename-in work is to define-syntax the “token” to a dummy syntax transformer, and change your macro to recognize the token using ~literal. Here’s an

Re: [racket-users] Is something wrong with the documentation site?

2021-03-08 Thread Sorawee Porncharoenwase
See also the discussion at https://github.com/mbutterick/pollen-users/issues/92 On Tue, Mar 9, 2021 at 2:31 AM Sage Gerard wrote: > There's an issue where if a package build fails, the pretty links to the > docs do not resolve. > > For future reference, you can get around this by going to the

Re: [racket-users] Possible bug when reading/writing large inexact numbers

2021-03-07 Thread Sorawee Porncharoenwase
This is already fixed. Racket 8.0 doesn't have this issue. On Mon, Mar 8, 2021 at 8:31 AM Greg Rosenblatt wrote: > Large inexact numbers may change values after a second round trip between > read and write. I was expecting to reach a fixed point after the first > round trip. Is this a bug? >

Re: [racket-users] Racket slower than Chez Scheme on interpreter benchmark, potential low hanging fruit?

2021-03-07 Thread Sorawee Porncharoenwase
With the recent improvements by Phil, the rank of the syntax object variant moves up from 26th to the second (what?!?), losing only to c++ / g++. Moreover, it's significantly faster than the third place. On Fri, Mar 5, 2021 at 3:29 AM philngu...@gmail.com < philnguyen0...@gmail.com> wrote: > Oh

Re: [racket-users] Re: When are rackunit tests delayed? (different between 7.8 and 8)

2021-03-06 Thread Sorawee Porncharoenwase
This is a regression caused by me ( https://github.com/racket/rackunit/commit/d7665ddc17405b25c7365eda5c560b671340853d). I will try to find a way to fix. On Thu, Feb 25, 2021 at 3:30 PM jackh...@gmail.com wrote: > The test-suite semantics in rackunit are complex, under-specified, and > quite

Re: [racket-users] can't create a new package on pkgd.racket-lang.org

2021-02-19 Thread Sorawee Porncharoenwase
For the raco pkg install error, it looks like your branch is named main, so you need to run raco pkg install git:// github.com/rogerkeays/racket-dollar#main Ideally, raco pkg install git://github.com/rogerkeays/racket-dollar should also work, but currently it doesn’t

Re: [racket-users] put-image

2021-02-06 Thread Sorawee Porncharoenwase
As explained in documentation of WeScheme , put-image is only available in WeScheme. Racket and its libraries don’t have this function. It’s easy to implement it yourself, however, by using

Re: [racket-users] Using GraphViz inside of Scribble?

2021-01-27 Thread Sorawee Porncharoenwase
Here’s how to add graphviz to Pollen . The same technique can be used for Scribble, but you would want to use image as the tag

Re: [racket-users] Unsafe structs

2021-01-19 Thread Sorawee Porncharoenwase
However, ‘struct-field-info-list’ returns only fields defined by the actual type and does not include fields that were inherited. What I don’t see is any simple way to get at the struct’s inheritance hierarchy —- it seems that you have to iterate ‘struct-type-info’ to enumerate the supertypes.

Re: [racket-users] Typed Racket: Subtype of a struct typed where one field has a fixed value

2021-01-16 Thread Sorawee Porncharoenwase
According to https://docs.racket-lang.org/ts-reference/type-ref.html, `Zero` exists. On Sat, Jan 16, 2021 at 8:14 AM je...@lisp.sh wrote: > Working in Typed Racket, consider a struct like this: > > (struct point > ([x : Real] >[y : Real])) > > Is there a way to express the type of those

[racket-users] History changes

2021-01-10 Thread Sorawee Porncharoenwase
Hi Racketeers, Laurent Orseau asked if it’s possible for the release announcement to include @history changes (compared to the previous release), because some small but useful changes might go unnoticed otherwise. I think this is a great idea, so I tried to implement the feature. The result for

Re: [racket-users] compose in Typed Racket

2020-12-16 Thread Sorawee Porncharoenwase
syntax-parse can already perform pattern matching. No need to use match (define-syntax (multi-compose stx) (syntax-parse stx [(_ f:expr g:expr) #'(compose f g)] [(_ f:expr funcs:expr ...) #'(compose f (multi-compose funcs ...))])) On Wed, Dec 16, 2020 at 1:37 PM

Re: [racket-users] (current-memory-use cust) gives "wrong number of arguments" in typed racket

2020-12-13 Thread Sorawee Porncharoenwase
Fixed by https://github.com/racket/typed-racket/pull/1009. On Sat, Dec 12, 2020 at 7:09 PM James Cook wrote: > I'm new to racket, and I'm not sure if this is a bug or oversight or I'm > just missing something. > > In typed racket, when I try to pass a custodian as an argument to the >

Re: [racket-users] Racket GUI editor: how read and process keyboard input

2020-12-06 Thread Sorawee Porncharoenwase
IIRC, capslock can’t be handled by applications. When people customize capslock to do something else, what they actually do is to ask their OS to redirect the capslock keypress to other keys (say, F2), and then intercept these other keys instead. To catch keypresses like F2, create your own class

Re: [racket-users] Towards an Incremental Racket Parser for better IDE experience?

2020-12-02 Thread Sorawee Porncharoenwase
IIUC, many tools (Racket Mode , drcomplete ) do exactly what Robby said: cache the most recent successfully expanded code. On Wed, Dec 2, 2020 at 7:08 AM Robby Findler wrote: > I'm not sure this approach is going to work for

Re: [racket-users] Rosette: can it help me

2020-11-26 Thread Sorawee Porncharoenwase
You are doing a recursion on a symbolic value, which is a common pitfall in Rosette. See slide 81 and subsequent slides for more details. Slide 87 shows a solution to this problem. On Thu, Nov 26, 2020 at 1:12 PM Bertrand

Re: [racket-users] Passing keywords from a list

2020-11-26 Thread Sorawee Porncharoenwase
If you are OK with preprocessing the argument list into a dictionary, then you can use keyword-apply/dict . For example: #lang racket (require racket/dict)

Re: [racket-users] Macros expanding to require forms

2020-11-12 Thread Sorawee Porncharoenwase
See https://docs.racket-lang.org/reference/stxtrans.html#%28def._%28%28quote._~23~25kernel%29._syntax-local-introduce%29%29 for an example program that requires a library via a macro. On Thu, Nov 12, 2020 at 3:09 AM Veit Heller wrote: > > Hello, > > I’m suspecting I’m getting a little turned

Re: [racket-users] cross-module `error` changed?

2020-11-06 Thread Sorawee Porncharoenwase
This is the same problem as https://github.com/racket/racket/issues/3355. It's already been fixed in Racket 7.9. On Fri, Nov 6, 2020 at 5:30 AM Shriram Krishnamurthi wrote: > Has something changed in how `error` works across modules? This code that > I used last year without trouble seems to

Re: [racket-users] bf program benchmark

2020-11-04 Thread Sorawee Porncharoenwase
You might want to take a look at Danny’s original bf article , which includes optimizations. By the end of the article, he reduces the running time of one benchmark program from “thirty-seven seconds to just over one”. On Wed, Nov 4, 2020 at 1:40 AM

Re: [racket-users] Should I enter racket questions here: https://groups.google.com/g/racket-users

2020-11-01 Thread Sorawee Porncharoenwase
You can certainly ask questions here, but please keep in mind that it is also a mailing list. If you have many related questions, it would be nice to create only one thread to ask all related questions, to avoid spamming emails to the mailing list recipients. Another place to ask questions is

Re: [racket-users] [racket users] Pollen tag question

2020-10-29 Thread Sorawee Porncharoenwase
Whoops. I meant: #lang pollen ◊(define (vb . s) s) ◊vb{ A B C D} and the output is: '(" A B" "\n" " " "C D") On Thu, Oct 29, 2020 at 9:19 PM Sorawee Porncharoenwase < sorawee.pw...@gmail.com> wr

Re: [racket-users] [racket users] Pollen tag question

2020-10-29 Thread Sorawee Porncharoenwase
I think the issue is with vb. How does it work? If you try #lang pollen @(define (vb . s) s) ◊vb{ A B C D} you will find that it outputs: '(vb " A B" "\n" " " "C D") The third element is the space before “C”. It's not

Re: [racket-users] Why ~a, ~s, and ~v?

2020-10-26 Thread Sorawee Porncharoenwase
I had this question too. It looks like they are inherited from Scheme. ~a = any ~s = s-expression See http://wiki.call-cc.org/eggref/5/format#documentation. There's no ~v. IIUC, there's no `print` in Scheme. On Mon, Oct 26, 2020 at 5:50 PM primer wrote: > > I'm reading the documentation

Re: [racket-users] [scribble] Are nested lists possible?

2020-10-13 Thread Sorawee Porncharoenwase
apparently it doesn’t like having an itemlist inside of a {} block at all I’m not sure if I totally understand it, but this doesn’t appear to be true. The below doc renders correctly as I expect. #lang scribble/manual @itemlist[ @item{foo @itemlist[ @item{bar}

Re: [racket-users] Clearer code in DrRacket?

2020-10-10 Thread Sorawee Porncharoenwase
> > Looks interesting. Do you know any package of this type for DrRacket (or > another program) that works semantically while you program? (not just as a > checking tool like View Syntax) > I think it would be difficult. Racket has macros, and it allows shadowing on anything. The attached image

Re: [racket-users] [racket users] scribble using @ as text?

2020-09-24 Thread Sorawee Porncharoenwase
I think you meant `@"@"`? `@["@"]` is an application. On Thu, Sep 24, 2020 at 2:31 PM Jay McCarthy wrote: > @["@"] > > -- > Jay McCarthy > Associate Professor @ CS @ UMass Lowell > http://jeapostrophe.github.io > Vincit qui se vincit. > > > On Thu, Sep 24, 2020 at 5:26 PM Kevin Forchione

Re: [racket-users] [racket users] scribble using @ as text?

2020-09-24 Thread Sorawee Porncharoenwase
See https://docs.racket-lang.org/scribble/reader.html#%28part._.The_.Scribble_.Syntax_at_a_.Glance%29 On Thu, Sep 24, 2020 at 2:26 PM Kevin Forchione wrote: > Hi guys, > I’ve been racking my brains and going through scribble manuals trying to > figure out how to do something as simple as

Re: [racket-users] Why are these @defthing blocks typeset incorrectly?

2020-09-23 Thread Sorawee Porncharoenwase
Caution: I haven’t tried your code yet. I think Scribble uses source location equipped with syntax objects to figure out spacing. Since you generate stuff on the fly, there’s no source location, so the rendered text is screwed up. An idea I have (which might not work) is to use write /

Re: [racket-users] package manager woes on Windows 10?

2020-09-14 Thread Sorawee Porncharoenwase
uld probably add a 'single-no-return style and then grep > the codebase for places that use 'single and change them (as appropriate). > > Robby > > > On Sun, Sep 13, 2020 at 3:15 PM Sorawee Porncharoenwase < > sorawee.pw...@gmail.com> wrote: > >> I meant, wouldn’t

Re: [racket-users] package manager woes on Windows 10?

2020-09-13 Thread Sorawee Porncharoenwase
I meant, wouldn’t it be better to fix text-field% itself, instead of only some instances of it? Sorry if that was confusing. On Sun, Sep 13, 2020 at 1:12 PM Sorawee Porncharoenwase < sorawee.pw...@gmail.com> wrote: > Should the fix apply to all 'single styled text-field% > <http

Re: [racket-users] package manager woes on Windows 10?

2020-09-13 Thread Sorawee Porncharoenwase
Should the fix apply to all 'single styled text-field% too? On Sun, Sep 13, 2020 at 7:50 AM Robby Findler wrote: > Yea, I agree. I'd made that change locally but hadn't pushed because I > couldn't make the bad behavior happen reliably. Perhaps

Re: [racket-users] -i as an identifier

2020-09-10 Thread Sorawee Porncharoenwase
I think you read the doc correctly, but there are programs that use +i and -i, so it's unclear if fixing the reader is desirable. Perhaps the documentation should be adjusted instead. Here’s an example of how people use +i and -i:

Re: [racket-users] Making expanded bindings visible in top-level

2020-09-06 Thread Sorawee Porncharoenwase
I think it’s only enough to fabricate the #%info-* identifiers. For example, in the file you linked above, you can add: [#%info-domain (datum->syntax stx '#%info-domain)] to with-syntax, and provided that you provide #%top-interaction, you should be able to use #%info-domain in the REPL. On

Re: [racket-users] Re: provide-if-not-defined

2020-09-03 Thread Sorawee Porncharoenwase
I want to propose another interface: (my-provide #:default + - * #:override [my-+ +]) which expands to: (provide - *) (provide (rename-out [my-+ +])) and checks that + must be in the #:default section (because we are overriding it, it’d better already exist). More generally:

Re: [racket-users] provide-if-not-defined

2020-09-02 Thread Sorawee Porncharoenwase
IIUC, that’s not what Shriram wants. He wants a kind of interface / contract for a module (that it must export certain identifiers). The solution that you posted makes the module satisfy the interface by construction, but it creates another problem which is that he might accidentally export a

Re: [racket-users] Is this running in DrRacket or as a script?

2020-09-02 Thread Sorawee Porncharoenwase
Using Laurent’s suggestion, you can also create a global variable / parameter that will be set by the drracket submodule. That way, you can create running-in-drracket? and use it inside functions. On Wed, Sep 2, 2020 at 12:54 AM Laurent wrote: > You can use a `drracket` submodule: > > (module+

Re: [racket-users] printing errors

2020-08-29 Thread Sorawee Porncharoenwase
Alternatively, I think you can simply supply a non-exception value to the handler. This will suppress the red cross icon too, though. (define (print-exn exn) ((error-display-handler) (if (exn? exn) (exn-message exn) (format "~a" exn)) #f)) On Sat, Aug 29, 2020 at 8:17 AM

Re: [racket-users] graphical debugging

2020-08-29 Thread Sorawee Porncharoenwase
I meant the REPL in DrRacket (interaction window). On Sat, Aug 29, 2020 at 5:21 AM Catonano wrote: > Il giorno sab 29 ago 2020 alle ore 12:11 Sorawee Porncharoenwase < > sorawee.pw...@gmail.com> ha scritto: > >> It (kinda) works for me. You should make sure that

Re: [racket-users] graphical debugging

2020-08-29 Thread Sorawee Porncharoenwase
It (kinda) works for me. You should make sure that debugging is enabled in the language setting (it should display something like “Language: racket, with debugging [custom]” in the REPL). Then, click “Debug” and then click “Step” for a couple of times (seven to be precise). The little green

Re: [racket-users] printing errors

2020-08-27 Thread Sorawee Porncharoenwase
For stacktrace, use error-print-context-length to suppress it: (define (print-exn exn) (parameterize ([error-print-context-length 0]) ((error-display-handler) (if (exn? exn) (exn-message exn) (format "~a" exn)) exn))) I don’t see any extra newline though. On

[racket-users] Re: [racket-dev] Does the Guide need to mention syntax parse & does the Style guide need to provide guidance?

2020-08-23 Thread Sorawee Porncharoenwase
The guide seems to be for the Racket code base (https://github.com/racket) rather than general Racket code, so I don't think it should say "prefer syntax-parse over syntax-case". I do think there should be a style guide for general Racket code (which could very well be based on the style guide

Re: [racket-users] Deserializing snips from untrusted input

2020-08-20 Thread Sorawee Porncharoenwase
I don't know much about this specific case, but see Robby's comment about how "DrRacket can run user (untrusted) code in certain situations" at https://github.com/racket/gui/issues/157. A concrete problem I found is that you can have a snip running `struct->vector` and it will successfully extract

Re: [racket-users] Re: Application Templates!

2020-08-20 Thread Sorawee Porncharoenwase
Is this intended to be something like https://docs.racket-lang.org/scaffold/ ? On Thu, Aug 20, 2020 at 10:12 AM Stephen De Gabrielle < spdegabrie...@gmail.com> wrote: > Alex is right, most developers don't need this. > > The point of templates is

Re: [racket-users] Re: Strange performance behavior

2020-08-07 Thread Sorawee Porncharoenwase
I even saw people doing `collect-garbage` three times, just to be safe I guess. And yet theoretically it's not guaranteed that things will be claimed back properly. Honestly, there should be a function that does this `collect-garbage` until fixpoint or something, so that we don't need to perform

Re: [racket-users] Racket v7.8

2020-08-04 Thread Sorawee Porncharoenwase
uted to this release: > > > > > > Alex Harsányi, Alex Knauth, Alexander Shopov, Alexis King, Andrew > Kent, > > > Andrew Mauer-Oats, Atharva Raykar, Ben Greenman, Benjamin Yeung, Bert > De > > > Ketelaere, Bogdan Popa, David Christiansen, David Florn

Re: [racket-users] pictures in code?

2020-08-02 Thread Sorawee Porncharoenwase
For DrRacket, it's possible via "Insert > Insert Image". It's been used in HtDP. See https://htdp.org/2020-8-1/Book/part_prologue.html On Sun, Aug 2, 2020 at 7:07 PM Hendrik Boom wrote: > Is there any way to include pictures in Racket code? > Perhaps as constants or as prts of identifiers? >

[racket-users] Re: with-continuation-marks in errortrace

2020-07-26 Thread Sorawee Porncharoenwase
(By "integrating" with the new strategy, I meant having two keys: one for the new strategy and one for the old strategy. I can see that the first entry of the old strategy is useful, and it's missing in the new strategy). On Sun, Jul 26, 2020 at 8:21 PM Sorawee Porncharoenwase &l

[racket-users] with-continuation-marks in errortrace

2020-07-26 Thread Sorawee Porncharoenwase
Hi everyone, I have a question about the implementation of errortrace. Consider the classic factorial program, except that the base case is buggy: (define (fact m) (let loop ([n m]) (cond [(zero? n) (/ 1 0)] [else (* (loop (sub1 n)) n)]))) (fact 5) Running this program with

Re: [racket-users] catalog not working?

2020-07-23 Thread Sorawee Porncharoenwase
Though, considering that there are so many people who are misled that the catalog is down (my past self included), it might be better if that page displays some useful information rather than a 404. On Thu, Jul 23, 2020 at 8:12 PM Sorawee Porncharoenwase < sorawee.pw...@gmail.com>

Re: [racket-users] catalog not working?

2020-07-23 Thread Sorawee Porncharoenwase
The catalog is functional. That path is simply not served. See also: From: Matthew Flatt Date: Thu, Feb 27, 2020 at 3:00 PM Subject: Re: [racket-users] download catalog down? To: Tom Gillespie Cc: Racket Users That path isn't served, but something like

Re: [racket-users] Multiple stage compilation in a tower of languages

2020-07-23 Thread Sorawee Porncharoenwase
local-expand supports the stop-list argument, so I think you can put all core forms there. #lang racket (require syntax/parse/define) (define-syntax (A-core stx) (syntax-parse stx #:literals (b-core) [(A-core (b-core x)) #'(printf "A-core got value ~a.~n" x)])) (define-syntax (b-core

Re: [racket-users] combining require, build-path, and namespaces

2020-07-21 Thread Sorawee Porncharoenwase
This is weird. I usually parameterize current-namespace when using namespace-* functions, and in this particular case it works fine. On Tue, Jul 21, 2020 at 11:05 AM Shriram Krishnamurthi wrote: > Thank you! Would you know why I might get this error: > > ; require: unknown module > > ; module

Re: [racket-users] reading s-expressions from a file

2020-07-17 Thread Sorawee Porncharoenwase
(with-input-from-file "abc" (thunk (sequence->list (in-port Note that you need to “read” in the dynamic extent of with-input-from-file. Outside it, the port is closed. On Fri, Jul 17, 2020 at 5:19 PM Hendrik Boom wrote: > Yes, I know the functino for reading s-expressions seems to be

Re: [racket-users] Are Regular Expression classes Unicode aware?

2020-07-09 Thread Sorawee Porncharoenwase
? But yes, the problem is definitely due to readline. Sam suggested me to try racket -q which suppresses readline, and the result is that there’s no issue. On Thu, Jul 9, 2020 at 11:43 AM Philip McGrath wrote: > On Thu, Jul 9, 2020 at 10:32 AM Sorawee Porncharoenwase < > sorawee.pw...@

Re: [racket-users] Are Regular Expression classes Unicode aware?

2020-07-09 Thread Sorawee Porncharoenwase
Racket REPL doesn’t handle unicode well. If you try (regexp-match? #px"^[a-zA-Z]+$" "héllo") in DrRacket, or write it as a program in a file and run it, you will find that it does evaluate to #f. On Thu, Jul 9, 2020 at 7:19 AM Peter W A Wood wrote: > I was experimenting with regular expressions

Re: [racket-users] Is there a way to open (and just view) a Racket file (e. g. .rkt or .scrbl extensions) from Google Drive?

2020-07-07 Thread Sorawee Porncharoenwase
A quick Google returns this site: https://superuser.com/questions/659666/how-do-i-get-google-drive-to-open-text-files-with-arbitrary-extensions-as-text-f So it looks like there's no way if you are not willing to rename files or use a third-party text editor in Google Drive. On Tue, Jul 7, 2020

Re: [racket-users] Wrong result from a define-syntax with pattern maching on a hash table

2020-07-06 Thread Sorawee Porncharoenwase
#lang scribble/manual @(require (only-in racket ~a)) @(define persons (list (hash 'name 'name1 'e-mail 'email1 'nickname 'nickname1) (hash 'name 'name2

  1   2   >