Re: [racket-users] docs for string-trim

2016-11-01 Thread Ben Greenman
The trick is that 'whitespace' isn't just #\space. It's any sequence of whitespace characters, like "\r\r\r" or " \r\n\t" On Wed, Nov 2, 2016 at 12:12 AM, wrote: > Hi, > > when using the search function for the Racket-docs > with string-trim I found: > > - >

[racket-users] docs for string-trim

2016-11-01 Thread Meino . Cramer
Hi, when using the search function for the Racket-docs with string-trim I found: - Trims the input str by removing prefix and suffix sep, which defaults to whitespace. A string sep is matched literally (as opposed to being used as a regular expression). Use #:left? #f or

Re: [racket-users] Contracts for functions that take only a rest arg

2016-11-01 Thread David Storrs
On Tue, Nov 1, 2016 at 6:51 PM, Robby Findler wrote: > On Tue, Nov 1, 2016 at 2:06 PM, David Storrs > wrote: > >> It is a syntax error. > > > > > > Absolutely, but that's not what the message says. :> > > Yes, syntax errors in "#lang racket"

Re: [racket-users] Contracts for functions that take only a rest arg

2016-11-01 Thread Robby Findler
On Tue, Nov 1, 2016 at 2:06 PM, David Storrs wrote: >> It is a syntax error. > > > Absolutely, but that's not what the message says. :> Yes, syntax errors in "#lang racket" and its variants don't come with the word "syntax" in them, but you can tell because they happen

[racket-users] Re: syntax-parse examples

2016-11-01 Thread Dan Liebgold
On Tuesday, November 1, 2016 at 3:01:44 PM UTC-7, Dan Liebgold wrote: > > - > https://docs.racket-lang.org/syntax/varied-meanings.html?q=define-syntax-class#%28part._.Non-syntax-valued_.Attributes%29 > For example, I can't seem to access the "ast" attribute in this particular example without a

[racket-users] syntax-parse examples

2016-11-01 Thread Dan Liebgold
I'm working with syntax-parse, and the examples in the docs are quite useful, but several seem stop before they get to the good part. Is there any way someone could supply examples of using the syntax classes developed in these sections: -

[racket-users] Re: Contracts for functions that take only a rest arg

2016-11-01 Thread Jack Firth
As an aside, I've written (define (rest-> arg result) (->* () #:rest (listof arg) result)) enough times that it'd be nice if it was either in the racket/contract library or a sugar/contract lib on the package server. -- You received this message because you are subscribed to the Google Groups

Re: [racket-users] Recursive stepping down a list patially?

2016-11-01 Thread David Storrs
On Tue, Nov 1, 2016 at 1:34 PM, John Clements wrote: > > > On Nov 1, 2016, at 8:02 AM, David Storrs wrote: > > > ... > > > Is it possible to jump right into a list at a certain item of > > > the list and to start processing there? > > > > Yes.

Re: [racket-users] Contracts for functions that take only a rest arg

2016-11-01 Thread David Storrs
On Tue, Nov 1, 2016 at 2:52 PM, Robby Findler wrote: > > > On Tuesday, November 1, 2016, David Storrs wrote: > >> >> >> On Tue, Nov 1, 2016 at 12:58 PM, Robby Findler < >> ro...@eecs.northwestern.edu> wrote: >> >>> I wish I could see how to

Re: [racket-users] Recursive stepping down a list patially?

2016-11-01 Thread Meino . Cramer
Hi Jon, thank you for your mind reading! :::))) Exactly! Now I know, that racket passes references under the hood and the world is getting a better place again. Cheers Meino Jon Zeppieri [16-11-01 04:40]: > On Mon, Oct 31, 2016 at 11:28 PM, wrote:

Re: [racket-users] Recursive stepping down a list patially?

2016-11-01 Thread Meino . Cramer
Hi David, thanks for your...:) DOCUMENTATION PROJECT :).!!! Whow! Now I have a lot to read! Cheers Meino David Storrs [16-11-01 18:47]: > Hi Meino, > > Good news! There are built-ins that will do almost all of this for you: > > On Mon, Oct 31, 2016 at 10:53

Re: [racket-users] Recursive stepping down a list patially?

2016-11-01 Thread Meino . Cramer
'John Clements' via Racket Users [16-11-01 18:47]: > > > On Nov 1, 2016, at 8:02 AM, David Storrs wrote: > > > ... > > > Is it possible to jump right into a list at a certain item of > > > the list and to start processing there? > > > >

Re: [racket-users] Re: Recursive stepping down a list patially?

2016-11-01 Thread Meino . Cramer
George Neuner [16-11-01 18:47]: > On Tue, 01 Nov 2016 06:47:24 +0100, Vincent St-Amour > wrote: > > >FWIW, your `find-it` is a thin wrapper over `memf` from `racket/base`. > > > >Vincent > > Sort of. In a roundabout way, the OP also asked

Re: [racket-users] Contracts for functions that take only a rest arg

2016-11-01 Thread Robby Findler
On Tuesday, November 1, 2016, David Storrs wrote: > > > On Tue, Nov 1, 2016 at 12:58 PM, Robby Findler < > ro...@eecs.northwestern.edu > > wrote: > >> I wish I could see how to make a better error message for

Re: [racket-users] Re: Recursive stepping down a list patially?

2016-11-01 Thread Meino . Cramer
Hi Vincent, thanks for your info! :) ...but unfortunately I cannot find find-it in the docs... Cheers Meino Vincent St-Amour [16-11-01 18:47]: > FWIW, your `find-it` is a thin wrapper over `memf` from `racket/base`. > > Vincent > > > > On Tue, 01 Nov

Re: [racket-users] Re: Recursive stepping down a list patially?

2016-11-01 Thread Meino . Cramer
Hi Ken, thanks for your reply ! :) ...sorry, I forgot to mention a certain aspect: The list begins with unwanted items and after that, all following items are wanted. Finding the first wanted item means: The search is over now, from here happiness will start! :) "Filter"ing means to crawl down

Re: [racket-users] Re: [OT]: Receiving doubled mail and mutt (Linux/UNIX mailclient)

2016-11-01 Thread Meino . Cramer
George Neuner [16-11-01 18:47]: > On Tue, 1 Nov 2016 09:24:54 -0400, David Storrs > wrote: > > >I also have been getting [duplicate posts], and I use GMail. > > > >I suspect part of the problem is that when I hit "Reply All" to this > >message, it

Re: [racket-users] Contracts for functions that take only a rest arg

2016-11-01 Thread David Storrs
On Tue, Nov 1, 2016 at 12:58 PM, Robby Findler wrote: > I wish I could see how to make a better error message for this input, > but I'm not seeing it. Do you? > > Robby > > With this function: (define/contract (register-functions . func-list) (->* () #:rest

Re: [racket-users] Recursive stepping down a list patially?

2016-11-01 Thread 'John Clements' via Racket Users
> On Nov 1, 2016, at 8:02 AM, David Storrs wrote: > ... > > Is it possible to jump right into a list at a certain item of > > the list and to start processing there? > > Yes. What you want is list-ref > > (define my-list '(a b c d e f g)) > > (list-ref (list 'a 'b

Re: [racket-users] Contracts for functions that take only a rest arg

2016-11-01 Thread Robby Findler
I wish I could see how to make a better error message for this input, but I'm not seeing it. Do you? Robby On Tue, Nov 1, 2016 at 11:50 AM, David Storrs wrote: > Aha. It's always the simple things that get you. Thanks, Alexis. > > On Tue, Nov 1, 2016 at 12:30 PM,

Re: [racket-users] Contracts for functions that take only a rest arg

2016-11-01 Thread David Storrs
Aha. It's always the simple things that get you. Thanks, Alexis. On Tue, Nov 1, 2016 at 12:30 PM, Alexis King wrote: > You have the order wrong for ->*. The #:rest option should come > after the positional argument contracts, just before the return > contract. Since

Re: [racket-users] Contracts for functions that take only a rest arg

2016-11-01 Thread Alexis King
You have the order wrong for ->*. The #:rest option should come after the positional argument contracts, just before the return contract. Since this function has no positional optional arguments, you can either omit the optional positional argument contracts entirely: (->* () #:rest (listof

[racket-users] Contracts for functions that take only a rest arg

2016-11-01 Thread David Storrs
What would the correct contract for this function be? (define/contract (register-functions . func-list) (->* () #:rest (listof procedure?) () any) ;; this is wrong (for ((f func-list)) ...do something...)) I've read through the docs below and it doesn't make clear how to do it.

Re: [racket-users] Recursive stepping down a list patially?

2016-11-01 Thread David Storrs
Hi Meino, Good news! There are built-ins that will do almost all of this for you: On Mon, Oct 31, 2016 at 10:53 PM, wrote: > Hi, > > I have a lng list of something. And I have a recursive serach > function to crawl down the list and search for a previously determined

[racket-users] Re: [OT]: Receiving doubled mail and mutt (Linux/UNIX mailclient)

2016-11-01 Thread George Neuner
On Tue, 1 Nov 2016 09:24:54 -0400, David Storrs wrote: >I also have been getting [duplicate posts], and I use GMail. > >I suspect part of the problem is that when I hit "Reply All" to this >message, it was going to send to "Meino + list" and I had to >explicitly delete

[racket-users] Re: Recursive stepping down a list patially?

2016-11-01 Thread Ken MacKenzie
I am wondering why not use a filter on the list? Ken On Monday, October 31, 2016 at 10:53:25 PM UTC-4, meino.cramer wrote: > Hi, > > I have a lng list of something. And I have a recursive serach > function to crawl down the list and search for a previously determined > item. > When found,

Re: [racket-users] [OT]: Receiving doubled mail and mutt (Linux/UNIX mailclient)

2016-11-01 Thread David Storrs
I also have been getting that, and I use GMail. I suspect part of the problem is that when I hit "Reply All" to this message, it was going to send to "Meino + list" and I had to explicitly delete your name before sending. On Tue, Nov 1, 2016 at 1:00 AM, wrote: > Hi, > >

[racket-users] Re: Recursive stepping down a list patially?

2016-11-01 Thread George Neuner
On Tue, 01 Nov 2016 06:47:24 +0100, Vincent St-Amour wrote: >FWIW, your `find-it` is a thin wrapper over `memf` from `racket/base`. > >Vincent Sort of. In a roundabout way, the OP also asked about how to return multiple values from a function. memf doesn't do