Re: [racket-users] How to store a list (or struct...) in SQL and extract again as original Racket value

2017-03-21 Thread Marc Kaufmann
Thanks, I will give that a try in the future, once I have time to look at PG database (as I have some experience with Mysql, but none with PG). But that would be exactly the kind of thing I was looking for. Cheers, Marc On Tue, Mar 21, 2017 at 8:47 PM, George Neuner wrote:

Re: [racket-users] How to store a list (or struct...) in SQL and extract again as original Racket value

2017-03-21 Thread George Neuner
On 3/21/2017 8:36 PM, Marc Kaufmann wrote: Thanks. But I have to turn it into a string before storing it in the database; when I tried to store a serialized list in it (in a VARCHAR field), it complained that it expected a string. That's where all the trouble came from. The trouble I had was

Re: [racket-users] How to store a list (or struct...) in SQL and extract again as original Racket value

2017-03-21 Thread Jon Zeppieri
Oh, never mind. I see what you mean. On Tue, Mar 21, 2017 at 8:42 PM, Jon Zeppieri wrote: > Did you try a using a bytea field? > > On Tue, Mar 21, 2017 at 8:36 PM, Marc Kaufmann > wrote: >> Thanks. But I have to turn it into a string before storing

Re: [racket-users] How to store a list (or struct...) in SQL and extract again as original Racket value

2017-03-21 Thread Marc Kaufmann
Thanks. But I have to turn it into a string before storing it in the database; when I tried to store a serialized list in it (in a VARCHAR field), it complained that it expected a string. That's where all the trouble came from. The trouble I had was parsing the string back into the serialized

Re: [racket-users] How to store a list (or struct...) in SQL and extract again as original Racket value

2017-03-21 Thread Marc Kaufmann
Regarding not using deserialize directly: I may be using deserialize in the wrong way, but the following doesn't work (and I had tried that before posting): > (define-values (in out) (make-pipe)) > (write (~a (serialize '((0 1) (1 0) "((3) 0 () 0 () () (q (0 1) (1 0)))" > (write (~a

Re: [racket-users] syntax-parse: using expr/c with ~optional

2017-03-21 Thread Philip McGrath
Thanks! Is there an equivalent approach that works to replace ~optional as a repetition constraint? Given: (define-syntax (prefix stx) > (syntax-parse stx > [(_ (~or (~seq nat:exact-nonnegative-integer) > (~optional (~seq #:tail tail) > #:defaults ([tail

Re: [racket-users] How to store a list (or struct...) in SQL and extract again as original Racket value

2017-03-21 Thread George Neuner
On 3/21/2017 5:48 PM, Jon Zeppieri wrote: Ah, except apparently `pg-array` only supports arrays with dimension 1. So... that won't help. I *think* Ryan Culpepper fixed that a long time ago ... though the docs may never have been updated. I had a workaround at the time and unfortunately I

Re: [racket-users] How to store a list (or struct...) in SQL and extract again as original Racket value

2017-03-21 Thread Philip McGrath
I would do: (with-input-from-string from-db (λ () (deserialize (read On Tue, Mar 21, 2017 at 4:48 PM Jon Zeppieri wrote: > On Tue, Mar 21, 2017 at 5:44 PM, Jon Zeppieri wrote: > > However, postgres (if that's what you're using) > > has

Re: [racket-users] How to store a list (or struct...) in SQL and extract again as original Racket value

2017-03-21 Thread Jon Zeppieri
On Tue, Mar 21, 2017 at 5:44 PM, Jon Zeppieri wrote: > However, postgres (if that's what you're using) > has multidimensional arrays as a native type, so you could use those > [https://www.postgresql.org/docs/current/static/arrays.html]. The > Racket db package has a

Re: [racket-users] How to store a list (or struct...) in SQL and extract again as original Racket value

2017-03-21 Thread Jon Zeppieri
On Tue, Mar 21, 2017 at 5:34 PM, Marc Kaufmann wrote: > Hi, > > I want to store matrices of the following form (but larger) in a database: > > (define m '((0 1) (1 0))) > > Currently I manage to store them by turning them into strings first via: > > (~a (serialize m));

[racket-users] How to store a list (or struct...) in SQL and extract again as original Racket value

2017-03-21 Thread Marc Kaufmann
Hi, I want to store matrices of the following form (but larger) in a database: (define m '((0 1) (1 0))) Currently I manage to store them by turning them into strings first via: (~a (serialize m)); Or just drop the serialize, but I figured I might benefit from it later. The problem is that

Re: [racket-users] beautiful-racket, contract-violation: expected: module-path? given ('planet ....)

2017-03-21 Thread Alexis King
The unlib package is an old PLaneT package, so it won’t show up when you run `raco pkg show`. It’s a dependency of the snooze package (also from PLaneT), which you appear to have installed. Unfortunately, the unlib package appears to have bitrotted, so it won’t build on modern Racket (due to

Re: [racket-users] beautiful-racket, contract-violation: expected: module-path? given ('planet ....)

2017-03-21 Thread Daniel Bastos
On Tue, Mar 21, 2017 at 1:16 PM, John Clements wrote: > It looks to me as though this error may have nothing to do with beautiful > racket, and that beautiful racket may have installed successfully. > > In particular, it looks like an error occurred while building the

Re: [racket-users] beautiful-racket, contract-violation: expected: module-path? given ('planet ....)

2017-03-21 Thread 'John Clements' via Racket Users
It looks to me as though this error may have nothing to do with beautiful racket, and that beautiful racket may have installed successfully. In particular, it looks like an error occurred while building the docs for ‘unlib’, and that the ‘unlib’ library is something that you had installed

Re: [racket-users] How to use the REPL with #lang s-exp "expander.rkt"

2017-03-21 Thread Jan Hondebrink
On Monday, March 20, 2017 at 7:25:35 PM UTC+1, Matthew Butterick wrote: > On Mar 20, 2017, at 2:59 AM, Jan Hondebrink wrote: > > Testing top-interaction with expression: (#%top-interaction + 1 2) > . +: unbound identifier; > also, no #%app syntax transformer is bound in: + >

Re: [racket-users] Typed Racket: Using (Sequenceof a) in place of (Listof a)

2017-03-21 Thread WarGrey Gyoudmon Ju
For input arguments, it's okay, (Sequenceof a) does accept (Listof a); but for the return value, (Listof a) does not accept (Sequenceof a). You can pass a list as the input, but you cannot narrow the type annotation in you example, say (list->vector) satisfies the annotation, both the input and

[racket-users] beautiful-racket, contract-violation: expected: module-path? given ('planet ....)

2017-03-21 Thread Daniel Bastos
This was installed via DrRacket. The generated command line was: raco.exe pkg update --deps search-auto --scope user beautiful-racket See errors below. Thank you. Resolving "beautiful-racket" via https://download.racket-lang.org/releases/6.6/catalog/ Resolving "beautiful-racket" via

[racket-users] Call for Papers & Demos: International Workshop on Functional Art, Music, Modelling and Design (FARM)

2017-03-21 Thread Michael Sperber
5th ACM SIGPLAN International Workshop on Functional Art, Music, Modelling and Design Oxford, UK, September, 9th 2017 Key Dates: Submission deadline June 1, 2017 Author Notification July 1, 2017 Camera ReadyJuly 13, 2017 Call for Papers and Demos: