Re: [racket] Exception Stack Trace Troubles

2012-06-27 Thread Robby Findler
No, that's not the way Racket works. :) There is something wrong and our messages are designed to figure out what that is. Thanks for your patience. I think Matthew's message is next on the list to answer. Robby On Wed, Jun 27, 2012 at 10:15 PM, Chad Albers wrote: > Yes, intel/amd 64 bit. > > I

Re: [racket] Exception Stack Trace Troubles

2012-06-27 Thread Chad Albers
Yes, intel/amd 64 bit. I don't have a .racketrc...I need to find out why I need that in the docs. I did you -j and success! I got a stack trace. So, that brings up a question. Is there a way to support stack traces without disabling the jit compiler? I understand that stack traces add a certa

Re: [racket] Exception Stack Trace Troubles

2012-06-27 Thread Matthew Flatt
I should have also mentioned that using -j to disable the JIT (as Robby suggested) should also give you context independent of the platform or the way that Racket is compiled. At Wed, 27 Jun 2012 20:28:53 -0600, Matthew Flatt wrote: > I wonder whether the problem could be related to compilation op

Re: [racket] Exception Stack Trace Troubles

2012-06-27 Thread Matthew Flatt
I wonder whether the problem could be related to compilation options. Did you compile your own executable? If so, what flags were given to `configure' and/or the C compiler? On x86_64 Linux, Racket uses DWARF information to walk parts of the runtime stack. It occurs to me that if you use gcc witho

Re: [racket] returning self as sync result with struct prop:evt and wrap-evt

2012-06-27 Thread Matthew Flatt
At Wed, 27 Jun 2012 18:20:45 -0400, Neil Van Dyke wrote: > Question: If I put a "log-debug" into that "(lambda (self) ...)" proc, > looks like the proc is applied every time i call "sync". If the > "log-debug" isn't in there, is the overhead of applying that proc and > "wrap-evt" each time I ca

Re: [racket] returning self as sync result with struct prop:evt and wrap-evt

2012-06-27 Thread Neil Van Dyke
Matthew Flatt wrote at 06/27/2012 05:41 PM: At Wed, 27 Jun 2012 17:34:27 -0400, Neil Van Dyke wrote: If I have a struct that wraps an input-port, and I want the struct to be usable as an event that returns the struct as the sync result... is there an better way than the code below? Yo

Re: [racket] openGL on Mac OS

2012-06-27 Thread Matthew Flatt
At Wed, 27 Jun 2012 23:14:21 +0200, Petr Samarin wrote: > I was trying out some examples from the documentation and used openGL code > outside of openGL context! That makes sense. I vaguely recall that Apple's GL is likely to crash without a context, while other GL implementations tend not to cra

Re: [racket] returning self as sync result with struct prop:evt and wrap-evt

2012-06-27 Thread Matthew Flatt
At Wed, 27 Jun 2012 17:34:27 -0400, Neil Van Dyke wrote: > If I have a struct that wraps an input-port, and I want the struct to be > usable as an event that returns the struct as the sync result... is > there an better way than the code below? You can use a procedure that receives "self" as the

[racket] returning self as sync result with struct prop:evt and wrap-evt

2012-06-27 Thread Neil Van Dyke
If I have a struct that wraps an input-port, and I want the struct to be usable as an event that returns the struct as the sync result... is there an better way than the code below? In the code below, I am using "letrec" to get around the fact that AFAIK, I need my "wrap-evt" proc arg to refer

Re: [racket] openGL on Mac OS

2012-06-27 Thread Petr Samarin
I was trying out some examples from the documentation and used openGL code outside of openGL context! Here is the code to reproduce the error: (require sgl/gl sgl/gl-vectors) (glBegin GL_TRIANGLES) (glVertex3i 1 2 3) (glVertex4fv (gl-float-vector 1 2 3 4)) (glEnd) It would be nice to g

Re: [racket] openGL on Mac OS

2012-06-27 Thread Matthew Flatt
I don't have any immediate ideas. I've always used the Apple libraries, and they work for me. Do you see the crash just running one of the GL-based games in the PLT Game application (such as Jewel or Gobblet)? Can you send more of the crash report? At Wed, 27 Jun 2012 15:04:43 +0200, Petr Samari

Re: [racket] HtDP for programmers?

2012-06-27 Thread saad bashir
I am a novice programmer learning it primarily through How to Design Programmes, 2nd edition. I have to say it is a unique book, as it claims and superbly designed and written. I think any one who wants to learn programming should go through the entire book - if he/she knows it, the progress will

Re: [racket] Is list processing function "last" expensive?

2012-06-27 Thread Jay McCarthy
And there are a lot of other list-like data-structures that make certain operations better (at the expense, sometimes, of different ones): https://github.com/takikawa/tr-pfds On Wed, Jun 27, 2012 at 11:06 AM, Danny Yoo wrote: > > > On Wednesday, June 27, 2012, Harry Spier wrote: >> >> Is the lis

Re: [racket] Is list processing function "last" expensive?

2012-06-27 Thread Danny Yoo
On Wednesday, June 27, 2012, Harry Spier wrote: > Is the list processing function "last" expensive? Does it traverse > the entire list to get the value? > > Random access in a linked list is costly, so yes. If you need fast random access, vectors and gvectors may be appropriate.

[racket] Is list processing function "last" expensive?

2012-06-27 Thread Harry Spier
Is the list processing function "last" expensive? Does it traverse the entire list to get the value? Thanks, Harry Racket Users list: http://lists.racket-lang.org/users

Re: [racket] Choosing what class to instantiate at runtime

2012-06-27 Thread Matthias Felleisen
On Jun 27, 2012, at 12:39 PM, Kieron Hardy wrote: > Thanks Danny, that's a step in the direction I wanted to go. > > But on further reflection, I think what I was looking for (i.e. have some > class that stops it's own instantiation and defers to another class depending > on some parameter val

Re: [racket] Choosing what class to instantiate at runtime

2012-06-27 Thread Kieron Hardy
Thanks Danny, that's a step in the direction I wanted to go. But on further reflection, I think what I was looking for (i.e. have some class that stops it's own instantiation and defers to another class depending on some parameter value(s)) doesn't really make sense. Instead I need some sort of

Re: [racket] Exception Stack Trace Troubles

2012-06-27 Thread Robby Findler
By 64 bit architecture, I assume it is an intel/amd chip? What happens if you pass -j on the command-line to racket when you try this? (You don't have a .racketrc, right?) Does the test suite pass? You'd run that with racket -qr plt/collects/tests/racket/quiet.rktl (where "plt" is the path t

Re: [racket] datum-intern-literal and lists?

2012-06-27 Thread Danny Yoo
> Any idea why?  Did you trace everything under a custodian to catch all > threads etc, and ran without places? I ran Scribble directly through the command line program 'scribble'. As far as I can tell, under that environment, there are no direct uses of threads or places, so the profile should be

Re: [racket] HtDP for programmers?

2012-06-27 Thread Matthias Felleisen
On Jun 27, 2012, at 1:39 AM, m...@goblin.punk.net wrote: > I am planning to work through _How to Design Programs_ but > already have some (imperative) programming experience as well as > some exposure to Racket/Scheme. > > I found the following piece of advice in the mailing list > archive. An

Re: [racket] why is the comparimng always false

2012-06-27 Thread Roelof Wobben
Oke, If I understand this the struct Vanimal is not a part of the programm ? Roelof Op 27-6-2012 15:56, Matthias Felleisen schreef: 1. You got trapped in a strange corner of the language: -- to ask whether some value is a a Vcat you should use Vcat? -- BSL should not really allow you to s

Re: [racket] why is the comparimng always false

2012-06-27 Thread Matthias Felleisen
1. You got trapped in a strange corner of the language: -- to ask whether some value is a a Vcat you should use Vcat? -- BSL should not really allow you to say 'Vcat' all by itself. [I need to investigate this problem. Sadly it is not a bug.] 2. Try to understand this: (define-struct Vcat

[racket] openGL on Mac OS

2012-06-27 Thread Petr Samarin
FFI bindings for openGL do not work when "glu-lib" and "gl-lib" in gl.rkt are linked to Apple's own openGL libraries in: "/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL" "/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGLU" Any use of functions provided

Re: [racket] for*/list and Typed Racket

2012-06-27 Thread Adolfo Pérez Álvarez
> > Looking at this smaller example, I think that the nested recursion in > expansion of `for*/list` is confusing Typed Racket.  I'll look into > why that is, and if it can be fixed.  In the meantime, you ought to be > able to rewrite the loop to use `for/fold:` and `reverse` to work > around this

Re: [racket] Exception Stack Trace Troubles

2012-06-27 Thread Chad Albers
Hi Eli, Here's the file that I'm running in a gist: https://gist.github.com/3003496 In other words, it's a cut-and-paste of code that you posted earlier in this chain: #lang racket (with-handlers ([void (λ (e) (continuation-mark-set->context (ex

[racket] why is the comparimng always false

2012-06-27 Thread Roelof Wobben
Hello, I try to figure out how I can check if a struct is a Vcat or a Vcham. So i tried this: ; – a VCham (define-struct Vanimal (animal)) ; a struct has two parts ( the x-coordinate of a cat and the happiness of the cat) (define-struct Vcat [x happiness]) ; make Vcat : number (x) number (h)