Re: 'split' declared more than once

new topic     » goto parent     » topic index » view thread      » older message » newer message
_tom said...

The solution is namespaces.

include std/regex.e as re 
include std/sequence.e as s 

The standard libraries in Euphoria 4.0 include namespaces and I recommend using those instead of declaring your own.

I suppose you could do that for shorthand, but it can become tedious to track custom namespacing in a larger project.

The original "include <file> as <namespace>" syntax is a throwback to before the addition of the namespace keyword.

You can see the default namespace in the declaration for each function:

regex:split()

include std/regex.e 
namespace regex 
public function split(regex re, string text, integer from = 1, option_spec options = DEFAULT) 

stdseq:split()

include std/sequence.e 
namespace stdseq 
public function split(sequence st, object delim = ' ', integer no_empty = 0, integer limit = 0) 

-Greg

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu