Re: [racket-users] list->set behavior on lists of symbols

2016-12-28 Thread Deyaaeldeen
Thank you David and Alexis for the helpful answers. Deyaa On Thu, Dec 29, 2016 at 2:17 AM, Alexis King wrote: > David’s explanation is good. Let me add a little bit more context. It is > a common mistake to think that ' can be used as a shorthand form of the > `list` function, but this is not t

Re: [racket-users] list->set behavior on lists of symbols

2016-12-28 Thread Alexis King
David’s explanation is good. Let me add a little bit more context. It is a common mistake to think that ' can be used as a shorthand form of the `list` function, but this is not the case. The quote form is a primitive, and it has very specific (if fairly simple) behavior with respect to evaluation.

Re: [racket-users] list->set behavior on lists of symbols

2016-12-28 Thread David Christiansen
Hi Deyaa, > I wonder why (list->set '('1)) evaluates to (set ''1) instead of (set '1). > I use Racket v6.7. The expression '('1) is a shorter way of writing (quote ((quote 1))) The value of (quote x) is x, so the value of that is the list containing (quote 1), or ((quote 1)). In other

[racket-users] list->set behavior on lists of symbols

2016-12-28 Thread Deyaaeldeen
Hi, I wonder why (list->set '('1)) evaluates to (set ''1) instead of (set '1). I use Racket v6.7. Thanks! Deyaa -- 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 t

[racket-users] Racket-ese for Scheme `define-record-type' protocol?

2016-12-28 Thread Eric Eide
Hi! I'm translating a R6RS Scheme program to Racket, and I have a question about the best "Racket-ese" translation for Scheme's `define-record-type'. Consider the following R6RS definition: - (define-record-type racr-specification (fields (mutable specification-phase) rules-table (mutabl

Re: [racket-users] Add fns or at least sample code for getting column names from table?

2016-12-28 Thread David Storrs
There's also this: (query-rows db " SELECT column_name FROM information_schema.columns WHERE table_schema = 'your_schema' AND table_name = 'your_table' ") On Wed, Dec 28, 2016 at 12:46 PM, Philip McGrath wrote:

Re: [racket-users] Narrow radix of string->number.

2016-12-28 Thread Robby Findler
I started with Ryan's code from `~r` and tried to emulate some special cases I see the C code (and didn't worry about negative numbers) and ended up with something 4-5x slower than the C code version. :( Code follows. Robby #lang racket (define (number->string* N) (cond [(zero? N) (st

Re: [racket-users] mode-lambda and the gl-backend

2016-12-28 Thread Jens Axel Søgaard
Thanks for the recommendation! /Jens Axel 2016-12-28 19:21 GMT+01:00 David Vanderson : > On Wed, Dec 28, 2016 at 11:40 AM, Jens Axel Søgaard > wrote: > >> Below is what works for me (this is just for the archives). >> When run the program prints this warning/info which I assume it is ok to >

Re: [racket-users] mode-lambda and the gl-backend

2016-12-28 Thread David Vanderson
On Wed, Dec 28, 2016 at 11:40 AM, Jens Axel Søgaard wrote: > Below is what works for me (this is just for the archives). > When run the program prints this warning/info which I assume it is ok to > ignore. > > GL context changed > You are using OpenGL '(4 1) with gl-backend-version of 3.3

Re: [racket-users] Add fns or at least sample code for getting column names from table?

2016-12-28 Thread Philip McGrath
Something like this would be really good. I also, relatively recently, discovered the "name" fields when I happened to look at a rows-result directly, and being able to work with columns by name rather than by position is much better. I guess I should have realized there was some way of doing this,

Re: [racket-users] mode-lambda and the gl-backend

2016-12-28 Thread Jens Axel Søgaard
Below is what works for me (this is just for the archives). When run the program prints this warning/info which I assume it is ok to ignore. GL context changed You are using OpenGL '(4 1) with gl-backend-version of 3.3 '#(#(400.0 400.0) #(0.945 0.945) #(378.0 378.0) #(378.0 378.0) #(40

Re: [racket-users] Mobile Friendly HTML in Scribble?

2016-12-28 Thread Matthew Butterick
> On Dec 28, 2016, at 6:06 AM, Michael Rossi wrote: > > couldn't you simply add all three code layout options and then add a > commandline switch in scribble when generating html? I.e. by default, do > nothing with the code. Otherwise, add switches to either wrap the code or > else put it in

[racket-users] Add fns or at least sample code for getting column names from table?

2016-12-28 Thread 'John Clements' via Racket Users
For the last few years, I’ve believed that there was no way to get the column names of tables using the db interface. Today I discovered that—using both postgresql and sqlite3, at least—I can extract these from the “name” fields of the “headers” field of the row-response to a “SELECT * FROM tabl

Re: [racket-users] mode-lambda and the gl-backend

2016-12-28 Thread Jay McCarthy
On Wed, Dec 28, 2016 at 5:57 AM, Jens Axel Søgaard wrote: > That example is quite involved. It doesn't show how to get things going > without using chaos. I suggest looking at lux/chaos/gui for how to get a canvas. > If I use (require mode-lambda/backend/gl) instead of (require > mode-lambda/bac

Re: [racket-users] Re: Mobile Friendly HTML in Scribble?

2016-12-28 Thread Hendrik Boom
On Tue, Dec 27, 2016 at 10:55:45PM -0500, George Neuner wrote: > On Tue, 27 Dec 2016 22:23:49 +, Philip McGrath > wrote: > > >Has something changed recently in the CSS for the Racket documentation? I > >thought that formerly the phone layout was equivalent to what happens if > >you manually r

Re: [racket-users] Narrow radix of string->number.

2016-12-28 Thread Robby Findler
On Wed, Dec 28, 2016 at 12:08 AM, Matthew Butterick wrote: > FWIW Racket's own `~r` function already accepts radixes (radices? radishes?) > up to 36. Ah, good point! I think it makes a lot of sense to do exactly what it does (or, if people find useful things, something more (but maybe not someth

[racket-users] Fix Ctr+F search on the new website?

2016-12-28 Thread Leif Andersen
Hey all, I noticed that Ctr+F based searching is kind of uncomfortable on the new website. Namely, if I am searching for a word that is located below one of the images, it gets highlighted like you would expect, but the image doesn't actually disappear. Thus I need to play whack-a-mole to find the

Re: [racket-users] Mobile Friendly HTML in Scribble?

2016-12-28 Thread Michael Rossi
On Wednesday, December 28, 2016 at 12:00:24 AM UTC-6, Matthew Butterick wrote: > Google's policy is coercive and awful. But even if it weren't, the practical > problem is that code samples don't shrink well because they can't be > line-wrapped. [1] > > > [1] https://github.com/racket/scribble/p

Re: [racket-users] mode-lambda and the gl-backend

2016-12-28 Thread Jens Axel Søgaard
That example is quite involved. It doesn't show how to get things going without using chaos. If I use (require mode-lambda/backend/gl) instead of (require mode-lambda/backend/software) and use a bitmap with gl backing like this: (define draw (rendering-states->draw lc (list fish-sprite lanter

Re: [racket-users] Mobile Friendly HTML in Scribble?

2016-12-28 Thread Dupéron Georges
Le mercredi 28 décembre 2016 07:00:24 UTC+1, Matthew Butterick a écrit : > If someone knows offhand where the main Scribble HTML template lives in > `racket/scribble`, that would save me some time discovering it. https://github.com/racket/scribble/blob/master/scribble-lib/scribble/html-render.rkt