Re: [racket-dev] Enhancement to the syntax system?

2014-05-13 Thread Marijn Schouten (hkBst)
I realize this is a very old thread, but the behavior of Racket has not
changed since.

On 03-05-14 23:29, Marijn Schouten (hkBst) wrote:
 On 07/10/2012 05:03 PM, Matthew Flatt wrote:
 At Tue, 10 Jul 2012 10:51:57 -0400, Eli Barzilay wrote:
 20 minutes ago, Marijn wrote:

 It seems to me that both these results cannot be correct
 simultaneously, but I'll await the experts' opinion on that.

 This does look weird:

   #lang racket
   (define-for-syntax (f stx) #`(let ([x 1]) #,stx))
   (define-syntax (m stx)
 (with-syntax ([zz (f #'x)]) #`(let ([x 2]) zz)))
   (m)

 evaluates to 1, but if I change the first two stx names into x
 *or* if I change the argument name for the macro to x, then it
 returns 2.

 It's natural --- but not correct --- to think that #` is responsible
 for hygiene, in which case `(f #'x)' should keep the given `x' separate
 from the `let'-bound `x' in the result.

 Instead, hygiene is the responsibility of macro invocation, and

  #`(let ([x 1]) #,#'x)

 is simply the same as

  #`(let ([x 1]) x)

 and so

  (f #'x)

 above is equivalent to

  #`(let ([x 1]) x)
 
 IIUC then you're saying that also all the following (fx #'x) and (fy
 #'x) are equivalent to #`(let ((x 0)) x), but if you run this code then
 you will get a 0 result only for (myy), contrary to what I would expect
 based on the above explanation.
 
 #lang racket
 
 (define-for-syntax (fx x) #`(let ((x 0)) #,x))
 (define-for-syntax (fy y) #`(let ((x 0)) #,y))
 
 (define-syntax (mxx x)
   (syntax-case x () ((_) #`(let ((x 99)) #,(fx #'x)
 
 (define-syntax (mxy x)
   (syntax-case x () ((_) #`(let ((x 99)) #,(fy #'x)
 
 (define-syntax (myx y)
   (syntax-case y () ((_) #`(let ((x 99)) #,(fx #'x)
 
 (define-syntax (myy y)
   (syntax-case y () ((_) #`(let ((x 99)) #,(fy #'x)
 
 (mxx)
 (mxy)
 (myx)
 (myy)
 
 ==
 
 99
 99
 99
 0
 
 Marijn
 _
   Racket Developers list:
   http://lists.racket-lang.org/dev
 

_
  Racket Developers list:
  http://lists.racket-lang.org/dev


Re: [racket-dev] Enhancement to the syntax system?

2014-05-03 Thread Marijn Schouten (hkBst)
On 07/10/2012 05:03 PM, Matthew Flatt wrote:
 At Tue, 10 Jul 2012 10:51:57 -0400, Eli Barzilay wrote:
 20 minutes ago, Marijn wrote:

 It seems to me that both these results cannot be correct
 simultaneously, but I'll await the experts' opinion on that.

 This does look weird:

   #lang racket
   (define-for-syntax (f stx) #`(let ([x 1]) #,stx))
   (define-syntax (m stx)
 (with-syntax ([zz (f #'x)]) #`(let ([x 2]) zz)))
   (m)

 evaluates to 1, but if I change the first two stx names into x
 *or* if I change the argument name for the macro to x, then it
 returns 2.
 
 It's natural --- but not correct --- to think that #` is responsible
 for hygiene, in which case `(f #'x)' should keep the given `x' separate
 from the `let'-bound `x' in the result.
 
 Instead, hygiene is the responsibility of macro invocation, and
 
  #`(let ([x 1]) #,#'x)
 
 is simply the same as
 
  #`(let ([x 1]) x)
 
 and so
 
  (f #'x)
 
 above is equivalent to
 
  #`(let ([x 1]) x)

IIUC then you're saying that also all the following (fx #'x) and (fy
#'x) are equivalent to #`(let ((x 0)) x), but if you run this code then
you will get a 0 result only for (myy), contrary to what I would expect
based on the above explanation.

#lang racket

(define-for-syntax (fx x) #`(let ((x 0)) #,x))
(define-for-syntax (fy y) #`(let ((x 0)) #,y))

(define-syntax (mxx x)
  (syntax-case x () ((_) #`(let ((x 99)) #,(fx #'x)

(define-syntax (mxy x)
  (syntax-case x () ((_) #`(let ((x 99)) #,(fy #'x)

(define-syntax (myx y)
  (syntax-case y () ((_) #`(let ((x 99)) #,(fx #'x)

(define-syntax (myy y)
  (syntax-case y () ((_) #`(let ((x 99)) #,(fy #'x)

(mxx)
(mxy)
(myx)
(myy)

==

99
99
99
0

Marijn
_
  Racket Developers list:
  http://lists.racket-lang.org/dev


[racket-dev] racket-5.3.[34] compilation failure SIGSEGV MAPERR si_code 1 fault

2013-06-14 Thread Marijn
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi list,

racket-5.3.3 and 5.3.4 are today both failing to compile for me with:

raco setup:  in r5rs/private
raco setup:  in typed-racket/optimizer
SIGSEGV MAPERR si_code 1 fault on addr 0x130

I get this error using gcc versions 4.5.3, 4.6.3 and 4.7.3. My glibc
is 2.17, but I have a bug report of a very similar failure[1] using
glibc-2.15:

raco setup: 1 making: math/private/vector
raco setup: 1 making: math/scribblings
raco setup: --- updating info-domain tables ---
SIGSEGV MAPERR si_code 1 fault on addr 0x40

which also contains this backtrace:

[New LWP 9579]
[New LWP 9514]
[New LWP 9528]
[New LWP 9581]
[Thread debugging using libthread_db enabled]
Using host libthread_db library /lib/libthread_db.so.1.
Core was generated by
`/var/tmp/portage/dev-scheme/racket-5.3.3/work/racket-5.3.3/src/racket/.libs/rac'.
Program terminated with signal 6, Aborted.
#0  0xb76e58d2 in _dl_sysinfo_int80 () from /lib/ld-linux.so.2
(gdb) bt
#0  0xb76e58d2 in _dl_sysinfo_int80 () from /lib/ld-linux.so.2
#1  0xb71bf2b1 in *__GI_raise (sig=6) at
../nptl/sysdeps/unix/sysv/linux/raise.c:64
#2  0xb71c0a8e in *__GI_abort () at abort.c:91
#3  0xb761f427 in fault_handler () from
/var/tmp/portage/dev-scheme/racket-5.3.3/work/racket-5.3.3/src/racket/.libs/libracket3m-5.3.3.so
#4  signal handler called
#5  0xa2e9d7a9 in ?? () from /usr/lib/libGL.so.1
#6  0xb7320d3f in __nptl_deallocate_tsd () at pthread_create.c:155
#7  0xb7320f15 in start_thread (arg=0xb200bb40) at pthread_create.c:312
#8  0xb727e64e in clone () at ../sysdeps/unix/sysv/linux/i386/clone.S:133
(gdb) q


I was able to compile 5.3.3 fine in February, although drracket won't
start (anymore?), but gracket will:


set-loaded-mask method in bitmap%: contract violation
 expected: (is-a?/c bitmap%)
 given: #f
 in: the 1st argument of
 the set-loaded-mask method in
  bitmap%/c
 contract from: collects/racket/draw.rkt
 blaming:
  collects/drracket/private/frame-icon.rkt
 at: collects/racket/draw.rkt:58.19
  context...:
   /usr/lib64/racket/collects/racket/contract/private/blame.rkt:89:0:
raise-blame-error
   /usr/lib64/racket/collects/drracket/private/frame-icon.rkt:
[running body]
   /usr/lib64/racket/collects/drracket/private/drracket-normal.rkt:
[traversing imports]
   /usr/lib64/racket/collects/drracket/drracket.rkt: [running body]


My cairo is version 1.12.14.

I tried googling the SIGSEGV MAPERR error and got some other mentions
of the problem dating back a long time, but no-one seemed to have any
clue what was going on.

Marijn

[1]:https://bugs.gentoo.org/show_bug.cgi?id=471978
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.20 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iEYEARECAAYFAlG65M0ACgkQp/VmCx0OL2x/NACgyZKRKfZvB6g6zOAaNID4YpI3
ZBAAoMFLhuOKc0uY5x4tcougoot73I6u
=JIBm
-END PGP SIGNATURE-
_
  Racket Developers list:
  http://lists.racket-lang.org/dev


Re: [racket-dev] `math' compilation time !!!

2013-02-28 Thread Marijn
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 27-02-13 21:51, Neil Toronto wrote:

 (An example that came up in the implementation of matrix norms: the
 type of (sqrt (/ 1 x)) isn't Nonnegative-Real if x :
 Nonnegative-Real, but Complex. Consider x = -0.0. Without TR's
 complaints, `matrix-norm' would have contained a time bomb.)

Should -0.0 really be a Nonnegative-Real?

Marijn
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.19 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iEYEARECAAYFAlEwYUEACgkQp/VmCx0OL2xaggCfUPkt0tdp8fnpo0/ig+3GacNH
fQoAniPJdBWqzQhkJeZ7FU7qdPbhZgQ9
=BH1h
-END PGP SIGNATURE-
_
  Racket Developers list:
  http://lists.racket-lang.org/dev


Re: [racket-dev] Testing whether a procedure gets collected

2012-12-06 Thread Marijn
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 01-12-12 18:45, Neil Toronto wrote:


Rather than a guarantee (or a probabilistic estimate) of actual
collection, could the garbage collector's opinion of what is or isn't
garbage be exposed somehow?

Marijn

-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.19 (GNU/Linux)
Comment: Using GnuPG with undefined - http://www.enigmail.net/

iEYEARECAAYFAlDAUtAACgkQp/VmCx0OL2xK+ACfeSZXDxrYv93gfCu2wlqqnMDW
AIYAn0D/LZsml0eP2625gE92VzjpiMAv
=cEMa
-END PGP SIGNATURE-
_
  Racket Developers list:
  http://lists.racket-lang.org/dev


Re: [racket-dev] Racket doesn't compile without cairo

2012-11-12 Thread Marijn
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 09-11-12 16:33, Eli Barzilay wrote:
 Four hours ago, Sam Tobin-Hochstadt wrote:
 On Fri, Nov 9, 2012 at 4:57 AM, Marijn hk...@gentoo.org wrote:
 I've had a report that building racket without X doesn't work
 if cairo is not installed. Presumably in this mode it should
 not need cairo, right?
 
 Libraries like `racket/draw` and `slideshow/pict` don't need X
 -- they can produce PDFs or PNGs or other formats, but they do
 rely on cairo.
 
 IIUC, Marijn is talking about the required libraries for compiling 
 Racket, and since cairo is used in the doc build, it is needed,
 which (at least in the Fedora package I have) means that you also
 need to have X installed.

Indeed I am inquiring after the libraries required for compiling
Racket. On Gentoo, cairo can be configured ``without X'' (whether X is
installed or not), so if cairo is really needed for building ``without
X'' it is no problem to specify that.

So my question is then, is cairo really needed for compiling the
textual part of Racket or is it a dependency that slipped in by accident?

 Marijn: if this is a problem, you might get around it by avoiding
 the documentation build, but maybe not -- I think that the icon
 build also requires it.

It's not a problem. I'm trying to correct a user-reported error in the
dependencies of the Gentoo Racket package. If I made a wrong
inference/assumption about when cairo is needed, then I want to
correct that. My initial thought though, was that it was an
inadvertent dependency for the textual part.

Marijn
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.19 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://www.enigmail.net/

iEYEARECAAYFAlCgxQoACgkQp/VmCx0OL2yMtgCdGyX0eijd7eM4ypYvza1vhiEu
8s8An1srr12dRMJstmPJ7+oEL3LKI0Gf
=KqA/
-END PGP SIGNATURE-
_
  Racket Developers list:
  http://lists.racket-lang.org/dev


Re: [racket-dev] Racket doesn't compile without cairo

2012-11-12 Thread Marijn
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 11-11-12 18:06, Eli Barzilay wrote:
 Yesterday, Neil Toronto wrote:
 On 11/09/2012 08:33 AM, Eli Barzilay wrote:
 
 Marijn: if this is a problem, you might get around it by
 avoiding the documentation build, but maybe not -- I think that
 the icon build also requires it.
 
 Anything that renders icons at compile time needs Cairo. That 
 includes DrRacket, the macro stepper, algebraic stepper, 
 optimization coach, etc.
 
 So in case Marijn cares: there might be hope for using the
 -textual distribution...

It was my understanding that the textual distribution results in
artefacts that can similarly be obtained by building the ``normal''
distribution but configuring it specifically ``without X''. By
configuring ``without X'' in particular DrRacket doesn't get built, so
there's no problem there.

Marijn
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.19 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://www.enigmail.net/

iEYEARECAAYFAlCgxQwACgkQp/VmCx0OL2zoNwCfS82Ei+iUV7mxRKZHqyIHbeQa
WP8An29XmpYkWcByy6RagBVNJs0XOR7y
=W+Sd
-END PGP SIGNATURE-
_
  Racket Developers list:
  http://lists.racket-lang.org/dev


[racket-dev] internal error when saving as

2012-11-09 Thread Marijn
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi,

in DrRacket 5.3.1 I just got an internal error when trying to Save
As a file to a new name. Selecting a file, hitting search button,
changing the file name and hitting Save. I haven't been able to
reproduce, but different strange things happen. The error:

bytes-path: path string is empty
  context...:
   /usr/lib64/racket/collects/mred/private/wx/gtk/utils.rkt:156:14
   /usr/lib64/racket/collects/mred/private/wx/gtk/filedialog.rkt:58:0:
file-selector
   /usr/lib64/racket/collects/framework/private/finder.rkt:34:4: core312
   /usr/lib64/racket/collects/framework/private/frame.rkt:1411:48:
file-menu:save-as-callback method in ...rk/private/frame.rkt:1240:2
   /usr/lib64/racket/collects/mred/private/mrmenu.rkt:250:14: command
method in basic-selectable-menu-item%
   /usr/lib64/racket/collects/racket/private/more-scheme.rkt:146:2:
call-with-break-parameterization
   /usr/lib64/racket/collects/racket/private/more-scheme.rkt:263:2:
call-with-exception-handler
   /usr/lib64/racket/collects/mred/private/wx/common/queue.rkt:445:6
   /usr/lib64/racket/collects/mred/private/wx/common/queue.rkt:485:32
   /usr/lib64/racket/collects/mred/private/wx/common/queue.rkt:633:3

Marijn
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.19 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://www.enigmail.net/

iEYEARECAAYFAlCcx/oACgkQp/VmCx0OL2wXAwCgj2eQdHigcUG99E8nz72DGmEw
iXUAni72AhlCzSkjEZp2uE29Nus3FaEb
=Nt5Z
-END PGP SIGNATURE-
_
  Racket Developers list:
  http://lists.racket-lang.org/dev


Re: [racket-dev] racket/gui performance problem when using lots of items in table-panels

2012-11-09 Thread Marijn
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 19-07-12 16:59, Marijn wrote:
 Hi,
 
 I've been having some performance problems when using lots of items
 in table-panels[1]. Switching tabs when running the following
 example exhibits the problem. Can anything be done about it?

So it seems a missing container-sequence block was causing unnecessary
extra problems. With it switching tabs is a lot less painful. However,
unfortunately trying to resize the window when showing the second tab
is still glacial/unusable.

Some clarifications:

1) I'm not claiming the problem is in the table-panel class. I'm just
using it as my vehicle to put lots of widgets on the screen. As far as
I can judge there is nothing in table-panel that could cause this
performance problem.

2) This is a test case reduced from a real program. Therefore the way
it goes about recreating widgets cannot be justified without the
context of the larger program. It is still not very small, but I did
not see a way to make it any smaller without destroying the essential
behavior. You can find a reduced test case for just the window
resizing problem below.

Slightly adapted code:

#lang racket/gui

;(require (planet williams/table-panel:1:1/table-panel))
(require table-panel.rkt)

;;; The top-level frame
(define frame
  (new frame%
   (label Table Panel Perf Test)
   (width 500) (height 500)))

(define (current-root-tab)
  (vector-ref root-tab-vector (send root-tab-panel get-selection)) )

(define (delete-all-children area)
  #;(for ((child (send area get-children)))
(send area delete-child child))
  (send area change-children
(lambda (children) '())) )

(define (root-tab-callback tab-panel event)
  (send root-tab-panel change-children
(lambda (children) (list (current-root-tab )

(define root-tab-panel
  (new tab-panel%
   (choices '()#;tab-names)
   (parent frame)
   (callback root-tab-callback)))

(define nr-rows 25)
(define nr-cols 20)

(define on-show-refresh-panel%
  (class table-panel%
(init-field refresher)
(super-new)
(define/override (on-superwindow-show shown?)
  (when shown?
(displayln refreshing!)
(send this begin-container-sequence)
(refresher this)
(send this end-container-sequence)))
))

(define tab1
  (new panel% (parent root-tab-panel)))

(define (build-tab2 tab2)
  (delete-all-children tab2)
  (for* ((r nr-rows)
 (c nr-cols))
(new button%
 (parent tab2)
 (label (format ~a,~a r c))
 (stretchable-width #t)
 (stretchable-height #t)
 (callback
  (lambda (button event)
(printf ~a~n
(send button get-label )  ))

(define tab2
  (new on-show-refresh-panel% (parent root-tab-panel)
   (style '(deleted))
   (alignment '(center center))
   (dimensions `(,nr-rows ,nr-cols))
   (refresher build-tab2)))

(define tabs
  `((,tab1 . Tab 1)
(,tab2 . Tab 2)))

(define tab-names (map cdr tabs))
(define root-tab-vector (list-vector (map car tabs)))

(send root-tab-panel set tab-names)

(send frame show #t)


The window resizing problem is also exhibited by this reduced test case:


#lang racket/gui

;(require (planet williams/table-panel:1:1/table-panel))
(require table-panel.rkt)

(define frame
  (new frame%
   (label Window Resize Perf Test)
   (width 500) (height 500)))

(define nr-rows 30)
(define nr-cols 25)

(define panel
  (new table-panel% (parent frame) (dimensions `(,nr-rows ,nr-cols)) ))

(for* ((r nr-rows)
   (c nr-cols))
  (new button%
   (parent panel)
   (label (format ~a,~a r c))
   (stretchable-width #t)
   (stretchable-height #t)
   (callback
(lambda (button event)
  (printf ~a~n
  (send button get-label )  )

(send frame show #t)


Thanks for any help,

Marijn

[1]:http://planet.racket-lang.org/display.ss?package=table-panel.pltowner=williams
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.19 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://www.enigmail.net/

iEYEARECAAYFAlCczOgACgkQp/VmCx0OL2yx/ACgyM2A1eP/vkDvJCCd1PJBDLek
xC0AoI56WCkNiZJWY210gFxItVs2tP3l
=u64I
-END PGP SIGNATURE-
_
  Racket Developers list:
  http://lists.racket-lang.org/dev


[racket-dev] Racket doesn't compile without cairo

2012-11-09 Thread Marijn
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi,

I've had a report that building racket without X doesn't work if cairo
is not installed. Presumably in this mode it should not need cairo, right?

Marijn
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.19 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://www.enigmail.net/

iEYEARECAAYFAlCc04YACgkQp/VmCx0OL2y9HgCcDHAXS0NdHu72LgORgnslbNPd
+moAnjN2y/htISTz+T/lKk0+qajpfoy+
=VS79
-END PGP SIGNATURE-
_
  Racket Developers list:
  http://lists.racket-lang.org/dev


Re: [racket-dev] racket/gui performance problem when using lots of items in table-panels

2012-07-20 Thread Marijn
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 19-07-12 17:08, Doug Williams wrote:
 I think the problem is the time it takes to create 600 buttons in
 this case, not the time needed to switch between the tabs. I'm not
 sure why you are recreating them each refresh. Am I missing
 something?

This is a cutdown slightly changed testcase for a performance problem
I'm having in a real program. I'm using some tabs that recreate their
contents in my program, because their contents depend on values input
by the user from another tab. In the testcase, imagine that the first
tab is not blank but lets you specify the number of rows and columns
of the table of buttons on tab 2.

Marijn
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.19 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAlAJCm0ACgkQp/VmCx0OL2y6yQCfYPX0yMMNNSUdk5J3FoCeHYg9
Ia4AnRbCOVgH13ZyQN/HbrJXkbTC37a4
=Shso
-END PGP SIGNATURE-
_
  Racket Developers list:
  http://lists.racket-lang.org/dev


[racket-dev] racket/gui performance problem when using lots of items in table-panels

2012-07-19 Thread Marijn
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi,

I've been having some performance problems when using lots of items in
table-panels[1]. Switching tabs when running the following example
exhibits the problem. Can anything be done about it?

Marijn


#lang racket/gui

;(require (planet williams/table-panel:1:1/table-panel))
(require table-panel.rkt)

;;; The top-level frame
(define frame
  (new frame%
   (label Table Panel Perf Test)
   (width 500) (height 500)))

(define (current-root-tab)
  (vector-ref root-tab-vector (send root-tab-panel get-selection)) )

(define (delete-all-children area)
  (send area change-children
(lambda (children) '())) )

(define (root-tab-callback tab-panel event)
  (send root-tab-panel change-children
(lambda (children) (list (current-root-tab )

(define root-tab-panel
  (new tab-panel%
   (choices '()#;tab-names)
   (parent frame)
   (callback root-tab-callback)))

(define nr-rows 30)
(define nr-cols 20)

(define on-show-refresh-panel%
  (class table-panel%
(init-field refresher)
(super-new)
(define/override (on-superwindow-show shown?)
  (when shown?
(displayln refreshing!)
(refresher)))
))

(define tab1
  (new panel% (parent root-tab-panel)))

(define (build-tab2)
  (delete-all-children tab2)
  (for* ((r nr-rows)
 (c nr-cols))
(new button%
 (parent tab2)
 (label (format ~a,~a r c))
 (stretchable-width #t)
 (stretchable-height #t)
 (callback
  (lambda (button event)
(printf ~a~n
(send button get-label )  ))

(define tab2
  (new on-show-refresh-panel% (parent root-tab-panel)
   (style '(deleted))
   (alignment '(center center))
   (dimensions `(,nr-cols ,nr-rows))
   (refresher build-tab2)))

(define tabs
  `((,tab1 . Tab 1)
(,tab2 . Tab 2)))

(define tab-names (map cdr tabs))
(define root-tab-vector (list-vector (map car tabs)))

(send root-tab-panel set tab-names)

(send frame show #t)


[1]:http://planet.racket-lang.org/display.ss?package=table-panel.pltowner=williams
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.19 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAlAIIMoACgkQp/VmCx0OL2x3CgCbBhGkCCroHrEj1giTYA7KYhC4
3sgAoMLUC6S+zouYY4kXm4HFca85odPG
=n8MG
-END PGP SIGNATURE-
_
  Racket Developers list:
  http://lists.racket-lang.org/dev


Re: [racket-dev] implicit begin for define-syntax-rule

2012-05-07 Thread Marijn
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 04-05-12 21:54, Vincent St-Amour wrote:
 I don't think that's what Marijn was suggesting.
 
 I understood it as:
 
 (define-syntax-rule (define-complex real-name imag-name rhs) 
 (define real-name (real-part rhs)) (define imag-name (imag-part
 rhs)))
 
 (define-complex r i 1+2i)
 
 =
 
 (begin (define r (real-part 1+2i)) (define i (imag-part 1+2i)))
 
 
 Marijn, is this what you meant?

Yes, that is indeed what I meant.

I wanted to benefit from being able to use multiple forms as in
lambda, but on second thought I guess this would conflict with `begin'
having a different meaning in macro templates than it does in function
bodies... I should prolly also rethink whether I didn't mean `(let ()
...)' in my code...

Thanks,

Marijn
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.19 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk+n3mcACgkQp/VmCx0OL2xZWQCfWUkdcMHLxbo6DsnT/KnRyUBw
MLcAn0cqH1ptiC7E5XBE43C5lJKba0+x
=FfQt
-END PGP SIGNATURE-
_
  Racket Developers list:
  http://lists.racket-lang.org/dev


Re: [racket-dev] current-*-port

2012-05-07 Thread Marijn
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 04-05-12 05:03, Neil Van Dyke wrote:
 Matthias Felleisen wrote at 05/03/2012 10:57 PM:
 I don't think Eli is proposing an elimination of the old names
 but supplementing the code base with new ones.
 
 I am in favor -- Matthias
 
 Would be good to have a shorter naming convention for all
 parameters. The current- prefix is not short, but it's what I've
 been using when coding new parameters, because that's the
 convention.

How about prefixing a tilda (~) instead of current-? It looks like a
current ;P and also like a snake (parameters could be thought to
``snake'' through the code). Alternatively the at-sign (@) to
represent currentness. To make them stand out more (if that is
desirable) the same symbol could be postfixed as well. In conclusion,
some options are:

~error-port
@error-port
~error-port~
@error-port@

Just some random thoughts,

Marijn
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.19 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk+n4hUACgkQp/VmCx0OL2xyCgCfVhr3/gHu/n0bdRTaCPVaILz7
dOwAnjf1HbYc0nBy/hnqWax9C1AQE765
=qgJq
-END PGP SIGNATURE-
_
  Racket Developers list:
  http://lists.racket-lang.org/dev


[racket-dev] implicit begin for define-syntax-rule

2012-05-03 Thread Marijn
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi,

would it make sense for define-syntax-rule to have an implicit begin
such that it could accept multiple forms for the template?

Marijn
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.19 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk+iUj4ACgkQp/VmCx0OL2zrmACfQ18nV7BoxV2wm4SrPyCSD0rY
z54An3Kd24mFWFVuCxQ95J1Z6I5EuEJy
=fmgP
-END PGP SIGNATURE-
_
  Racket Developers list:
  http://lists.racket-lang.org/dev


Re: [racket-dev] platform dependence with tab-panel callback

2012-03-12 Thread Marijn
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 10-03-12 19:00, Matthew Flatt wrote:
 I've fixed the Gtk and Cocoa bindings to never invoke a
 `tab-panel%' callback when the tab changes indirectly via the
 `set', `append', or `delete' method.

Thanks!

 It's possible that you were hoping to have the callback invoked
 more often on Windows, instead of less often on Gtk, but
 `racket/gui' is meant to invoke callbacks only in response to user
 actions.

Not really; all I was looking for was the consistency that you've now
established.

Marijn
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.18 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk9d1bwACgkQp/VmCx0OL2wzVACeMh6HrshHqtQTiZaFwbuyWxOR
PDIAnAnc1Eztp2Osa7gd9Aigh6kTmy/O
=BeX6
-END PGP SIGNATURE-
_
  Racket Developers list:
  http://lists.racket-lang.org/dev


[racket-dev] platform dependence with tab-panel callback

2012-03-05 Thread Marijn
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi,

if you create a tab-panel with a callback, then on GNU/Linux the
callback is called once by the system, but on Windows 7 it isn't. This
can result in different initial tab visibility. For example:


#lang racket/gui

(define root
  (new frame% (width 300) (height 300)
   (label Test tabs)))

(define (tab-callback tab-panel event)
  (send tab-panel change-children
(lambda (children)
  (list
   (vector-ref tab-vector
   (send tab-panel
 get-selection))

(define tab-panel
  (new tab-panel% (parent root)
   (callback (lambda (tab-panel event)
   (displayln called!)
   (tab-callback tab-panel event)))
   (choices '(

(define tab1
  (new panel% (parent tab-panel)
   (style '(deleted ; ===

(define tab2
  (new panel% (parent tab-panel)
   (style '(deleted

(define msg1
  (new message% (parent tab1)
   (label visible?)))

(define tabs
  `((,tab1 . t1)
(,tab2 . t2)))

(define tab-names (map cdr tabs))
(define tab-vector (list-vector (map car tabs)))

(send tab-panel set tab-names)

(send root show #t)


The difference in this example is caused by all tabs being initially
deleted and the callback always enabling one tab. Arguably this is not
a valid configuration (I don't know), but there are other ways to
tickle this difference that don't rely on that: any effectful callback
would exhibit the difference. Is it possible to remove this
platform-dependent difference?

Marijn
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.18 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk9U104ACgkQp/VmCx0OL2wNlgCeKYg8aGBi0182hcZI0415tqfT
BHEAnR7h+hNlPBXpZYbaKjTuDgkgpu96
=7rnA
-END PGP SIGNATURE-
_
  Racket Developers list:
  http://lists.racket-lang.org/dev


Re: [racket-dev] very unhelpful beginner language error message, possible fix proposed

2012-02-13 Thread Marijn
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 10-02-12 23:38, John Clements wrote:
 A user on stackoverflow had a question about this code:
 
 (define list-sum-odd (lambda (list) (cond ((null? list) 0) ((odd?
 (car list)) (+ (car list) (list-sum-odd (cdr list (list-sum-odd
 (cdr list)
 
 
 (list-sum-odd '(3 4 5))
 
 ... which signalled an error. In #lang racket, you get
 
 +: expects type number as 2nd argument, given: '(5); other
 arguments were: 3
 
 ... which is the right error for #lang racket. The response showed
 him that he'd forgotten the else in his last clause.
 
 Ho Ho! thought I. Beginner Student Racket will give a much
 better error message. Actually, though, the error message was much
 worse: it highlighted the id list-sum-odd in what should have
 been the 'else' case, and wrote:
 
 list-sum-odd: expected a function call, but there is no open
 parenthesis before this function
 
 ... which is really terrible, because there *IS* a parenthesis
 right before the function name.

How about changing the message such that it complains about a shortage
of parentheses without stating that there are none?

- - expected a function call, but there is an open parenthesis missing
before this function name

Or maybe formulate it in a positive way to encourage the user to
insert parentheses?

- - expected a function call, but found a function name; to call it add
surrounding parentheses

Marijn
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.18 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEUEARECAAYFAk844HoACgkQp/VmCx0OL2yVKACXWLUXrftUvkaqxqMkmK0LY/UO
OwCgmulM/kFmLsxoQfv4t+flPv9D4G8=
=/Yj0
-END PGP SIGNATURE-
_
  Racket Developers list:
  http://lists.racket-lang.org/dev


Re: [racket-dev] problem with require and frtime

2012-01-19 Thread Marijn
On 18-01-12 17:47, Matthew Flatt wrote:
 At Wed, 18 Jan 2012 12:02:10 +0100, Marijn wrote:
 I would expect both forms to work. This is a reduction of a different
 problem possibly caused by these issues here.

So I tried to cut down my program to a reasonably sized test-case which
is attached to this email. model.rkt contains (what's left of) the model
macro, demo1.rkt contains a small model and a (require frtime). If you
do racket demo1.rkt then you get the following error:


model.rkt:30:17: make-entry: bad syntax in: (make-entry (= profit
(for/hash ((y years)) (values y (- (hash-ref income y 0) (hash-ref
expenses y 0) (years income expenses profit))

 === context ===
standard-module-name-resolver


but if you comment the (require frtime) then the error goes away. I have
other code that tests this same simple-economy model with the
non-cutdown version of the model macro and supporting code and
everything seems to work fine.

Any idea what's going on here?

Marijn
#lang racket/gui

;;; comment this line to make error go away
(require frtime)

(require model.rkt)

(define simple-economy
  (model make-immutable-hash hash-ref
   ((? years #f)
(? income (hash))
(? expenses (hash))

(= profit   
   (for/hash ((y years))
 (values
  y
  (- (hash-ref income y 0)
 (hash-ref expenses y 0)   )))
#lang racket

(provide model)

(struct variable ((value #:mutable) rule))

(define-syntax make-store
  (syntax-rules ()
((_ _make-store_ _get-value_ ((_type_ _id_ _args_ ...) ...))
 (let-syntax
 ((make-entry
   (syntax-rules (? =)
 ((_ (? __id__  __init-value__) __other-ids__)
  `(__id__ . ,(variable __init-value__ #f)))
 ((_ (= __id__ __rule__) (__other-id__ (... ...)))
  `(__id__
.
,(variable
  #f
  (lambda ()
(let-syntax
((__other-id__
  (syntax-id-rules ()
(_ (_get-value_ '__other-id__
 (... ...))
  __rule__
   (letrec
   ((store
 (_make-store_
  `(,(make-entry (_type_ _id_ _args_ ...) (_id_ ...)) ...)) ))
 store)

(define-syntax model
  (syntax-rules ()
((_ _make-store_ _store-ref_ ((_type_ _id_ _args_ ...) ...))
 (let ()
   (define (get-variable id) (_store-ref_ store id))
   (define (get-value id) (variable-value (get-variable id)))
   (define store (make-store _make-store_ get-value ((_type_ _id_ _args_ 
...) ...)))

   (match-lambda*
((list 'get id) (get-value id)))
   


signature.asc
Description: OpenPGP digital signature
_
  Racket Developers list:
  http://lists.racket-lang.org/dev


Re: [racket-dev] FrTime propagation bug

2012-01-13 Thread Marijn
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 12-01-12 18:27, Gregory Cooper wrote:
 Hi Marijn,
 
 The value-now/sync procedure waits for propagation to complete
 before reading a signal's value.  Would something like the
 following suit your purposes?
 
 (define a (event-receiver)) (define b (event-receiver)) (define a+b
 (+ (hold a) (hold b))) (send-event a 3) (send-event b 5) 
 (value-now/sync a+b)  ; read a+b after propagation = 8
 
 Or, even simpler:
 
 (define c (new-cell)) (define d (new-cell)) (define c+d (+ c d)) 
 (set-cell! c 3) (set-cell! d 5) (value-now/sync c+d)
 
 Greg

Thanks Greg, that helps a lot,

Marijn
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.18 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk8P8XkACgkQp/VmCx0OL2z0zACeJC+KOeUcuykFuCo8zfUv/nnm
RhQAnAvkx7TelLpiQHqSHr26Pu0BC8Ib
=KRNI
-END PGP SIGNATURE-
_
  Racket Developers list:
  http://lists.racket-lang.org/dev


Re: [racket-dev] racket unlinking bigloo lib

2012-01-12 Thread Marijn
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 10-01-12 15:25, Matthew Flatt wrote:
 At Tue, 10 Jan 2012 11:31:19 +0100, Marijn wrote:
 Racket calls `ldconfig -n /usr/lib' in the course of doing `make 
 install' and this causes one of bigloo's shared object symlinks
 to be unlinked. I don't think racket should be calling ldconfig.
 
 That call comes from `libtool --mode=finish'. I'm no libtool
 expert,but my understanding is that `libtool --mode=finish' is
 needed in general when installing via `libtool'.

I'm far from an expert on libtool.

Using DESTDIR everything including shared libraries is installed in a
staging area by `make install'. Files will only be moved to the ``live
filesystem'' by the package manager after things like make install
have finished running. Currently `libtool --mode=finish' is run on the
``live filesystem'' library directory. This should not have any effect
on anything in the staging area.

Thus `libtool --mode=finish' should either be run on the DESTDIR
staging area or not at all.

Marijn
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.18 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk8OpxwACgkQp/VmCx0OL2z5BwCffdwgsr8LNua1whRL+WRawQ6a
VasAoIqZPcXdzllC4X8WchOlK/rxmeGa
=f3vP
-END PGP SIGNATURE-
_
  Racket Developers list:
  http://lists.racket-lang.org/dev


Re: [racket-dev] check-syntax (require plot) hangs drracket

2012-01-11 Thread Marijn
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 15-12-11 15:29, Robby Findler wrote:
 Hm. Mysterious. Thanks for trying all this stuff. I'll let you know
 if I think of something else to try.
 
 And sorry for the annoyance.
 
 Robby

Hi Robby,

as it turns out this bug seems to have been caused by the recently
fixed locale bug (that caused .1 to be read as .0) and works fine now.
At least it doesn't hang drracket any more. Without screenshots it is
hard to say whether it does what is expected.

Anyway, I'm just glad it is working now,

Marijn
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.18 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk8NkVYACgkQp/VmCx0OL2wLpACfRB+wnDnMF/3mDkaCVwvQtWMi
CPoAn1Rdo2LJTsh/OvfCtVaDYL8MAw7B
=SHpb
-END PGP SIGNATURE-
_
  Racket Developers list:
  http://lists.racket-lang.org/dev


Re: [racket-dev] XREPL and readline-6.*

2012-01-11 Thread Marijn
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 19-12-11 16:45, Marijn wrote:
 Hi,
 
 just tried out XREPL and it turns out it complains about not
 finding libreadline.so.5:
 
 $ racket Welcome to Racket v5.2.0.7.
 (require xrepl)
 ; Warning: no readline support (ffi-lib: couldn't open 
 libreadline.so.5 (libreadline.so.5: cannot open shared object
 file: No such file or directory)) -
 
 that makes sense as my installed and the current upstream readline 
 version is 6.2. Any chance that could be fixed?

This is still current,

Marijn
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.18 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk8NkdkACgkQp/VmCx0OL2yidwCgiM5vvpEb6Gpb0cnUJJAB63y/
zhQAnAu9qzXVNHtCeVRahOiZXLzwk2W5
=BnOt
-END PGP SIGNATURE-
_
  Racket Developers list:
  http://lists.racket-lang.org/dev


Re: [racket-dev] installing XREPL

2012-01-11 Thread Marijn
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 19-12-11 16:50, Marijn wrote:
 Hi,
 
 XREPL is said to be able to edit your .racketrc in the docs, but 
 apparently doesn't cope well with that file not existing yet:
 
 $ racket Welcome to Racket v5.2.0.7.
 (require xrepl)
 ; Warning: no readline support (ffi-lib: couldn't open 
 libreadline.so.5 (libreadline.so.5: cannot open shared object
 file: No such file or directory)) - ,install! file-size: file not
 found: /home/marijn/.racketrc -
 
 and indeed it doesn't get created:
 
 $ cat ~/.racketrc cat: /home/marijn/.racketrc: No such file or
 directory

This is still current,

Marijn
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.18 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk8Nkf8ACgkQp/VmCx0OL2yx1QCfWvUWB2dkAAAX8oSe7GgZp8t+
MpQAnj8ERz83opx++XJS7qGkT3GCPBbe
=dgis
-END PGP SIGNATURE-
_
  Racket Developers list:
  http://lists.racket-lang.org/dev


Re: [racket-dev] application:current-app-name not appearing in Help menu

2012-01-11 Thread Marijn
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 27-12-11 11:04, Marijn wrote:
 Hi,
 
 the docs for application:current-app-name say that it is used in
 the Help menu, but that doesn't seem to work for the following
 program:
 
 
 #lang racket/gui
 
 (require framework)
 
 (application:current-app-name Land Usage Calculator)
 
 (define root-frame (new (frame:standard-menus-mixin frame:basic%) 
 (label (application:current-app-name)) (width 200) (height 200) ))
 
 (send root-frame show #t)

This program still has an empty Help menu,

Marijn
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.18 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk8NksUACgkQp/VmCx0OL2woJgCghTK1eV5IC1hxOOdGkiV4XRoO
F9MAnRwMXO5ntSHrV9395tIZb/OujH1b
=Dh+0
-END PGP SIGNATURE-
_
  Racket Developers list:
  http://lists.racket-lang.org/dev


[racket-dev] FrTime propagation bug

2012-01-11 Thread Marijn
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi,

Consider:


#lang racket

(require frtime)

(define a (event-receiver))
(define b (hold a))

(send-event a 3)

;;; uncomment next line to make it work
;(value-now (hold a))
(value-now b)


`a' is an event-stream onto which the value 3 is sent. `b' is the
behavior produced by holding the last value seen on `a'. After the
value 3 arrives on `a', `b' should hold to 3. But it doesn't unless
you ``help'' frtime a bit...

Marijn
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.18 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk8Ns/8ACgkQp/VmCx0OL2yahwCcDFs/1kL+m4PVhfmPdkjTQTcu
KmMAnjLaAAHPYvCM1eKkLXl0EBCuXRkE
=mrh9
-END PGP SIGNATURE-
_
  Racket Developers list:
  http://lists.racket-lang.org/dev


[racket-dev] racket unlinking bigloo lib

2012-01-10 Thread Marijn
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi lists, Matthew, Manuel,

this is about Gentoo bug 379931[1] which I'll summarize here.

Racket calls `ldconfig -n /usr/lib' in the course of doing `make
install' and this causes one of bigloo's shared object symlinks to be
unlinked.
I don't think racket should be calling ldconfig.
On the other hand, I am not sure that I know of any good reason why
calling ldconfig should cause that unlink to happen (which isn't
saying very much). Could it be that bigloo also does something funny here?

Marijn

[1]:https://bugs.gentoo.org/show_bug.cgi?id=379931
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.18 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk8ME3cACgkQp/VmCx0OL2zTVgCdGvtJWKNYkorDY2SWmThpoaIJ
zrUAoKJWcDf/qUvcutHQp8+4dJZ/FVhr
=Lhld
-END PGP SIGNATURE-
_
  Racket Developers list:
  http://lists.racket-lang.org/dev


Re: [racket-dev] no capturing groups in regexp-split? [was Re: [PATCH] add regexp-split]

2011-12-30 Thread Marijn
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 30-12-11 09:32, Eli Barzilay wrote:
 This doesn't look like an issue that is related to guile, just that
 he chose python as the goal...  The first other random example I
 tried was `split-string' in Emacs, which did the same thing as
 Racket.

They may choose python's version as the goal. It doesn't look like
they have looked very hard as of yet at what else is out there.
Probably because they are expecting compatibility between most
implementations.

 
 Welcome to Racket v5.2.0.7.
 (regexp-split ([^0-9])  123+456*/)
 '(123 456  )
 
 should it be considered a bug in racket that it doesn't support 
 capturing groups in regexp-split?
 
 No.
 
 
 Without the capturing group the results are identical: [...]
 
 Which is expected.

Good, just establishing a baseline here, but it is good that some
compatibility is *expected*. How nice is that? Since we're expecting
compatibility between python and racket, I guess it goes without
saying that racket's and guile's regexp-split should be compatible as
well. R7RS Large may standardize a regular expression library, and we
can make that easier by reducing incompatibilities between schemes. We
can all grow from examining our incompatibilities, discussing them and
sometimes resolving them.

 Python does something which is IMO very weird:
 
 re.split(([^0-9]), 123+456*/)
 ['123', '+', '456', '*', '', '/', '']
 
 It's even more confusing with multiple patterns:
 
 re.split(([^0-9]([0-9])), 123+456*/)
 ['123', '+4', '4', '56*/']
 
 There's probably uses for that -- at least for the simple version
 with a single group around the whole regexp, but that's some hybrid
 of `regexp-split' and `regexp-match*': it returns something that 
 interlevase them, which can be useful, but I'd rather see it with
 a different name.

Yes, I agree that I find it a bit weird as well.

You don't lose anything by supporting this though, since you can
always use a non-capturing group, but I do agree that it can be
considered an inappropriate extension of the meaning of regexp-split.
I'll be sure to raise these issues on the guile list.

 We've talked semi-recently about adding an option to
 `regexp-match*' so it can return the lists of matches for each
 pattern, perhaps add another option for returning the unmatched
 sequences between them, and give the whole thing a new name?
 (Something that indicates it being the multitool version of all of
 these.)

Interesting.

Marijn
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.18 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk79i1QACgkQp/VmCx0OL2zI4gCgtLLd3b6vgzaksYSA7wsZksHA
yeIAoJJ6G7AcimN3OhtxFMvN8Xf7TdrH
=1+Ax
-END PGP SIGNATURE-
_
  Racket Developers list:
  http://lists.racket-lang.org/dev


Re: [racket-dev] .1 evaluates to 0.0 [was Re: plot doesn't plot (inexact-exact: no exact representation for +nan.0)]

2011-12-29 Thread Marijn
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 28-12-11 13:18, Matthew Flatt wrote:
 Thanks for all the new info! I don't think that it's a bytcode
 problem. I start to wonder if it's in number parsing...
 
 On line 1102 of src/racket/src/numstr.c, there's a call to
 STRTOD(). Does it change anything if you wrap that call with calls
 to scheme_push_c_numeric_locale() and
 scheme_pop_c_numeric_locale(loc)?:
 
 { GC_CAN_IGNORE char *loc; loc = scheme_push_c_numeric_locale(); d
 = STRTOD(ffl_buf, ptr); scheme_pop_c_numeric_locale(loc); }

Hi Matthew,

you're certainly on the right track. I tried starting drracket in this
way:

LC_ALL=en_US.UTF-8 drracket 

and almost all symptoms were gone.

Marijn
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.18 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk78JkIACgkQp/VmCx0OL2wedgCfSApHFEmJ6GojTYbTGg/fY4fz
LjoAnREzYAr9VYv/BZyAJEWYNunWNK9s
=1ZSi
-END PGP SIGNATURE-
_
  Racket Developers list:
  http://lists.racket-lang.org/dev


Re: [racket-dev] .1 evaluates to 0.0 [was Re: plot doesn't plot (inexact-exact: no exact representation for +nan.0)]

2011-12-29 Thread Marijn
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 28-12-11 17:08, Neil Toronto wrote:
 On 12/28/2011 05:18 AM, Matthew Flatt wrote:
 Thanks for all the new info! I don't think that it's a bytcode
 problem. I start to wonder if it's in number parsing...
 
 On line 1102 of src/racket/src/numstr.c, there's a call to
 STRTOD(). Does it change anything if you wrap that call with
 calls to scheme_push_c_numeric_locale() and
 scheme_pop_c_numeric_locale(loc)?: ...
 
 Locales? Then maybe I wasn't crazy for thinking the bug might 
 discriminate against people whose first language isn't English?
 Laurent speaks French and I think Marijn speaks Dutch.

Locales are a beautiful thing, but they also cause many many weird
issues... but it is ever so annoying to see a numeric date and have to
wonder which is months and which is days (for exmaple in Thunderbird),
so I configured my locale to be a wonderful mix of nl_NL and en_US...

 (Beautiful country, BTW, Marijn. I was at Avifauna for a
 conference.)

Thanks!

 I had an email about this ready, but then I tried switching
 DrRacket's language to French and Dutch to see if I could duplicate
 it. I couldn't, so I deleted the email.

I think to switch the locale you would have to do some more work, like
set an environment variable.

Marijn
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.18 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk78KNcACgkQp/VmCx0OL2yOJgCfVmeUIb7/KyJFfkRXGNoNXb8p
fksAnRFYz2ez3HpQgEN3AXxK7iFCZ5vP
=Nrgv
-END PGP SIGNATURE-
_
  Racket Developers list:
  http://lists.racket-lang.org/dev


Re: [racket-dev] .1 evaluates to 0.0 [was Re: plot doesn't plot (inexact-exact: no exact representation for +nan.0)]

2011-12-29 Thread Marijn
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 29-12-11 09:55, Laurent wrote:
 
 you're certainly on the right track. I tried starting drracket in
 this way:
 
 LC_ALL=en_US.UTF-8 drracket 
 
 
 Same here: LC_ALL=en_US.UTF-8 gracket
 
 Welcome to Racket v5.2.0.6. This is a simple window for evaluating
 Racket expressions. Quit now and run DrRacket to get a better
 window. The current input port always returns eof.
 .3
 0.3
 
 
 Great!
 
 *However*, this did not work with: LC_ALL=fr_FR.UTF-8 gracket

Because the french locale uses comma (,) as the decimal separator like
my dutch one and unlike the english one which uses dot (.). So when
the locale-aware C number reading function gets to it and sees (.) it
fails to recognize is as a valid number character. Now that I've
thought about it more the weird behavior where it starts working
correctly after having seen a number bigger than 1.0 smells like an
unmatched push/pop locale pair. Might this then not also cause quite a
big locale stack to be allocated? Finally I wanted to ask if it was
possible that the automated tests are run with a non-english or random
locale.

Matthew, I still wanted to remark that I find it strange that plain
racket did not exhibit the same locale-dependence. Do you have an
explanation for that? Does it read some =1.0 float causing the locale
stack to become ``seeded'' (due to postulated unmatched push/pop).

BTW Perhaps coccinelle (http://coccinelle.lip6.fr/) can help identify
(and automatically fix) the unmatched uses of the locale stack.

Marijn
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.18 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk78ND0ACgkQp/VmCx0OL2xrMwCgyRftnjOkQfIA3rpWKKwT7dKh
KaAAoIDRW5XBM9d87FQ1CbCVUhpXPREm
=Sw9a
-END PGP SIGNATURE-
_
  Racket Developers list:
  http://lists.racket-lang.org/dev


[racket-dev] no capturing groups in regexp-split? [was Re: [PATCH] add regexp-split]

2011-12-29 Thread Marijn
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi,

this just appeared on guile-devel, but it seems to have exposed a bug
in racket.

On 29-12-11 10:32, Nala Ginrut wrote:
 hi guilers! It seems like there's no regexp-split procedure in
 Guile. What we have is string-split which accepted Char only. So
 I wrote one for myself.
 
 --python code-
 import re re.split(([^0-9]), 123+456*/)
 [’123’, ’+’, ’456’, ’*’, ’’, ’/’, ’’] code end---
 
 The Guile version:
 
 --guile code--- (regexp-split ([^0-9])  123+456*/) 
 ==(123 + 456 *  / ) --code end
 
 Anyone interested in it?

Welcome to Racket v5.2.0.7.
 (regexp-split ([^0-9])  123+456*/)
'(123 456  )

should it be considered a bug in racket that it doesn't support
capturing groups in regexp-split? Without the capturing group the
results are identical:

 import re re.split([^0-9], 123+456*/)
['123', '456', '', '']

 (regexp-split [^0-9]  123+456*/)
'(123 456  )

Marijn
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.18 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk78QJUACgkQp/VmCx0OL2xi1ACgu2CbR7PPti7KZVkqAHvW9Cep
VO0AnAm0fWP+q6BH/zcqOd3TuaSEiarN
=xuUl
-END PGP SIGNATURE-
_
  Racket Developers list:
  http://lists.racket-lang.org/dev


[racket-dev] require does not recognize filenames with '' in them

2011-12-29 Thread Marijn
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi,

require doesn't seem to like filename with '' in them:

$ FILENAME=file-with-long-name; echo '(module bert racket (displayln
42))'  ${FILENAME}  racket -e (require \${FILENAME}\); rm
${FILENAME}
42
$ FILENAME=file-with-long-name; echo '(module bert racket
(displayln 42))'  ${FILENAME}  racket -e (require
\${FILENAME}\); rm ${FILENAME}
#f::0: require: bad module-path string at: file-with-long-name in:
(require file-with-long-name)

 === context ===
/usr/lib64/racket/collects/racket/private/reqprov.rkt:243:14:
transform-simple
/usr/lib64/racket/collects/racket/private/reqprov.rkt:222:2

Marijn
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.18 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk78SPIACgkQp/VmCx0OL2wP4wCgs0uuuAzzVR/gtE36H3QXL0wy
y7QAn0Uf2qIyjeblQLH07JuQCNqunAe1
=HR6A
-END PGP SIGNATURE-
_
  Racket Developers list:
  http://lists.racket-lang.org/dev


[racket-dev] application:current-app-name not appearing in Help menu

2011-12-27 Thread Marijn
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi,

the docs for application:current-app-name say that it is used in the
Help menu, but that doesn't seem to work for the following program:


#lang racket/gui

(require framework)

(application:current-app-name Land Usage Calculator)

(define root-frame (new (frame:standard-menus-mixin frame:basic%)
(label (application:current-app-name))
(width 200)
(height 200) ))

(send root-frame show #t)


Marijn
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.18 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk75mEoACgkQp/VmCx0OL2xClgCeMUZ6Xn8UBPH3PNZ225yiYQQb
xXEAn29Z77e/r+slBRmGHtcJktBhRESf
=UWwC
-END PGP SIGNATURE-
_
  Racket Developers list:
  http://lists.racket-lang.org/dev


[racket-dev] frame:editor-mixin not happy with a text%

2011-12-27 Thread Marijn
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi,

according to the docs a frame:editor-mixin requires an editor%
argument that is an editor%[1], but it really wants its argument to be
a editor:basic-mixin.


#lang racket/gui

(require framework)

(application:current-app-name Land Usage Calculator)

(define root-frame (new (frame:editor-mixin
(frame:standard-menus-mixin frame:basic%))
(filename Untitled)
(editor% (editor:basic-mixin text%))
#;(editor% text%) ))

(define root (send root-frame get-area-container))

(send root-frame show #t)


Marijn

[1]:http://docs.racket-lang.org/framework/Frame.html?q=default%20key%20bindingsq=menu-bar#%28def._%28%28lib._framework/main..rkt%29._frame~3aeditor-mixin%29%29
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.18 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk75m/wACgkQp/VmCx0OL2zetgCfQc/xnXrXOtoDW53tOwIajL3Z
nqgAnjoc4L2tO6AGp/0QEJeA4le1Nmu7
=G+DM
-END PGP SIGNATURE-
_
  Racket Developers list:
  http://lists.racket-lang.org/dev


[racket-dev] .1 evaluates to 0.0 [was Re: plot doesn't plot (inexact-exact: no exact representation for +nan.0)]

2011-12-27 Thread Marijn
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 24-12-11 16:23, Matthew Flatt wrote:
 At Wed, 14 Dec 2011 16:49:23 +0100, Marijn wrote:
 #lang racket (* .1 pi)
 
 produces 0.0 reliably in a freshly started drracket even when 
 rerunning it, but:
 
 $ racket -e '(* .1 pi)' 0.3141592653589793
 
 and the program:
 
 #lang racket pi (* .1 pi)
 
 on the first run (drracket again) produces:
 
 3.141592653589793 0.0
 
 while on subsequent runs it produces:
 
 3.141592653589793 0.3141592653589793
 
 Thanks --- this is very helpful!
 
 I'm still stumped, unfortunately. It looks the same as PR 12070,
 which we never figured out:
 
 http://bugs.racket-lang.org/query/?debug=database=defaultcmd=view+audit-trailcmd=viewpr=12070

Interesting!,
 
though it is a bit hard to read the Audit Trail because
everything is jumbled together.

I reproduce that bug and step 7) and 8) can be replaced with a single
re-evaluate for me.

It seems to indicate very clearly that the problem is in the floating
point start-up somehow and has nothing to do with `pi' or variable
references.

Another possibility would be that multiplication (*) was at fault, but
my new smallest test-case rules that out:

#lang racket
.1

= 0.0

And actually it works also directly in the REPL without running any
program:

Welcome to DrRacket, version 5.2.0.7--2011-12-15(-/f) [3m].
Language: racket; memory limit: 128 MB.
 .1
0.0
 1
1
 .1
0.0
 .2
0.0
 .3
0.0
 .4
0.0
 .5
0.0
 .6
0.0
 .7
0.0
 .8
0.0
 .9
0.0
 1.0
1.0
 .1
0.1

So should we look at the byte-code produced for this (how does one do
that and what is the expected code)?
Is there some way to invoke racket from the command line in such a way
that it behaves like the drracket initial repl?
How does one run the byte-code?

What external suspects are there? I suppose gcc, but are there any
other? My CFLAGS are set to a very conservative AFAIK
CFLAGS=-march=native -ggdb -O2 -pipe, currently on version 4.5.3.

Marijn


-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.18 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk75x5IACgkQp/VmCx0OL2xZRACcC8dubYCSNXScyOG8wdJQxxN1
xAgAnRVKv8YpTWODEKn2qEMMhcXHZLSk
=n+xT
-END PGP SIGNATURE-
_
  Racket Developers list:
  http://lists.racket-lang.org/dev


Re: [racket-dev] Racket home page proposal [and 1 more messages]

2011-12-22 Thread Marijn
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 21-12-11 18:57, Eli Barzilay wrote:
 Since I'm talking, I might as well mention my personal opinion
 on the strong points of racket (besides the (non-)obvious ones
 of having advanced macros, first-class continuations and all that
 kind of stuff) since these might be worth mentioning on the front
 page: [...gui...] [...web-server...]
 
 Yeah, including these things would be good, if someone can compose
 a similarly short and understandable and not-too-buzz-wordy text
 out of them.

Right, so let's brainstorm a bit.

GUI:
cross-platform native GUI library
unified native GUI programming for Windows, OS X and Linux
native cross-platform widgets
cross-platform graphics
cross-platform graphical library
that supports writing cross-platform native GUI applications

Web:
continuation-enabled web server
direct style web programming
direct style web programming with continuation-enabled web server
non-inverted web programming
writing web applications as normal programs
that let's you write web applications as normal programs
that let's you write web applications without inverting control flow

Racket:
Racket is a unique general-purpose programming language with strong
support for domain-specific languages, that enables you to do unified
native GUI programming for Windows, OS X and Linux, and let's you
write web applications without inverting control flow.

Who's next? ;P

Marijn
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.18 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk7y8iAACgkQp/VmCx0OL2wuOACfS96l5P6nDCcJwW9V0R0O35Qp
Y7wAnioWjgJmXru3m3jt8GOZy4bKq2YG
=u51W
-END PGP SIGNATURE-
_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/dev


Re: [racket-dev] Racket home page proposal

2011-12-21 Thread Marijn
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 20-12-11 21:28, Eli Barzilay wrote:
 | platform for language design and implementation.
 
 That means almost nothing to most people.  Even something like
 Racket is a Programmable Language works better...  I don't think
 that there's a way to make it clear in a short sentence, but if
 there is, it should most definitely get included.

Some while ago you and me talked on irc about a short one-sentence
description of the racket package for Gentoo. IIRC the conclusion was
that you weren't unhappy with me using:

Racket is a general-purpose programming language with strong support
for domain-specific languages.

Maybe that is a good start to finally improve over just Racket is a
programming language..

Since I'm talking, I might as well mention my personal opinion on the
strong points of racket (besides the (non-)obvious ones of having
advanced macros, first-class continuations and all that kind of stuff)
since these might be worth mentioning on the front page:

*) The cross-platform native GUI library is a big part of why I'm
interested in Racket at all. It looks like the plot library makes this
already awesome (and I believe still quite unique) feature even more
awesome (at least for the applications that I'm interested in these days).

*) The support for writing web applications in ordinary direct style.
Though I haven't really tried it out yet, if the times comes I would
definitely try racket for this first.

Marijn
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.18 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk7xoPkACgkQp/VmCx0OL2x6QACfdjGoHJZzG7JTyhpcy5nMig6x
2ZgAn0W4eD0xf6DYTWh+xkMxxamJcTTC
=1LGq
-END PGP SIGNATURE-
_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/dev


[racket-dev] XREPL and readline-6.*

2011-12-19 Thread Marijn
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi,

just tried out XREPL and it turns out it complains about not finding
libreadline.so.5:

$ racket
Welcome to Racket v5.2.0.7.
 (require xrepl)
; Warning: no readline support (ffi-lib: couldn't open
libreadline.so.5 (libreadline.so.5: cannot open shared object file:
No such file or directory))
- -

that makes sense as my installed and the current upstream readline
version is 6.2. Any chance that could be fixed?

Marijn
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.18 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk7vXBwACgkQp/VmCx0OL2zjlwCfX9fY6jYWzXv5Dq1T7qNYB8jp
MZMAoIXGK2e48jJh28A2abGtWu5CNQwE
=demb
-END PGP SIGNATURE-
_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/dev


[racket-dev] installing XREPL

2011-12-19 Thread Marijn
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi,

XREPL is said to be able to edit your .racketrc in the docs, but
apparently doesn't cope well with that file not existing yet:

$ racket
Welcome to Racket v5.2.0.7.
 (require xrepl)
; Warning: no readline support (ffi-lib: couldn't open
libreadline.so.5 (libreadline.so.5: cannot open shared object file:
No such file or directory))
- - ,install!
file-size: file not found: /home/marijn/.racketrc
- -

and indeed it doesn't get created:

$ cat ~/.racketrc
cat: /home/marijn/.racketrc: No such file or directory

Marijn
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.18 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk7vXTcACgkQp/VmCx0OL2yurACeN7MgxZmzrtvakW359iNdB0+Y
2JoAn2T3Hik2gvJd59sLhTdDS0MKax5X
=RdjZ
-END PGP SIGNATURE-
_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/dev


Re: [racket-dev] check-syntax (require plot) hangs drracket

2011-12-15 Thread Marijn
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 13-12-11 11:57, Robby Findler wrote:
 Thanks for checking back in. In retrospect, that was a stupid
 change of mine.
 
 I've reverted it and pushed a different attempt. The current change
 is unlikely to be the right long-term solution, but I'm curious to
 see if it improves things for you at least.

Hi Robby, I'm sorry to disappoint again, but there was no change to
the observed behavior.

Marijn
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.18 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk7pslgACgkQp/VmCx0OL2xr0ACgtwMFYdLmRnsfex9PS5lfJ4lX
iJsAoLb9JuRHpM+SJMgfuDVOgVblWQj1
=Ulky
-END PGP SIGNATURE-
_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/dev


Re: [racket-dev] check-syntax (require plot) hangs drracket

2011-12-13 Thread Marijn
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 06-12-11 23:14, Robby Findler wrote:
 I've pushed a change that I think (hope) fixes this.
 
 Robby

Hi Robby, I'm sorry to disappoint, but the issue is still there with
this morning's master.

Marijn
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.18 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk7nHGkACgkQp/VmCx0OL2wVIwCff4v831EIkc0ZsPANG1xikoRV
4N4An0MCyTXbDlpcBN0MZgRMlXI/uLD9
=z8Nt
-END PGP SIGNATURE-
_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/dev


Re: [racket-dev] plot doesn't plot (inexact-exact: no exact representation for +nan.0)

2011-12-13 Thread Marijn
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 07-12-11 19:46, Neil Toronto wrote:
 I just pushed a change that should keep it from raising an error.
 Can you get the latest and try it? If there's no error, will you
 please send me (personally, not the list) a screenshot of the
 result?

The error is gone now, and I will send you a screenshot privately.
Interestingly, after playing with it for a while, suddenly when I run
it the plot produced has a different viewing angle and dragging it is
actually working. Unfortunately I cannot yet reliably reproduce this.
So maybe this is some initialisation problem? The way I test, I start
up a fresh drracket, load up the file and run it.

 Could you also try this?
 
 #lang racket (require plot racket/flonum unstable/flonum) (plot
 (function sqrt 0 (* 40 +min.0))) (plot (function (compose flsqrt
 exact-inexact) 0 (* 40 +min.0)))
 
 Both plots should be identical and look like staircases.

This works and I get the two identical staircases. Further selecting
an area to zoom in to and back out works as well. On a closer
inspection I notice that some of the vertical parts of the stairs are
slanted after zooming in (will send screenshots privately).

 The thing is, the error shouldn't be happening at all. As far as I
 can tell, it happens because at least one surface normal of a
 polygon that makes up the plot has a +nan.0 in it.
 
 That *could* happen if your machine's floating-point processor is
 pretty b0rked - for example, if it returned +nan.0 for square roots
 of very small numbers. (Or possibly Racket on your machine, for
 some reason, computes things like that wrongly.) Have you had
 floating-point problems with anything else?

Not that I have noticed. Also the numeric tests seem to complete
without any errors.

Marijn
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.18 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk7nYwcACgkQp/VmCx0OL2zukQCfekGL3loKA0R283YC8ZrmLJoR
Q3AAoIvZ+oJU/Qo5UtXJAAmsfyHeqPwH
=EkDe
-END PGP SIGNATURE-
_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/dev


[racket-dev] plot doesn't plot (inexact-exact: no exact representation for +nan.0)

2011-12-06 Thread Marijn
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

So I just wanted to repost this to dev for the record.

The program:

;== start
#lang racket

(require plot)

;(plot3d-diffuse-light? #f)
;(plot3d-specular-light? #f)

(plot3d (list (surface3d (λ (x y) (+ (sqr x) (sqr y))) -1 1 -1 1
   #:label z = x^2 + y^2)
(surface3d (λ (x y) (- (+ (sqr x) (sqr y -1 1 -1 1
   #:color 4 #:line-color 4
   #:label z = -x^2 - y^2)))
;== end

produces:

inexact-exact: no exact representation for +nan.0

but when the commented lines are uncommented it does plot. The plot
looks plausible, though apparently it should be possible to drag
inside the plot area to change the view. This is not possible for me;
the view is stuck from looking along the xy-plane onto the z-axis.

Matthew has been trying to determine the cause via private email.
Matthew, has any of the data I provided so far pointed you anywhere?
Otherwise is there something else I can do to help debug?

Marijn
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.18 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk7d6uIACgkQp/VmCx0OL2yVAQCdEaRC6AuBfrbUtFBXDJF4uBVh
lJYAoIfI1nkHSURKjhdNeN4qX13I2vnm
=NTTc
-END PGP SIGNATURE-
_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/dev

Re: [racket-dev] regexp-split produces immutable cons when rnrs/base-6 is required

2011-11-28 Thread Marijn
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi Neil,

On 25-11-11 14:47, Neil Van Dyke wrote:
 As an immediate solution, I suggest simply not trying to use R6RS 
 compatibility libraries with Racket, and instead just use the
 Racket language.  Spend your energy on your application.  (I don't
 want to get into why right now, but my book will have an entire
 section or chapter entitled Don't Use R6RS.)
 
 If you have some super-good reason for wanting to use R6RS, a few
 more comments...

All I really wanted was the mod0 function from r6rs, which I can get
without causing any further problems doing:
(require (only-in rnrs/base-6 mod0))

 The particular problem you're having is due to rnrs/base-6
 wanting to use mutable pairs, while libraries implemented in Racket
 want to use immutable pairs.  They *could* be made more
 interoperable, but all the ways I can think of would have other
 undesirable costs, and you'd either end up getting bugs in other
 places or get really lousy performance.

I guess I was under the mistaken impression that all this stuff was
compatible with each other. I can live with that not being so, but it
seems that it might then be a good idea to include some of the
functions that r6rs has, but racket doesn't, in some other module.

 As a workaround if you *really* want to use R6RS, but also use 
 regexp-split, is to make a tiny #lang racket/base module that
 wraps Racket's regexp-split to convert any pairs in the return
 value to mpairs.
 
 BTW, if you want to parse input like this from a port, you can use 
 Racket regexp operations or a grammar-based parser directly on the
 port, rather than reading a line and then doing a regexp-split on
 the line. The latter way is a Perl idiomatic way of parsing a
 language like this, and that way will also work in Racket, but
 there are arguably better ways.

Thanks, I had no idea.

Marijn

-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.18 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk7TQdgACgkQp/VmCx0OL2xVJQCgwYLCsTuAIPyNynYhVnLKjKIW
znYAoMQkfYKLuLsE50VV8REBcVcLypPT
=B68t
-END PGP SIGNATURE-
_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/dev


[racket-dev] regexp-split produces immutable cons when rnrs/base-6 is required

2011-11-25 Thread Marijn
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi,

regexp-split produces an immutable cons when rnrs/base-6 is required:

$ echo m | racket -e '(require rnrs/base-6) (car (regexp-split  +
(read-line (current-input-port
'mcar: expects argument of type mutable-pair; given '(m)

but

$ echo m | racket -e '(require rnrs/base-6) (car (list (read-line
(current-input-port'
m

so apparently regexp-split is the culprit,

Marijn
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.18 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk7PlOEACgkQp/VmCx0OL2wlTwCgwTewaztqNFFkqtQxj9Yh2ELB
/FkAnjA9OksH4ziOdIP33C5SdveRx960
=Mw9C
-END PGP SIGNATURE-
_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/dev


Re: [racket-dev] check-syntax (require plot) hangs drracket

2011-11-24 Thread Marijn
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi Robby,

On 23-11-11 13:10, Robby Findler wrote:
 I'm not seeing that under ubuntu 10.04 using the version of Racket 
 from this morning. Is there possibly something else that would need
 to be done to see the problem?

Not that I can think of and this is not an intermittent problem.

I did manage to produce some terminal output this time, by Ctrl-C'ing
in the terminal when syntax-check had frozen my drracket (this
morning's git master):


^Cuser break

 === context ===
/usr/lib64/racket/collects/drracket/private/syncheck/traversals.rkt:940:4:
document-variable
/usr/lib64/racket/collects/drracket/private/syncheck/traversals.rkt:485:12:
for-loop
/usr/lib64/racket/collects/drracket/private/syncheck/traversals.rkt:481:8:
for-loop
/usr/lib64/racket/collects/drracket/private/syncheck/traversals.rkt:451:4:
annotate-variables
/usr/lib64/racket/collects/drracket/private/syncheck/gui.rkt:1942:24
/usr/lib64/racket/collects/mred/private/wx/common/queue.rkt:432:6
/usr/lib64/racket/collects/mred/private/wx/common/queue.rkt:472:32
/usr/lib64/racket/collects/mred/private/wx/common/queue.rkt:618:3

internal error: wrong eventspace for constrained event handling

/usr/lib64/racket/collects/mred/private/wx/common/freeze.rkt:9:0
internal-error
/usr/lib64/racket/collects/mred/private/wx/common/freeze.rkt:36:0 core6

internal error: wrong eventspace for constrained event handling

/usr/lib64/racket/collects/mred/private/wx/common/freeze.rkt:9:0
internal-error
/usr/lib64/racket/collects/mred/private/wx/common/freeze.rkt:36:0 core6


this internal error is repeated some dozen more times.

Marijn


 On Wed, Nov 23, 2011 at 1:53 AM, Marijn hk...@gentoo.org wrote: 
 In the latest git master, check-syntax button is freezing drracket
 for me on x86-64 GNU/Linux on the following code fragment:
 
 #lang racket
 
 (require plot)
 
 although it runs fine... Only way to proceed is to kill the
 program. I get no output on the console.
 
 Marijn
 _ For
 list-related administrative tasks: 
 http://lists.racket-lang.org/listinfo/dev
 

-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.18 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk7OBYYACgkQp/VmCx0OL2y0cgCfZITmHJ1qRi2B8FDH7fp1lmfN
vVMAnjVQG7hZ/3VLTqUNA/hPA4uGICVG
=MdMR
-END PGP SIGNATURE-
_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/dev


[racket-dev] check-syntax (require plot) hangs drracket

2011-11-22 Thread Marijn
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

In the latest git master, check-syntax button is freezing drracket for
me on x86-64 GNU/Linux on the following code fragment:

#lang racket

(require plot)

although it runs fine... Only way to proceed is to kill the program. I
get no output on the console.

Marijn
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.18 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk7MppAACgkQp/VmCx0OL2yThQCbBswXbYafdokzgEqZPQXtb7SG
R/UAn2aLiKOgyLXu5Ui7Eh8oB/gvB9Yy
=eqRj
-END PGP SIGNATURE-
_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/dev


Re: [racket-dev] while resizing drawing into a canvas is off

2011-10-21 Thread Marijn
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 10/20/11 20:30, Robby Findler wrote:
 On Thu, Oct 20, 2011 at 11:34 AM, Marijn hk...@gentoo.org wrote:
 -BEGIN PGP SIGNED MESSAGE- Hash: SHA1
 
 Hi Robby,
 
 On 10/20/11 18:15, Robby Findler wrote:
 Generally, the menukey-c, menukey-v, keybindings (and
 friends) come about via the menus, not via a keymap% object.
 And those menus come in via a frame. I'm not sure how you're
 using your library, but you might want to consider some of the
 mixins in the framework whose names start with frame:.
 
 I'm actually trying to create something spreadsheet-like. I'm
 using editors to manage(display/edit) cell contents. Although
 each cell(-editor) individually doesn't have a menu, when used in
 a complete application there probably will be menus, and I'm
 planning to check out what the framework provides.
 
 However, I don't understand the logic of menus that bring about
 key bindings for editors.
 
 I'm not sure how to respond here, except to say that that's what
 the GUI designers of the world seem to have come up with. The
 keybindings that you asked for earlier (control-c and control-v for
 copy and paste under windows, for example (command-c and command-v
 on the mac)) are there because they are shortcuts for menu items,
 not because they are keybindings at the level of the editor.

So you're saying this is something that is inherited from Gtk and the
Windows and OSX graphics layers?

Marijn
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.18 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk6hM5UACgkQp/VmCx0OL2yxQACdEN5pStXBxVEwKIZJFwpu+nvx
P84AoIap2s2eG2cm8VLLR/A/sMSc5XzQ
=O+19
-END PGP SIGNATURE-
_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/dev


Re: [racket-dev] while resizing drawing into a canvas is off

2011-10-20 Thread Marijn
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi Matthew,

On 10/18/11 17:10, Matthew Flatt wrote:
 At Tue, 18 Oct 2011 16:32:54 +0200, Marijn wrote:
 the attached program draws a grid in a canvas and paints a few of
 the cells so created. When resizing the window, the grid is also
 dynamically resized together with the coloring of a few painted
 cells. Everything seems to work fine, except that while the
 window is being changed in size the drawing is off and the
 colored cells do not properly correspond to the drawn grid. You
 can see this especially well if you hold down the mouse button
 after resizing. When releasing it the grid lines will change
 position to match up once more with the colorings.
 
 This was due to an internal inconsistency with `get-char-width'
 and `get-char-height'. I've pushed a repair.

Could you perhaps comment on the slowness of the cursor appearing in a
clicked cell? It seems to have something to do with the timer
frequency, because if I decrease the frequency the first time that the
cursor appears is also sooner after clicking in a cell.

Another thing. How do you enable simple select/copy/cut/paste behavior
with standard key-bindings in an editor?

Thanks,

Marijn
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.18 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk6f5wsACgkQp/VmCx0OL2xPLgCgjPdS/Ii9Kdyj4bNKZGLYRcOh
qn0An14oOSrI57/XU/n3tkELHvs4qhg3
=90cJ
-END PGP SIGNATURE-
_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/dev


Re: [racket-dev] while resizing drawing into a canvas is off

2011-10-20 Thread Marijn
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 10/20/11 14:53, Matthew Flatt wrote:
 At Thu, 20 Oct 2011 11:16:59 +0200, Marijn wrote:
 Could you perhaps comment on the slowness of the cursor appearing
 in a clicked cell? It seems to have something to do with the
 timer frequency, because if I decrease the frequency the first
 time that the cursor appears is also sooner after clicking in a
 cell.
 
 I think you need to add `(send grid refresh)' to the admin's 
 `set-focus' method.

It's funny that you mention this `set-focus' method, because I can't
find it in the docs, although my code seems to think it's a canvas%
method (oops?). I hope my confusion isn't contagious. ;P
Calling `refresh' of either the display or the editor in the admin's
on-focus works beautifully though, thanks.

 Calling `on-focus' doesn't make an editor request a refresh, so
 the refresh is currently happening only when the caret is blinked
 (which does cause a refresh request).

That explains it.

 Another thing. How do you enable simple select/copy/cut/paste
 behavior with standard key-bindings in an editor?
 
 Apply `(current-text-keymap-initializer)' to the editor.

I'm kinda struggling with this one. What I came up with is:

(define default-keymap (new keymap%))
((current-text-keymap-initializer) default-keymap)
(add-text-keymap-functions default-keymap)

and then I do (send editor set-keymap default-keymap) for each editor.
Is that what you meant?
This makes some emacs-like bindings work (C-a and C-e go to beginning
and end of line, C-y - yank). Is there a way to get the more familiar
{C-a - select-all, C-v - copy-selection, etc.} bindings?

Marijn
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.18 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk6gRRAACgkQp/VmCx0OL2ybiACfaC+KRtsiWWZKPoGbW7NrD0J6
TOEAnjhJ02SucsrekmvzVTgl2icwGkAM
=+/MB
-END PGP SIGNATURE-
_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/dev


Re: [racket-dev] while resizing drawing into a canvas is off

2011-10-20 Thread Marijn
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 10/20/11 18:12, Matthew Flatt wrote:
 At Thu, 20 Oct 2011 17:58:08 +0200, Marijn wrote:
 Another thing. How do you enable simple
 select/copy/cut/paste behavior with standard key-bindings in
 an editor?
 
 Apply `(current-text-keymap-initializer)' to the editor.
 
 I'm kinda struggling with this one. What I came up with is:
 
 (define default-keymap (new keymap%)) 
 ((current-text-keymap-initializer) default-keymap) 
 (add-text-keymap-functions default-keymap)

The last line here is actually not needed and doesn't seem to do anything.

 and then I do (send editor set-keymap default-keymap) for each
 editor. Is that what you meant?
 
 Yes, though I forgot exactly how the parameter value works.
 
 This makes some emacs-like bindings work (C-a and C-e go to
 beginning and end of line, C-y - yank). Is there a way to get
 the more familiar {C-a - select-all, C-v - copy-selection,
 etc.} bindings?
 
 Use `add-editor-keymap-functions' in addition to 
 `add-text-keymap-functions'.

Actually I was already trying these, but AFAICT they don't do anything.

Marijn

-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.18 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk6gS5kACgkQp/VmCx0OL2zM0QCeKhFeH89ymFTA+FzXoz0taFav
fXkAnjGjYenPu9gXbn+vIFFDdfGb3hdd
=sTyd
-END PGP SIGNATURE-
_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/dev


Re: [racket-dev] while resizing drawing into a canvas is off

2011-10-20 Thread Marijn
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi Robby,

On 10/20/11 18:15, Robby Findler wrote:
 Generally, the menukey-c, menukey-v, keybindings (and friends) 
 come about via the menus, not via a keymap% object. And those
 menus come in via a frame. I'm not sure how you're using your
 library, but you might want to consider some of the mixins in the
 framework whose names start with frame:.

I'm actually trying to create something spreadsheet-like. I'm using
editors to manage(display/edit) cell contents. Although each
cell(-editor) individually doesn't have a menu, when used in a
complete application there probably will be menus, and I'm planning to
check out what the framework provides.

However, I don't understand the logic of menus that bring about key
bindings for editors.

Marijn

-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.18 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk6gTaQACgkQp/VmCx0OL2xPwQCeKkbJVMxYHBiCk3ERSmKockhM
atIAoIhmA0QMroKZATMWI3xRXUWjEBc6
=7eHt
-END PGP SIGNATURE-
_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/dev


Re: [racket-dev] while resizing drawing into a canvas is off

2011-10-19 Thread Marijn
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 10/18/11 17:10, Matthew Flatt wrote:
 At Tue, 18 Oct 2011 16:32:54 +0200, Marijn wrote:
 the attached program draws a grid in a canvas and paints a few of
 the cells so created. When resizing the window, the grid is also
 dynamically resized together with the coloring of a few painted
 cells. Everything seems to work fine, except that while the
 window is being changed in size the drawing is off and the
 colored cells do not properly correspond to the drawn grid. You
 can see this especially well if you hold down the mouse button
 after resizing. When releasing it the grid lines will change
 position to match up once more with the colorings.
 
 This was due to an internal inconsistency with `get-char-width'
 and `get-char-height'. I've pushed a repair.

Thanks for the quick fix.

 Beware that, under Windows, `on-paint' is called before `on-size', 
 which means that the state update in your `on-size' callback
 happens too late. I think it would be nicer if `on-size' reliably
 came before `on-paint' but it's difficult to maintain those kinds
 of guarantees across all platforms. One solution is to add a call
 to `refresh' in your `on-size' callback.

Thanks for the heads-up. I've added the call to refresh and made a
mental note not to assume too much about the order in which call-backs
get called.

Marijn

-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.18 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk6ehuwACgkQp/VmCx0OL2zejQCgmCP1oh8jFBzbaT7IafLDDshU
7WIAn3FlMLQmzS1YTRkunb5Pr+CA9VhA
=d8Hp
-END PGP SIGNATURE-
_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/dev


Re: [racket-dev] wrong line marked as source of error?

2011-10-19 Thread Marijn
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi Robby,

On 10/18/11 17:58, Robby Findler wrote:
 On Tue, Oct 18, 2011 at 8:39 AM, Marijn hk...@gentoo.org wrote:
 -BEGIN PGP SIGNED MESSAGE- Hash: SHA1
 
 On 10/18/11 14:09, Robby Findler wrote:
 Oh, and one more comment: did  you try clicking on the
 left-hand little red icon? That shows you the part of the stack
 that is in other files (if there is any to be shown).
 
 I did try that, but it didn't show anything outside my one file.
 
 At the moment, the more precise (possibly with missing chunks)
 source location annotations override the others. You might get
 more information if you disable debugging.
 
 I've just pushed an improvement to that window so it shows both
 stacks (when they are both available). Hopefully that'll help in
 the future.

I see the additional information, but getting multiple pages of code
pointed out as the source isn't very helpful.
In this case the error occurs because I broke the contract of the
editor-admin% method get-view by supplying a non-number in one of the
boxes in which it expects return values. I don't understand your
explanation of why it cannot find the line that produced the
non-number input to +, or even the line with that addition outside my
source file. From the user perspective it just looks like racket
blames a semi-random line, which in this case is responsible for some
of the construction of the objects, but hardly the real source of the
error.

Marijn

-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.18 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk6ejBYACgkQp/VmCx0OL2xfcACeJnPEclxp8tdp0vG2GFKYtxOB
+1AAnA19pgBy2tMUxZNzCBk4lGAEPLvi
=4a8o
-END PGP SIGNATURE-
_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/dev


Re: [racket-dev] wrong line marked as source of error?

2011-10-18 Thread Marijn
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 10/18/11 14:09, Robby Findler wrote:
 Oh, and one more comment: did  you try clicking on the left-hand 
 little red icon? That shows you the part of the stack that is in
 other files (if there is any to be shown).

I did try that, but it didn't show anything outside my one file.

 On Tue, Oct 18, 2011 at 6:36 AM, Marijn hk...@gentoo.org wrote:
 Hi list,
 
 while running some code I'm working on, I noticed that the error
 message reported and the expression highlighted as the source of
 the error don't seem to match. The error produced is correct, but
 the line recognized as the source is quite suboptimal. I've tried
 to cut down on the number of lines in the file by removing
 uninvolved code, but haven't tried to rewrite beyond that. I've
 attached the code and a screenshot of my drracket exhibiting the
 problem. Racket used is this morning's git version.
 
 Marijn
 
 _ For
 list-related administrative tasks: 
 http://lists.racket-lang.org/listinfo/dev
 

-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.18 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk6dgYYACgkQp/VmCx0OL2yn3wCfUQb8m9A7UQ/17KH1xtjpsVm1
660An1jKCziqlh0/WLYJiAPeCmcsOoDL
=4pEM
-END PGP SIGNATURE-
_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/dev


[racket-dev] while resizing drawing into a canvas is off

2011-10-18 Thread Marijn
Dear list,

the attached program draws a grid in a canvas and paints a few of the
cells so created. When resizing the window, the grid is also dynamically
resized together with the coloring of a few painted cells. Everything
seems to work fine, except that while the window is being changed in
size the drawing is off and the colored cells do not properly correspond
to the drawn grid. You can see this especially well if you hold down the
mouse button after resizing. When releasing it the grid lines will
change position to match up once more with the colorings.

Marijn
#lang racket/gui

;;; multi-dimensional arrays
(require srfi/25)

(define cell-editor%
  (class text%
(init)
(super-new)
))

(define cell-editor-admin%
  (class editor-admin%
(init-field grid row column editor)

(super-new)

(define blinker
  (new timer% (notify-callback (lambda () (send editor blink-caret)

(define/public (start-caret-blinking interval)
  (send blinker start interval))

(define/public (stop-caret-blinking)
  (send blinker stop))

(define/public (on-char char)
  (send editor on-char char))

(define/public (on-focus on?)
  (if on?
  (send blinker start 500)
  (send blinker stop))
  (send editor on-focus on?))

(define/public (redraw-editor)
  (send editor
refresh
0 0
(send grid get-cell-pixel-width) (send grid get-cell-pixel-height) 
(if (eq? this (send grid get-active-admin))
'show-caret
'no-caret)
#f))

(define/override (get-dc (x #f) (y #f))
  (when x (set-box! x (- -2 (send grid column-x column
  (when y (set-box! y (- -2 (send grid row-y row
  (send grid get-dc) )

(define/override (get-max-view x y w h (full? #f))
  (get-view x y w h full?))

(define/override (get-view x y w h (full? #f))
  (when x (set-box! x 0))
  (when y (set-box! y 0))
  (when w (set-box! w (send grid get-cell-pixel-width)))
  (when h (set-box! h (send grid get-cell-pixel-height))) )

(define/override (grab-caret (domain 'global))
  (when (eq? domain 'global)
(send grid set-focus)))

(define/override (modified modified?)
  (values))

(define/override (needs-update x y w h)
  (send grid refresh))

(define/override (popup-menu menu x y)
  #f)

(define/override (refresh-delayed?)
  #f)

(define/override (resized refresh?)
  (send grid refresh)) ;; only when refresh? arg ?

(define/override (scroll-to x y w h (refresh? #t) (bias 'none))
  (send grid refresh)) ;; necessary ?

(define/override (update-cursor)
  (values))

))

(define grid%
  (class canvas%
(init-field nr-rows nr-columns)
(init parent
 (min-height 0) (min-width 0)
 (stretchable-height #t) (stretchable-width #t))

(define cell-char-width 5)
(define cell-char-height 1)

(super-new (parent parent)
   (min-height min-height) (min-width min-width)
   (stretchable-height stretchable-height) (stretchable-width 
stretchable-width))

(define dc (send this get-dc))

(define char-width-scale 1)
(define char-height-scale 1.3)
(define (char-width) (* (send dc get-char-width) char-width-scale))
(define (char-height) (* (send dc get-char-height) char-height-scale))

(display char-width: ) (displayln (char-width))
(display char-height: ) (displayln (char-height))

(define (cell-pixel-width) (inexact-exact (ceiling (* cell-char-width 
(char-width)
(define (cell-pixel-height) (inexact-exact (ceiling (* cell-char-height 
(char-height)
(define (cell+border-pixel-width) (+ (cell-pixel-width) 1))
(define (cell+border-pixel-height) (+ (cell-pixel-height) 1))

(define/public (get-cell-pixel-width) (cell-pixel-width))
(define/public (get-cell-pixel-height) (cell-pixel-height))

(define (window-height) (+ 1 (* nr-rows (cell+border-pixel-height
(define (window-width) (+ 1 (* nr-columns (cell+border-pixel-width

;(display window-width: ) (displayln window-width)
;(display window-height: ) (displayln window-height)

;;; set window size
(send this min-width (max min-width (window-width)))
(send this min-height (max min-height (window-height)))

(define (x-column x)
  (inexact-exact (floor (/ x (cell+border-pixel-width)
(define (y-row y)
  (inexact-exact (floor (/ y (cell+border-pixel-height)
(define/public (column-x column)
  (* column (cell+border-pixel-width)))
(define/public (row-y row)
  (* row (cell+border-pixel-height)))

(define (paint-cell row column color)
  (send dc set-pen  1 'transparent)
  (send dc set-brush color 'solid)
  (send dc draw-rectangle
(column-x column) (row-y row

Re: [racket-dev] Creating executables still broken

2011-10-05 Thread Marijn
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 10/04/11 20:59, Matthew Flatt wrote:
 I think I found the problem. Can you try the latest version?

Thanks Matthew, everything seems to work now.

 At Tue, 04 Oct 2011 09:42:53 +0200, Marijn wrote: On 10/03/11
 17:07, Matthew Flatt wrote:
 At Mon, 03 Oct 2011 16:10:15 +0200, Marijn wrote:
 creating executables is still broken and seems now to cause
 lots of memory allocation causing my system to start
 thrashing...
 
 I've fixed the problem that caused `raco exe' to not
 terminate.
 
 Thanks, indeed the old failure mode is restored.
 
 I doubt that the older problem you've seen is fixed, since I 
 haven't been able to replicate it. Assuming that the old
 problem is still there, can you tell me (perhaps again) the
 platform you're running on and the arguments that you
 supplied to `configure'?
 
 Sure,
 
 platform: x86_64-pc-linux-gnu
 
 ./configure --prefix=/usr --build=x86_64-pc-linux-gnu 
 --host=x86_64-pc-linux-gnu --mandir=/usr/share/man 
 --infodir=/usr/share/info --datadir=/usr/share --sysconfdir=/etc 
 --localstatedir=/var/lib --libdir=/usr/lib64 --enable-gracket 
 --enable-plot --disable-docs --enable-shared --enable-jit 
 --enable-foreign --disable-places --disable-futures 
 --disable-backtrace --disable-pthread --disable-perl --with-x
 
 Thanks for looking into this,
 
 Marijn
 

-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.18 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk6MDdoACgkQp/VmCx0OL2x97gCfcpH1103Q/JSISsOLig0oGj4Q
UEQAniRjl67hJgDKWcuiTEQ46qk6ET2A
=qr4m
-END PGP SIGNATURE-
_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/dev


Re: [racket-dev] Creating executables still broken

2011-10-04 Thread Marijn
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 10/03/11 17:07, Matthew Flatt wrote:
 At Mon, 03 Oct 2011 16:10:15 +0200, Marijn wrote:
 creating executables is still broken and seems now to cause lots
 of memory allocation causing my system to start thrashing...
 
 I've fixed the problem that caused `raco exe' to not terminate.

Thanks, indeed the old failure mode is restored.

 I doubt that the older problem you've seen is fixed, since I
 haven't been able to replicate it. Assuming that the old problem is
 still there, can you tell me (perhaps again) the platform you're
 running on and the arguments that you supplied to `configure'?

Sure,

platform: x86_64-pc-linux-gnu

./configure --prefix=/usr --build=x86_64-pc-linux-gnu
- --host=x86_64-pc-linux-gnu --mandir=/usr/share/man
- --infodir=/usr/share/info --datadir=/usr/share --sysconfdir=/etc
- --localstatedir=/var/lib --libdir=/usr/lib64 --enable-gracket
- --enable-plot --disable-docs --enable-shared --enable-jit
- --enable-foreign --disable-places --disable-futures
- --disable-backtrace --disable-pthread --disable-perl --with-x

Thanks for looking into this,

Marijn
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.18 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk6KuPwACgkQp/VmCx0OL2xpXACeO3tRaKDQ4a30e/Bki38LS4JY
6XIAn1d8K8V5fgdf4uzu20vorMOieCbx
=EUU5
-END PGP SIGNATURE-
_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/dev


[racket-dev] Creating executables still broken

2011-10-03 Thread Marijn
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi list,

creating executables is still broken and seems now to cause lots of
memory allocation causing my system to start thrashing...

$ cat hello.rkt
#lang racket
(print hello)

$ raco exe -o hello hello.rkt
[.starts thrashing.]

Marijn


On 09/16/11 10:59, Marijn wrote:
 On 09/05/11 10:03, Marijn wrote:
 Hi Vincent,
 
 On 09/02/11 19:33, Vincent St-Amour wrote:
 At Fri, 02 Sep 2011 09:15:20 +0200, Marijn wrote:
 I just tried with latest git and nothing has changed for me.
  Neither the wrong message, nor the failing executable.
 
 You're building executables from DrRacket, right?
 
 Does it work if you build them from the command-line, with
 `raco exe'?
 
 Vincent
 
 No, it doesn't work either:
 
 $ cat hello.rkt #lang racket
 
 (print hello) $ raco exe -o hello hello.rkt $ ./hello read
 failed to read all 885871033 bytes from file 
 /home/marijn/racketzooi/./hello Aborted
 
 The above bug is still manifested in today's git.
 
 Marijn _ For
 list-related administrative tasks: 
 http://lists.racket-lang.org/listinfo/dev

-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.18 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk6JwkcACgkQp/VmCx0OL2x5wgCfQLHTHRzxs00DOZjDd4R3AC+U
+UUAoMT6tkSNwrbF9S0jjktNtQkHPSeq
=zH4m
-END PGP SIGNATURE-
_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/dev


Re: [racket-dev] Adding the new plot library [was: Re: Plot?]

2011-09-30 Thread Marijn
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 09/30/11 02:06, James Vega wrote:
 Eli Barzilay eli@... writes:
 The thing is that keeping things completely backward compatible
 means keeping some C code (the fit thing), and that translates to
 a real problem with linux distributions (see the Fedora point
 earlier).  Not being completely backward compatible has the
 advantage of moving at least the Fedora distribution faster (and
 I won't be surprised if Debian/Ubuntu would have issues with this
 too -- I'm surprised they didn't say anything about it so far).
 
 I did -- http://bugs.racket-lang.org/query/?cmd=viewpr=10756. :) 
 You convinced me that the status quo was good enough for now and
 that it'd eventually be replaced by scheme^Wracket.  Glad to see
 that's happening.

I'm confused now. That bug talks about a bundled zlib, while Eli says
this is about:

``keeping the C code that was ripped out of gnuplot.''

which would IIUC be a violation of gnuplot's license.

Marijn
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.18 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk6FcjoACgkQp/VmCx0OL2wdQgCbByav/H9v6rl2Fhsi38DJlu0K
OHIAn1eUdjpjEz/PtALj59vS597vB8vY
=2R0l
-END PGP SIGNATURE-
_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/dev


Re: [racket-dev] creating executables

2011-09-16 Thread Marijn
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 09/05/11 10:03, Marijn wrote:
 Hi Vincent,
 
 On 09/02/11 19:33, Vincent St-Amour wrote:
 At Fri, 02 Sep 2011 09:15:20 +0200, Marijn wrote:
 I just tried with latest git and nothing has changed for me. 
 Neither the wrong message, nor the failing executable.
 
 You're building executables from DrRacket, right?
 
 Does it work if you build them from the command-line, with `raco 
 exe'?
 
 Vincent
 
 No, it doesn't work either:
 
 $ cat hello.rkt #lang racket
 
 (print hello) $ raco exe -o hello hello.rkt $ ./hello read failed
 to read all 885871033 bytes from file 
 /home/marijn/racketzooi/./hello Aborted

The above bug is still manifested in today's git.

Marijn
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.18 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk5zD/EACgkQp/VmCx0OL2x/WQCghFgPgeOSEbk3PtVuYyHHAgJI
q4cAoIfLXgXIKanGJ3DZ9VDsQBaOO/f+
=UzdE
-END PGP SIGNATURE-
_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/dev


Re: [racket-dev] list-box% not properly sized

2011-09-16 Thread Marijn
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 09/08/11 11:16, Marijn wrote:
 Hi Matthew,
 
 On 09/01/11 10:31, Marijn wrote:
 Hi list,
 
 list-box%es are not properly sized; the following code:
 
 I think you pushed a patch to change this. Currently the list-box
 as coded below has a minimum size of three items. Unfortunately the
 scroll bar seems to have a minimum size which is unusably large.
 There are 8 items in the list, but only 3 are shown and the scroll
 bar at ~99% size and only serves to scroll to the last 3 items.
 Scrolling back up doesn't work (the small ^ and v seem to work
 fine).

With today's git checkout it works fine, so thanks to whoever fixed it.

Marijn

-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.18 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk5zELAACgkQp/VmCx0OL2y6JACfcssE7KpbeRbNfYziSG/0SWPQ
4XoAoKK+UUFCZfz7nqQGynU7/Ipiv8Lz
=S9zU
-END PGP SIGNATURE-
_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/dev


[racket-dev] internal error while debugging (plus startup error)

2011-09-14 Thread Marijn
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi list,

While using the integrated debugger I got an internal error which
caused the whole of that DrRacket-instance to become non-functional.
Fortunately I had started it from console, so the error didn't get
lost and I have the context. The error occurred while after I had been
stepping through my program at the moment I understood what was wrong
and tried to fix it by editing the code. For completeness I am
including the error that I got on startup which was non-fatal, but
probably accounts for online syntax checking not working (I think).

This is with a git racket of 12 Sept on amd64 Linux.

Marijn

standard-module-name-resolver: expected argument of type module-path
or path; given
#/usr/lib64/racket/collects/drracket/private/syncheck/online-comp.rkt

 === context ===
standard-module-name-resolver
/usr/lib64/racket/collects/drracket/private/expanding-place.rkt:26:17:
for-loop
/usr/lib64/racket/collects/drracket/private/expanding-place.rkt:18:0:
start

draw-ellipse method of dc%: expects type nonnegative-real as 3rd
argument, given: -390.0; other arguments were: 395.0 419.5 -390.0

 === context ===
/usr/lib64/racket/collects/racket/draw/private/dc.rkt:1005:4:
draw-ellipse method in dc%
/usr/lib64/racket/collects/racket/draw/private/record-dc.rkt:222:4:
draw-ellipse method in ...rivate/record-dc.rkt:94:2
/usr/lib64/racket/collects/gui-debugger/debug-tool.rkt:480:10:
on-paint method in ...ugger/debug-tool.rkt:156:8
/usr/lib64/racket/collects/mred/private/wxme/text.rkt:5195:18: paint-done
/usr/lib64/racket/collects/mred/private/wxme/text.rkt:5019:2: refresh
method in text%
/usr/lib64/racket/collects/mred/private/wxme/editor-canvas.rkt:606:2:
redraw method in editor-canvas%
/usr/lib64/racket/collects/mred/private/wxme/text.rkt:751:2:
end-edit-sequence method in text%
/usr/lib64/racket/collects/framework/private/text.rkt:3976:4:
after-delete method in ...ork/private/text.rkt:3799:2
/usr/lib64/racket/collects/mred/private/wxme/text.rkt:1794:2: core1128
/usr/lib64/racket/collects/mred/private/wxme/editor-canvas.rkt:444:2:
on-char method in editor-canvas%
/usr/lib64/racket/collects/racket/private/more-scheme.rkt:151:2:
call-with-break-parameterization
/usr/lib64/racket/collects/racket/private/more-scheme.rkt:268:2:
call-with-exception-handler
/usr/lib64/racket/collects/mred/private/wx/gtk/window.rkt:631:4:
dispatch-on-char method in window%
/usr/lib64/racket/collects/mred/private/wx/common/queue.rkt:432:6
/usr/lib64/racket/collects/mred/private/wx/common/queue.rkt:472:32
/usr/lib64/racket/collects/mred/private/wx/common/queue.rkt:618:3
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.18 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk5wrccACgkQp/VmCx0OL2x2YACgr9YKPnCY8+TkVTpecoB0I41V
Sp8AoLl7c72/B+QzMQE3iLw50rB+RPqU
=Cbg1
-END PGP SIGNATURE-
_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/dev


Re: [racket-dev] Weird bug in Typed Racket predicate for Float 0.0

2011-09-12 Thread Marijn
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 09/09/11 18:26, Luke Vilnis wrote:
 Hmm, curiouser and curiouser. Using the latest nightly build from 
 http://pre.racket-lang.org/installers/, I get #f #t #t #f both on
 my home machine and work machine, which run Windows 7 64-bit. Now
 I'm really curious as to what's going on here!

With last week's code I get:

eq? 0.0 #f
eqv? 0.0 #t
Float? #t
Float-Or-Integer? #f

but with this morning's git version:

eq? 0.0 #f
eqv? 0.0 #t
Float? #t
Float-Or-Integer? #t

on amd64 Gentoo GNU/Linux,

HTH,

Marijn
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.18 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk5tsYEACgkQp/VmCx0OL2w/JwCgnWt5bRIor3nwtiX+XoHhI3W8
gPMAn3VAaQTC/E+9+gbcSXwvATDyfHMA
=JGKC
-END PGP SIGNATURE-
_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/dev


Re: [racket-dev] weird (memory?) bug using (dis)similar require mechanisms

2011-09-12 Thread Marijn
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi Matthew,

On 09/10/11 22:49, Matthew Flatt wrote:
 At Fri, 09 Sep 2011 12:29:13 +0200, Marijn wrote:
 this racket bug was discovered when I was trying out geiser
 which starts programs in a way that exposes this bug. The program
 starts correctly but none of the buttons work (or only reserve
 screen space) and it is hard to terminate the program.
 
 I think this is now fixed. For me, the GUI worked until I clicked
 a button that needed to grow the frame, at which point it got stuck
 due to competing callbacks with different opinions on the frame
 height. (One of those callbacks was wrong.)

Seems to work for me too now. The only thing I'm left wondering is why
starting the program in ways that I would mentally classify as exactly
the same turned out to differ in such a way. Would appreciate if you
could shed some light on that.

Thanks,

Marijn
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.18 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk5ttKsACgkQp/VmCx0OL2xo+wCgxTQiEkn7+o4q+KM8//3Wnhlq
2woAoKg/mwc3nFj8doocwwp7IMW24i0c
=qo0A
-END PGP SIGNATURE-
_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/dev


[racket-dev] weird (memory?) bug using (dis)similar require mechanisms

2011-09-09 Thread Marijn
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi list,

this racket bug was discovered when I was trying out geiser which
starts programs in a way that exposes this bug. The program starts
correctly but none of the buttons work (or only reserve screen space)
and it is hard to terminate the program. I got the impression that a
lot of memory was being allocated in a loop.

The bug manifests itself when starting racket from the command line
and copying into the resulting repl (require ./test1.rkt). But doing
either of:
$ racket -e '(require ./test1.rkt)'
$ racket  '(require ./test1.rkt)'
works fine.

Test program to exhibit the bug:

#lang racket/gui

(define f (new frame% [label List Editor]))

(define items (new vertical-pane% (parent f)))

(define (create-item val parent)
  (define v (new vertical-panel% (parent parent)))
  (define ins (new button% (parent v) (label insert)
   (callback (λ (b e) (create-item 0 items))) ))
  (define h (new horizontal-pane% (parent v)))
  (define t (new text-field% (parent h) (label ) (init-value val)))
  (define del (new button% (parent h) (label del)
   (callback (λ (b e) (send parent delete-child v))) ))
  v)

(for-each (λ (v) (create-item v items)) '(1 2 3))

(new button% (parent f) (label append) (callback (λ (b e)
(create-item 0 items

(send f show #t)

Marijn
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.18 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk5p6nkACgkQp/VmCx0OL2zqKACeK7P3FAQFTZ1aEd+O+X+/wWWA
QtAAoKgi7zNggcdW8zLC0+YXpmX6l4Bh
=yfHI
-END PGP SIGNATURE-
_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/dev

Re: [racket-dev] distributing native code

2011-09-09 Thread Marijn
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 09/09/11 09:33, John Clements wrote:
 [*] See earlier thread where the general consensus was that it was
 not possible to make a Racket version of this run less than (IIRC)
 5x slower than C.

What is the subject of that thread?

Marijn
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.18 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk5p6t4ACgkQp/VmCx0OL2yF7ACgq937LVOCsoV4a0XktzF+U7Kv
R0gAoMTEWS/CHFzg7jUvQguFfCJOY8YJ
=O0sD
-END PGP SIGNATURE-
_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/dev


Re: [racket-dev] creating executables

2011-09-05 Thread Marijn
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi Vincent,

On 09/02/11 19:33, Vincent St-Amour wrote:
 At Fri, 02 Sep 2011 09:15:20 +0200, Marijn wrote:
 I just tried with latest git and nothing has changed for me.
 Neither the wrong message, nor the failing executable.
 
 You're building executables from DrRacket, right?
 
 Does it work if you build them from the command-line, with `raco
 exe'?
 
 Vincent

No, it doesn't work either:

$ cat hello.rkt
#lang racket

(print hello)
$ raco exe -o hello hello.rkt
$ ./hello
read failed to read all 885871033 bytes from file
/home/marijn/racketzooi/./hello
Aborted

Marijn
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.18 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk5kgkoACgkQp/VmCx0OL2xS/wCfXd6rf9hPB6LvJGsU6N2eybmL
gPoAn1kIBGOSBAILwSzxF9APL9yyAB+9
=A/l2
-END PGP SIGNATURE-
_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/dev


Re: [racket-dev] creating executables

2011-09-02 Thread Marijn
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi Vincent,

On 09/01/11 17:27, Vincent St-Amour wrote:
 I had a similar problem on Linux x86. Matthew just pushed a fix,
 and now everything works for me. Haven't tried on amd64, though.
 
 Vincent

I just tried with latest git and nothing has changed for me. Neither
the wrong message, nor the failing executable.

Marijn

 At Thu, 01 Sep 2011 16:24:02 +0200, Marijn wrote:
 
 Hi list,
 
 when creating executables from racket, when I choose (the
 defaults) standalone based on racket, it will say creating
 executable for distribution. I did not choose for distribution, so
 that is wrong.The created executable fails to run like this:
 
 $ ./hello read failed to read all 885878182 bytes from file 
 /home/marijn/racketzooi/./hello Aborted
 
 
 
 My test program:
 
 
 
 #lang racket
 
 (print hello)
 
 
 
 This is on amd64 Linux with a racket from a day old.
 
 Marijn
 _ For
 list-related administrative tasks: 
 http://lists.racket-lang.org/listinfo/dev

-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.18 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk5ggogACgkQp/VmCx0OL2yBqwCfa08Brqs0eBj2CYV8GxGIgLwo
t34AniKekcSvspiJAAZL7Q8/vzgv2ivA
=qdBp
-END PGP SIGNATURE-
_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/dev


Re: [racket-dev] drRacket Close/Close tab

2011-09-02 Thread Marijn
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi Matthew,

On 09/01/11 16:41, Marijn wrote:
 On 09/01/11 16:29, Matthew Flatt wrote:
 At Thu, 1 Sep 2011 09:14:47 -0500, Robby Findler wrote:
 On Wed, Aug 31, 2011 at 3:30 AM, Marijn hk...@gentoo.org 
 wrote:
 I like the idea of adding shift, but I've changed things
 so that instead of the w shortcut going away, the close
 menu item becomes menukey-shift-w (so the shifting
 behavior is still there and we are complying with the
 guidelines in the no-tabs case).
 
 On Gtk nothing has changed for me.
 
 
 I've managed to get my ubuntu 10.04.1 vm back in shape and 
 rebuild drracket there and the various keybindings and menu
 items seem to shift around as expected.
 
 Was that after commit 459d2422e3ad8?
 
 I looked into menu-item shortcuts this morning and pushed a 
 Gtk-specific fix for updating the displayed shortcut.
 
 
 Alright, that probably explains it. I'll test again tomorrow to
 make sure.

It now works for me too. Thanks,

Marijn
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.18 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk5gg7MACgkQp/VmCx0OL2wWxQCfdI9CZWxBDy0BEaZlplHvUx4o
inAAoJe6JT3LIkGqzfpEs/a++TxWlqTf
=wtt/
-END PGP SIGNATURE-
_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/dev


Re: [racket-dev] drRacket Close/Close tab

2011-09-02 Thread Marijn
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi Robby,

On 09/01/11 17:55, Robby Findler wrote:
 Okay, thanks everyone for the comments. Generally speaking, I
 dread keybinding-based discussions because it is impossible to make
 everyone happy (and usually only the unhappy people speak up :).

It will probably get really quiet now then ;P.

 Still, I think you folks are right that changes need to happen.
 I've looked over various apps and the guidelines and whatnot and
 (yep, I buy the argument that 'Terminal and Safari don't follow the
 HIG so why should we?'.) so here's the changes I've just pushed.
 
 Mac OS X  Windows :
 
 - renamed Close to Close Window (but kept the keybinding 
 switchero-ness as is)
 
 Gtk:
 
 - changed the menus so there is only one Close menu (no Close
 Tab or Close Window); if there are multiple tabs, it closes the
 tab otherwise it closes the window. To close the window in the
 multiple tabs case, you have to use the close box (or maybe alt-f4
 if the OS-level keybindings map it to closing the window).

I think the distinction (between platforms) in the menu is mostly
academic (both are good choices) and should IMHO be eliminated since
it can only create confusion when people on different platforms talk
to each other. But anyway, the test for whether the platform is Gtk
seems to be faulty, because now I'm seeing the ``Windows/OS X''-style
menu. The good news is that it's now working as you describe.

 All platforms:
 
 - changed New Tab to menukey-t
 
 - changed Run to menukey-r

These are working.

 - changed Replace to menukey-shift-f

This also seems to be working.

I think FindReplace could be so much more useful though: Ctrl-F
find-search-term-as-you-type instead of Ctrl-F search-term Ctrl-G,
identifier renaming (ignore strings, symbols, partial matches),
regular expression replacements, identifier regular expression
renaming (lifts restriction on partial matches, by using wildcards to
extend to full match). I'm sure other people have more/better ideas.

 Please let me know if you spot any problems.

No problems, just work in progress (as is all software) ;P
Thanks for working on this!

Marijn
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.18 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk5girYACgkQp/VmCx0OL2y3/ACfY5Gv2BKIYyY+dbFFog16FXGL
C4oAn3+iXbOJiA3f2k8dhSQ160Wlm08h
=aDXI
-END PGP SIGNATURE-
_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/dev


Re: [racket-dev] drRacket Close/Close tab

2011-09-02 Thread Marijn
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi Robby,

On 09/02/11 14:33, Robby Findler wrote:
 On Fri, Sep 2, 2011 at 2:50 AM, Marijn hk...@gentoo.org wrote:
 But anyway, the test for whether the platform is Gtk seems to be
 faulty, because now I'm seeing the ``Windows/OS X''-style menu.
 The good news is that it's now working as you describe.
 
 Can you tell me the result of evaluating
 
 (system-type)
 
 on your machine?

'unix

 All platforms:
 
 - changed New Tab to menukey-t
 
 - changed Run to menukey-r
 
 These are working.
 
 - changed Replace to menukey-shift-f
 
 This also seems to be working.
 
 I think FindReplace could be so much more useful though: Ctrl-F 
 find-search-term-as-you-type instead of Ctrl-F search-term
 Ctrl-G,
 
 I'll note two things here: it does search as you type (and it
 circles the search results); it just does not jump around as you
 type. I find this to be easier to use as it helps me navigate more
 effectively through the buffer. But I realize others don't like
 this (especially those coming from Emacs) so there is an attempt to
 do things in a more Emacs-y way that you can get to by chosing the
 search with anchors (or something like that) preference.

I feel really stupid now; I could have sworn that there was no
search-as-you-type, and it was there all along right in front of me.
I'll try and keep my eyes open next time ;P. Thanks for your patience.

Marijn
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.18 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk5g27wACgkQp/VmCx0OL2w+fwCdEwwfdTD+RqHSH1mhPiFN0RyJ
F90Anjktee2gw20jm8fRXsqbV93NjdD3
=icI7
-END PGP SIGNATURE-
_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/dev


Re: [racket-dev] drRacket Close/Close tab

2011-09-01 Thread Marijn
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 08/31/11 20:11, Eli Barzilay wrote:
 6 hours ago, Sam Tobin-Hochstadt wrote:
 The other three applications (Pidgin, Epiphany, Gedit) all
 follow the behavior described in the HIG: there is only a Close
 menu entry (no Close Tab), it closes the current tab, and its
 shortcut is Ctrl-w.
 
 I think we should follow the platform guidelines here as well,
 and do the same.
 
 I prefer that the above (a single Close entry that closes the 
 current tab or the current window) be used everywhere, including
 on OSX.
 
 1. It's as important as the Run button, which already steps over
 the well-used `C-t', which is *so* confusing[*] that not having
 two distinct menu entries for close/close-all seems extremely minor
 in comparison.
 
 [*] Confusing enough that I keep tripping over it in class,
 hitting C-t a few times and realize the mistake.  It's even worse
 in making me use C-= in my browser later in an attempt to create a
 new tab.  This is a mess that I think is better to address than
 keeping C-t for backward compatibility.

I concur with Eli completely. Given that Ctrl+R is currently bound to
``Replace'' which is disabled by default (!) it seems silly not to
bind it to Run (which apparently is important enough to have its own
button).

Marijn
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.18 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEUEARECAAYFAk5fQNwACgkQp/VmCx0OL2zjRwCgoqe68NzyJ5w3gRCyoUEPPluP
A+UAl2izKs/lM46vf9ZW2VwxAAosVeI=
=vsqY
-END PGP SIGNATURE-
_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/dev


[racket-dev] list-box% not properly sized

2011-09-01 Thread Marijn
Hi list,

list-box%es are not properly sized; the following code:



#lang racket/gui

(define root (new frame% (label choice widgets)))

(define list-box (new list-box% (parent root) (label List-box: )
(style '(multiple)) (choices '(1 b C3 44 five 6 seven OO

(send root show #t)



results in the attached screenshot.

Marijn

attachment: bug-in-list-box-display.png

signature.asc
Description: OpenPGP digital signature
_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/dev

[racket-dev] editor-canvas% not visually distinguished

2011-09-01 Thread Marijn
Hi list,

on GTK, editor-canvas%es are not visually distinguished, like
text-field%s are, to indicate that it is possible to enter text; the
following code:



#lang racket/gui

(define root (new frame% (label test)))

(new text-field% (parent root) (label Input: ))

(define text (new text%))

(new editor-canvas% (parent root) (editor text) (min-width 40)
(min-height 50))

(send root show #t)



produces the attached screenshot on my system,

Marijn
attachment: editor-canvas-not-visually-distinguished.png

signature.asc
Description: OpenPGP digital signature
_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/dev

[racket-dev] creating executables

2011-09-01 Thread Marijn
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi list,

when creating executables from racket, when I choose (the defaults)
standalone based on racket, it will say creating executable for
distribution. I did not choose for distribution, so that is wrong.The
created executable fails to run like this:

$ ./hello
read failed to read all 885878182 bytes from file
/home/marijn/racketzooi/./hello
Aborted



My test program:



#lang racket

(print hello)



This is on amd64 Linux with a racket from a day old.

Marijn
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.18 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk5flYIACgkQp/VmCx0OL2y3fwCgnJ7uf7DQTaBHlcxXdOk/evoq
8jQAoMPuoC321g0MT+r9axDE6gMUeP5q
=j8W+
-END PGP SIGNATURE-
_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/dev


Re: [racket-dev] drRacket Close/Close tab

2011-09-01 Thread Marijn
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 09/01/11 16:14, Robby Findler wrote:
 On Wed, Aug 31, 2011 at 3:30 AM, Marijn hk...@gentoo.org wrote:
 I like the idea of adding shift, but I've changed things so
 that instead of the w shortcut going away, the close menu item
 becomes menukey-shift-w (so the shifting behavior is still
 there and we are complying with the guidelines in the no-tabs
 case).
 
 On Gtk nothing has changed for me.
 
 
 I've managed to get my ubuntu 10.04.1 vm back in shape and rebuild 
 drracket there and the various keybindings and menu items seem to 
 shift around as expected. I've put a screenshot here to illustrate 
 what I mean.
 
 This is the file menu I see when there is just one tab (right
 after drracket starts up):
 
 http://www.eecs.northwestern.edu/~robby/tmp/one-tab.png
 
 Then, after creating a tab, this is the file menu that I see:
 
 http://www.eecs.northwestern.edu/~robby/tmp/two-tabs.png
 
 Robby

Interesting, for me only whether Close tab is disabled changes, but
not the displayed keybindings. I have both gtk+-2.24.5 and gtk+-3.0.12
installed. Not sure what else could make the difference. Any other
Linux users with test data?

Marijn
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.18 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk5fmDoACgkQp/VmCx0OL2ycgACggi9D/AM5mrvtYEJj3Mt+WYTj
bxEAn1XqqQTjyXWyAy+1B8DUFwhBpXPU
=Kyxd
-END PGP SIGNATURE-
_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/dev


Re: [racket-dev] drRacket Close/Close tab

2011-09-01 Thread Marijn
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 09/01/11 16:29, Matthew Flatt wrote:
 At Thu, 1 Sep 2011 09:14:47 -0500, Robby Findler wrote:
 On Wed, Aug 31, 2011 at 3:30 AM, Marijn hk...@gentoo.org
 wrote:
 I like the idea of adding shift, but I've changed things so
 that instead of the w shortcut going away, the close menu
 item becomes menukey-shift-w (so the shifting behavior is
 still there and we are complying with the guidelines in the
 no-tabs case).
 
 On Gtk nothing has changed for me.
 
 
 I've managed to get my ubuntu 10.04.1 vm back in shape and
 rebuild drracket there and the various keybindings and menu items
 seem to shift around as expected.
 
 Was that after commit 459d2422e3ad8?
 
 I looked into menu-item shortcuts this morning and pushed a 
 Gtk-specific fix for updating the displayed shortcut.
 

Alright, that probably explains it. I'll test again tomorrow to make sure.

Marijn
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.18 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk5fmYoACgkQp/VmCx0OL2wuVQCfYSx13oaZCSuBOpfWleJuqn7Z
daAAn3+o7qanxUXvT90Wp/3qsQAA9GYt
=tRjD
-END PGP SIGNATURE-
_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/dev


[racket-dev] non-existing files in drRacket recent file list

2011-08-25 Thread Marijn
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi,

in drRacket when doing File - Open Recent and selecting a non-existing
file (because it was deleted), there is an error message stating this,
but the file remains in the list. This might be good in case the file
was accidentally removed, but for me in most cases I'd prefer for the
file to disappear from the list. Alternatively the list could be checked
for no-longer-existing files on startup or when opening it from the menu.

What do you think?

Marijn
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.17 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk5WA2kACgkQp/VmCx0OL2zQTwCeMaYcw8ZBK5svveJTfl0HEqA2
GcUAnjpQEcWkjgAgBCq/4BUR8fS6zss0
=OFpe
-END PGP SIGNATURE-
_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/dev


[racket-dev] drRacket Close/Close tab

2011-08-25 Thread Marijn
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi,

in drRacket in the File menu there are the option Close and Close Tab.
File - Close does not close the current file, but instead closes the
whole program. Furthermore, it is bound to Ctrl+w, which in many
browsers is bound to Close Tab, and in many terminal emulators (like
LXTerminal, Konsole, Gnome Terminal) Ctrl+Shift+w means close tab. Close
Program (usually called Quit) is bound to Ctrl+Q (Firefox) or
Ctrl+Shift+Q (terminal emulators). Could drRacket follow these keybindings?

Marijn
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.17 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk5WCREACgkQp/VmCx0OL2wXJACeIgC+GivVNvxHJV7V3RYdomyE
FfUAn3M0q5Q6KrP+YiAg1VG1Pi44RKfR
=LGP8
-END PGP SIGNATURE-
_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/dev


Re: [racket-dev] [plt] Push #23267: master branch updated

2011-08-17 Thread Marijn
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 08/16/11 20:54, Stephen Bloch wrote:
 Wouldn't it be even better to put curly-braces around the body of the
 C macro, so people using it don't have to know that it expands into
 multiple statements?

I read a long time ago (I think it was on LWN, but I can't find the
article) about some tricks that are used in the linux kernel to mitigate
weaknesses of the C preprocessor. You wrap multiple statement macros in
do { } while(0), so that you don't have to think about whether you
need curly braces and it will absorb (and need) a semicolon, so that it
won't break your if-statements. You can read more about it here:

https://www.securecoding.cert.org/confluence/display/seccode/PRE10-C.+Wrap+multi-statement+macros+in+a+do-while+loop

HTH,

Marijn

-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.17 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk5LgLEACgkQp/VmCx0OL2xATgCeIdh5rtE6SqCmKXZ6UYxBBTDV
1xIAoLlXT3M9od0S1T3pNnoO0b8jAu+d
=Ea5K
-END PGP SIGNATURE-
_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/dev


Re: [racket-dev] strange/wrong placement and sizing in racket/gui

2011-08-16 Thread Marijn
 I noticed that text-fields are now missing their right border. Might be
 related to your fix.
 
 Marijn

There seems to be some positioning error, as text-fields are now
displayed on top of their labels. Sample program:


#lang racket/gui

(define root (new frame% (label Test)))

(new text-field% (parent root) (label Label) (init-value value))

(send root show #t)


Output attached.

Marijn
attachment: bug-in-text-field-display.png

signature.asc
Description: OpenPGP digital signature
_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/dev

Re: [racket-dev] strange/wrong placement and sizing in racket/gui

2011-08-11 Thread Marijn
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 06/21/11 09:50, Marijn wrote:
 On 06/20/11 18:29, Matthew Flatt wrote:
 I think I've found the problem and pushed a fix.
 
 Thanks for the quick fix Matthew! 1) 2) and 3) are now working fine
 :) but I do believe borders are still broken. For example:
 
 
 #lang racket/gui
 
 (define root (new frame% (label Label)))
 
 (define vp (new vertical-panel% (parent root) (vert-margin 5) (style
 '(border
 
 (define vp2 (new vertical-panel% (parent vp) (horiz-margin 5) (style
 '(border
 
 (define vp3 (new vertical-panel% (parent vp2) (vert-margin 5) (style
 '(border
 
 (define btn (new button% (parent vp3) (label button) (horiz-margin
 5)))
 
 (send root show #t)
 
 
 produces the attached window with just a button, but no borders for
 any of the panels...
 
 Marijn

The above is still valid with yesterday's git (see original mail for
image attachment).

Marijn

-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.17 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk5DyQcACgkQp/VmCx0OL2xcUgCgnQzryZY/1mw9NCny0JiA6DN5
/zgAoLgg2kACqajFD/VinfS6RoFXaHL6
=XmUg
-END PGP SIGNATURE-
_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/dev


Re: [racket-dev] strange/wrong placement and sizing in racket/gui

2011-06-21 Thread Marijn
On 06/20/11 18:29, Matthew Flatt wrote:
 I think I've found the problem and pushed a fix.

Thanks for the quick fix Matthew! 1) 2) and 3) are now working fine :)
but I do believe borders are still broken. For example:


#lang racket/gui

(define root (new frame% (label Label)))

(define vp
  (new vertical-panel% (parent root) (vert-margin 5) (style '(border

(define vp2
  (new vertical-panel% (parent vp) (horiz-margin 5) (style '(border

(define vp3
  (new vertical-panel% (parent vp2) (vert-margin 5) (style '(border

(define btn
  (new button% (parent vp3) (label button) (horiz-margin 5)))

(send root show #t)


produces the attached window with just a button, but no borders for any
of the panels...

Marijn
attachment: drracket_noborders.png

signature.asc
Description: OpenPGP digital signature
_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/dev

[racket-dev] strange/wrong placement and sizing in racket/gui

2011-06-20 Thread Marijn
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi list,

I have a couple of issues with current racket/gui behavior. I have
created the following test-case:


#lang racket/gui

(define list-editor%
  (class vertical-panel%
(init init-values parent)
(super-new (parent parent))

(define (insert-item val)
  (let* ((v (new vertical-panel% (parent this) )) ;**
; (ins (new button% (parent v) (label insert)))
 )
(new text-field% (parent this) (label ) (init-value val))) )

;(send this begin-container-sequence)
(for ((v init-values)) (insert-item v))
;(send this end-container-sequence)

)) ; end define class

(define root (new frame% (label List Editor)))

(new list-editor% (parent root) (init-values '(1 2 3)))

(send root show #t)


1) If you run the program like this, then 3 wide text-fields are created
each with lots of empty space on top of it. The empty space shouldn't be
there.

2) Now uncomment the first commented line, the one that creates buttons
and run again. The texfields are now narrow and instead of empty space
there are now buttons. This case seems fine.

3) Now uncomment the begin/end-container-sequence lines and run again.
Suddenly the textfields are wide again and there is extra vertical space
in between the textfields and buttons. I don't think that
begin/end-container-sequence should ever influence the final result,
since they are only to prevent flickering due to too frequent on-screen
resizing.

4) Finally, it seems that (style '(border)) doesn't work for me when I
add it on the line marked ** as a property of the vertical-panel.

All this (tested) on Linux.

Marijn
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.17 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk3/UTwACgkQp/VmCx0OL2wBKwCgiOstXY8bJfRiWplxuWXIl2e/
gtYAniao8oxq9yOv14PMw/SaYgpjppk0
=Cn3z
-END PGP SIGNATURE-
_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/dev


Re: [racket-dev] Please help me to fix the code

2011-05-31 Thread Marijn
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi Yingjian,

On 05/31/11 01:17, Yingjian Ma wrote:
 Hi All,
 
 I wrote a piece of code to count the occurrance of a letter in a list.  But
 it gave me an error saying #procedure:...uments...

What makes you think it's an error?

 The code is below:
 
 (define (count-matches s l)
   (cond
  [(empty? l) 0]
  [(equal? s (first l)) (lambda (i)(+ i 1))]
  [else (count-matches s (rest l))]))

Part of this code reads:

compare s to the first element of list l and if they are equal return a
function that returns its argument plus one (and forget about the rest
of the list).

Marijn

-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.17 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk3koL8ACgkQp/VmCx0OL2ztFwCfUG1WrfbagBXTp7F9prAvvaL8
sycAoJWBleSTJ/eE2CExwx1zt71Z1Lks
=e+cf
-END PGP SIGNATURE-
_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/dev


[racket-dev] drracket internal error when playing with insert - GUI

2011-05-26 Thread Marijn
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

I got the following internal error when playing with insert - GUI:

refresh method of pasteboard%: expects type 'no-caret,
'show-inactive-caret, or 'show-caret as 5th argument, given: '(0 . 1);
other arguments were: 0.0 0.0 104.0 125.0 #f

 === context ===
/usr/lib64/racket/collects/mred/private/wxme/pasteboard.rkt:1297:2:
refresh method in pasteboard%
/usr/lib64/racket/collects/mred/private/wxme/editor-snip.rkt:292:10
/usr/lib64/racket/collects/mred/private/wxme/text.rkt:5253:24: sloop
/usr/lib64/racket/collects/mred/private/wxme/text.rkt:5222:16: lloop
/usr/lib64/racket/collects/mred/private/wxme/text.rkt:5019:2: refresh
method in text%
/usr/lib64/racket/collects/mred/private/wxme/editor-canvas.rkt:605:2:
redraw method in editor-canvas%
/usr/lib64/racket/collects/mred/private/wxme/text.rkt:805:2:
do-set-position method in text%
/usr/lib64/racket/collects/mred/private/wxme/editor-canvas.rkt:382:2:
on-event method in editor-canvas%
/usr/lib64/racket/collects/racket/private/more-scheme.rkt:149:2:
call-with-break-parameterization
/usr/lib64/racket/collects/racket/private/more-scheme.rkt:265:2:
call-with-exception-handler
/usr/lib64/racket/collects/mred/private/wx/gtk/window.rkt:621:4:
dispatch-on-event method in window%
/usr/lib64/racket/collects/mred/private/wx/common/queue.rkt:430:6
/usr/lib64/racket/collects/mred/private/wx/common/queue.rkt:470:32
/usr/lib64/racket/collects/mred/private/wx/common/queue.rkt:607:3

Marijn
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.17 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk3eRN4ACgkQp/VmCx0OL2yDPgCgijQ7LueD+cGjxtI++HPE9Eu6
UrMAoMM/Huubl1VLcDm/BUWyXd92FVrv
=i/Mq
-END PGP SIGNATURE-
_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/dev


[racket-dev] drracket on linux, no middle-mouse-paste, no Replace

2011-05-24 Thread Marijn
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi,

with version 5.1.1 of drracket running on linux,
mouse-select/middle-mouse-paste isn't working.

Unrelatedly I noticed that in the Edit menu all three options concerning
Replace are greyed out.

Marijn
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.17 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk3brFUACgkQp/VmCx0OL2wDKgCffgGF9SJxsG954PN6emJ4/owM
jUgAn1r1DNkteVsfYLO8dU1eGfU6+dSA
=DyN0
-END PGP SIGNATURE-
_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/dev


Re: [racket-dev] drracket on linux, no middle-mouse-paste, no Replace

2011-05-24 Thread Marijn
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 05/24/11 15:41, Rodolfo Carvalho wrote:
 On Tue, May 24, 2011 at 10:02, Marijn hk...@gentoo.org wrote:
 Unrelatedly I noticed that in the Edit menu all three options concerning
 Replace are greyed out.
 
 Indeed, but I wonder it's like this by design?
 If you click find and then show replace on the menu, then replace is
 available.
 

Hmm, I guess that it's possible to be by design, but I find it a bit
clunky. Also I am missing regex search and replace tools!

Marijn
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.17 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk3bw8AACgkQp/VmCx0OL2wQ/ACgg70vGB/au5j9feu1fIMAZUQL
GvwAn25E8AjaHv8LgCdz4Q+Ed+eUGvSd
=i5cj
-END PGP SIGNATURE-
_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/dev


Re: [racket-dev] mzscheme executable broken when using --enable-shared

2011-04-19 Thread Marijn
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 04/18/11 14:35, Matthew Flatt wrote:
 At Mon, 18 Apr 2011 10:11:25 +0200, Marijn wrote:
 I tried to test your changes, but ran into an (unrelated I think)
 compile failure:
 
 Fix pushed. (Previous changes broke the non-futures, non-places build.)
 

Thanks Matthew, mzscheme and mred are now both working.

Marijn
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.17 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk2tQG8ACgkQp/VmCx0OL2w8OACgiEh9XWcJoRkP3xnrRvZAsGA3
LfAAn1hyrgyKRUxRUiL1nFo1sc13YjWQ
=L6mi
-END PGP SIGNATURE-
_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/dev


Re: [racket-dev] mzscheme executable broken when using --enable-shared

2011-04-18 Thread Marijn
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi Matthew,

On 04/18/11 04:00, Imran Rafique wrote:
 Ah, that would explain it (Marijn is packaging racket for gentoo, as
 part of the gentoo-lisp group). Binaries are stripped by default
 pre-installation by the emerge packager.

Imran is correct.

 On 18 April 2011 00:39, Matthew Flatt mfl...@cs.utah.edu wrote:
 Was `strip' or a similar tool run on the `mzscheme' executable?

 Except for `racket', `gracket', and executables created as shell
 scripts, Racket executables are generated by cloning `starter' and
 appending extra data to the end of the executable file. Simply
 appending data to the end of the file is a hack; it doesn't create a
 well-formed ELF binary. Using `strip' or similar tools on the broken
 binary tends to just throw away the data, which would lead to an error
 like the one you reported.

 I've pushed changes that add to `starter' in a proper ELF section. Even
 if you didn't run `strip', having a valid ELF binary may fix the
 problem you're seeing.

I tried to test your changes, but ran into an (unrelated I think)
compile failure:

 x86_64-pc-linux-gnu-gcc -I./.. -I./../include
- -I/usr/lib64/libffi-3.0.10rc8/include -DMZ_DONT_USE_JIT
- -DMZ_USES_SHARED_LIB -c ./module.c  -fPIC -DPIC -o .libs/module.o
/var/tmp/portage/dev-scheme/racket-999/work/racket-999/src/lt/libtool
- --mode=compile --tag=CC x86_64-pc-linux-gnu-gcc -I./.. -I./../include
   -I/usr/lib64/libffi-3.0.10rc8/include   -DMZ_DONT_USE_JIT
- -DMZ_USES_SHARED_LIB -c ./mzrt.c -o mzrt.lo
./module.c: In function 'do_module_execute':
./module.c:5278: error: 'scheme_module_code_cache' undeclared (first use
in this function)
./module.c:5278: error: (Each undeclared identifier is reported only once
./module.c:5278: error: for each function it appears in.)
make[6]: *** [module.lo] Error 1


Marijn
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.17 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk2r8i0ACgkQp/VmCx0OL2w6pwCgyPsC25mIOgur+YpA/nMpLPPX
QIYAn3LHhcfdf6Xdv29z7qVDefv8SPVf
=dsGD
-END PGP SIGNATURE-
_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/dev


Re: [racket-dev] racket-5.1{, .0.6} not building foreign interface not supported

2011-04-15 Thread Marijn
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 04/14/11 18:55, Matthew Flatt wrote:
 At Thu, 14 Apr 2011 16:56:30 +0200, Marijn wrote:
 configure:5173: x86_64-pc-linux-gnu-gcc -o conftest -march=native -ggdb
 -O2 -pipe -I/usr/lib64/libffi-3.0.10rc8/include  -Wl,-O1
 -Wl,--as-needed -lffi
 conftest.c -ldl -lm  -ldl -lm -rdynamic 5
 
 I mixed up LDFLAGS and LIBS, now fixed.
 
 Another try?

Thanks Matthew, that did it.

Marijn

-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.17 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk2oBJ0ACgkQp/VmCx0OL2wKfgCeNGCjzt6RH6l5H2hATqTJxv6t
I4gAn2IVLLDzKWxr66k9qoBcLzY5pebB
=F+Dz
-END PGP SIGNATURE-
_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/dev


Re: [racket-dev] mzscheme executable relic

2011-04-15 Thread Marijn
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 04/13/11 14:15, Marijn wrote:
 Hi,
 
 racket currently still installs a mzscheme executable that (on my
 system) does this:
 
 $ mzscheme
 read failed to read all 31 bytes from file /usr/bin/mzscheme
 Aborted
 
 Marijn

Does anyone know what this broken file is about or am I the only one
seeing this?

Marijn
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.17 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk2oBwYACgkQp/VmCx0OL2zDcwCgkh6F6Hi0lSufRidQ4h0/IZmD
9T4An1JJtxYfitjAgSVj/OtVdz5YNUHw
=gDVF
-END PGP SIGNATURE-
_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/dev


Re: [racket-dev] mzscheme executable broken when using --enable-shared

2011-04-15 Thread Marijn
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

 On Fri, Apr 15, 2011 at 10:51, Marijn hk...@gentoo.org wrote:
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 On 04/13/11 14:15, Marijn wrote:
 Hi,

 racket currently still installs a mzscheme executable that (on my
 system) does this:

 $ mzscheme
 read failed to read all 31 bytes from file /usr/bin/mzscheme
 Aborted

 Marijn

 Does anyone know what this broken file is about or am I the only one
 seeing this?

On 04/15/11 11:05, Pierpaolo Bernardi wrote:
 See: 
 http://docs.racket-lang.org/scheme/compat-exe.html?q=mzscheme#(idx._(gentag._0._(lib._scribblings/scheme/scheme..scrbl)))
 
 Or search mzscheme in the Help Desk.  In windows, it works as advertised.
 
 Cheers
 P.

Okay, I see there that it is supposed to be equivalent to racket -I
scheme/init, but that command works fine.

On 04/15/11 11:08, Eli Barzilay wrote:
 Random guess -- maybe it's a result of using shared libraries?  (Our
 linux builds are not using that configuration.)

Yes, I am building with --enable-shared. Both mzscheme and mred are
broken with the same error, drscheme works fine.

Marijn
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.17 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk2oD9AACgkQp/VmCx0OL2z8KQCguXZd4LyPlG8DwTLEgq2sHuDX
tkEAoIFpOFIrrSpE8+moBkShQW92rQso
=jiZR
-END PGP SIGNATURE-
_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/dev


Re: [racket-dev] mzscheme executable broken when using --enable-shared

2011-04-15 Thread Marijn
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 04/15/11 18:07, Matthew Flatt wrote:
 I tried a build with `--enable-shared' and the generated `mzscheme'
 executable worked for me, so it's not just `--enable-shared' that
 causes the problem.
 
 If you run the `starter' executable in the Racket lib directory, do
 you get an error like this?
 
   lib/starter: this is an unconfigured starter

Yes, I do.

Marijn

 The `mzscheme' and `mred' executables are created by cloning and
 configuring `starter', so something could be going wrong either in the
 creation of `starter' or in copying and configuring it.
 
 Thanks,
 Matthew
 
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.17 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk2ocycACgkQp/VmCx0OL2zbOgCeLxB1f7HMfISArJEZ83ade4kn
JHkAnAhd8zyCM6uHbLbX7lU0uggJnitg
=fc+i
-END PGP SIGNATURE-
_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/dev

Re: [racket-dev] racket-5.1{, .0.6} not building foreign interface not supported

2011-04-14 Thread Marijn
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi Matthew,

On 04/13/11 19:00, Matthew Flatt wrote:
 At Wed, 13 Apr 2011 11:54:44 +0200, Marijn wrote:
 Meanwhile, `configure' now detects when libffi is already installed and
 uses it (instead of building the version that is included with Racket).

 I am now able to build with the bundled libffi, but when I delete that
 from the source and try to build it doesn't find the system library:

 x86_64-pc-linux-gnu-gcc -march=native -ggdb -O2 -pipe -DMZ_DONT_USE_JIT
 -DMZ_USES_SHARED_LIB -I./../racket -I./../racket/include
 -I./../racket/src -Ilibffi/include -c ./foreign.c  -fPIC -DPIC -o
 .libs/foreign.o
 ./foreign.c:73:17: error: ffi.h: No such file or directory

 libffi uses pkgconfig but I'd have to check up on how to use that again
 
 I've pushed changed to make `configure' use `pkg-config' for libffi.

configure doesn't detect that I have a system libffi installed.
Specifically,

  AC_TRY_LINK([#include ffi.h],
  [ffi_cif cif; ]
  [ffi_prep_cif(cif, FFI_DEFAULT_ABI, 0, ffi_type_void,
NULL);],
 have_libffi=yes,
 have_libffi=no)

seems to be failing. If I fool it by inserting

  have_libffi=yes

after that test, then everything seems to build fine. I'm not sure how
to debug that AC_TRY_LINK invocation or what kind of information would
help you to do it, so please tell me if you need anything.

Marijn
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.17 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk2msuwACgkQp/VmCx0OL2zUPACguYhksn5Xvg+epnKJfx76qU8a
I1oAoLEn7gfFfgw3KWQGclYgpCMT51FK
=45zy
-END PGP SIGNATURE-
_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/dev


Re: [racket-dev] racket-5.1{, .0.6} not building foreign interface not supported

2011-04-14 Thread Marijn
On 04/14/11 14:03, Matthew Flatt wrote:
 At Thu, 14 Apr 2011 10:40:12 +0200, Marijn wrote:
 I'm not sure how
 to debug that AC_TRY_LINK invocation or what kind of information would
 help you to do it, so please tell me if you need anything.
 
 Can you send me config.log? It shows the compilation commands and
 error messages when AC_TRY_LINK tries to compile and link.


configure:5116: result: yes
configure:5121: checking for libffi
configure:5173: x86_64-pc-linux-gnu-gcc -o conftest -march=native -ggdb
-O2 -pipe -I/usr/lib64/libffi-3.0.10rc8/include  -Wl,-O1
-Wl,--as-needed -lffi
conftest.c -ldl -lm  -ldl -lm -rdynamic 5
/var/tmp/portage/dev-scheme/racket-999/temp/ccc4wcaM.o: In function `main':
/var/tmp/portage/dev-scheme/racket-999/work/racket-999/src/conftest.c:29: 
undefined
reference to `ffi_type_void'
/var/tmp/portage/dev-scheme/racket-999/work/racket-999/src/conftest.c:29: 
undefined
reference to `ffi_prep_cif'
collect2: ld returned 1 exit status
configure:5179: $? = 1
configure: failed program was:
| /* confdefs.h.  */
| #define PACKAGE_NAME 
| #define PACKAGE_TARNAME 
| #define PACKAGE_VERSION 
| #define PACKAGE_STRING 
| #define PACKAGE_BUGREPORT 
| #define USE_SINGLE_FLOATS 1
| #define HAVE_LIBM 1
| #define HAVE_LIBDL 1
| #define MZ_USE_NOINLINE 1
| #define HAVE_CODESET 1
| #define HAVE_GETADDRINFO 1
| #define STDC_HEADERS 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRING_H 1
| #define HAVE_MEMORY_H 1
| #define HAVE_STRINGS_H 1
| #define HAVE_INTTYPES_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_UNISTD_H 1
| /* end confdefs.h.  */
| #include ffi.h
| int
| main ()
| {
| ffi_cif cif;
|   ffi_prep_cif(cif, FFI_DEFAULT_ABI, 0, ffi_type_void,
NULL);
|   ;
|   return 0;
| }
configure:5195: result: no
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.

It was created by configure, which was
generated by GNU Autoconf 2.61.  Invocation command line was

  $ ./configure --prefix=/usr --build=x86_64-pc-linux-gnu 
--host=x86_64-pc-linux-gnu --mandir=/usr/share/man --infodir=/usr/share/info 
--datadir=/usr/share --sysconfdir=/etc --localstatedir=/var/lib 
--libdir=/usr/lib64 --enable-gracket --disable-plot --disable-docs 
--enable-shared --disable-jit --enable-foreign --disable-places 
--disable-futures --disable-backtrace --disable-pthread --disable-perl --with-x

## - ##
## Platform. ##
## - ##

hostname = fusion
uname -m = x86_64
uname -r = 2.6.36-gentoo-r8
uname -s = Linux
uname -v = #1 SMP PREEMPT Wed Mar 9 14:02:29 CET 2011

/usr/bin/uname -p = Intel(R) Core(TM)2 Duo CPU E8600 @ 3.33GHz
/bin/uname -X = unknown

/bin/arch  = unknown
/usr/bin/arch -k   = unknown
/usr/convex/getsysinfo = unknown
/usr/bin/hostinfo  = unknown
/bin/machine   = unknown
/usr/bin/oslevel   = unknown
/bin/universe  = unknown

PATH: /usr/lib64/portage/bin/ebuild-helpers/4
PATH: /usr/lib64/portage/bin/ebuild-helpers
PATH: /usr/local/sbin
PATH: /usr/local/bin
PATH: /usr/sbin
PATH: /usr/bin
PATH: /sbin
PATH: /bin
PATH: /opt/bin
PATH: /usr/x86_64-pc-linux-gnu/gcc-bin/4.4.5


## --- ##
## Core tests. ##
## --- ##

configure:1693: loading site script /usr/share/config.site
| #!/bin/bash
| # Copyright 2009 Gentoo Foundation
| # Distributed under the terms of the GNU General Public License v2
| 
| TOPDIR=/usr/share/crossdev/include/site
| 
| config_site_arch() {
|   local host=$(echo ${CHOST/-/ } | awk '{print $1}')
| 
|   [[ ${host/arm.*eb/} != ${host} ]]  host=armeb
|   [[ ${host/arm/} != ${host} ]]  [[ ${host} != armeb ]]  host=arm
| 
|   [[ ${host/mips.*el/} != ${host} ]]  host=mipsel
| 
|   #[[ ${host/i[4-5]/6} != ${host} ]]  host=i686
| 
|   echo ${host}
| }
| 
| config_site_names() {
|   local site_arch=$(config_site_arch)
|   local sites=
|   local x
| 
|   [[ ${CHOST/-linux-/} != $CHOST ]]  sites+= linux ${site_arch}-linux
|   [[ ${CHOST/darwin/} != $CHOST ]]  sites+= darwin ${site_arch}-linux
| 
|   [[ ${CHOST/-linux-uclibc/} != $CHOST ]]  sites+= linux-uclibc 
${site_arch}-linux-uclibc
|   [[ ${CHOST/-linux-gnu/} != $CHOST ]]  sites+= linux-gnu 
${site_arch}-linux-gnu
| 
|   [[ ${CHOST/-linux-uclibceabi/} != $CHOST ]]  sites+= 
linux-uclibceabi ${site_arch}-linux-uclibceabi
|   [[ ${CHOST/-linux-gnueabi/} != $CHOST ]]  sites+= linux-gnueabi 
${site_arch}-linux-gnueabi
| 
|   for x in ${sites} ${CHOST}; do
|   [[ -e ${TOPDIR}/${x} ]]  echo ${TOPDIR}/${x}
|   done
| }
| 
| if [[ ${CHOST} !=  ]]; then
|   sites=$(config_site_names)
|   if [[ ${sites} !=  ]]; then
|   for site in ${sites}; do
|   echo $(basename $0): loading site script ${site}
|   . ${site}
|   done
|   fi
|   unset site
|   unset sites
| fi
configure:2366: checking for x86_64-pc

[racket-dev] mzscheme executable relic

2011-04-13 Thread Marijn
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi,

racket currently still installs a mzscheme executable that (on my
system) does this:

$ mzscheme
read failed to read all 31 bytes from file /usr/bin/mzscheme
Aborted

Marijn
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.17 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk2lk+QACgkQp/VmCx0OL2xOqwCdGo857ztIWO7KGw/8GFT9iTo2
nHAAnRQL9x8gjl4CzkoB9/E3y+hoP5j5
=NSMG
-END PGP SIGNATURE-
_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/dev