On 18 Apr 2012, at 16:00, Ryan Culpepper wrote:
* Kathy Gray kathryn.g...@cl.cam.ac.uk
- Test Engine Tests
Done
-Kathy
_
Racket Developers list:
http://lists.racket-lang.org/dev
(sorry, I couldn't figure out how to reply properly from the list archive,
as I don't receive the dev-list emails.)
One string function that I often find useful in various scripting languages
is a `string-split' (explode in php).
It can be done with `regexp-split', but having something more along
I second that.
On Apr 19, 2012, at 5:57 AM, Laurent wrote:
(sorry, I couldn't figure out how to reply properly from the list archive, as
I don't receive the dev-list emails.)
One string function that I often find useful in various scripting languages
is a `string-split' (explode in
[Changed title to talk about each one separately.]
Two hours ago, Laurent wrote:
One string function that I often find useful in various scripting
languages is a `string-split' (explode in php). It can be done with
`regexp-split', but having something more along the lines of a
`string-split'
Two hours ago, Laurent wrote:
Maybe also a `string-replace' could be useful, especially when one
does not want regexps and has special characters that need to be
quoted.
Again, it's not clear how this shold look -- my guess:
(define (string-replace from str to)
(regexp-replace*
On Thu, Apr 19, 2012 at 8:21 AM, Eli Barzilay e...@barzilay.org wrote:
Two hours ago, Laurent wrote:
One string function that I often find useful in various scripting
languages is a `string-split' (explode in php). It can be done with
`regexp-split', but having something more along the lines
(define (string-split str [sep #px\\s+])
(remove* '() (regexp-split sep str)))
Nearly, I meant something more like this:
(define (string-split str [splitter ])
(regexp-split (regexp-quote splitter) str))
No regexp from the user POV, and much easier to use with little knowledge.
I agree with this: we should add `string-split', the one-argument case
should be as Eli wrote, and the two-argument case should be as Laurent
wrote. (Probably the optional second argument should be string-or-#f,
where #f means to use #px\\s+.)
At Thu, 19 Apr 2012 14:30:31 +0200, Laurent wrote:
I think Laurent pointed out in his initial message that beginners may be
intimidated by regexps. I agree. Plus someone who isn't fluent with regexp may
be more comfortable with string-split. Last but not least, a program documents
itself more clearly with string-split vs regexp.
On Apr 19,
At Thu, 19 Apr 2012 08:26:20 -0400, Eli Barzilay wrote:
Two hours ago, Laurent wrote:
Maybe also a `string-replace' could be useful, especially when one
does not want regexps and has special characters that need to be
quoted.
Again, it's not clear how this shold look -- my guess:
On Thu, Apr 19, 2012 at 14:26, Eli Barzilay e...@barzilay.org wrote:
Two hours ago, Laurent wrote:
Maybe also a `string-replace' could be useful, especially when one
does not want regexps and has special characters that need to be
quoted.
Again, it's not clear how this shold look -- my
On Thu, Apr 19, 2012 at 14:33, Matthew Flatt mfl...@cs.utah.edu wrote:
I agree with this: we should add `string-split', the one-argument case
should be as Eli wrote,
About this I'm not sure, as one cannot reproduce this behavior by providing
an argument (or it could make the difference
At Thu, 19 Apr 2012 14:43:44 +0200, Laurent wrote:
On Thu, Apr 19, 2012 at 14:33, Matthew Flatt mfl...@cs.utah.edu wrote:
I agree with this: we should add `string-split', the one-argument case
should be as Eli wrote,
About this I'm not sure, as one cannot reproduce this behavior by
On Thu, Apr 19, 2012 at 14:53, Matthew Flatt mfl...@cs.utah.edu wrote:
At Thu, 19 Apr 2012 14:43:44 +0200, Laurent wrote:
On Thu, Apr 19, 2012 at 14:33, Matthew Flatt mfl...@cs.utah.edu wrote:
I agree with this: we should add `string-split', the one-argument case
should be as Eli
A few minutes ago, Laurent wrote:
Then instead of #f one idea is to go one step further and consider
different useful cases based on input symbols like 'whitespaces,
'non-alpha, etc. ? Or even a list of string/symbols that can be used
as a splitter. That would make a more powerful function
[Meta-note: I'm not just flatly object to these, just trying to
clarify the exact behavior and the possible effects on other
functions.]
10 minutes ago, Laurent wrote:
(define (string-split str [sep #px\\s+])
(remove* '() (regexp-split sep str)))
Nearly, I meant something
30 minutes ago, Laurent wrote:
I meant this:
(define (string-replace from str to)
(regexp-replace* (regexp-quote from) str (regexp-replace-quote to)))
30 minutes ago, Matthew Flatt wrote:
Surely Laurent meant
(define (string-replace str from to)
(regexp-replace*
Continuing with this line, it seems that a better definition is as
follows:
(define (string-split str [sep ])
(remove* '() (regexp-split (regexp-quote (or sep )) str)))
Except that the full definition could be a bit more efficient.
Three questions:
1. Laurent: Does this make more
(define (string-index-of sub str [start 0] [end (string-length str)])
I always need to go check the documentation for that kind of argument
position (like for (string-replace from str to) ).
To me, what makes more sense is to have the str argument on the first
position, just like for a method
A few minutes ago, Laurent wrote:
(define (string-index-of sub str [start 0] [end (string-length str)])
I always need to go check the documentation for that kind of argument position
(like for (string-replace from str to) ).
To me, what makes more sense is to have the str argument on
4. Related to Q3: what does xy as that argument mean exactly?
a. #rx[xy]
b. #rx[xy]+
c. #rxxy
d. #rx(?:xy)+
Good question. d. would be the simplest case for newbies, but b. might be
more useful.
It would make more sense that a string really is a string, not a set of
characters.
Just now, Laurent wrote:
1. Laurent: Does this make more sense?
Yes, this definitely makes more sense to me. It would then treat
(string-split aXXby X) just like the case.
Although if you want to find the columns of a latex line like x
y z you will have the wrong result.
All of the plot routines work as expected.
Done
Doug
On Wednesday, April 18, 2012, Ryan Culpepper wrote:
Checklist items for the v5.3 release
(using the v5.2.901.1 release candidate build)
Search for your name to find relevant items, reply when you finish an
item (please indicate which
An hour and a half ago, Ryan Culpepper wrote:
Instead of trying to design a 'string-split' that is both
miraculously intuitive and profoundly flexible, why not design it
like a Model-T
Invalid analogy: the issue is not flexibility, it's making something
that is simple (first) and useful
Sorry for the new thread, but this is a kind of a summary on the
extensions that I think we're converging to, with a way to resolve the
exact meaning of arguments. Please read through and reply if you see
any problems with it. There are three specific questions, which are
marked with
I like it a lot.
[...]
(string-split str [sep #px\\s+])
Splits `str' on occurrences of `sep'. Unclear whether it should
do that with or without trimming, which affects keeping a
first/last empty part. [*1*] Possible solution: make it take a
`#:trim?' keyword, in analogy to
On Thu, Apr 19, 2012 at 1:28 PM, Eli Barzilay e...@barzilay.org wrote:
(list-index list elt)
Looks for `elt' in `list'. This is a possible extension for
`racket/list' that would be kind of obvious with adding the above.
[*3*] I'm not sure if it should be added, but IIRC it was
On Thu, Apr 12, 2012 at 5:26 PM, Robby Findler
ro...@eecs.northwestern.edu wrote:
Yes, normalization doesn't deal with those spaces. It does change the
text in ways that are unfriendly and I often tell DrRacket no when
it asks about normalization. I just wanted to put that into the mix
for
At Wed, 18 Apr 2012 14:41:46 -0400, Danny Yoo wrote:
I'm trying to wrap my head around submodules so I can get it working
with Whalesong
I see that the structure of 'mod' has changed a bit to accommodate
submodules; in particular, mod-name can now be a list of symbols vs
just a symbol,
I've pushed a repair for this bug.
At Wed, 18 Apr 2012 13:02:05 -0400, Danny Yoo wrote:
I'm trying to wrap my head around submodules so I can get it working
with Whalesong, but I'm running into an issue:
#lang racket
(define (print-cake n)
#;(show~an #\.)
#;(show .-~a-. n
Thank you so much for this. This was definitely one area of difficulty
when I started using Racket for scripting.
On 04/19/2012 09:28 AM, Eli Barzilay wrote:
But to allow other uses, make these arguments a string *or* a regexp,
where a regexp is taken as-is. This leads to another simplicity
On Thu, Apr 19, 2012 at 2:45 PM, Matthew Flatt mfl...@cs.utah.edu wrote:
I've pushed a repair for this bug.
Ah, thank you! I will try it out as soon as it hits the 5.3 release branch.
_
Racket Developers list:
http://lists.racket-lang.org/dev
An hour ago, Danny Yoo wrote:
On Thu, Apr 12, 2012 at 5:26 PM, Robby Findler
ro...@eecs.northwestern.edu wrote:
Yes, normalization doesn't deal with those spaces. It does change
the text in ways that are unfriendly and I often tell DrRacket
no when it asks about normalization. I just
I think this is the kind of mixin that belongs in the framework and, if you
don't want it, you don't mix it in.
The preferences dialog additions could be DrRacket-specific, tho.
Also, option 2 should probably have a button in the dialog that adjusts the
preference to one of the two silent modes.
On Apr 18, 2012, at 8:00 AM, Ryan Culpepper wrote:
Checklist items for the v5.3 release
(using the v5.2.901.1 release candidate build)
I'm confused by the OS X download options on the pre-release download page
(http://pre.racket-lang.org/release/installers/).
Specifically, one of the
I've pushed a fix.
At Thu, 19 Apr 2012 16:55:10 -0700, John Clements wrote:
Apologies in advance if this is my fault; I can't see an obvious reason why
it
would be.
I'm building from the head, and I rm'ed my build directory, and I get a build
failure that ends with:
Compiling xform
Just now, Matthew Flatt wrote:
I've pushed a fix.
At Thu, 19 Apr 2012 16:55:10 -0700, John Clements wrote:
Ooh… just looked at git log, perhaps this has something to do with
2b76d9e5b03ea97b8de155d2dda63e64256a3212 ?
Yes, it was my fault. (I didn't try to build from scratch, so I
didn't
Three hours ago, John Clements wrote:
Mac OS X (32-bit 64-bit)
I'm guessing this was supposed to be
Mac OS X (Intel 64-bit)
Yes, that was a typo.
--
((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay:
http://barzilay.org/ Maze
I have downloaded the latest pre-release for v5.3
(plt-5.2.901.1-bin-i386-win32.exe). All of my PLaneT collections load
and run fine. But, my large application at work fails to run - it dies
during startup with Seg Fault (internal error during gc) at 58720044
printed (twice) in a new window. It's
39 matches
Mail list logo