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

World: r3wp

[!REBOL3-OLD1]

Maxim
13-Feb-2007
[2099x2]
why not allow accessors for any types?
(and actually per instance, for some types)
BrianH
13-Feb-2007
[2101x3]
Well, because only series, any-word and object types have internal 
state that could be changed.
Number and character types are not modifiable. When you change a 
number, you actually replace it with a new number.
All of the modifiable types already have accessors, they're just 
awkward in some cases.
Maxim
13-Feb-2007
[2104x4]
(read all as on types which this is logically possible, althouh in 
pure OOP languages you can set the accessor fof any type.)
fof-for
Carl had talked about allowing some set-word functions but I'd rather 
have a full set of accessors (set get pick poke skip, etc)
so second 13  could be made to return 3  :-)
BrianH
13-Feb-2007
[2108]
The situation is the same for OOP languages too. None of those have 
modifiable numbers either, just modifiable variables that can hold 
numbers.
Maxim
13-Feb-2007
[2109]
in a specific context (not by default)
BrianH
13-Feb-2007
[2110]
Second in what base? In what byte order? Second what, bit or byte? 
If you don't specify, the function has no meaning.
Maxim
13-Feb-2007
[2111]
this is what the use of accessor IS  :-) this is where you decide, 
what such things relate to.
BrianH
13-Feb-2007
[2112]
Ah, but where there are clear default answers to those questions, 
accessors already exist.
Maxim
13-Feb-2007
[2113x3]
there are no accessors in rebol, they are defined internally and 
cannot be changed.
I mean, the concept of an "accessor" is the fact of changing them 
externally.
this allows you to remove the complexity of an API and integrate 
it within the normal flow of a language.
BrianH
13-Feb-2007
[2116]
There are no object! accessors, to be sure, except for field setting 
and getting. It definitely makes sense to add them to object! types, 
but it doesn't make sense to add them to non-object types.
Maxim
13-Feb-2007
[2117x3]
why not?
conceptually, in rebol all the types are private classes.  if we 
had access to the accessors of integer, we could fix/adapt the "out 
of bounds" conditions, for example.
I understand that this raises some points as to the loading part, 
but within an application this is not an issue, it does not change 
REBOL itself, it changes the application of a type within a specific 
use.
BrianH
13-Feb-2007
[2120]
In the blog and here I was in favor of adding property accessors 
to object types (think get and set handlers). There was much debate 
as to whether such a concept would be added to REBOL 3 - I was in 
favor.


If what you want is general redefinition of the actions associated 
with a type, what you are really asking for is user-defined types, 
and those have already been promised for REBOL 3.
Maxim
13-Feb-2007
[2121x2]
they still boil down to pretty much the same thing... they could 
simple be the same api.
IMHO.
Ladislav
13-Feb-2007
[2123x2]
Brian: trampoline actions: interesting idea.
For:
- simplifies some scripts
Against:
- may complicate/slow down the interpreter
- may make debugging harder in some cases
so, I am neither 100% for nor 100% against it
BrianH
13-Feb-2007
[2125x2]
Maxin, I like that there are two models for types, with different 
semantics:

- Datatypes: Classes with polymorphic methods handled by dynamic 
dispatch.

- Objects: Unique objects with methods directly associated, where 
you can emulate class-based or delegation-based systems at your whim.

The advantage of having two models is that you can balance efficiency 
versus flexibility. The only disadvantages are that there is a fixed 
set of datatypes (to be fixed with user-defined types), and that 
the usage patterns for objects are somewhat limited (which would 
be fixed by the get/set handler proposal if implemented properly).
Ladislav, another to add to the For list:

- Lets programmers used to imperative programming code using algorithms 
they already know, rather than having to adopt a functional style.

That may be one for the Against list as well, depending on your attitude 
towards such things.
Maxim
13-Feb-2007
[2127]
I think I meant to say that I hope the api, can be uniformitised... 
so we decide if we want instance or class based method.
BrianH
13-Feb-2007
[2128x3]
As for complicating or slowing down the interpreter, I don't think 
that it will. The trampoline code would be contained in the actions 
associated with two datatypes, not in the interpreter at all. The 
interpreter would not need any changes.
Maxim, what does it matter if the API is uniform, as long as the 
syntax is similar? You can't make the API completely uniform when 
you are supporting different semantic models.
The speed of datatypes comes from the fixed action list. It allows 
the dispatch to be a simple retrieval from a fixed offset into a 
function table, no lookup required. It is not the same thing as general 
class-based methods, which in a language with dynamically typed variables 
would need to do a lookup to figure out where to find the method 
to call, same as with instance-based methods.
Ladislav
13-Feb-2007
[2131]
- Lets programmers used to imperative programming code using algorithms 
they already know

 - there is no algorithm you cannot use in REBOL even now, those are 
 mainly C idioms as far as I can tell?
BrianH
13-Feb-2007
[2132]
I meant style I suppose, though even C is expression-based. The idioms 
would actually be more assembler-like than C-like, for 2-address 
instruction sets like x86. Still, this wouldn't add anything to the 
language that isn't there through other means, except speed. And 
while it wouldn't complicate the interpreter, it would complicate 
the semantics of REBOL, making it harder to explain, debug or reimplement.
Ladislav
13-Feb-2007
[2133]
agreed
Jerry
10-Mar-2007
[2134]
http://www.rebol.com/priorities.htmlIn the green little box, there 
is an item called "Deci". What's that?
Anton
10-Mar-2007
[2135]
A new deci! datatype for storing floating point numbers in BCD (Binary 
Coded Decimal) format.
Jerry
10-Mar-2007
[2136x2]
Tanks Anton.
=> Thanks
Henrik
3-Apr-2007
[2138x2]
good news about the STACK function: http://www.rebol.net/cgi-bin/r3blog.r?view=0075
hah! A percent datatype as well. :-)
Oldes
3-Apr-2007
[2140]
yes... singing with Queens... I want it all, I want it all,I want 
it all, and I want it now:]
Henrik
3-Apr-2007
[2141]
Oldes, how spooky, I have a Queen song running in the background!
PeterWood
3-Apr-2007
[2142]
I agree Queen songs are spooky ;-)
Geomol
3-Apr-2007
[2143]
:-) Good to be back!
ChristianE
3-Apr-2007
[2144]
Hi Peter, sadly, this isn't reddit. I so want to vote your comment 
up :-D
Pekr
3-Apr-2007
[2145]
Minor Bitsets - http://www.rebol.net/r3blogs/0077.html
Maxim
3-Apr-2007
[2146x2]
is it just me or is it obvious R3 is about giving us what we always 
asked for and need? so far, all I read is user requests coming to 
life.


If people think 100% open source is the universal panacea...  I think 
its time people looked at how REBOL is evolving.


I think R3 might be the middle ground which allows much of the "open" 
discussion to be irrelevant.  user types,  open  linking and compilation, 
 lexical allowance for unrecognised tokens, somehow, this seems like 
we will be able to mold (sorry for the pun) REBOL into what we need, 
finally, rather than molding what we do to what REBOL (the interpreter) 
wants  :-)
pekr, I think you're going to have to book a flight to paris... to 
much of what you and I have criticised about  for you not to show 
up.  ;-)
btiffin
3-Apr-2007
[2148]
Make sure you comment on the relaxed lexical parsing.  I've been 
working around this one for a long time...but it may hold traps my 
giddy little mind is missing today.