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

World: r3wp

[!REBOL3]

BrianH
14-Feb-2010
[782]
This is why portable use of those filesystems tends to not use filenames 
that only differ by case.
Andreas
14-Feb-2010
[783x3]
Yes, but that is totally besides the point
There is perfectly portable code that can work as expected both with 
case-sensitive and case-insensitive filesystems
But to write such code in R3, we _can not_ use filename as map! keys 
as-is
Paul
14-Feb-2010
[786x2]
There is a way around that on windows I think.
Just collected the short name for all the files using dir/x and then 
you can create a map for all of them.
Andreas
14-Feb-2010
[788x2]
non-posix ntfs is case insensitive anyway, so it's not really an 
issue on most windows systems
the workaround to write portable rebol code in this situation is 
either not using map! or transcoding the file! keys to binary!
Paul
14-Feb-2010
[790]
yeah that should work.
BrianH
14-Feb-2010
[791x2]
Yeah, on Windows the filesystems are case-preserving, not case-sensitive. 
You can mount a filesystem as case-sensitive, but most programs will 
fail when using such files. And most modern Windows don't use short-names, 
since that limits the number of files that a directory can hold.
On Win9x there were always short-names, but on NTFS its an option.
Paul
14-Feb-2010
[793]
you just use dir/x on NTFS
BrianH
14-Feb-2010
[794x2]
No, I mean it's an option at filesystem creation time, and a rarely 
chosen option at that nowadays.
It's not an issue on OSX most of the time either since they act case-preserving 
too, afaik.
Paul
14-Feb-2010
[796]
no rebcode in R3?
BrianH
14-Feb-2010
[797]
No rebcode in R3. Rebcode got its speed from certain tricks that 
don't work as well in R3 due to the changes in the context model. 
However, you can make your ow3n rebcode as an extension if you like 
(one of my pending projects).
Paul
14-Feb-2010
[798]
Cool Brian.
BrianH
14-Feb-2010
[799]
It won't likely be compatible though - I'm planning to make a more 
REBOL-like dialect. A compatible dialect would be slow.
Paul
14-Feb-2010
[800]
Yeah was looking for the speed.
BrianH
14-Feb-2010
[801]
It should even be easier with the changes to the command! type that 
are to be upcoming with the new host kit.
Paul
14-Feb-2010
[802x3]
what is the command type?
Also can you tell me how to use tasks?
Also can you tell me how to use tasks?
BrianH
14-Feb-2010
[805x2]
A command is the type of function that you currently use to access 
extensions. Soon it will be more.
Tasks currently don't work.
Paul
14-Feb-2010
[807]
they do something.
BrianH
14-Feb-2010
[808]
But that something isn't currently multitasking. What they currently 
do is crash REBOL :(
Paul
14-Feb-2010
[809x2]
>> do b
Begin Task
End Task>>
Didn't crash it but not sure of the spec
BrianH
14-Feb-2010
[811]
Much of the code in R3 isn't task-safe yet. There is a planned tasking 
model, but it isn't implemented yet.
Paul
14-Feb-2010
[812x2]
k
Really look foward to tasks.
BrianH
14-Feb-2010
[814]
As do we all (especialy Doc and Pekr).
Maxim
14-Feb-2010
[815]
an me... even if I haven't ranted about this... liquid is waiting 
for parallel node processing... which requires threads.
Steeve
15-Feb-2010
[816x2]
time events need that too.
actually i use current tasks to generate time events
Gregg
15-Feb-2010
[818x2]
Regarding Robert's question about not erroring out when accessing 
non-existent object words, I tend to agree with the current implementation, 
but not necessarily Brian's rationale that errors are our friends. 
There are a number of places where REBOL could raise an error, but 
doesn't, and more have been added in R3. It's a balancing act, and 
depends on what we think most people will use, and will lead to common 
cases being clearer and more correct. 


I think it would be great to collect language design questions, and 
have Carl answer them. It would be good for REBOL. Some answers may 
be "we tossed a coin", and that's OK too, but many will have deep 
or important answers that may just appear as caprice from a user's 
perspective.
On STRICT-EQUAL?, I'll also cast my vote that keeping doc strings 
short is a good idea. But if a doc string is unclear, incomplete, 
or just plain wrong just so it won't wrap on a text console in a 
HELP listing, Our priorities are severely out of whack.. Let me know 
if I need to take that opinion directly to Carl.
Paul
15-Feb-2010
[820]
Proposal - Templates


Summary:  Templates would be code blocks that can be bound into other 
code and become part of the context in which they are called.

implements  a Template! type

template function 

template word block

The word argument is the template word that you define

The block argument is [some [word! block!]] where word is the different 
words you define for the template and the block is the code that 
gets reduced when the template word is encountered.

Operation:

mytemplate: make template! [count [print c] release [clear blk]]
mytemplate/release


Since I used /release which was defined in the spec all code where 
the word mytemplate is used will take on the action of the release 
which is to clear the blk word!
PeterWood
15-Feb-2010
[821]
Rather than add a new datatype for case sensitive map!s, I've added 
a ticket #1494 requesting the hash! datatype be added to Rebol 3.
BrianH
15-Feb-2010
[822x6]
The additional case-sensitive map! type idea sounds better to me 
than hash!, but I'll wait for consensus.
Gregg, the reason for the most of the changes where R2 threw errors 
and R3 doesn't is specificly to make errors more friendly. We're 
trying to limit the situations where errors are thrown to ones where 
you want errors thrown. This makes errors more useful. And there 
are workarounds for the occasions where the condition isn't an error. 
In the case of object! field behavior, there are two workarounds: 
Using SELECT, or using the map! type instead. Both workarounds are 
simple, and commonly used in mezz code in those occasions where field 
absence isn't an error - rare occasions merit SELECT, common occasions 
merit map!.
This is one of those cases where this is an example of errors being 
our friends, rather than that being the rationale. An example of 
errors not being friendly was the R2 bounds checking error on ordinal 
functions, so that condition was redefined as non-erroneous. If you 
need series bounds checking to be erroneous it is quite easy to check 
for that, efficiently (I'd recommend ASSERT). Years of REBOL code 
have shown that this is the less common case though, so R2's behavior 
led to a lot of extra screening code.
Paul, how is that different from an object full of no-argument functions? 
And keep in mind that code doesn't actually exist in a context. Words 
are bound to a context; blocks aren't. Ironically, this means that 
contexts aren't contextual - it's kind of a bad term for the concept.
So in your example, mytemplate/release wouldn't be able to get the 
bindings of 'clear and 'blk from the calling context, since there 
isn't one. In order for the template to know what context to bind 
those words, a reference to that context would have to be passed 
as a parameter. The way that nested contexts are emulated in REBOL 
is through iterative overrides, not real nesting.


Making template! a datatype wouldn't help with this - it's part of 
the core semantics of REBOL. This is the same reason why the script 
or module Needs header can know what the target context to bind or 
resolve to is, but the IMPORT function can't.
Gregg, as for the STRICT-EQUAL? doc string length limit not allowing 
us to have its most important behavior mentioned, we don't have evidence 
yet that this is the case, and it seems unlikely. Noone mentioned 
the case sensitivity needing to be there before, and now noone has 
tried to phrase the doc string accordingly. I suggested that a documentation 
ticket be submitted with new phrasing, and just mentioned the limit 
(and its rationale) for the information of the person doing the submitting.


We need to have some limit on the length doc strings for a variety 
of reasons, not the least of which is that it is good to be concise. 
Many built-in functions can't have thorough documentation in their 
doc strings no matter how long we make them. The doc string is just 
a smmary for some functions, a reminder for others. The full docs 
should go on the web site accessible from HELP/doc. And if there 
isn't a web site for one of the system words, or if it's wrong or 
outdated (which is a lot at this stage) then report it.
BrianH
16-Feb-2010
[828]
Peter, I added a supporting comment for your ticket. Good luck!
Gregg
16-Feb-2010
[829]
Brian, agreed. My point was that we should'nt have a fixed limit 
of 70 characters (for example) that prevents us from using 75 characters 
for a func that really needs it. STRICT-EQUAL? was just the example 
at hand.
Paul
16-Feb-2010
[830x2]
Brian, the reference would be the template word that is defined. 
 The word would be bound to the context and assigned to the block 
when called.
So the mytemplate would be the word that gets bound to the context. 
 mytemplate/release is just a way of telling it BEFOREHAND what block 
to bind to the word.