Re: [racket-users] Can raco distribute produce a single executable?

2017-02-20 Thread Shu-Hung You
https://docs.racket-lang.org/raco/exe.html Is raco exe in this page what you want? Just type > raco exe q.rkt And this command will produce a single executable. Now we can now run > ./q q: expects 1 on the command line, given 0 arguments Best, Shu-Hung On Mon, Feb 20, 2017 at 1:12 PM, lu

Re: [racket-users] Can raco distribute produce a single executable?

2017-02-20 Thread Shu-Hung You
Sorry, I saw that you're already using raco exe and raco distribute. So is the problem related to some DLL issue on Windows? Best, Shu-Hung On Mon, Feb 20, 2017 at 1:19 PM, Shu-Hung You <shu-hung@eecs.northwestern.edu> wrote: > https://docs.racket-lang.org/raco/exe.html >

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

2017-02-17 Thread Shu-Hung You
This works completely fine on a fresh racket REPL: > (exn:fail:bmtc:unknown-user "message" (current-continuation-marks) "bob") (exn:fail:bmtc:unknown-user "message" # "bob") I guess there might be some inconsistency in REPL states. Starting a fresh racket should work, or maybe use (enter!

Re: [racket-users] How to 'apply' a function with optional parameters?

2016-10-29 Thread Shu-Hung You
Hi Meino, Could you give an example of lst or line? Unlike string-append, most of the time string-join doesn't really require an 'apply'. As we can see: > (string-append "a" "b" "c") "abc" > (string-join '("a" "b" "c") ":") "a:b:c" While string-append takes all its arguments and concatenates

Re: [racket-users] Where is "PLT Games.exe" source code?

2016-11-23 Thread Shu-Hung You
Hi Ken, do you mean this? https://github.com/racket/games --Shu-Hung On Wed, Nov 23, 2016 at 2:02 PM, Ken Biondi wrote: > Where is the source code for "PLT Games.exe"? I unsuccessfully searched > github for it. > > -- > You received this message because you are subscribed

[racket-users] Re: Compare parts of string or compare with wildcard.

2016-10-28 Thread Shu-Hung You
Hi Ken, string-prefix? does exactly what you want. > (define a "this") (define b "that") (define c "thisandthat") > (string-prefix? c a) #t > (string-prefix? c b) #f https://docs.racket-lang.org/reference/strings.html#%28def._%28%28lib._racket%2Fstring..rkt%29._string-prefix~3f%29%29 Best,

[racket-users]

2016-12-19 Thread Shu-Hung You
imp-prop:a "a value")) (define unimpersonated (impersonate-procedure impersonated #f)) (unimpersonated 10) ;=> 19 (impersonator? unimpersonated) ;=> #t (imp-prop:a? unimpersonated) ;=> #t (imp-prop:a-get unimpersonated) ;=> "a value" Best, Shu-Hung --

Re: [racket-users] Correctly executing a source file from embedded Racket

2017-07-25 Thread Shu-Hung You
Hi Thomas, I think the program is more of Racket programming setup rather than embedding Racket. When start a Racket program on our own, we have to setup the environment correctly. Here is my test program that can load an external program and the accompanying commands (also attached at the end).

Re: [racket-users] Correctly executing a source file from embedded Racket

2017-07-26 Thread Shu-Hung You
Hi Thomas, I tried following Matthew's suggestions to attach my-lang and use dynamic-require. Turns out that works pretty well! And then there's even no need to setup collection path since everything loads from compiled byte-code. https://gist.github.com/shhyou/aa2adaf7e1b7d548783cee352c3230a9

Re: [racket-users] Re: Racket from Homebrew has trouble when upgrading

2017-08-07 Thread Shu-Hung You
>From this thread, it seems that the original formula it not actively maintained. But the thread also mentions `cask`, probably worth a try. https://groups.google.com/forum/#!msg/racket-dev/Zyl9m8UWvp0/GVDcHVkWAwAJ Best, Shu-Hung On Mon, Aug 7, 2017 at 6:23 PM, wrote:

Re: [racket-users] Re: Readers and Namespaces

2017-08-18 Thread Shu-Hung You
If you are implementing a new language, this can be done by delegating the "=-to-let" work to the macro-expander and let the reader simply parenthesizing the input into s-expression form. In this approach, we don't need to worry about being hygienic in the reader since the actual work is done by

Re: [racket-users] ~literal vs ~datum

2017-09-11 Thread Shu-Hung You
I think the case here is a little subtle. The syntax object #'(define x y) has actually gone through expansion, but Racket's new expansion model will prune this syntax object's local scopes [1]. One could use #:local [2] in this case to see the difference: > (syntax-parse (let ([define

Re: [racket-users] How to load net/jwt

2017-09-10 Thread Shu-Hung You
This command should install the net-jwt library for you: raco pkg install net-jwt --Shu-Hung On Mon, Sep 11, 2017 at 9:15 AM, Chongkai Zhu wrote: > Hi all, > > https://docs.racket-lang.org/jwt/index.html > > It seems I just need to (require net/jwt) in racket 6.10 and

Re: [racket-users] Confusing typed/racket error message

2017-10-03 Thread Shu-Hung You
Hi Taahir, The keyword is #:replacement? instead of #:replacement (note the question mark). I don't know enough Typed Racket to understand that error message tho, sorry. Cheers, Shu-Hung On Tue, Oct 3, 2017 at 1:40 AM, Taahir Ahmed wrote: > Hi, > > I have been

Re: [racket-users] Suppress print lines from required modules

2017-08-27 Thread Shu-Hung You
Parameterizing current-output-port to (open-output-string) redirects the output to a string. Something along the line of (open-output-file "/dev/null") sounds a bit better but I'm not sure how to create a discard-everything output port. (define ns (make-base-namespace)) (parameterize

Re: [racket-users] structs vs classes

2017-12-07 Thread Shu-Hung You
I'm not sure whether the following is a good idea, but it more or less works. The impersonate-struct function allows one to redirect the some or all of accessor and mutator functions on *individual struct instances*. If the actual constructor is hidden from the user and only a ``smart''

Re: [racket-users] DrR compilation progress bar

2017-10-28 Thread Shu-Hung You
I think printing which file is currently being loaded can also help, like the logs given by enter! #:verbose. These logs can also be printed to the interaction window and be erased after the loading process is finished. This can let the user know that something is actually running. --Shu-Hung On

Re: [racket-users] namespace-variable-value thinks functions are bound to syntax

2017-10-30 Thread Shu-Hung You
Yes, because keyword functions expand to macro definitions that try to optimize keyword applications. namespace-require and namespace-variable-value are relatively low-level operations on modules and namespaces. Using dynamic-require could be a bit easier: #lang racket (module p racket

Re: [racket-users] Arity-error for Handin Checker

2018-05-12 Thread Shu-Hung You
Hi James, If you use (check-deadline) in the checker, the config file needs to contain the deadline of the assignment. If the deadline configuration is not found, this error would show up. For example, in you have this config, ((active-dirs ("directoryA")) (inactive-dirs ...) (deadline (

Re: [racket-users] Problems with dynamic loading and `raco exe` executables

2018-05-07 Thread Shu-Hung You
#lang racket/load and (load PATH) are less idiomatic and more low-level in Racket. I don't know how did racket/load and load interact with ``raco exe'' but here's another way to make it work. Everything is placed inside modules. $ racket test.rkt ... ok ... $ raco exe ++lib

Re: [racket-users] Any place to get keywords and constants of Racket?

2018-05-05 Thread Shu-Hung You
Here's a list of *some* keywords and regular expressions used by DrRacket, from line 387 to line 477: https://github.com/racket/gui/blob/master/gui-lib/framework/private/main.rkt#L387 On Sat, May 5, 2018 at 9:44 AM, piv det wrote: > I want to write a Racket mode for ace, > >

Re: [racket-users] DrRacket prefs?

2018-05-24 Thread Shu-Hung You
Hi Stephen, Running (find-system-path 'pref-file) in the REPL shows the path to the preference file. Inside the file there's one line like: (plt:framework-pref:framework:display-line-numbers #t) I don't know if directly copying the pref file to another computer would work but perhaps worth a

Re: [racket-users] char-utf-8-length signature is surprising

2018-05-03 Thread Shu-Hung You
Looks like the implementation of char-utf-8-length returns values fitting the "FSS-UTF (1992) / UTF-8 (1993)" table in https://en.wikipedia.org/wiki/UTF-8#History. Not sure what's the standard UTF-8 encoding.. /* racket/src/char.c */ static Scheme_Object *char_utf8_length (int argc, Scheme_Object

[racket-users] Redex trace/ps doesn't produce edges

2018-04-28 Thread Shu-Hung You
Hello everyone, I try to save the traces generated by Redex to an image. However, the arrows between the expressions don't show up in the result. I tried some combinations of #:x-spacing, #:edge-labels? and #:layout to let the arrows showed up in trace, but the edges remain hidden when I ran

Re: [racket-users] A very simple #lang

2018-01-25 Thread Shu-Hung You
The explanation of the 5-argument read and 6-argument read-syntax is here, starting from the 3rd paragraph of this subsection: https://docs.racket-lang.org/reference/reader.html#%28part._parse-reader%29 The 5 (or 6) arguments version read accepts extra source location information. However, this

Re: [racket-users] Byte Order Mark: alter display of symbols containing nonprinting characters?

2017-12-27 Thread Shu-Hung You
(Interned) symbols that have the same printed form but are not equal to each other already exist tho; the symbols produced by string->unreadable-symbol are not equal? to their counterparts produced by the reader, but nevertheless have the same printed representation. Shu-Hung On Wed, Dec 27,

[racket-users] How to limit memory usage and raise out-of-memory error?

2018-08-10 Thread Shu-Hung You
I'm running a thread with memory limit using custodian-limit-memory. How do I reliably detect whether the thread I'm running was terminated normally or aborted by custodian shutdown? Plus, is it possible to obtain the context at the time the memory limit was exceeded? I can think these two: 1.

Re: [racket-users] How to limit memory usage and raise out-of-memory error?

2018-08-10 Thread Shu-Hung You
> for custodian shutdown. > > At Fri, 10 Aug 2018 15:27:07 -0500, Shu-Hung You wrote: >> I'm running a thread with memory limit using custodian-limit-memory. >> How do I reliably detect whether the thread I'm running was terminated >> normally or aborted by custodian shut

Re: [racket-users] Re: Question about style

2018-08-11 Thread Shu-Hung You
For small expressions it probably does not matter, but suitably naming intermediate expressions is definitely a good approach as it `explains' the code. Also, replacing let* by define can reduce nesting level. These 2 points are suggested in the style guide 4.2 and 4.4:

Re: [racket-users] Do I need macros to flag unbound identifiers as failing unit tests?

2018-08-11 Thread Shu-Hung You
Would convert-syntax-error and convert-compile-time-error work? Sure they are macros, but wrapped up in a nice way. https://docs.racket-lang.org/syntax/macro-testing.html On Sat, Aug 11, 2018 at 11:00 AM, Sage Gerard wrote: > Hi all, > > Still working the koans project and am hitting a design

Re: [racket-users] bf "module: initial import is not a well-formed module path"

2018-08-09 Thread Shu-Hung You
Change the first few lines of lang/reader.rkt to: #lang s-exp syntax/module-reader bf/language #:read my-read #:read-syntax my-read-syntax ;; ... And just install the entire directory as a package using raco pkg install. This could take a while. If you want to make it faster, just skip building

Re: [racket-users] bf "module: initial import is not a well-formed module path"

2018-08-09 Thread Shu-Hung You
On Thu, Aug 9, 2018 at 3:42 PM, Zeta Convex wrote: > > > On Thursday, 9 August 2018 21:34:16 UTC+1, Shu-Hung You wrote: >> >> Change the first few lines of lang/reader.rkt to: >> >> #lang s-exp syntax/module-reader >> bf/language >> #:read my-read >

[racket-users] In Redex, how to to specify mutually-recursive bindings (#:refers-to)?

2018-08-23 Thread Shu-Hung You
Is it possible to specify mutually-recursive scope in Redex without an extra layer of nesting expression? I found this example for letrec: https://github.com/racket/redex/blob/master/redex-examples/redex/examples/letrec.rkt#:34 34 #:binding-forms ... 37 (letrec ([x e_x] ...) #:refers-to (shadow

Re: [racket-users] How to handle define forms in a scribble-like language

2018-08-17 Thread Shu-Hung You
I would try make-wrapping-module-begin too. Basically, it wraps all module-level forms that "calculates something" with the syntax object you gave it. For example, the following program ;; some-language.rkt #lang racket (provide (except-out (all-from-out racket)

Re: [racket-users] Where to put scribblings in 'multi package?

2018-08-29 Thread Shu-Hung You
The gui-lib might be an example. It provides modules spanning different collections such as racket/gui, framework/ and mrlib/. https://github.com/racket/gui/tree/master/gui-lib On Wed, Aug 29, 2018 at 7:13 AM, Erich Rast wrote: > On Wed, 29 Aug 2018 06:46:49 -0500 > Philip McGrath wrote: > >

Re: [racket-users] MIT/Chicken/Chibi Scheme style ir-macro-transformer in Racket

2018-08-29 Thread Shu-Hung You
I think the following program illustrates the idea, though it doesn't really work: #lang racket (begin-for-syntax (define (syntax-pair->cons stx) (define datum (syntax-e stx)) (cond [(list? datum) (map syntax-pair->cons datum)] [(pair? datum) (cons

Re: [racket-users] MIT/Chicken/Chibi Scheme style ir-macro-transformer in Racket

2018-08-29 Thread Shu-Hung You
I should've been clear that the loop example was taken from the Chicken scheme wiki. Same for the while example mentioned in the email: https://wiki.call-cc.org/man/4/Macros#ir-macro-transformer Using the syntax->datum here would drop lexical information though; if the syntax object given to the

Re: [racket-users] let-syntax example?

2018-04-03 Thread Shu-Hung You
Hi Keven, Here's an example: #lang racket (let-syntax ([a (lambda (stx) (printf "expansion time: stx = ~a\n" stx) #'3) ]) a) However, I would suggest to start at least from syntax objects and macro transformers in the guide and use

Re: [racket-users] Re: [racket/racket] bc5556: raco pkg update: add `---unclone` as a kind of ali...

2018-04-25 Thread Shu-Hung You
This is awesome! I never knew that un-cloning can be done by using --lookup. Shu-Hung On Wed, Apr 25, 2018 at 12:35 PM, 'John Clements' via Racket Users wrote: > YAY! > > I can *never* remember this flag. > > Many thanks, > > John > >> On Apr 25, 2018, at 9:32 AM,

Re: [racket-users] handin-server: reader used in checker modules

2018-10-17 Thread Shu-Hung You
On Wed, Oct 17, 2018 at 1:12 PM Jordan Johnson wrote: > > > On Oct 17, 2018, at 10:35, Matthias Felleisen wrote: > > (check-expect (+ 10 .25) 10.25) > > errors with check-expect’s message about not comparing inexact numbers, but > in DrRacket+BSL the decimals are treated as exact numbers. > >

Re: [racket-users] confusion about call-with-current-continuation

2018-10-26 Thread Shu-Hung You
(lambda (exn) (println "div by 0"))]) > (saved-k 0)) ; wrapped in "prompt 4" > > (println 'hello2) ; wrapped in "prompt 5" > > ) > > Since the continuation executed in "prompt 4", why I can not print "div by

Re: [racket-users] confusion about call-with-current-continuation

2018-10-25 Thread Shu-Hung You
FWIW here's the part in the document that could be helpful: 1. The section in the Guide that talks about the concept of prompts and their usage in the continuation in Racket: https://docs.racket-lang.org/guide/prompt.html The prompt is kind of like a mark on the continuations that lets the

Re: [racket-users] Re: reporting contract violations in executable programs

2018-11-01 Thread Shu-Hung You
Thanks for catching this! This is a bug in the setup/dirs library, which the contract system transitively depends on to compute the path in the error message. I opened a pull request and let's see how it goes (#2352). On Thu, Nov 1, 2018 at 5:23 PM Alex Harsanyi wrote: > > > > On Thursday,

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

2018-10-01 Thread Shu-Hung You
Here! http://www.cs.utah.edu/~mflatt/racket-on-chez-jan-2018/ Also a few days algo there were some more updates at RacketCon and Scheme Workshop. On Mon, Oct 1, 2018 at 1:08 PM Brett Gilio wrote: > > > Philip McGrath writes: > > In light of > > the promising outlook for Chez replacing the current

Re: [racket-users] Is there a way to eval a custom language from inside a module... without instantiating modules multiple times?

2018-11-16 Thread Shu-Hung You
On Fri, Nov 16, 2018 at 12:43 PM Andrew Wilcox wrote: > > I'd like to be able to eval a custom language from inside a module... without > instantiating modules multiple times. > > With the help of Matthew Butterick, I've gotten this far: > > ; runtime.rkt > #lang racket > > > (printf "This is

[racket-users] (pict-snip%) Write: cannot marshal value that is embedded in compiled code value

2018-12-10 Thread Shu-Hung You
Is this some expected behavior? 1. Open DrRacket and run: #lang racket/base (require pict) (circle 50) 2. Copy the output. Open a new tab in DrRacket and paste the pict-snip%. 3. An error message showed up at the bottom, similar to this https://i.imgur.com/5BnTWP0.png Despite the error

[racket-users] (pict-snip%) Write: cannot marshal value that is embedded in compiled code value

2018-12-10 Thread Shu-Hung You
Is this some expected behavior? 1. Open DrRacket and run: #lang racket/base (require pict) (circle 50) 2. Copy the output. Open a new tab in DrRacket and paste the pict-snip%. 3. This error message showed up at the bottom: ``write: cannot marshal value that is embedded in compiled code value:

Re: [racket-users] Re: Why enter/run a submodule in the REPL?

2018-12-13 Thread Shu-Hung You
Hi Stephan, The "submodules to run" drop-down menu lets you choose which submodules will be executed when you click the "Run" button. For example, if you have a main submodule and a test submodule, DrRacket will run those 2 submodules by default. You can avoid running tests in the test submodule

[racket-users] Obtain use-site source information

2018-11-21 Thread Shu-Hung You
ormation I can get is the client module that uses USE, obtained by checking (current-module-declare-name) at expansion time in X. Shu-Hung -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving

Re: [racket-users] Obtain use-site source information

2018-11-21 Thread Shu-Hung You
Thanks! However, I am trying to avoid changing USE. The trouble is that there are too many macros using X that I don't understand, and these macros themselves are more than one layers deep. It is nearly impossible to thread the syntax property through the macros.On Wed, Nov 21, 2018 at 7:30 PM

Re: [racket-users] One macro -> N defined functions

2018-11-20 Thread Shu-Hung You
The begin form can encapsulate multiple definitions like this: (require (for-syntax racket/sequence racket/syntax) syntax/parse/define) (define-simple-macro (define-asserts predicate:id ...) #:with (assert-name ...) (for/list ([id (in-syntax #'(predicate ...))])

Re: [racket-users] Loggers that don't prepend?

2018-11-26 Thread Shu-Hung You
I think it depends on the code that logs the message, not the logger. In the log-message function, the topic and the prefix-message? arguments together control whether the message will be prefixed by the topic and ": " or not. On Mon, Nov 26, 2018 at 5:00 PM David Storrs wrote: > > Is there a way

Re: [racket-users] Re: Redex: making a #lang with native lambda, app, etc.

2019-01-03 Thread Shu-Hung You
Deferring everything to runtime could avoid macros as much as possible. You can implement input parsing as a function and use the macro only to glue things together. #lang racket/base (require (for-syntax racket/base) syntax/parse/define redex/reduction-semantics) (provide

Re: [racket-users] Re: Intriguing performance difference between Windows and Linux on `(factorial 100000)`

2019-03-24 Thread Shu-Hung You
Interesting. This is the timing on Mac. Comparing to Alex's result, the numbers roughly match "< 7s" v.s. "> 13s" while fact-1 is close. $ racket Welcome to Racket v7.2.0.3. > (enter! "factorial.rkt") "factorial.rkt"> (equal? (fact 10) (fact-1 10)) #t "factorial.rkt"> (time (void (fact-1

Re: [racket-users] Cannot use case+else inside match+else

2019-02-25 Thread Shu-Hung You
ut you > shadowed it with 'match', which does not treat 'else' differently than any > other identifier. > > Sam > > On Mon, Feb 25, 2019, 7:33 PM Shu-Hung You > wrote: >> >> When using a case expression with an else clause in inside a match >> expression, t

[racket-users] Cannot use case+else inside match+else

2019-02-25 Thread Shu-Hung You
When using a case expression with an else clause in inside a match expression, the expander complains about case having a bad syntax. However, the use of case expressions outside of match are fine. Is there anyway to get around this? Currently, I just replace it with another match. #lang

Re: [racket-users] Cannot use case+else inside match+else

2019-02-27 Thread Shu-Hung You
And because it is nothing else but a usual binding, it's possible to prefix-in or rename-in as in (require (prefix-in r: racket/base)) (case 5 [r:else 'ok]) On Wed, Feb 27, 2019 at 7:32 AM Laurent wrote: > > Good point. I wasn't sure that would work---it does. > > On Wed, Feb 27, 2019 at 1:28

Re: [racket-users] Fully expanded programs grammar: print-values

2019-02-06 Thread Shu-Hung You
print-values is a normal identifier introduced by the racket/base's macro module-begin. It is a (private) function defined in racket/private/modbeg. On Feb 6, 2019 5:02 AM, "'Paulo Matos' via Racket Users" < racket-users@googlegroups.com> wrote: > Hi, > > The docs[1] give a grammar for fully

Re: [racket-users] Fully expanded programs grammar: print-values

2019-02-06 Thread Shu-Hung You
On Wed, Feb 6, 2019 at 9:42 AM 'Paulo Matos' via Racket Users < racket-users@googlegroups.com> wrote: > > > > On 06/02/2019 16:00, Shu-Hung You wrote: > > print-values is a normal identifier introduced by the racket/base's > > macro module-begin. It is a (private)

Re: [racket-users] struct-info

2019-02-12 Thread Shu-Hung You
On Tue, Feb 12, 2019 at 3:55 PM David Storrs wrote: > > On Tue, Feb 12, 2019 at 4:46 PM wrote: > >> > >> Thank you for the explanation. Can I ask why the heck it works this > >> way? This seems to be explicitly designed for maximal surprise and > >> minimal usefulness. > > > > > > It works

Re: [racket-users] file-position does not extend file as expected

2019-06-24 Thread Shu-Hung You
On Mon, Jun 24, 2019 at 4:09 PM David Storrs wrote: > > I actually did try writing something at the extended position, although I > removed it before posting the above. Even with a write, it still does not do > as expected. In fact, the results are even stranger: > > #lang racket > > (define

Re: [racket-users] Re: catch and bind an unbound id in a macro

2019-04-20 Thread Shu-Hung You
identifier-binding returns #f for top-level bindings. I believe make-base-eval is evaluating expressions at top-level. On Sat, Apr 20, 2019 at 4:56 PM Ryan Kramer wrote: > > Below is a short example showing that identifier-binding doesn't seem to work > quite right with Scribble's

Re: [racket-users] handin-server: writing a first checker

2019-08-23 Thread Shu-Hung You
I forgot to CC my reply to the list. The case here is that the user account data in `users.rktd` only contain one field but the default `extra-fields` configuration requires 3 extra fields. The error message probably comes from some (map cons ...) expression that resides in the server code.

Re: [racket-users] Re: Using errortrace with repl-driven-development?

2019-07-24 Thread Shu-Hung You
errortrace with ,en should work as normal, as long as you ensure that there are no pre-compiled bytecode files (compiled/*.zo): $ ls myfile.rkt $ racket -l errortrace -i Welcome to Racket v7.2. > ,en "myfile.rkt" "myfile.rkt"> (f 123) ; g: 123 [,bt for context] "myfile.rkt"> ,bt ; g: 123 ;

Re: [racket-users] scribble cannot find module that racket finds

2019-11-03 Thread Shu-Hung You
On Sun, Nov 3, 2019 at 2:26 PM Hendrik Boom wrote: > > scribble does not find module "inclusion.rkt" even though racket does. > There must be a work-around, mustn't there? > > I can (require "inclusion.rkt") jusr fine from racket > > t3.rkt: > > #lang racket > (require "inclusion.rkt") > foo > >

Re: [racket-users] reading code

2019-11-12 Thread Shu-Hung You
On Mon, Nov 11, 2019 at 10:30 AM Hendrik Boom wrote: > > On Fri, Oct 25, 2019 at 11:31:41AM +0200, Niklas Larsson wrote: > > Hi! > > > > If you right click on an identifier in drracket you get “jump to binding > > occurrence” and “jump to definition” (if it’s defined in another file). > > Don’t

Re: [racket-users] Does match against list traverse the whole list?

2019-10-29 Thread Shu-Hung You
>From the expansion result, match does check whether the inspected value is a list using list?. But at least for the current version of Racket (and the C VM), list? is handled specially and ``effectively takes constant time due to internal caching.'' (quoted from:

Re: [racket-users] Racket COM error opening Word document: expected argument of type <(opt (box any))>

2019-10-08 Thread Shu-Hung You
I don't know COM but here's an attempt to guess what happened based on the documentation. On Tue, Oct 8, 2019 at 11:51 AM Scott Gudeman wrote: > > I am working on converting a powershell script to Racket that takes a Word > XML document and saves it as PDF. > > In powershell, when I call Word's

Re: [racket-users] file-position in Win32 not working beyond 1 GB

2019-12-20 Thread Shu-Hung You
Could it be that the Racket layer importing rktio C code directly uses get-ffi-obj and does not convert scheme_bignum_type to _int64? @Dmitry: I guess Racket uses 1 bit for type tagging, leaving only 30+sign (or 62+sign) bits for the actual value. On Fri, Dec 20, 2019 at 2:01 PM Matthew Flatt

Re: [racket-users] file-position in Win32 not working beyond 1 GB

2019-12-20 Thread Shu-Hung You
On Fri, Dec 20, 2019 at 2:05 PM Shu-Hung You wrote: > > Could it be that the Racket layer importing rktio C code directly uses > get-ffi-obj and does not convert scheme_bignum_type to _int64? > Never mind this -- I got the FFI part wrong. > On Fri, Dec 20, 2019 at 2:01 PM Matth

Re: [racket-users] Annoying run-warnings in DrR 7.5: How to disable?

2020-01-24 Thread Shu-Hung You
On Fri, Jan 24, 2020 at 10:37 PM Jordan Johnson wrote: > > On 24 Jan 2020, at 14:00, Robby Findler wrote: > > In the preferences dialog, in the General tab, the last checkbox is > > the one you want. > > The one for saving files upon switching tabs? > That new options is added in the upcoming

Re: [racket-users] Re: Installing Drracket on linux penguin on Chromebook

2020-01-17 Thread Shu-Hung You
What's the result of `file /home/user/racket-tmp-install/bin/racket` and the result of `uname -a`? (In other words, what hardware are you using? Is it 32-bit or 64-bit, it is x86 or ARM? Which version of Racket did you download?) On Fri, Jan 17, 2020 at 12:21 PM William Dobias wrote: >

Re: [racket-users] Installing Drracket on linux penguin on Chromebook

2020-01-16 Thread Shu-Hung You
Here's what I did: 1. Download the installer for x86_64 linux. 2. Move (or copy) the downloaded .sh file _into_ penguin through Files App. 3. Allow the installer to run by using `chmod +x FILE` (or `chmod 755 FILE`) * Chromrebook does not allow eXecutable permission for files

[racket-users] Running DrRacket on Chromebook

2020-01-07 Thread Shu-Hung You
? Best, Shu-Hung -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. To view this discussion on the web vi

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

2020-10-09 Thread Shu-Hung You
Here is an example that provides different colors for some particular forms such as define, require, lambda etc. However, these forms ('keywords') are recognized literally by the lexer instead of semantically as in Check Syntax. Therefore it will classify non-keywords as keywords from time to

Re: [racket-users] syntax woe with typed Racket 'let'

2020-06-01 Thread Shu-Hung You
FWIW, because `.` is just cons, the program (define (F [X : T1] . [Y : T2]) 'e) is being read as: (define (F [X : T1] Y : T2) 'e) I guess that's the reason for having an extra '*' in the syntax. On Mon, Jun 1, 2020 at 10:16 PM Sam Tobin-Hochstadt wrote: > > The syntax looks like this: >

Re: [racket-users] make-set!-transformer

2020-06-24 Thread Shu-Hung You
Here it is. https://github.com/racket/racket/blob/master/pkgs/racket-doc/scribblings/reference/stx-trans.scrbl#L31 I agree that it will be good to have a pointer or an example involving set!-values in the documentation of make-set!-transformer. The status quo is kind of indirect. The

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

2020-07-27 Thread Shu-Hung You
to identify which (/ y 0) caused the error. On Mon, Jul 27, 2020 at 1:13 PM Shu-Hung You wrote: > > By changing (fact 5) to (* 2 (fact 5)), the stack information becomes > > /: division by zero > errortrace...: >/Volumes/ramdisk/fact.rkt:6:17: (/ 1 0) >/Volumes/ramdisk/fa

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

2020-07-26 Thread Shu-Hung You
By changing (fact 5) to (* 2 (fact 5)), the stack information becomes /: division by zero errortrace...: /Volumes/ramdisk/fact.rkt:6:17: (/ 1 0) /Volumes/ramdisk/fact.rkt:7:12: (* (loop (sub1 n)) n) /Volumes/ramdisk/fact.rkt:7:12: (* (loop (sub1 n)) n)

Re: [racket-users] Is there a function to find and update all compiled directories?

2020-11-01 Thread Shu-Hung You
Using the command-line instruction `raco setup` will update all obsolete bytecodes. If you are looking for a programmable interface, `compiler/cm` is a good starting point. On Sun, Nov 1, 2020 at 5:43 PM infodeveloperdon wrote: > > I've never had problems with the .zo files being auto-created