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

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

Why use value() rather than new_from_string()?

I guess it is that the manual doesn't really explain the intent of functions and things are scattered through the manual so that unless you know what you are looking for you can only find it by examining all the libraries.

I agree that it is hard to know everything in the manual, even when one has had a major part in writing it and the functionality it talks about. It is also hard to know the intent of people asking questions unless they help us by telling us what they are trying to achieve rather than how they are attempting to achieve it.

gimlet said...

Re a = b, 'A' + 'B'.

You are not making a firm distinction between what a set of bytes means and the actual values.

a = b in one place means assign the value of b to a, in another place it means test a is equal to b.

'A' + 'B' is nonsense 65 + 66 is not. Their representations are the same (and in Euphoria presumably if you wrote c = 'A' + 'B' then c would be assigned 131) - but shouldn't that be nonsense?

Thank you. This way of explaining things is a lot more helpful. I don't have to read your mind so much.

Anyhow, I thought I was making a firm distinction between meaning and value. A value (number) is absolute and a meaning is relative. As in the example using the '=', the meaning depends on the context. The source text 'a = b' is absolute but the meaning is relative to the context that text is placed in.

Consider the English language. It gives you the freedom to place together words that, when taken as a phrase, is nonsense. The author Lewis Carroll in his story "Alice in Wonderland" made great use of this feature, even managing to invent new words for the occasion. Euphoria, like many other programming languages, also gives you freedom to write nonsense. Your job as a programmer, is to ensure that any 'nonsense' you write has a valid purpose in your application, and to ensure that other nonsense is not present in your code. Sure some languages make it hard to write 'nonsense' code (I'm looking at you Ada) but there is still plenty of ways to create nonsense algorithms.

Ok, so Euphoria doesn't have a datatype for characters. Instead it uses integers, when used in the right context, mean the same as characters. This isn't going to change so either get used to it or don't use Euphoria.

By the way, have a look at this nonsense code ...

integer Lower 
integer Upper 
 
    Lower = 'A' + ' ' 
    Upper = 'a' - ' ' 
new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu