Re: OK what does ` mean - seriously seems to be not documented.

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

I will preface my response with this:

If you're on Windows, then you have to be careful how you open the file, as Jim alluded. If you open a file in text mode on Windows (the default if you pass "r" to open) then Windows will strip out the \r characters before your program sees anything. Likewise, it will insert them if you output just a \n character. Other platforms don't do this, so you'll get exactly what's there. Text editors often have their own ideas about how to deal with all of this, and the bottom line is that if this stuff is critical to what you're doing, you have to be extra careful.

For euphoria source files, we strip out carriage returns since these are really extra fluff that aren't needed and can actually be harmful in some cases.

gimlet said...

I will spell it out.

Assume the text read in contains `\r\n` then the person writing this meant \r\n not {13,10}. You can say they are the same as 65 = 'A' but that doesn't make them the same. Just because in Euphoria 'A' and 65 are the same byte values doesn't make them the same values with the same meaning.

This is like saying a while loop is only a label loop pair.

Apart from anything else why should `\r\n` be illegal - I am not talking about source code but the textual representation of source to be read into a map.

How coherent would key: 63 = "assignment" be to any person reading the file?

You read in a piece of text containing "crlf". You pass this piece of text "crlf" including the quotes to value and it returns "crlf" a sequence.

You say I can't do something similar to `\r\n` and introduce the red herring that I can't match for \r\n but can match for "*
r
n*". Really?

There is no reason why loading any valid euphoria object as a map key or value is illegal. If you're trying to use the provided text file to map loading routines, then you have to follow the format. If that doesn't answer your questions, then I'm not sure what you're asking.

Matt

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

Search



Quick Links

User menu

Not signed in.

Misc Menu