Re: [racket-users] Strange behaviour of the eq? operator in racket repl
Il giorno 18/mag/2015, alle ore 21.34, Jens Axel Søgaard ha scritto: 2015-05-18 21:25 GMT+02:00 Michael Tiedtke michael.tied...@o2online.de: Il giorno 18/mag/2015, alle ore 20.50, Jos Koot ha scritto: I think Rackets's reference and guide are *very clear* about eq?, eqv? and equal?. Yes, right. It was the Racket Reference to tell me exactly that eqv? is an eq? that works for numbers and characters, too. I really had to look this up and found an simple and concise description. But the entries for for-each and map do not state anything about the execution order of the list processing. Here is what the documentation say: Racket docs: Applies proc to the elements of the lsts from the first elements to the last. R5RS: The dynamic order in which proc is applied to the elements of the lists is unspecified. I interpret the Racket docs to mean that the procedure are applied to the elements in the list in the order they appear in the list. In contrast R5RS (on purpose) state that the order is unspecified, which means that an implementor of R5RS Scheme is free to choose the order which fits his system best. Potentially the freedom to choose the order could enable some optimizations. the order for map is unspecified so that it can be optimized. for-each guarantees to call proc in order from list head to list tail. -- You received this message because you are subscribed to the Google Groups Racket Users group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[racket-users] Implementing a lazy for/stream using for/fold/derived and delimited control
I'm trying to implement a for/stream loop using for/fold/derived that will return a lazy stream, as would be expected. One way to do this is by using delimited control, which is what I'm currently trying. If there's an easier way, let me know, but I'd still like to figure this out as a pedagogical exercise. Right now, I'm just trying to play with for/fold and some control operators to get a feel for how a solution should work. Using racket/control, I've managed to get this working snippet: (define result-stream (let () (define (stream-loop element continue) (stream-cons element (call-with-values (thunk (call/prompt continue)) stream-loop))) (call-with-values (thunk (prompt (for/fold () ([i (in-naturals)]) (let/cc continue (abort i continue) stream-loop))) This will create an infinite, lazy stream bound to ‘result-stream’ containing all the natural numbers. It works, which is cool, but it also seems pretty overcomplicated. Is there a better approach to this sort of thing that I'm missing? My intuition for working with control operators isn't the best, so I wouldn't be surprised if I was overlooking something. Thanks, Alexis -- You received this message because you are subscribed to the Google Groups Racket Users group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [racket-users] slideshow keyboard callbacks?
I don't think keybinding support or slide-changing operations are there already. My guess is that they'd be easy to add. At Tue, 19 May 2015 19:30:35 -0700, 'John Clements' via users-redirect wrote: I’m creating a simple slideshow, and I’d like to be able to jump to a given slide instantly, ideally by pressing a particular key. Basically, I’d like to be able to write this: #lang slideshow (extend-keyboard-handler (lambda (key default-handler) (match key [1 (jump-to-slide some-slide)] [2 (jump-to-slide some-other-slide)] [a (play my-sound)] [other (default-handler key)]))) I’ve just been through the slideshow docs, and I don’t see anything like this—at least, not documented. Is something like this easy, or hard? Thanks! John -- You received this message because you are subscribed to the Google Groups Racket Users group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups Racket Users group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[racket-users] Re: Implementing a lazy for/stream using for/fold/derived and delimited control
As I've continued to experiment with this, I've run into something that I don't really understand. I've managed to come up with this snippet of code. (define (do prompt-tag) (define (loop element continue) (if continue (+ element (call-with-continuation-prompt continue prompt-tag loop)) element)) (call-with-continuation-prompt (thunk (for/fold () ([i (in-range 10)]) (let/cc continue (abort-current-continuation prompt-tag (let () i) continue))) (abort-current-continuation prompt-tag 0 #f)) prompt-tag loop)) (do (default-continuation-prompt-tag)) (do (make-continuation-prompt-tag)) The first of the two calls at the end returns 45, but the second returns 0. Why does using a non-default prompt tag change the behavior if I'm installing my own prompt anyway? On May 19, 2015, at 19:24, Alexis King lexi.lam...@gmail.com wrote: I'm trying to implement a for/stream loop using for/fold/derived that will return a lazy stream, as would be expected. One way to do this is by using delimited control, which is what I'm currently trying. If there's an easier way, let me know, but I'd still like to figure this out as a pedagogical exercise. Right now, I'm just trying to play with for/fold and some control operators to get a feel for how a solution should work. Using racket/control, I've managed to get this working snippet: (define result-stream (let () (define (stream-loop element continue) (stream-cons element (call-with-values (thunk (call/prompt continue)) stream-loop))) (call-with-values (thunk (prompt (for/fold () ([i (in-naturals)]) (let/cc continue (abort i continue) stream-loop))) This will create an infinite, lazy stream bound to ‘result-stream’ containing all the natural numbers. It works, which is cool, but it also seems pretty overcomplicated. Is there a better approach to this sort of thing that I'm missing? My intuition for working with control operators isn't the best, so I wouldn't be surprised if I was overlooking something. Thanks, Alexis -- You received this message because you are subscribed to the Google Groups Racket Users group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[racket-users] slideshow keyboard callbacks?
I’m creating a simple slideshow, and I’d like to be able to jump to a given slide instantly, ideally by pressing a particular key. Basically, I’d like to be able to write this: #lang slideshow (extend-keyboard-handler (lambda (key default-handler) (match key [1 (jump-to-slide some-slide)] [2 (jump-to-slide some-other-slide)] [a (play my-sound)] [other (default-handler key)]))) I’ve just been through the slideshow docs, and I don’t see anything like this—at least, not documented. Is something like this easy, or hard? Thanks! John -- You received this message because you are subscribed to the Google Groups Racket Users group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[racket-users] DLS-15, CFP
- C A L L F O R P A P E R S - DLS 2015 === 11th Dynamic Languages Symposium 2015 October, 2015 Pittsburgh, Pennsylvania, United States http://DLS2015.inria.fr Co-located with SPLASH 2015 In association with ACM SIGPLAN The 11th Dynamic Languages Symposium (DLS) at SPLASH 2015 is the premier forum for researchers and practitioners to share knowledge and research on dynamic languages, their implementation, and applications. The influence of dynamic languages -- from Lisp to Smalltalk to Python to Javascript -- on real-world practice and research continues to grow. DLS 2015 invites high quality papers reporting original research, innovative contributions, or experience related to dynamic languages, their implementation, and applications. Accepted papers will be published in the ACM Digital Library, and freely available for 2 weeks before and after the event itself. Areas of interest include but are not limited to: Innovative language features and implementation techniques Development and platform support, tools Interesting applications Domain-oriented programming Very late binding, dynamic composition, and run-time adaptation Reflection and meta-programming Software evolution Language symbiosis and multi-paradigm languages Dynamic optimization Hardware support Experience reports and case studies Educational approaches and perspectives Semantics of dynamic languages == Invited Speaker == DLS is pleased to announce a talk by the following invited speaker: Eelco Visser: Declare your Language. == Submissions and proceedings == Submissions should not have been published previously nor under review at other events. Research papers should describe work that advances the current state of the art. Experience papers should be of broad interest and should describe insights gained from substantive practical applications. The program committee will evaluate each contributed paper based on its relevance, significance, clarity, length, and originality. Papers are to be submitted electronically at http://www.easychair.org/conferences?conf=dls15 in PDF format. Submissions must be in the ACM format (see http://www.sigplan.org/authorInformation.htm) and not exceed 12 pages. Authors are reminded that brevity is a virtue. DLS 2015 will run a two-phase reviewing process to help authors make their final papers the best that they can be. After the first round of reviews, papers will be rejected, conditionally accepted, or unconditionally accepted. Conditionally accepted papers will be given a list of issues raised by reviewers. Authors will then submit a revised version of the paper with a cover letter explaining how they have or why they have not addressed these issues. The reviewers will then consider the cover letter and revised paper and recommend final acceptance or rejection. Accepted papers will be published in the ACM Digital Library. Important dates Abstract Submissions: Sun 7 Jun 2015 Full Submissions: Sun 15 Jun 2015 First phase notification: Mon 27 Jul Revisions due: Mon 3 Aug Final notification: Mon 17 Aug Camera ready: Fri 21 21 Aug Program chair Manuel Serrano, Inria Sophia-Antipolis, dl...@easychair.org Program committee Carl Friedrich Bolz, DE William R. Cook, UTexas, USA Jonathan Edwards, MIT, USA John Field, Google, USA Matthew Flatt, USA Elisa Gonzalez Boix, Vrije Universiteit, BE Robert Hirschfeld, Hasso-Plattner-Institut Potsdam, DE Benjamin Livshits, Microsoft, USA Crista Lopes, UC Irvine, USA Kevin Millikin, Google, DN James Noble, Victoria University of Wellington, NZ Manuel Serrano, Inria, FR (General chair) Didier Verna, EPITA, FR Jan Vitek, Purdue, USA Joe Politz, Brown University, USA Olivier Tardieu, IBM, USA -- You received this message because you are subscribed to the Google Groups Racket Users group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[racket-users] RACO : how to build a shared fPIC library?
Hi i wonder if it could be quite straight forward to build a binary file with the raco exe as a shared library with Position Independent Code ? I'd like to be able to build osv.io qemu images from racket projects. It would be a pretty damn killer feature. osv.io is some kind of a unikernel technology that allows you to build 8Mo virtual machines to run on top of kvm, xen etc. There could be two ways of doing this : - the first is quite simple : build the racket binary as a shared library, and embed it in osv, and then run racket ./myprog.rkt within the osv Virtual machine. But it would require the VM to embed all the racket libraries ( ~300Mo ) even those which are not used by the program. It's not the osv.io way of doing things. - the other one would be to use the raco tool to build a shared library instead of an exe binary. we could then use the distribute command to upload only the necessary files to the osv.io image. -- You received this message because you are subscribed to the Google Groups Racket Users group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[racket-users] Tunable flonum comparison using math library
Hi, I've been trying out Racket for 2D graphics tasks and have come across the Racket math library. Firstly just wanted to say a big thank you to the developers for such a well thought out and documented library. I've had problems in the past with floating point comparison, especially around catastrophic cancellation issues. What I need as a result is a tunable floating point (Flonum) comparison function. Following these authors: http://www.cygnus-software.com/papers/comparingfloats/comparingfloats.htm https://www.ualberta.ca/~kbeach/phys420_580_2010/docs/ACM-Goldberg.pdf http://stackoverflow.com/questions/10334688/how-dangerous-is-it-to-compare-floating-point-values/10335601#10335601 I've been testing this approach that provides an epsilon value for two flonums near zero and an ULP difference otherwise. (: close? (- Flonum Flonum Real Real Boolean)) (define (close? x y eps ulps) (cond [(or (nan? x) (nan? y)) #f] [(= (abs (- x y)) (fl eps) #t] [(not (= (sgn x) (sgn y))) #f] [else (= (flulp-error x y) (fl ulps))])) I'm almost certainly misunderstanding something in those references and not making the best use of the facilities the math library has to offer. Has anyone else gone down this path with Racket and can share their experiences? Thanks, Stu -- You received this message because you are subscribed to the Google Groups Racket Users group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [racket-users] Type error using in-list on empty list
What's happening here is that when typechecking a `let loop`, Typed Racket will try to guess the loop argument types from the initial values. Here, it converts `Null` into `(Listof Any)`, and then that choice runs into trouble later. The simplest fix here is to pass something with the type `(Listof Void)`, such as `(ann '() (Listof Void))`. The real fix is more type inference in Typed Racket. Sam On Tue, May 19, 2015 at 4:52 PM, Benjamin Greenman bl...@cornell.edu wrote: This program raises a type error about unsafe-car (for ([x : Void (in-list '())]) x) So far, I've found ways to remove the error 1. Remove the annotation on x 2. Remove the in-list hint 3. Use a non-empty list Is this a bug? -- You received this message because you are subscribed to the Google Groups Racket Users group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups Racket Users group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[racket-users] Type error using in-list on empty list
This program raises a type error about unsafe-car (for ([x : Void (in-list '())]) x) So far, I've found ways to remove the error 1. Remove the annotation on x 2. Remove the in-list hint 3. Use a non-empty list Is this a bug? -- You received this message because you are subscribed to the Google Groups Racket Users group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.