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

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

2015-05-10 Thread WarGrey Gyoudmon Ju
WarGrey Gyoudmon Ju juzhenli...@gmail.com 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*? *d* means *D* *rRacket*? and these two ones

[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

[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,

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 spen...@florence.io wrote: Whoops, sorry! Knew we forgot something... Sorry about that! Cover is a

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 tim.br...@cityc.co.uk wrote: In the distant past, I tried to use `scribble/lp' with a program with a `test'

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

2015-07-01 Thread WarGrey Gyoudmon Ju
`. 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 frequently. and this problem seems quite

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

2015-06-30 Thread WarGrey Gyoudmon Ju
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 juzhenli...@gmail.com wrote: Hello

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 attic...@posteo.org 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 :

[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

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

2015-05-20 Thread WarGrey Gyoudmon Ju
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 juzhenli...@gmail.com wrote: Hello Jay, and Racketeers. What the original problem is: I want my pure Racket Web Server listens

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

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 mardu...@gmail.com 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.

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

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

2015-07-13 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

[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 <mfl...@cs.utah.edu> 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 <mfl...@cs.utah.edu> > wrote: > > > > >

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

2015-09-24 Thread WarGrey Gyoudmon Ju
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 ncurses bindings. On Fri, Sep 18, 2015 at 3:00 AM, WarGrey Gyoudmon Ju

[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

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

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

[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

[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

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

2016-01-09 Thread WarGrey Gyoudmon Ju
urations? (That doesn't seem particularly simple, tho.) > >> > >> Robby > >> > >> > >> On Sat, Jan 9, 2016 at 10:07 AM, Matthew Flatt <mfl...@cs.utah.edu> > wrote: > >>> At Sat, 9 Jan 2016 08:34:45 -0700, Matthew Fl

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

2015-12-25 Thread WarGrey Gyoudmon Ju
> > The problem is a bug in `namespace-mapped-symbols` (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

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

2015-11-30 Thread WarGrey Gyoudmon Ju
t; > 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 options. > >

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,

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

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

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

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

2016-01-11 Thread WarGrey Gyoudmon Ju
e doc submodule > expected by scribble itself... > > Cheers > > > > 2015-02-21 11:22 GMT-02:00 WarGrey Gyoudmon Ju <juzhenli...@gmail.com>: > >> Glad to see the literate programming technology updated. >> I thought it might be a "Forgotten Feature&qu

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

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,

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

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

Re: [racket-users] Typed Racket

2016-02-21 Thread WarGrey Gyoudmon Ju
On Sun, Feb 21, 2016 at 4:13 PM, Asumu Takikawa <as...@ccs.neu.edu> 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 commo

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] [racket] typed racket needs editor-snip%

2016-03-30 Thread WarGrey Gyoudmon Ju
requiring it from `typed/racket/gui`. > > Sam > > On Tue, Mar 29, 2016 at 4:09 AM, WarGrey Gyoudmon Ju > <juzhenli...@gmail.com> wrote: > > Hello, I am currently building a desktop application (which is a > component > > of a production system for customer) in typed r

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

2016-04-09 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] 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_

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 <juzhenli...@gmail.com> 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 struc

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] 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

[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 <sa...@cs.indiana.edu> 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 > <juzhenli...@gmail.

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%

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 <as...@ccs.neu.edu> 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 comp

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

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

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

[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

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

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 <matth...@ccs.neu.edu> wrote: > > > On Jan 31, 2017, at 12:37 AM, WarGrey Gyoudmon Ju <juzhenli...@gmail.com> > wrote: > > > > Hello. > > > > This is one of the culture shocks

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

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

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

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

2017-01-26 Thread WarGrey Gyoudmon Ju
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 at 12:48 AM, WarGrey Gyo

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 <juzhenli...@gmail.com> 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 ho

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

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

2017-01-28 Thread WarGrey Gyoudmon Ju
I'll look > > into adding it soon. (The addition 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

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

2017-01-28 Thread WarGrey Gyoudmon Ju
ive 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, typed racket complains any `ctype?` types and warns

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

[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

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

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

2016-08-20 Thread WarGrey Gyoudmon Ju
; Gustavo > > > > PS for Pekka: In this case it's better to use for/last and for/or, but > > in more complicated cases you can try with for/fold. > > > > > > On Fri, Aug 19, 2016 at 10:34 AM, WarGrey Gyoudmon Ju > > <juzhenli...@gmail.com> wrote: > >>

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

2016-08-31 Thread WarGrey Gyoudmon Ju
016-08-31 14:19 GMT+02:00 WarGrey Gyoudmon Ju <juzhenli...@gmail.com>: > >> Try this example, >> >> (require racket/draw) >> >> (define bitmap-blank >> (lambda [[w 0] [h #false] #:backing-scale [backing-scale 2.0]] >> (define width (max 1 (exa

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] 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

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

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

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

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

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

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

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

[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

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,

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

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

2017-01-04 Thread WarGrey Gyoudmon Ju
; On Wednesday, 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, d

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

2017-01-04 Thread WarGrey Gyoudmon Ju
ixed in a PR that 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 d

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

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

2017-01-05 Thread WarGrey Gyoudmon Ju
just by > editing 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:

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

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

[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

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

2017-04-13 Thread WarGrey Gyoudmon Ju
functions and methods returning the ink metrics instead of the logical one. I prefer the former. On Wed, Apr 12, 2017 at 10:23 PM, George Neuner <gneun...@comcast.net> wrote: > > On 4/11/2017 10:41 PM, WarGrey Gyoudmon Ju wrote: > >> This is a little awkward, there are lots of

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 <juzhenli...@gmail.com> wrote: > But sometimes I happened to see that some one-line codes and their line > number are overlapped. > And line number

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, 武晓宇

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 <juzhenli...@gmail.com> wrote: > I think, line numbers are likely displayed in another canvas. > The current implementation o

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 <juzhenli...@gmail.com> wrote: > Okay, in the gui

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] 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] 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

Re: [racket-users] Putting everything in a single monolithic source file

2017-07-21 Thread WarGrey Gyoudmon Ju
If the code is written in Typed Racket, the compilation time will drive you mad since every one-byte-modification forces the entire project being typed-checked... On Fri, Jul 21, 2017 at 5:07 PM, Erich Rast wrote: > I'm using mostly racket-mode in emacs for development and even

Re: [racket-users] Wrap long text in 2htdp/image

2017-07-22 Thread WarGrey Gyoudmon Ju
Yes, but you must implement it yourself. This simplest one works for fixed-width font (implemented with pict-lib, you get the idea): (define desc (lambda [txt size width #:head [head (blank 0 0)] #:style [fstyle null]] (define {desc0 txt size width fstyle}

Re: [racket-users] Printing Quickly

2017-07-25 Thread WarGrey Gyoudmon Ju
On Tue, Jul 25, 2017 at 4:52 PM, George Neuner wrote: > > Having little experience with Racket's drawing library, I can't speak to > how fast it is. I do recall someone saying it was (mostly) just a thin > layer over the native platform library, but even "thin layers" add

Re: [racket-users] beating java (speed)

2017-07-01 Thread WarGrey Gyoudmon Ju
Hello, did you try remove racket/unsafe/ops? You do not have to use unsafe operations for fixnum and flonum, Typed Racket will do it for you. I am not sure if this is my problem, I found that racket/unsafe/op slows down my typed bitmap library. According to the Optimization Coach, FlVector (with

Re: [racket-users] beating java (speed)

2017-07-02 Thread WarGrey Gyoudmon Ju
Yes, I agree with you. Choosing "unsafe" operations is a tradeoff since Typed FFI is unavailable, I need a convenient and practical framework. I am sure, in the future, I will rewrite it without FFI. images/flomap was a great starting point. Anyway, it is a longterm plan. On Sun, Jul 2, 2017

Re: [racket-users] Speeding up graphics / moving away from 2htdp/image

2017-04-25 Thread WarGrey Gyoudmon Ju
Hi Daniel, I have a functional bitmap library[1] as a part of my CSS engine. This library is inspired by the official pict-lib and flomap(images-lib), and handles bitmap% directly. I don't think it is efficient enough since every functional operation creates another bitmap%. Here I recommend you

  1   2   >