Opened 8 years ago

Closed 7 years ago

#984 closed defect (fixed)

irregex documentation example for irregex-search does not match implementation

Reported by: Christian Kellermann Owned by:
Priority: minor Milestone: 4.9.0
Component: extensions Version: 4.8.x
Keywords: Cc:
Estimated difficulty:


The docs for irregex-search imply that an case-insensitive search is possible by passing the symbol 'i as third argument. This seems to be wrong:

#;1> (use irregex)
#;2> (irregex-search "foobar" "abcFOOBARdef" 'i) 

Error: (irregex-search) not an exact integer: i

This happened with

; csi

(c) 2008-2013, The Chicken Team
(c) 2000-2007, Felix L. Winkelmann
Version 4.8.2 (rev 623c46b)
openbsd-unix-gnu-x86 [ manyargs dload ptables ]
compiled 2013-02-03 on (OpenBSD)

Attachments (1)

0001-Fix-irregex-search-example-with-i-case-insensitive-o.patch (792 bytes) - added by evhan 7 years ago.

Download all attachments as: .zip

Change History (6)

comment:1 Changed 8 years ago by Christian Kellermann

My uneducated guess is that this should read

(irregex-search (irregex "foobar" 'i) "abcFOOBARdef")

comment:2 Changed 7 years ago by sjamaan

Milestone: someday4.9.0

Let's do this for 4.9.0 too

comment:3 in reply to:  1 Changed 7 years ago by evhan

Replying to ckeen:

My uneducated guess is that this should read

(irregex-search (irregex "foobar" 'i) "abcFOOBARdef")

I think that's right (and that's what's used in an example later in the docs, as well). I sent this change to Alex, so we can... Wait for that to be applied? Or just go ahead and change the docs, I dunno. Here's a patch for the manual either way.

comment:4 Changed 7 years ago by sjamaan

Thanks Evan. I think we should wait and see what Alex says.

comment:5 Changed 7 years ago by evhan

Resolution: fixed
Status: newclosed

This change was accepted upstream. I also noticed another case where our docs don't match irregex proper's, which has the correct version:

-(irregex-search '(: "match" (? "es") "!") "matche!") => #<match>
+(irregex-search '(: "match" (? "es") "!") "matche!") => #f

Because these are trivial fixes, I've gone ahead and pushed them to the manual, so this can be closed.

I also noticed two cases where both our unit and irregex proper don't behave like the docs say they should: #1064 #1065

Note: See TracTickets for help on using tickets.