World: r3wp
[!REBOL3]
older newer | first last |
BrianH 14-Feb-2010 [755x2] | So limited that typeset! values are immediate types, fitting inside a value slot. |
I'm in favor of a strict-map! type, if my support counts. | |
Andreas 14-Feb-2010 [757x2] | :) |
If the number of types is an issue, I personally would rather prefer it the other way round. Having a case-sensitive map per default and having the user use LOWERCASE on keys if case-insensitivity is desired. | |
BrianH 14-Feb-2010 [759x2] | Case-insensitivity will be what is needed most of the time. Particularly for word types, but for strings too. |
Maps are used most often as a variant of the object type with slightly different behavior (mentioned by Robert above). | |
Andreas 14-Feb-2010 [761x2] | Maybe it's just because I'm spoiled by case-sensitive languages and operating systems, but I can't see how case-insensitive strings are ever useful. |
I would mostly use a map! as a hashtable | |
Paul 14-Feb-2010 [763x2] | BrianH can vectors be made extendable, shrinkable? |
would be nice to append beyond the end of a vector but I guess that would defeat it, correct? | |
BrianH 14-Feb-2010 [765] | Sorry, REBOL is case-insensitive by default in almost all cases. Something to get used to. At least R3 is case-preserving for words. |
Andreas 14-Feb-2010 [766x3] | Paul, as vectors are supposed to be contiguous regions of memory, it would be possible, but appending would either be _very_ slow in general or of unpredictable preformance at the cose of increased memory usage |
Brian, I don't have any issues with REBOL being case insensitive | |
But my filesystem simply is not, for example | |
Paul 14-Feb-2010 [769] | Yeah that is what I thought. I didn't think it would be possible without rebuilding the vector to some extent. |
BrianH 14-Feb-2010 [770] | Also, it would depend on whether the dimensions of a vector are considered part of their definition. And that would break multidimensional vectors, which are still planned. |
Paul 14-Feb-2010 [771] | ok thanks. |
Andreas 14-Feb-2010 [772] | And if I want to use filenames as keys, I already need to do `to-binary to-string` |
BrianH 14-Feb-2010 [773] | You can use filenames as keys as-is, if your code is portable. |
Andreas 14-Feb-2010 [774x2] | No, I can't |
Portability has nothing to do with it :) | |
BrianH 14-Feb-2010 [776] | Ah, your code must not be portable - if it was then you couldn't be using filenames that differed only by case. |
Andreas 14-Feb-2010 [777x3] | Let's say I write a script that displays the number of files in all current subdirectories |
Let's say I want to store those numbers in a map! associating the subdirectory name with the count of files | |
Perfectly portable code, but fails on case-sensitive filesystems | |
Paul 14-Feb-2010 [780] | Yeah can't use different case names in map. |
BrianH 14-Feb-2010 [781x2] | Right. Case-sensitive filesystems aren't portable to the main client OS'es, or even all server OS'es. |
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? | |
older newer | first last |