r3wp [groups: 83 posts: 189283]
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

World: r3wp

[Core] Discuss core issues

BrianH
14-Jul-2010
[17391x2]
Maxim's point about serializing circular structures also applies 
to "nested scopes" with more than one level of nesting.
>> #[function! [[x][#[function! [[][x * x]]]]]] 42
** Script error: x has no value
** Where: applier applier
** Near: make function! [[][x * x]]
Maxim, I have yet to comment on the DED - I am still commenting on 
REBOL.
Ladislav
14-Jul-2010
[17393]
The trick here is that #[none], #[true], #[false] and #[unset!] are 
constructed values.

 - yet another Goebbels' truth. They are much less "constructed" than 
 e.g. 0.1, which actually does not even exist in REBOL (how many users 
 know that?)
BrianH
14-Jul-2010
[17394]
I am not using Goebbel's truth, I am using REBOL.
Ladislav
14-Jul-2010
[17395]
Me too, but, I am not trying to present falsehoods as truths
Andreas
14-Jul-2010
[17396]
Well, obviously decimal!s are constructed values too!
Maxim
14-Jul-2010
[17397]
well,   once could argue that 0.1 exists in REBOL at the DED level 
but not at the,  but not after its constructed.  ;-)
Ladislav
14-Jul-2010
[17398]
As said, if #[true] is "constructed" in any sense of the word, what 
is 0.1? As I said, 0.1 does not even exist in REBOL, which is easy 
to prove
Andreas
14-Jul-2010
[17399]
Maybe it is deconstructed?
BrianH
14-Jul-2010
[17400]
litteral notation of specific datatypes

 - Those are "serialized syntax". The definition of "constructed datatypes" 
 in REBOL is those types that can be written literally in REBOL without 
 using "serialized syntax". I am going by the standard REBOL terms 
 obviously, since both syntaxes are serial and all values are constructed 
 from those syntaxes.
Maxim
14-Jul-2010
[17401x2]
1.0 doesn't exist in any IEEE using software, but a value can be 
constructed FROM it  ;-)
oops  

1.0 = 0.1
BrianH
14-Jul-2010
[17403]
If you want to use other than the standard REBOL terms, then come 
up with some other terminology to make that specific distinction, 
since it is the only distinction that matters for this discussion, 
which is about the difference between MOLD and MOLD/all.
Ladislav
14-Jul-2010
[17404]
Max, to be true, you should add in binary floating point IEEE754, 
otherwise, there are non-binary (decimal IEEE 754 versions), where 
it is not true
BrianH
14-Jul-2010
[17405]
And pardon the delay in replying, I am having AltME freezes again.
Andreas
14-Jul-2010
[17406]
Brian: ``The definition of "constructed datatypes" in REBOL is those 
types that can be written literally in REBOL without using "serialized 
syntax"``

_can_ or _can not_?
Ladislav
14-Jul-2010
[17407]
Freezes: me too
BrianH
14-Jul-2010
[17408]
can not. The not got dropped in a freeze.
Maxim
14-Jul-2010
[17409]
(Ladislav, true, that is what I meant)
Ladislav
14-Jul-2010
[17410x2]
Standard REBOL terms - I like those, is there a definition, what 
is meant by "serialized syntax"?
(I suppose, that it is the syntax starting with #"#"?
Andreas
14-Jul-2010
[17412]
I think the definition would be to observe mold/all behaviour.
BrianH
14-Jul-2010
[17413x2]
Anything in #[].
That is the standard term's meaning.
Ladislav
14-Jul-2010
[17415]
Well, then, ok, some REBOL values can be represented by "serialized 
syntax" and not by "non-serialized" DED syntax, this is where we 
agree, I suppose?
BrianH
14-Jul-2010
[17416x2]
At least the REBOL standard. We have a lot of inappropriate standard 
terms (I'm looking at you, "context"). :(
I have no idea what you mean by DED.
Ladislav
14-Jul-2010
[17418]
read http://en.wikipedia.org/wiki/REBOL#Syntax
BrianH
14-Jul-2010
[17419]
So you basically mean REBOL without #[] ?
Ladislav
14-Jul-2010
[17420x2]
no, I just mean REBOL
i.e. everything LOAD accepts
BrianH
14-Jul-2010
[17422]
Oh, then you are not making the distinction in question here in this 
discussion.
Andreas
14-Jul-2010
[17423]
Ok, so decimal! is obviously something in a third category. It can 
not be written literally without using special syntax, but it is 
not using serialized syntax according to Brian's definition.
BrianH
14-Jul-2010
[17424]
LOAD accepts a lot of stuff that doesn't match this or that dialect's 
semantic model.
Andreas
14-Jul-2010
[17425]
The point is, that DED has no semantic model.
Ladislav
14-Jul-2010
[17426]
Yes, that is the point
Andreas
14-Jul-2010
[17427]
It is purely of syntactical nature, a tree of blocks (and parens) 
and scalar values.
Ladislav
14-Jul-2010
[17428]
And, it is trivial to see, that #[true] belongs to it.
Andreas
14-Jul-2010
[17429]
And based on that, the problem is: load + save does not preserve 
the original data correctly
Ladislav
14-Jul-2010
[17430]
Regardless of #[true], as demonstrated on decimals
BrianH
14-Jul-2010
[17431]
Andreas, decimal is a special case in that the regular syntax which 
can specify every value representable in memory, also can specify 
values which aren't representable, which have to be approximated. 
And since those approximated values include much of what developers 
actually use, the aproximation is undone when the value is saved 
in the form which is supposed to result in ordinary source code.
Maxim
14-Jul-2010
[17432x2]
which is why some values wrap to 0.1 even though that value isn't 
representable within memory... it should be 0.999999999999999... 
 IIRC
when I say "it should be" I mean the real value in memory
Ladislav
14-Jul-2010
[17434]
Yes, that looks as a reasonable explanation, but, as I said, it transforms 
the script:

rebol [] same? 0.10000000000000001 0.10000000000000002

yielding #[false] into:

rebol [] same? 0.1 0.1

yielding #[true]


If I had to use a script preprocessor doing this, I would rather 
jump under a moving magnetophone tape, as a friend of mine told once
Andreas
14-Jul-2010
[17435x2]
the approximation is undone

 is an euphemism. more precisly a transformation is applied which 
 also transforms values that are perfectly reprensetable in memory
and therefore have not had to be "approximated" in the first place. 
0.10000000000000002 demonstrates this
Ladislav
14-Jul-2010
[17437]
euphemism
 is pregnant, yes
BrianH
14-Jul-2010
[17438]
Ladislav, a clarification: The DED has a semantic model, but it doesn't 
exactly match the in-memory model. And there is currently no function 
that can generate a serialized form of the in-memory model, and no 
function that can recreate the in-memory model from a serialized 
form (in this case "serialized" being used in its accepted meaning 
rather than the REBOL "serialized syntax" term). MOLD and MOLD/all 
are just approximate, as is LOAD. DO is a bit more accurate, but 
there is no function that can generate DO code from *all* in-memory 
structures, just some of them; the rest currently have to be written 
manually. So what we need is a function that does a better job of 
serializing the in-memory data model, and probably a new syntax to 
represent it.
Maxim
14-Jul-2010
[17439]
I think we could just extend the serialized form to represent just 
about everything in-memory.
Andreas
14-Jul-2010
[17440]
the best argument I heard in this discussion _against_ the sequence 
of load + save behaving as transparently as possible is that this 
is not at all intended in the first place! except, the argument gues, 
the intended design is for save to be symmetric to mold.