Download Reference Manual
The Developer's Library for D
About Wiki Forums Source Search Contact

Ticket #866 (assigned wishlist)

Opened 8 months ago

Last modified 3 months ago

Have both functional and object-oriented versions of Regex functionality

Reported by: JarrettBillingsley Assigned to: kris (accepted)
Priority: normal Milestone: 1.0
Component: Core Functionality Version: 0.99.4 Frank
Keywords: triage Cc: JarrettBillingsley

Description

It already seems to have search, but it'd be nice to have this extended to all the methods. Basically, for a method "foo", there should be a free function "foo" that takes a regex string as the first param. That is, something like:

auto r = Regexp(pattern);
auto val = r.foo(params);

Should be interchangeable with:

auto val = foo(pattern, params);

Change History

01/25/08 04:23:30 changed by larsivi

  • type changed from enhancement to wishlist.

Since this is part of the big debate, it will have to go into the grander schemes of things. What should be wrapped and why?

01/25/08 11:44:56 changed by JarrettBillingsley

Mostly to avoid a situation like Phobos, where functionality is available in one form but not the other. Consistency is a nice thing.

Implementing it wouldn't be too difficult either. Each functional version would basically just create a Regex and call the right method on it.

01/25/08 12:36:51 changed by kris

  • owner changed from sean to kris.

This will have to wait until such time as we decide to add this consistently across the API (don't wish to do it here alone)

(follow-up: ↓ 5 ) 02/10/08 15:44:37 changed by svanleent

Wouldn't it be better to have:

auto val = Regexp.foo(pattern, params);

this way, it would at least be central to Regexp

(in reply to: ↑ 4 ) 02/10/08 20:11:26 changed by kris

  • milestone changed from 0.99.5 to 0.99.6.

Replying to svanleent:

Wouldn't it be better to have: {{{ auto val = Regexp.foo(pattern, params); }}} this way, it would at least be central to Regexp

Yeah

04/12/08 17:38:39 changed by larsivi

  • milestone changed from 0.99.6 to 0.99.7.

05/24/08 15:08:00 changed by larsivi

  • keywords set to triage.

05/26/08 01:00:37 changed by kris

  • status changed from new to assigned.
  • milestone changed from 0.99.7 to 1.0.