From: SourceForge.net <no...@so...> - 2008-07-21 04:40:10
|
Bugs item #1902890, was opened at 2008-02-27 08:20 Message generated for change (Comment added) made by msofer You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=110894&aid=1902890&group_id=10894 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: 47. Bytecode Compiler Group: obsolete: 8.5.1 Status: Open Resolution: None Priority: 8 Private: No Submitted By: Andreas Leitgeb (avl42) >Assigned to: Jeffrey Hobbs (hobbs) Summary: compiled regexp behaves differently Initial Comment: >From comp.lang.tcl: <slr...@ga...> % set pattern --; set text ---- % regexp $pattern $text; # no error 1 % regexp -- ---- ; # error for same arguments. wrong # args: should be "regexp ?switches? [...]" This bug-report only documents the difference, not which of the two is to be considered correct. ---------------------------------------------------------------------- >Comment By: miguel sofer (msofer) Date: 2008-07-21 01:40 Message: Logged In: YES user_id=148712 Originator: NO This is tclguy's turf, I believe (and hope) ---------------------------------------------------------------------- Comment By: Don Porter (dgp) Date: 2008-03-27 18:14 Message: Logged In: YES user_id=80530 Originator: NO dkf points out the roadblock case: % regexp -about foo 0 {} % set e -about -about % set s foo foo % regexp $e $s 0 ---------------------------------------------------------------------- Comment By: Donal K. Fellows (dkf) Date: 2008-03-27 18:09 Message: Logged In: YES user_id=79902 Originator: NO Be aware of the test regexp-20.2 ---------------------------------------------------------------------- Comment By: Don Porter (dgp) Date: 2008-03-12 03:35 Message: Logged In: YES user_id=80530 Originator: NO I agree that is the most sensible way to define the behavior of this command. The snag is that the implementation over many years *and the documentation* disagree, saying that anything that starts with "-" gets an attempt at interpretation as a switch. This is stupid, and it foils many cases that could otherwise be compiled, so I agree we should change it like we changed [switch]. Just be ready for the same flood of complaints we got about the [switch] change. ---------------------------------------------------------------------- Comment By: Jeffrey Hobbs (hobbs) Date: 2008-03-12 03:05 Message: Logged In: YES user_id=72656 Originator: NO I believe the 2nd variant (eval version) is what should be fixed. The extended info from wrong#args is: wrong # args: should be "regexp ?switches? exp string ?matchVar? ?subMatchVar subMatchVar ...?" This indicates 2 known required args, and 2 args are given to regexp. Why try to find errors when we can otherwise assume a regexp+2args == [regexp $pat $str] at all times? ---------------------------------------------------------------------- Comment By: Don Porter (dgp) Date: 2008-03-11 18:02 Message: Logged In: YES user_id=80530 Originator: NO That is, 1899962. ---------------------------------------------------------------------- Comment By: Don Porter (dgp) Date: 2008-03-11 18:00 Message: Logged In: YES user_id=80530 Originator: NO This is the same issue as the compiled two argument [switch]. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=110894&aid=1902890&group_id=10894 |