[racket] Sorry, but what's the correct way to use `#lang scribble/lp2`

2015-02-21 Thread WarGrey Gyoudmon Ju
Glad to see the literate programming technology updated. I thought it might be a "Forgotten Feature" since the rest of scribble is so powerful and I cannot find any code base use it. Thank you. So... there still should be more examples to work with it. What's the extra work (rather than simply rep

Re: [racket] scribble and .gitignore

2015-03-14 Thread WarGrey Gyoudmon Ju
I use ./compiled as the dest directory so that all generated files can be omitted in .gitignore once and for all. On Sun, Mar 15, 2015 at 1:30 AM, Jon Zeppieri wrote: > I've been looking at the .gitignore files in various racket packages, > and the ones I've seen don't ignore files generated b

Re: [racket-users] Organizing tests

2015-04-19 Thread WarGrey Gyoudmon Ju
Thank you Matthias This suggestion has enlightened me. I did not figure out a good way to filter tests based on their types. and, Konrad. I have a makefile.rkt to help me (and potential cooperators) build the system. The *scribble/lp* plays an important role in my development process not only beca

Re: [racket-users] convert to/from Sribble

2015-04-22 Thread WarGrey Gyoudmon Ju
I use Scribble heavily every day. One question with the default Markdown renderer is it breaks line every 72 chars when rendering blocks, and this poor implementation totally messes up the resulting file. On Wed, Apr 22, 2015 at 11:13 PM, Neil Van Dyke wrote: > Here's an interface for using you

[racket-users] [racket][off-topic] what's the official meaning of *.rktl and *.rktd?

2015-05-10 Thread WarGrey Gyoudmon Ju
Sorry it's hard to find the official definition of **.rktl* and **.rktd* except both of them are racket source file extensions as well as **.rkt*. My dim memory shows that *l* means *load* or *link*? *d* means *D**rRacket*? and these two ones are used for configuration. In my web htdocs, there are

Re: [racket-users] [racket][off-topic] what's the official meaning of *.rktl and *.rktd?

2015-05-10 Thread WarGrey Gyoudmon Ju
; > On Sun, May 10, 2015, 9:40 PM WarGrey Gyoudmon Ju > wrote: > >> Sorry it's hard to find the official definition of **.rktl* and **.rktd* >> except both of them are racket source file extensions as well as **.rkt*. >> My dim memory shows that *l* means *load* or *link*?

[racket-users] [racket][web] How to make security-guard work with servlets

2015-05-20 Thread WarGrey Gyoudmon Ju
Hello Jay, and Racketeers. What the original problem is: I want my pure Racket Web Server listens on port 80, and this server allows per-user dynamic content. As a security problem, no comprehensive solutions exists, it is a big topic of system administration. In real world, the racket web serv

[racket-users] Re: [racket][web] How to make security-guard work with servlets

2015-05-20 Thread WarGrey Gyoudmon Ju
. You'd put it after the bind > message is returned from the Web server. > > Oh Great, this is exactly what I want. Thank you Jay. > Jay > > On Wed, May 20, 2015 at 6:26 AM, WarGrey Gyoudmon Ju > wrote: > > Hello Jay, and Racketeers. > > > > What the

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

2015-05-22 Thread WarGrey Gyoudmon Ju
On Fri, May 22, 2015 at 5:41 PM, Atticus wrote: > > Imho it would be nice if there was a small hint in the documentation > about that case, perhaps there is and I didn't see it? Yes, there is : http://docs.racket-lang.org/style/Units_of_Code.html?q=define%2Fcontract#%28part._.Contracts%29 In

Re: [racket-users] exn->string

2015-05-26 Thread WarGrey Gyoudmon Ju
I think user-friendly 500 page should be designed separately just as web devs do for 404 page. In practice, a user happens to meet an uncaught runtime exception, and he's browsing a buggy website, perhaps he do not have the will to report the problem, nor the way to report it. Finally, devs will fi

Re: [racket-users] Cover 2.0

2015-05-31 Thread WarGrey Gyoudmon Ju
Would you like to provide an example. Say, it can produce an HTML page, it would be better if your repo can show what it looks like finally. On Sun, May 31, 2015 at 9:51 AM, Spencer Florence wrote: > Whoops, sorry! Knew we forgot something... Sorry about that! > > Cover is a multi-file code cove

Re: [racket-users] Does scribble/lp2 allow for test submodule

2015-06-02 Thread WarGrey Gyoudmon Ju
Yes, you can. I do it all the time. BTW, lp2 is just the lp except that you do not need to wrap it in another scribble file before requiring. On Tue, Jun 2, 2015 at 8:43 PM, Tim Brown wrote: > In the distant past, I tried to use `scribble/lp' with a program with a > `test' sub-module (using tha

[racket-users] [racket][system] Web server does not sleep when idling in Solaris/OpenIndiana

2015-06-18 Thread WarGrey Gyoudmon Ju
Hello. This is in OpenIndiana. I found the web server does not want to sleep after handling at least one requests. Mostly, it just load the entire core, sometimes it keeps increasing with handling few requests, but there seems one exception, if the client is net/http-client (rather than curl, w3m

[racket-users] Re: [racket][system] Web server does not sleep when idling in Solaris/OpenIndiana

2015-06-30 Thread WarGrey Gyoudmon Ju
on as long as it is busy in doing nothing worthy. and more, I have no idea if it would be better to use some other event completion frameworks (say, port_create and friends) to take the place of poll(2)/poll(7d). On Thu, Jun 18, 2015 at 10:17 PM, WarGrey Gyoudmon Ju wrote: > Hello. > &

Re: [racket-users] Re: [racket][system] Web server does not sleep when idling in Solaris/OpenIndiana

2015-07-01 Thread WarGrey Gyoudmon Ju
L_SYSCALL`. > > The `configure` script's check for poll() could be disabled easily on > Solaris if using poll() is a bad idea on that platform. > > At Tue, 30 Jun 2015 16:30:23 +0800, WarGrey Gyoudmon Ju wrote: > > Finally I found the root cause is that pollsys is called too

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

2015-07-12 Thread WarGrey Gyoudmon Ju
I just finished my test framework, based on Scribble and RackUnit. https://github.com/digital-world/DigiGnome http://gyoudmon.org/~wargrey:DigiGnome At the beginning, I focused on BDD, later I noticed that BDD is a thinking patten more than a coding pattern, and to not lose the purpose of communic

Re: [racket-users] What limits would you put on racket?

2015-07-23 Thread WarGrey Gyoudmon Ju
First of all, the first field I am interested in Computer Science can reasonably marked as Programming Language itself. Before I chose Racket, I used C and Java/ActionScript at work. now Racket is the major one (among all languages not only lisp dialects) in my life. Many people choose Clojure for

Re: [racket-users] Using the draw and plot packages with other languages

2015-08-17 Thread WarGrey Gyoudmon Ju
On Sun, Aug 16, 2015 at 6:40 AM, Marduk Bolaños wrote: > Coming back to my original question. What is your advice for using > Racket's draw and plot in other programs? > Hi, Marduk. There was a discussion that is close to your purpose. http://lists.racket-lang.org/users/archive//2014-January/061

[racket-users] [racket][FFI] memory management when making io ports in C

2015-09-16 Thread WarGrey Gyoudmon Ju
Hello. foxpipe.c is a wrapper of libssh2 APIs that suitable to work with (sync) and custodian. Everything is okay except that the sigfault annoys me a lot. typedef struct foxpipe_session { LIBSSH2_SESSION *sshclient; Scheme_Input_Port *dev_tcpin; Scheme_Output_Port *dev_tcpout;

Re: [racket-users] [racket][FFI] memory management when making io ports in C

2015-09-17 Thread WarGrey Gyoudmon Ju
Okay, thank you Matthew. On Thu, Sep 17, 2015 at 10:17 PM, Matthew Flatt wrote: > At Thu, 17 Sep 2015 21:29:35 +0800, WarGrey Gyoudmon Ju wrote: > > On Wed, Sep 16, 2015 at 7:36 PM, Matthew Flatt > wrote: > > > > > But, also, to use either of those, you need to use &

Re: [racket-users] [racket][FFI] memory management when making io ports in C

2015-09-24 Thread WarGrey Gyoudmon Ju
- lwp# 8 / thread# 8 Three SSH clients are running in three places separately, all APIs are FFIed without '#:in-orignal-place'. The GC itself crushed in thread #1. I do not make subprocess explicitly and the main place is running with n

Re: [racket-users] Embedding Rust in Racket

2015-11-09 Thread WarGrey Gyoudmon Ju
Because C side output port is not controlled by (current-output-port) and (current-error-port) directly, C code always use the default ones. In theory, one can write a simple wrapper to deal with (current-output-port). On Tue, Nov 10, 2015 at 1:45 PM, Ty Coghlan wrote: > It works correctly if I

Re: [racket-users] Configuration Files

2015-11-18 Thread WarGrey Gyoudmon Ju
info.rkt, that's its name, you can search it in docs for details. On Thu, Nov 19, 2015 at 6:39 AM, Sam Tobin-Hochstadt wrote: > I usually use a file that I `read` and `write` with racket data, > probably a hash table. > > Sam > > On Wed, Nov 18, 2015 at 5:19 PM, Christopher Walborn > wrote: > >

Re: [racket-users] Typed Racket and struct

2015-11-19 Thread WarGrey Gyoudmon Ju
1. define structs in untyped racket; 2. (require/typed/provide) it with #:constructor-name option. On Thu, Nov 19, 2015 at 5:11 PM, Antonio Menezes Leitao < antonio.menezes.lei...@ist.utl.pt> wrote: > Hi, > > I've been using Typed Racket in the last few months and it has been an > interesting exp

Re: [racket-users] Configuration Files

2015-11-19 Thread WarGrey Gyoudmon Ju
Yes, I like the idea of #lang info(#lang setup/infotab) which is highly constrained, and it is an out-of-box solution. It's better to have a (get-info/file filename.rkt) as an alternative to (get-info/full infodir-path). On Thu, Nov 19, 2015 at 7:32 AM, Neil Van Dyke wrote: > I generally second

Re: [racket-users] Typed Racket and struct

2015-11-19 Thread WarGrey Gyoudmon Ju
On Fri, Nov 20, 2015 at 3:27 AM, Antonio Menezes Leitao < antonio.menezes.lei...@ist.utl.pt> wrote: > Hi, > > On Thu, Nov 19, 2015 at 11:36 AM, WarGrey Gyoudmon Ju < > juzhenli...@gmail.com> wrote: > >> 1. define structs in untyped racket; >> 2. (require/ty

[racket-users] [racket] Racket 6.3(.0.7) breaks old code

2015-11-29 Thread WarGrey Gyoudmon Ju
It is compiled by myself with no strange options. Rebuilding the project (without DrRacket) fails due to two strange behaviors. The first one is module-path-index-resolve: "self" index has no resolution. It breaks lots of scripts, I cannot locate where it is exactly occurs. 1. errortrace says mak

Re: [racket-users] [racket] Racket 6.3(.0.7) breaks old code

2015-11-30 Thread WarGrey Gyoudmon Ju
gt; > I'm unclear on what I'd need to do to replicate the problem, though. Is > there some code of yours that's available and that I could try to run? > > At Mon, 30 Nov 2015 06:53:28 +0800, WarGrey Gyoudmon Ju wrote: > > It is compiled by myself with no strange opt

Re: [racket-users] Re: reducing pauses with incremental GC

2015-12-02 Thread WarGrey Gyoudmon Ju
I think, always. Because they like games too. On Thu, Dec 3, 2015 at 2:35 AM, Jack Firth wrote: > Absolutely fantastic! I wonder how often language designers implement > features useful to game developers because of their children. > > -- > You received this message because you are subscribed to

Re: [racket-users] Is there a way to return no value?

2015-12-11 Thread WarGrey Gyoudmon Ju
Oh, that's interesting. > (void? (values)) Type Checker: expected single value, got multiple (or zero) values in: (values) On Fri, Dec 11, 2015 at 8:15 PM, Jay McCarthy wrote: > Hi David, > > You can return nothing with (values). The function "values" returns > any number of values... (values 1

[racket-users] [racket][scribble] UNSYNTAX and lp

2015-12-17 Thread WarGrey Gyoudmon Ju
I see docs says UNSYNTAX can be used to escape code to scribble lots of times. So what is the UNSYNTAX? In lp chunks, are there any examples to demonstrate how to keep comments in the resulting docs? In my practice, tests are written in lp. If there is a way to keep the original form of a numbe

Re: [racket-users] [racket] Racket 6.3(.0.7) breaks old code

2015-12-25 Thread WarGrey Gyoudmon Ju
ls` (due to changes > related to the new macro expander). I will push a repair later today. > > At Mon, 30 Nov 2015 20:16:44 +0800, WarGrey Gyoudmon Ju wrote: > > Thank you, Matthew. > > > > The project itself is organized as a multi package, however there is no &

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

2016-01-09 Thread WarGrey Gyoudmon Ju
1. Could you please treat the exn:fail:unsupported like a normal case as if it is wrapped by (eval:error)? http://docs.racket-lang.org/ts-reference/type-ref.html#%28form._%28%28lib._typed-racket%2Fbase-env%2Fbase-types..rkt%29._.Ext.Fl.Vector%29%29 this example is about ExtFlVector which is not s

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

2016-01-09 Thread WarGrey Gyoudmon Ju
t; > >> > >> On Sat, Jan 9, 2016 at 10:07 AM, Matthew Flatt > wrote: > >>> At Sat, 9 Jan 2016 08:34:45 -0700, Matthew Flatt wrote: > >>>> At Sat, 9 Jan 2016 22:58:00 +0800, WarGrey Gyoudmon Ju wrote: > >>>> > 1. Could you please trea

[racket-users] Re: [racket] Sorry, but what's the correct way to use `#lang scribble/lp2`

2016-01-11 Thread WarGrey Gyoudmon Ju
scribble itself... > > Cheers > > > > 2015-02-21 11:22 GMT-02:00 WarGrey Gyoudmon Ju : > >> Glad to see the literate programming technology updated. >> I thought it might be a "Forgotten Feature" since the rest of scribble is >> so powerful and I c

Re: [racket-users] A template/example to use to build a workflow illustration/flowchart in slideshow

2016-01-16 Thread WarGrey Gyoudmon Ju
you can use (system) run graphviz, then load the resulting picture into slideshow with (bitmap) of pict. On Sat, Jan 16, 2016 at 8:22 AM, ckkashyap wrote: > Thanks Jordan ... I was aware of the tutorial source ... I was looking for > something that let me draw a flowchart quickly - I used graphv

Re: [racket-users] Racket performance tips

2016-01-16 Thread WarGrey Gyoudmon Ju
Yes. What Bytes in Racket is what char * in C. String treats the chars as a UTF-8 value. On Sun, Jan 17, 2016 at 12:59 PM, Brian Adkins wrote: > On Saturday, January 16, 2016 at 11:54:05 PM UTC-5, Brian Adkins wrote: > > On Saturday, January 16, 2016 at 11:26:14 PM UTC-5, Neil Van Dyke wrote: >

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

2016-02-17 Thread WarGrey Gyoudmon Ju
On Sun, Feb 14, 2016 at 8:10 PM, Saša Janiška wrote: > Neil Van Dyke writes: > > > Being non-mainstream for practitioners, Racket is most popular with > > people who have the freedom to choose any tools they want, not forced > > into a mainstream set of options. Most often this means individual

Re: [racket-users] Typed Racket

2016-02-20 Thread WarGrey Gyoudmon Ju
I use typed racket in production too, and I also heavily use Scribble on the same source codebase. Here is my requirement that not so important: (exn:break:hang-up) and (exn:break:terminate) are useful in server application, if I (typed/require) them in the a common rkt and this file is also (requ

Re: [racket-users] Typed Racket

2016-02-21 Thread WarGrey Gyoudmon Ju
On Sun, Feb 21, 2016 at 4:13 PM, Asumu Takikawa wrote: > On 2016-02-21 13:23:40 +0800, WarGrey Gyoudmon Ju wrote: > >(exn:break:hang-up) and (exn:break:terminate) are useful in server > >application, if I (typed/require) them in the a common rkt and this > file > >

Re: [racket-users] Setup/teardown for unit testing

2016-03-08 Thread WarGrey Gyoudmon Ju
Hi, Brina. This is my README of how I use RackUnit in my project. http://gyoudmon.org/~wargrey:wisemon/readme_rkt.html#%28elem._%28chunk._~3ctestsuite~3a._building._the._baby._digimon~3e~3a1%29%29 (test-suite

Re: [racket-users] Web server catch exceptions, print stack trace to error-logs, display simple page to user

2016-03-20 Thread WarGrey Gyoudmon Ju
I just use the log facility that operating system uses, say, rsyslog. rsyslog is configured to forward all logs via UDP, and there is another racket UDP server that displays these logs on the terminal or sends to other dev-ops. (rsyslog can be run as a normal user, then you can setup your own log m

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

2016-03-22 Thread WarGrey Gyoudmon Ju
In Racket, (read) and (write) know all the builtin datatypes which are already structured more than a stream of bytes (like in C). Thus, you don't need scanf to tell Racket what is the type of the next token.

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

2016-03-22 Thread WarGrey Gyoudmon Ju
On Wed, Mar 23, 2016 at 8:26 AM, WarGrey Gyoudmon Ju wrote: > In Racket, (read) and (write) know all the builtin datatypes > <https://docs.racket-lang.org/reference/reader.html?q=readtable#%28part._parse-number%29> > which > are already structured more than a stream of bytes (

Re: [racket-users] performance, json

2019-02-22 Thread WarGrey Gyoudmon Ju
I have tried my best to find the "best practice" to do Racket IO. Here are some tips I found in writing CSV reader: https://github.com/wargrey/schema/blob/master/digitama/exchange/csv/reader/port.rkt With a MacBook Pro 15, 2013, it takes 3.5s to read a 70MB file. I agreed that `read-char` is the

Re: [racket-users] Generate really large random numbers in Racket

2019-04-01 Thread WarGrey Gyoudmon Ju
Hi, I am writing SSH in pure typed racket, Generating a big random primes is one of the tasks and I just finished it. https://github.com/wargrey/lambda-shell/blob/master/ssh/digitama/algorithm/random.rkt https://github.com/wargrey/lambda-shell/blob/master/ssh/digitama/algorithm/rsa.rkt Before I w

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

2019-04-24 Thread WarGrey Gyoudmon Ju
Great article, thanks. I like the logging facility, now I see it is more powerful than I known. On Thu, Apr 25, 2019 at 6:25 AM Gustavo Massaccesi wrote: > 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 >

[racket-users] [racket] typed racket needs editor-snip%

2016-03-29 Thread WarGrey Gyoudmon Ju
Hello, I am currently building a desktop application (which is a component of a production system for customer) in typed racket. I found that typed/private/gui-types.rkt does have the definition of Editor-Snip% but does not provide it in typed/racket/base. I do not know where is your prefer place

Re: [racket-users] [racket] typed racket needs editor-snip%

2016-03-29 Thread WarGrey Gyoudmon Ju
Oh, yes, it works. Thank you. On Tue, Mar 29, 2016 at 7:27 PM, Sam Tobin-Hochstadt wrote: > You can use `Editor-Snip%` by requiring it from `typed/racket/gui`. > > Sam > > On Tue, Mar 29, 2016 at 4:09 AM, WarGrey Gyoudmon Ju > wrote: > > Hello, I am currently buildi

Re: [racket-users] [racket] typed racket needs editor-snip%

2016-03-30 Thread WarGrey Gyoudmon Ju
gui`. > > Sam > > On Tue, Mar 29, 2016 at 4:09 AM, WarGrey Gyoudmon Ju > wrote: > > Hello, I am currently building a desktop application (which is a > component > > of a production system for customer) in typed racket. > > > > I found that typed/priv

Re: [racket-users] drracket / postgresql error when opening connection for syntax

2016-04-06 Thread WarGrey Gyoudmon Ju
I met this problem before. (system-type 'machine) uses the output of `uname`. On Wed, Apr 6, 2016 at 5:47 PM, Tim Brown wrote: > Folks, > > I’m experimenting with creating functions from a PostgreSQL database. > [Frankly, I’m still getting my head around what I _actually_ want to do > here, but.

[racket-users] [racket][typed] static-contracts/instantiate.rkt:64:2. car: contract violation.

2016-04-08 Thread WarGrey Gyoudmon Ju
This bug happened to appear two days ago and never disappear (both in version 6.4.0.13 and 6.5.0.1) in my codebase, however if I copy the minimal relative code into a fresh file, it disappears. In the original one's REPL, it disappears too. (define-type Card% (Class #:implements Darc-Card%

Re: [racket-users] [racket][typed] static-contracts/instantiate.rkt:64:2. car: contract violation.

2016-04-17 Thread WarGrey Gyoudmon Ju
On Sun, Apr 17, 2016 at 3:35 PM, Asumu Takikawa wrote: > If you can send me whatever code is necessary to reproduce the bug (even if > it's not very minimal), I can try to fix it. > Thank you Asumu for caring about this bug. But now I cannot reproduce it in the real world code either, just like

Re: [racket-users] [racket][typed] static-contracts/instantiate.rkt:64:2. car: contract violation.

2016-04-18 Thread WarGrey Gyoudmon Ju
On Mon, Apr 18, 2016 at 4:03 AM, Asumu Takikawa wrote: > On 2016-04-18 03:47:45 +0800, WarGrey Gyoudmon Ju wrote: > >And here is another question. Developing GUI Application involves > typed > >class system heavily, which makes the compiling time terribly long (if >

Re: [racket-users] Re: Accessing Undo/Redo History directly?

2016-04-19 Thread WarGrey Gyoudmon Ju
I think it's impossible to access written texts since what inside the undo/redo history are functions, not the content entities. So you have to manage texts on your own. -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this gr

Re: [racket-users] DrRacket debugger error

2016-05-11 Thread WarGrey Gyoudmon Ju
Just mention here: I met this error message when invoking a function with keyword arguments within the class body (but not method body). The simplest solution is to wrap the function application in another function that do not passed with keyword arguments. (define toolbar-snip% : Toolbar-Snip%

[racket-users] [racket][typed] infinite typechecking

2016-06-28 Thread WarGrey Gyoudmon Ju
Hello, This is version 6.5.0.5. (define-syntax (define-tokens stx) (syntax-case stx [] [(_ token #:+ Token (extra ...) #:with [[subtoken #:+ SubToken subrest ...] ...] [id #:+ ID #:-> parent #:as Type rest ...] ...) (with-syntax ([token->datum (format-id #'token

Re: [racket-users] error when intalling racket 6.5 in solaris (a sparc machine)

2016-06-29 Thread WarGrey Gyoudmon Ju
Also, you may want '--disable-libffi' On Thu, Jun 30, 2016 at 11:11 AM, Matthew Flatt wrote: > I'm not sure, but it's possible that a newer version of libtool is > needed. > > Meanwhile, does dropping the `--enable-shared` flag help? (I recommend > that in any case, unless you specifically need

Re: [racket-users] Re: How to differentiate between files and directories?

2016-07-21 Thread WarGrey Gyoudmon Ju
Maybe you can work with (namespace-mapped-symbols) and (namespace-variable-value), All field accessors are procedures with name starts with "struct-name-", no duplicates in the entire application. On Fri, Jul 22, 2016 at 3:59 AM, David Storrs wrote: > So there's no way to query the interface of

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

2016-08-19 Thread WarGrey Gyoudmon Ju
(define (read-on-row *params*) ;; Returns the last line in "myfile" which contains ;; substring "ON", otherwise #f (call-with-input-file (hash-ref *params* "myfile") (lambda (inp) (for/first ([row (in-lines inp 'return-linefeed)] #:when (string-contains? row "ON"))

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

2016-08-20 Thread WarGrey Gyoudmon Ju
gt; 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 > > wrote: > >> (define (read-on-row *params*) > >&g

Re: [racket-users] Scaling image with racket/draw?

2016-08-31 Thread WarGrey Gyoudmon Ju
Try this example, (require racket/draw) (define bitmap-blank (lambda [[w 0] [h #false] #:backing-scale [backing-scale 2.0]] (define width (max 1 (exact-ceiling w))) (define height (max 1 (exact-ceiling (or h w (make-bitmap width height #:backing-scale backing-scale))) (define

Re: [racket-users] Scaling image with racket/draw?

2016-08-31 Thread WarGrey Gyoudmon Ju
ntains the flomap library. What a pity! On Thu, Sep 1, 2016 at 4:40 AM, Jens Axel Søgaard < jensaxelsoega...@gmail.com> wrote: > Is the result as good as ImageMagick? > > Den 31. aug. 2016 kl. 22.25 skrev Tobias Gerdin : > > Right, that did it, thanks! > > 2016-08-31 14:19 GMT

Re: [racket-users] typed racket confusion

2016-09-09 Thread WarGrey Gyoudmon Ju
Because in function `b`, the type of the `lambda` that `n` actually be passed to is the union of `add1` and `sub1` in the context, hence, the info on parity of `n` are lost before this `lambda` is evaluated. On Sat, Sep 10, 2016 at 3:42 AM, Jos Koot wrote: > #lang typed/racket > > (define (a (n

Re: [racket-users] Vector or array type for math vector?

2016-09-16 Thread WarGrey Gyoudmon Ju
No, Racket's vector is an array from Java's perspective(int [] for instance), not a custom data structure, Array is not a builtin datatype in Racket. If working with math-lib, you already have linear algebra supported. the array in math/array is a custom data structure with vector in heart. On Fr

Re: [racket-users] Is it neccessary to learn how to define new language?

2016-09-19 Thread WarGrey Gyoudmon Ju
On Mon, Sep 19, 2016 at 3:12 PM, Lin Lee wrote: > I'm a newcomer to Racket,I have learned scheme before. > > Recently,I began to learn Racket,but I found that it's too complicate in > reader and expander. So,I want to know what if i dont learn this part.Does > it do harm to me? > > Any suggestion

Re: [racket-users] Twenty six low-risk ways to use Racket at work You can start right now

2016-09-29 Thread WarGrey Gyoudmon Ju
27. Racket is in the nature of a preprocessor; 28. Besides the literate programming, Racket is a "programmable documentation". Any point in the two (and those 26) is not as good as it's sound if it's not the important part in the project or team. However if all of these can work together in a syst

Re: [racket-users] Twenty six low-risk ways to use Racket at work You can start right now

2016-09-30 Thread WarGrey Gyoudmon Ju
Hi spdegabrielle, no apologies please. Actually, I did not or probably could not make myself clearly when I wrote that reply. I had felt depressed since this mail-list is not as active as before. At the first sight I saw your topic, I thought there should be more topics like this, but not only con

Re: [racket-users] Re: What is the fastest way to find the total free space on the disk?

2016-11-13 Thread WarGrey Gyoudmon Ju
I have written one in my project this task varies both from OS and filesystem. https://github.com/digital-world/sakuyamon/blob/master/digitama/posix.c It works on Solaris/Linux/MacOSX, and collects more sysinfo metrics than just disk usage. `ffi_prefab_ksysinfo` is the main struct, and `system_st

Re: [racket-users] Request for comments: An embedded DSL for CSS in Racket

2016-11-13 Thread WarGrey Gyoudmon Ju
I have been writing my CSS engine. [sorry this reply might be a little off-topic here] Long period before, someone in this mailing list asked if their are user editable configuration file formats that can be used in real world applications. `info.rkt` might be a choice but it is not designed for

Re: [racket-users] Re: Adding new exceptions

2016-11-29 Thread WarGrey Gyoudmon Ju
Hi, David. The exn:fail:filesystem and exn:fail:network do provide the errno code, If you are only working in one OS, you can also rely on the errno code. If you are working on multiple OSes, it might be a problem since Racket have not yet provided an abstract layer on the errno code. If you pref

Re: [racket-users] Good Data Structures Book?

2016-12-14 Thread WarGrey Gyoudmon Ju
"Pearls of Functional Algorithm Design" https://www.amazon.com/Pearls-Functional-Algorithm-Design-Richard/dp/0521513383/ref=sr_1_1 The functional "programming pearls" in Haskell, but the author prefers the term "algorithm design". On Wed, Dec 14, 2016 at 2:48 AM, Ben Greenman wrote: > "Purely

[racket-users] hello, where can I find the distribution 6.7.0.3.

2017-01-04 Thread WarGrey Gyoudmon Ju
I cannot deploy my typed desktop application on Windows. In the download home page, 6.7 does not work, and that bug seemed to be solved (I started 6.7 from 6.7.0.3, do not know whether it was okay on macOS). The latest snapshot has a new bug shown both on macOS and Windows: in-list: contract vio

Re: [racket-users] hello, where can I find the distribution 6.7.0.3.

2017-01-04 Thread WarGrey Gyoudmon Ju
Hi, Stephen, I've already tried 12.28 and no luck. And at this time, that link is dead. So, all snapshots are temporary testers. hi Dupéron, For me on my computer I always build it from source, but I never trace the date and commit. Actually this is one of the major reason I gave up Haskell, Racke

Re: [racket-users] Re: hello, where can I find the distribution 6.7.0.3.

2017-01-04 Thread WarGrey Gyoudmon Ju
t should be pushed in the > next couple of days (https://github.com/racket/typed-racket/pull/481). > > Sorry for the trouble. > > Best, > Andrew > > On Wednesday, January 4, 2017 at 3:51:15 AM UTC-5, WarGrey Gyoudmon Ju > wrote: > > I cannot deploy my typed desktop applica

Re: [racket-users] Re: hello, where can I find the distribution 6.7.0.3.

2017-01-04 Thread WarGrey Gyoudmon Ju
January 4, 2017 at 3:51:15 AM UTC-5, WarGrey Gyoudmon Ju > wrote: > > I cannot deploy my typed desktop application on Windows. > > > > > > In the download home page, 6.7 does not work, and that bug seemed to be > solved (I started 6.7 from 6.7.0.3, do not know whether it wa

Re: [racket-users] `apply`ing polymorphic functions in typed/racket

2017-01-05 Thread WarGrey Gyoudmon Ju
On Thu, Jan 5, 2017 at 3:28 PM, Matthew Eric Bassett wrote: > > the type signatures of this functions are: > (-> (Setof e) (Setof e) * (Setof e)) > > > (define list0 > (list (set 2) (set 3 2))) > (apply set-union list0) > > > (define list2 : (Listof (Setof Positive-Byte)) > (list (set 2)

Re: [racket-users] How to embed version and build date in an application executable?

2017-01-05 Thread WarGrey Gyoudmon Ju
A racket application usually has an `info.rkt` file in the root directory of the project/package/collection. see https://docs.racket-lang.org/raco/getinfo.html You can put your meta information in that file than read it with (get-info/full dirpath) which returns a function that works like `hash-re

Re: [racket-users] How to embed version and build date in an application executable?

2017-01-05 Thread WarGrey Gyoudmon Ju
the file. > > For reference, the application is https://github.com/alex-hhh/ActivityLog2, > you can have a look at build.rkt for how it is currently done (it creates > the file build-id.txt). > > Cheers, > Alex. > > On Friday, January 6, 2017 at 10:31:43 AM UTC+8, WarGrey Gyoudm

Re: [racket-users] Best practice for using .../private files from packages (pict3d)

2017-01-26 Thread WarGrey Gyoudmon Ju
How about merging these primitive geometry APIs into math-lib? On Thu, Jan 26, 2017 at 8:53 PM, Jay McCarthy wrote: > I think that it is quite common for a big library (especially > something really big like pict3d) to create a lot of residual useful > code that could conceivably be their own l

Re: [racket-users] Editor-canvas% how to set default style and use set-line-count correctly?

2017-01-26 Thread WarGrey Gyoudmon Ju
I have these two helpers (typed racket makes it a little verbose). (define change-style : (->* ((Instance Style<%>)) (#:font (Option (Instance Font%)) #:color (Option (Instance Color%)) #:background-color (Option

Re: [racket-users] Editor-canvas% how to set default style and use set-line-count correctly?

2017-01-26 Thread WarGrey Gyoudmon Ju
up to you. (send card insert "works as expected") (send card insert (make-object string-snip% "it's a bug of text%, snip's style is not (convert)ed, also affects the following inputs") (send digivice show #true) (send digivice center 'both) On Fri, Jan 27, 2017

Re: [racket-users] Editor-canvas% how to set default style and use set-line-count correctly?

2017-01-26 Thread WarGrey Gyoudmon Ju
On Fri, Jan 27, 2017 at 1:46 AM, WarGrey Gyoudmon Ju wrote: > > (send card insert (make-object string-snip% "it's a bug of text%, > snip's style is not (convert)ed, also affects the following inputs") > All right, it is not a bug, it's just how it works. the

Re: [racket-users] specify test timeout for pkg-build?

2017-01-27 Thread WarGrey Gyoudmon Ju
And also, I want to control `--check-stderr` in `info.rkt` file. 1. currently, typed racket complains any `ctype?` types and warns it to stderr. 2. for some tests, display their output to stdout and stderr is more convenient than wrapping the output into something like (check-exn?), say, to see if

Re: [racket-users] specify test timeout for pkg-build?

2017-01-28 Thread WarGrey Gyoudmon Ju
ild.racket-lang.org until the next release, though.) > > At Sat, 28 Jan 2017 11:23:44 +0800, WarGrey Gyoudmon Ju wrote: > > And also, I want to control `--check-stderr` in `info.rkt` file. > > > > 1. currently, typed racket complains any `ctype?` types and warns it to >

Re: [racket-users] specify test timeout for pkg-build?

2017-01-28 Thread WarGrey Gyoudmon Ju
n won't be effective in > > pkg-build.racket-lang.org until the next release, though.) > > > > At Sat, 28 Jan 2017 11:23:44 +0800, WarGrey Gyoudmon Ju wrote: > >> And also, I want to control `--check-stderr` in `info.rkt` file. > >> > >> 1. currently,

Re: [racket-users] Re: Package layout in docs

2017-01-30 Thread WarGrey Gyoudmon Ju
Hello. This is one of the culture shocks that a new Racketeer would face, and so was I. But this statement makes it clear to me: Racket is an operating system that pretend to a programming language; Yes, it may totally be a kind of over reading here. Say, I do not care if a manual page is the on

Re: [racket-users] Package layout in docs

2017-01-31 Thread WarGrey Gyoudmon Ju
On Tue, Jan 31, 2017 at 9:12 PM, Matthias Felleisen wrote: > > > On Jan 31, 2017, at 12:37 AM, WarGrey Gyoudmon Ju > wrote: > > > > Hello. > > > > This is one of the culture shocks that a new Racketeer would face, and > so was I. > > But this

Re: [racket-users] How to implement a dynamic plugin system?

2017-02-07 Thread WarGrey Gyoudmon Ju
I think you can check the source of `raco` which uses the `info.rkt` to search all subcommands(see `racket/getinfo`). In this way, all plugins are just normal packages, you do not have to reside them is a specific directory. Certainly, the plugin is loaded via `dynamic-require`, if the plugin needs

[racket-users] [racket][gui] maybe different behaviors of text% between Windows and macOS

2017-02-12 Thread WarGrey Gyoudmon Ju
Hello, the original problem is reported here[ https://github.com/racket/racket/issues/1573] My solution works well in macOS, but in Windows, it only "partially" works: If there is no newline (including the one produced by *auto-wrap*) in the texts, it works, or only the last line is rendered well,

Re: [racket-users] Typed Racket: Polymorphic function `dynamic-wind' could not be applied to arguments

2017-03-05 Thread WarGrey Gyoudmon Ju
The problem is not the `AnyValues` since it accepts all types, but you cannot instantiate a polymorphic type to return multiple values, so you have to return (cons ... ...) in dynamic-wind then extract that pair as two return values of the function. On Sun, Mar 5, 2017 at 3:23 PM, kay wrote: > I

Re: [racket-users] How to type annotate for bindings in complex syntax forms

2017-03-06 Thread WarGrey Gyoudmon Ju
1.5 years ago, I struggled with the command-line, finally I thought `parse-command-line` is friendlier than its macro form `command-line`, and got the solution with `cast`: ;;; firstly, define your precise Help-Table. (define-type Help-Table (Listof (U (Pairof 'usage-help String)

Re: [racket-users] racket/gui -- How to implement a text% area with line number displayed?

2017-03-08 Thread WarGrey Gyoudmon Ju
I think, line numbers are likely displayed in another canvas. The current implementation of text% does not support advanced font features, the line height therefore is always the same. Displaying the line numbers just consists of a bit of arithmetic. On Thu, Mar 9, 2017 at 8:31 AM, 武晓宇 wrote: >

Re: [racket-users] racket/gui -- How to implement a text% area with line number displayed?

2017-03-08 Thread WarGrey Gyoudmon Ju
in a special image box(also, those non-string snips may produce lines that bigger than text line height). On Thu, Mar 9, 2017 at 9:31 AM, WarGrey Gyoudmon Ju wrote: > I think, line numbers are likely displayed in another canvas. > The current implementation of text% does not support ad

Re: [racket-users] racket/gui -- How to implement a text% area with line number displayed?

2017-03-08 Thread WarGrey Gyoudmon Ju
Okay, in the gui framework, there is an interface text:line-numbers<%> On Thu, Mar 9, 2017 at 9:46 AM, WarGrey Gyoudmon Ju wrote: > But sometimes I happened to see that some one-line codes and their line > number are overlapped. > And line numbers are also controlled by the

Re: [racket-users] racket/gui -- How to implement a text% area with line number displayed?

2017-03-08 Thread WarGrey Gyoudmon Ju
that racket already provides, to override the (on-paint) method of text%, its first argument gives the change to draw something before or after the text% itself is displayed. On Thu, Mar 9, 2017 at 9:51 AM, WarGrey Gyoudmon Ju wrote: > Okay, in the gui framework, there is an interface text:l

Re: [racket-users] link: bad variable linkage

2017-03-11 Thread WarGrey Gyoudmon Ju
I have this issue in Racket 6.8.0.1 this morning, the project is compiled by compile-directory-zos, and all .zos are ensured up-to-date. Before I gave up, I had wrote a simple tests in DrRacket, lucky to saw the root cause, a contract error in the body of the newly added typed class, but the issue

Re: [racket-users] Typed Racket: Using (Sequenceof a) in place of (Listof a)

2017-03-21 Thread WarGrey Gyoudmon Ju
For input arguments, it's okay, (Sequenceof a) does accept (Listof a); but for the return value, (Listof a) does not accept (Sequenceof a). You can pass a list as the input, but you cannot narrow the type annotation in you example, say (list->vector) satisfies the annotation, both the input and ou

Re: [racket-users] Reporting exceptions as though they came from the caller

2017-03-31 Thread WarGrey Gyoudmon Ju
I use continuation marks to extract the nearest named function (named loops are also contained in the context): (define-syntax (#%function stx) ; class method has a symbol name looks like "[name] method in [class%]" #'(let use-next-id : Symbol ([stacks (continuation-mark-set->context (current-co

[racket-users] [racket][draw] some APIs should be more open

2017-04-11 Thread WarGrey Gyoudmon Ju
This is a little awkward, there are lots of simple classes defined in racket/draw, font%, color%, pen%, brush% and so on. They just hold a group of plain data, hence opportunities to be inspected easily. However by default all classes are opaque, the easiest (and perhaps unique) way to handle this

  1   2   >