World: r3wp
[!REBOL3-OLD1]
older newer | first last |
BrianH 3-Feb-2009 [10485x2] | Graham, if you want to form file paths without checking whether the directory portion has a trailing #"/" do this: blah: %dir f: blah/(file) instead of f: join blah file |
I use that trick with these a lot: .: %./ ..: %../ then you can do this: read ../blah.r | |
[unknown: 5] 3-Feb-2009 [10487] | GiuseppeC, I think that from a /core perspective that R3 is more mature than R2. |
BrianH 3-Feb-2009 [10488] | As far as design goes, I would agree, Paul. As far as stability goes, not yet :( |
[unknown: 5] 3-Feb-2009 [10489] | Hoping Carl gets on those issues fast. |
Henrik 3-Feb-2009 [10490] | BrianH, I get the impression that modules is somewhat unknown territory along with tasks. Do you think that's the case? |
BrianH 3-Feb-2009 [10491x7] | Yes, though not as much so as tasks. There were some proposed semantics for modules that would depend on changes to the semantics of objects, good changes but it is unknown when or if they will happen. I expect that modules will be simple at first. |
An include function is really unlikely because of binding issues, unless that function only returns a module reference and doesn't rebind the calling context with its exports. Binding order matters in REBOL. | |
Kaj, I've reported the EXISTS? bug you mentioned above (#604). Please report any additional bugs you find. | |
There is now a WINE platform choosable in CureCode. | |
Kaj, check out CureCode ticket #602 for your DIR? bug. If you can test the example code on WINE it would be appreciated. | |
Henrik, I changed the ticket to be more precise - my job as reviewer :) | |
It would probably be good to have FILEIZE, EXISTS-FILE? and EXISTS-DIR? functions in R3, with compatible backports to R2. | |
Graham 3-Feb-2009 [10498] | what would fileize do that to-file does not? |
BrianH 3-Feb-2009 [10499x3] | Done. Here is the R3 and R2 FILEIZE: fileize: func [ {Returns a copy of the path turned into a non-directory.} path [file! string! url!] ][ path: copy path if #"/" = last path [clear back tail path] path ] Here is the R3 DIR-EXISTS? and FILE-EXISTS?: dir-exists?: func [ "Returns TRUE if a file or URL exists and is a directory." target [file! url!] ][ if #"/" <> last target [target: append copy target #"/"] 'dir = select attempt [query target] 'type ] file-exists?: func [ "Returns TRUE if a file or URL exists and is not a directory." target [file! url!] ][ if #"/" = last target [target: head clear back tail copy target] 'file = select attempt [query target] 'type ] Here is the R2 DIR-EXISTS? and FILE-EXISTS?: dir-exists?: func [ "Returns TRUE if a file or URL exists and is a directory." target [file! url!] ][ if #"/" <> last target [target: append copy target #"/"] found? all [ target: attempt [info? target] 'directory = get in target 'type ] ] file-exists?: func [ "Returns TRUE if a file or URL exists and is not a directory." target [file! url!] ][ if #"/" = last target [target: head clear back tail copy target] found? all [ target: attempt [info? target] 'file = get in target 'type ] ] |
Graham, FILEIZE would get rid of any trailing / in the copy, as DIRIZE adds any missing /. | |
The above have been submitted. Time will tell if they are accepted, or will be included by default. They work though. | |
[unknown: 5] 3-Feb-2009 [10502] | Brian, what is the replacement for get-modes in R3? I'm want to see if I can now set creation and modification dates on directories yet. (see if it is now fixed in R3). I had to scrap a project before because of this. |
BrianH 3-Feb-2009 [10503x2] | GET-MODES and SET-MODES aren't in R3 yet. |
I wonder how they would work with the new port model... | |
[unknown: 5] 3-Feb-2009 [10505x2] | Well we will definately need those. |
I was hoping that more modes would be added in R3. | |
Pekr 4-Feb-2009 [10507x2] | why do we need special exists functions, when file is a datatype? Gee, I hate all those read-* - they are proof there is something wrong ... |
hmm, according to RebDev chat Carl's post, Carl wants RebDev to move to R3. Hence - R3 now boots on Fedora!!! ... although some gfx etc. is missing. Carl is looking for help in that area. Good news indeed ... | |
GiuseppeC 4-Feb-2009 [10509] | I have just taken a look at the DEMO and it is really amazing. Things are done in few lines of code. I feel the power. |
Pekr 4-Feb-2009 [10510x2] | I am now confused with latest changes to rebdev. It is becoming total mess for me! |
I start to lose control where to post what. How do I: - diplay latest # of messages content? We have L #, but not LM # - how do I display particular message, and all its replies? | |
GiuseppeC 4-Feb-2009 [10512] | We are now again in a grey area ;-) |
Pekr 4-Feb-2009 [10513] | Chat system feels good. But if we do add concepts like reply to particular message, and system is no more flat, we are not able to easily handle it without GUI anymore. Some commands are changed in quick pace, some changes don't make sense to me. |
BrianH 4-Feb-2009 [10514x2] | As long as the (hopefully useful) messages are being generated, and the source files come, chat is doing its job. We can pretty later. |
Pekr: "why do we need special exists functions" Those functions tell us whether the file exists *and* is of the ttype we need it to be. Files and directories are used differently. You use those functions to make sure that things are what you need them to be, so your code will be safer (or at least not crash). Pekr: "Gee, I hate all those read-* - they are proof there is something wrong" You are correct, that is exactly why the READ-* functions are there. They are temporary, until we get the Unicode conversions model finalized. Good catch. | |
GiuseppeC 4-Feb-2009 [10516] | BrianH: I always apreciate your good work and the work of the whole team. |
BrianH 4-Feb-2009 [10517] | Thanks :) |
Janko 4-Feb-2009 [10518x7] | BrianH: You could look at how Factor did "modules" they call it vocabularies (and "functions" are words).. I am saying because you said "..... Binding order matters in REBOL." |
That is the same in Factor, position matters, and the way they did is that it adds value as are able to use short general words because position defines from which vocab it will be called -- so you avoid need to define long words >>addTwoVectors<< .. and you also avoud >> module.word 12 + module2.word2 "asd"<< | |
this is fictional factor example.. not real code and modules: | |
USING: string math http ; : plus ( a b -- c ) + ; USE: vectors : vec-plus ( a b -- c ) + ; | |
because + is defined in math plus will use it's + to add two numbers and because we put USE: vectors the + in vec-plus will add 2 vectors ... this is in the same vocab / source code file.. I think they also have UNUSE now but I am not sure | |
( they have USING: for "including" multiple vocabs at once and USE: for one) | |
what I really liked about this (I am not a specialist in factor so I hope I am not saying it wrong) but when I was making DB libraray for example I could use define very generic words like SELECT WHERE UPDATE without thinking if they are defined somewhere else. | |
kib2 4-Feb-2009 [10525] | Janko : I think you're right (I'm currently learning Factor too). |
Janko 4-Feb-2009 [10526] | I am sort of factor traitor :( ... I was doing a very important project for me in it and told everyone that I am doing it etc... got relatively far, but then by "accident" discovered that there are many practical reasons to switch that project to Rebol, so I abandoned factor :/ |
BrianH 4-Feb-2009 [10527] | Links to web sites would be nice. I suspect that REBOL's situation is a little different though, as the binding model is unusual. |
Janko 4-Feb-2009 [10528] | technology is a cruel world :) "at the end, there can be only one" |
kib2 4-Feb-2009 [10529] | I can understand your choice, Rebol is a good alternative, even if I Factor is a very interesting langage to study. |
Janko 4-Feb-2009 [10530x3] | http://www.factorcode.org/http://concatenative.org/wiki/view/Factor |
this is maybe the good start: http://docs.factorcode.org/.. | |
yes, I don't know about low level things... maybe it can give you some ideas.. | |
BrianH 4-Feb-2009 [10533] | Thanks. I had heard of Factor, but not seen it. |
Janko 4-Feb-2009 [10534] | it's a forth + lisp + haskell sort of language .. it's stack and image based |
older newer | first last |