AltME groups: search
Help · search scripts · search articles · search mailing listresults summary
world | hits |
r4wp | 212 |
r3wp | 1716 |
total: | 1928 |
results window for this page: [start: 101 end: 200]
world-name: r4wp
Group: #Red ... Red language group [web-public] | ||
Kaj: 10-Mar-2013 | Can't you just return unset! from an undefined path, like for an undefined word? | |
DocKimbel: 11-Mar-2013 | Can't you just return unset! from an undefined path, like for an undefined word? I will give it a try. | |
Kaj: 11-Mar-2013 | Would it be hard to have the undefined warnings print the name of the undefined word/path? | |
Kaj: 12-Mar-2013 | red>> load x/y *** Error: word in path has no value! *** Runtime Error 1: access violation *** at: 08079DD7h | |
DocKimbel: 10-Apr-2013 | Also, when asking for the file to be downloaded, you should rename the file to something more human-friendly or ask the name from the user. You can use Content-Disposition HTTP field for doing that easily. Here's an example from one of CureCode's RSP: response/buffer: get-modes file 'full-path response/set-header 'Content-Disposition rejoin [{filename="} name {"}] | |
DocKimbel: 17-Apr-2013 | Shared libraries are on the critical path to Android support for Red and I've delayed it way too much already. | |
Kaj: 23-Apr-2013 | You also need to give the full path to the source file | |
Kaj: 23-Apr-2013 | Actually, you also have to give the full path in the -o switch | |
Arnold: 23-Apr-2013 | About the relative path, that was possible. Indeed. The Rebol console changed the path a few times so i needed to change it accordingly, but after that it was reusable. | |
Kaj: 23-Apr-2013 | ./ is a relative path | |
Andreas: 24-Apr-2013 | Test suite runs again, relative path handling for explicit output paths (-o) and sources passed to rsc.r should also work. | |
Andreas: 24-Apr-2013 | And w/o an explicit output path, builds are again stored in the builds/ directory. | |
DocKimbel: 9-May-2013 | Andreas, does it work on Linux for you? It seems there's a library path access issue there. | |
Andreas: 9-May-2013 | Doc: for Linux to work, you need to rename the .so to libJNIdemo.so, and start the demo with `java -Djava.library.path=. JNIdemo`. | |
Pekr: 9-May-2013 | I have some mess on my system, installing JDK did not add it to path, so I have to issue long Windows shitty path in console each time .... | |
Pekr: 14-May-2013 | I might miss some basic OS understanding. Guys, how do you work with all the path? I have JAVA installed, REBOL installed, yet what I am strugling with, is path. When I follow docs, it always seems to be easy. Docs state: do/args %rsc.r "-dlib %bridges/java/JNIdemo.reds -o %bridges/java/JNIdemo" well, for normal user, in order to try that, user needs to understand, he has to start Rebol for that. So there are basically two options: - running REBOL from icon. Then you have to change-dir to where Red is - in my case, something like C:\!Rebol\Red - I thought, I might use just "pressing ENTER" upon Red.r, which launches console for me. But above still will not work, unless I change-dir into red-system subdir. It should be imo either stated in the docs, or some shortcuts provided, e.g. red-system.r, allowing me to launch console directly in that subdir, and then above command would run just OK. I am not stating anything is wronk, it is upon user to improve the workflow, but surely it is an obstacle for occassional user. Now back to docs: 2. Compile and run the JNIdemo.java app from console: $ javac JNIdemo.java $ java JNIdemo Well, when in console, my console does not recognise javac, nor java executables. Apparently a path problem, but I have JAVA installed via installer. So I have to go inside JAVA dir, which means: cd c:\Program Files (x86)\Java\jdk1.7.0_21\bin\ javac c:\!rebol\!Red\\red-system\bridges\java\ Any tips? :-) | |
GrahamC: 14-May-2013 | install javac in your system path | |
GrahamC: 14-May-2013 | control panel/System/Advanced system/settings/environment settings/system variables/path | |
Group: Announce ... Announcements only - use Ann-reply to chat [web-public] | ||
Robert: 11-Jan-2013 | I'm happy to announce our next Android release. Cyphre did a great job and pushed the port further forward. Here are the highlights of the new release: -added full file access -added networking -added console user input (ASK etc. works) -improved threading (at the app level, not R3) -misc small internal changes in the console code With this it's possible to run R3 chat on your Android phone :-) Here is how to do it: make-dir %/mnt/sdcard/r3/ change-dir %/mnt/sdcard/r3/ chat The paths might be a bit different on your device. The trick is to use the /sdcard path and put everything below it. The link is as always: http://development.saphirion.com/experimental/R3droid.apk Again, thanks to all who made a donation for this project! | |
Kaj: 15-Feb-2013 | With Doc's latest #include path fixes (issue #385), I could make the Red bindings independent from my system configuration. You can now use them without changing the source code. | |
Kaj: 18-Feb-2013 | I added binaries for the Red browser example to the test repository, so you can try it right away, in */Red/GTK-browser: http://red.esperconsultancy.nl/Red-test/dir?ci=tip The latest Red interpreter enhancements are also in the build run. In the console, GTK-IDE and GTK-browser, path accessors can now be used. | |
Kaj: 7-Jul-2013 | You should be able to compile the test driver with the latest Red/System development version, following the normal build procedure but adding the following parameter to the Red/System compiler command line: rsc.r -t WinDRV driver.reds This effectively replaces a makefile build script that the WDK uses that is almost 12,000 lines. By the way, the WDK is unable to work in a path that contains spaces, so for example on older Windows versions such as XP, you can't develop drivers in your home directory, because your home path always contains spaces. I think Red will now allow you to do that. | |
Kaj: 7-Jul-2013 | You will get a driver.sys file that you can install, start, query and remove like this, from a Windows account with administrative rights: sc create hello-Red type= kernel binPath= C:\full\path\to\driver.sys sc qc hello-Red sc start hello-Red sc query hello-Red sc delete hello-Red | |
Group: Rebol School ... REBOL School [web-public] | ||
DocKimbel: 10-Oct-2012 | Also, you need to set the UniServe path variable before loading it: uniserve-path: <path-to-your-uniserve-folder> | |
DocKimbel: 10-Oct-2012 | After removing all unnecessary UniServe plugins, this sequence works for me: uniserve-path: %//dev/cheyenne-server/uniserve/ do uniserve-path/uni-engine.r uniserve/boot | |
Sujoy: 10-Oct-2012 | uniserve/boot works fine after these steps, but... ** Script Error: Cannot use path on none! value ** Where: process-task ** Near: if any [ zero? shared/pool-max shared/pool-max > shared/pool-count ] [fork] either | |
DocKimbel: 10-Oct-2012 | Ok, from the UniServe folder, this code works: uniserve-path: %./ do %uni-engine.r uniserve/boot I had to change your absolute path in %reminder.r to: - line 11: do uniserve-path/libs/scheduler.r - line 24: feeds: load uniserve-path/docs/feeds.r | |
Sujoy: 10-Oct-2012 | damn! no luck. >> ls BSD-License.txt change-log.txt clients/ docs/ handlers/ libs/ protocols/ services/ uni-engine.r >> uniserve-path: %./ == %./ >> do %uni-engine.r Script: "UniServe kernel" (17-Jan-2010) Script: "Encap virtual filesystem" (21-Sep-2009) == true >> uniserve/boot booya . http://newsrss.bbc.co.uk/rss/newsonline_uk_edition/business/rss.xml ** Script Error: Cannot use path on none! value ** Where: process-task ** Near: if any [ zero? shared/pool-max shared/pool-max > shared/pool-count ] [fork] either | |
Sujoy: 10-Oct-2012 | removed the scheduler/wait line...now: uniserve-path: %./ == %./ >> do %uni-engine.r Script: "UniServe kernel" (17-Jan-2010) Script: "Encap virtual filesystem" (21-Sep-2009) == true >> uniserve/boot booya ** Script Error: Invalid path value: server-ports ** Where: reform ** Near: mold any [uniserve/shared/server-ports port-id] >> | |
Sujoy: 10-Oct-2012 | this is what i get with the latest from googlecode: uniserve-path: %./ == %./ >> do %uni-engine.r Script: "UniServe kernel" (17-Jan-2010) Script: "Encap virtual filesystem" (21-Sep-2009) == true >> uniserve/boot booya 10/10-18:37:48.883-## Error in [uniserve] : Cannot open server reminder on port 9000 ! 10/10-18:37:48.884-## Error in [uniserve] : Cannot open server task-master on port 9799 ! == none >> | |
Sujoy: 10-Oct-2012 | sorry - just killed all previous Uniserve sessions. now get: uniserve-path: %./ == %./ >> do %uni-engine.r Script: "UniServe kernel" (17-Jan-2010) Script: "Encap virtual filesystem" (21-Sep-2009) == true >> uniserve/boot booya ** Script Error: Invalid path value: conf-file ** Where: on-started ** Near: if all [ uniserve/shared file: uniserve/shared/conf-file ] [ append worker-args reform [" -cf" mold file] ] >> | |
Sujoy: 10-Oct-2012 | just to persist with using uniserve...i think something i may be getting there uniserve-path: %./ == %./ >> do %uni-engine.r Script: "UniServe kernel" (17-Jan-2010) Script: "Encap virtual filesystem" (21-Sep-2009) == true >> uniserve/boot booya 127.0.0.1 127.0.0.1 == none >> i commented out the lines from on-started: on-started: has [file][ worker-args: reform [ "-worker" mold any [in uniserve/shared 'server-ports port-id] ;TBD: fix shared object issues ] if not encap? [ append worker-args reform [" -up" mold uniserve-path] if value? 'modules-path [ append worker-args reform [" -mp" mold modules-path] ] if all [ uniserve/shared ;file: uniserve/shared/conf-file ][ ;append worker-args reform [" -cf" mold file] ] ] if integer? shared/pool-start [loop shared/pool-start [fork]] ] ...since conf-file is cheyenne specific i think maybe the scheduler is killing UniServe - it exits while returning none... | |
Kaj: 10-Oct-2012 | #! /usr/bin/env r2 REBOL [] here: what-dir program: dirize clean-path here/../../../cms/files/program/PowerMezz do program/mezz/module.r load-module/from program module [ imports: [ %mezz/trees.r %mezz/load-html.r %mezz/html-to-text.r ] ][ ; print mold-tree load-html read http://osslo.nl/leveranciers make-dir %data for id 1 169 1 [ print id page: load-html read join http://osslo.nl/leveranciers?mod=organization&id= id content: get-node page/childs/html/childs/body/childs/div/childs/3/childs/2 body: get-node content/childs/table/childs/tbody ; print form-html/with body [pretty?: yes] ; print mold-tree body ; item: get-node body/childs/10/childs/2 ; print form-html/with item [pretty?: yes] ; print mold-tree item ; print mold item record: copy "" short-name: name: none unless get-node body/childs/tr/childs/th [ ; Missing record foreach item get-node body/childs [ switch/default type: trim get-node item/childs/td/childs/text/prop/value [ "Logo:" [ ; if all [get-node item/childs/2/childs/1 get-node item/childs/2/childs/1/childs/1] [ ; repend record ; ['icon tab tab tab tab get-node item/childs/2/childs/a/childs/img/prop/src newline] ; ] ] "Naam:" [ if get-node item/childs/2/childs/1 [ repend record ['name tab tab tab tab name: trim/lines html-to-text get-node item/childs/2/childs/text/prop/value newline] ] ] ... "Adres:" [ unless empty? trim/lines html-to-text form-html/with get-node item/childs/2 [pretty?: yes] [ street: get-node item/childs/2/childs/1/prop/value place: get-node item/childs/2/childs/3/prop/value number: next find/last street #" " street: trim/lines html-to-text copy/part street number unless empty? street [ repend record ['street tab tab tab tab street newline] ] unless empty? number [ repend record ['number tab tab tab tab number newline] ] unless place/1 = #" " [ where: find skip place 5 #" " repend record ['postal-code tab tab tab copy/part place where newline] place: where ] unless empty? place: trim/lines html-to-text place [ repend record ['place tab tab tab tab place newline] ] ] ] "Telefoon:" [ unless #{C2} = to-binary trim/lines html-to-text form-html/with get-node item/childs/2 [pretty?: yes] [ repend record ['phones tab tab tab tab trim get-node item/childs/2/childs/text/prop/value newline] ] ] "Website:" [ if all [get-node item/childs/2/childs/1 get-node item/childs/2/childs/1/childs/1] [ repend record ['websites tab tab tab trim get-node item/childs/2/childs/a/childs/text/prop/value newline] ] ] "E-mail:" [ if all [get-node item/childs/2/childs/1 get-node item/childs/2/childs/1/childs/1] [ repend record ['mail-addresses tab tab trim/all get-node item/childs/2/childs/a/childs/text/prop/value newline] ] ] "Profiel:" [ unless #{C2} = to-binary trim/lines html-to-text form-html/with get-node item/childs/2 [pretty?: yes] [ repend record [ 'description newline tab replace/all trim html-to-text form-html/with get-node item/childs/2 [pretty?: yes] "^/" "^/^-" newline ] ] ] ][ print ["Onbekend veld: " type] ] ] write rejoin [%data/ replace/all replace/all replace/all any [short-name name] #" " #"-" #"/" #"-" #"." "" %.txt ] record ] ] ] | |
MaxV: 2-Jan-2013 | Did you use the code on the blog post? It's different form the one here, I added the font support for Linux: you have to ad the path where are the font. Read carefull the post. | |
caelum: 28-Feb-2013 | I found set-net in prot-setnet.r and included it with the same includes of GrahamC above, and now I get this error: ** Script Error: Invalid path value: pop ** Where: forskip ** Near: forall settings [ if (item: first settings) = 'none [item: none] if word? item [item: form item] do first ... Not sure where to go from here as I don't know what I am looking at in terms of errors. | |
PatrickP61: 7-May-2013 | I am trying to troubleshoot a peculiarity in R3 2.101.0 from Saphirion >> print type? what-dir file! <-- Ok, it's a file, even if has an end slash instead of a specific file path >> print type? request-dir ; select any directory file! <-- Ok, Same thing So it stands to reason that passing the value returned by WHAT-DIR and by REQUEST-DIR will be FILE! | |
PatrickP61: 7-May-2013 | So here is my code that is giving me some trouble: file-list: [] read-dir: func [ dir [file! ] ] [ foreach file read dir [ file: either dir = %./ [file] [dir/:file] append file-list file if dir? file [ read-dir file ] ] ] inp-dir: request-dir/path what-dir unless inp-dir [ask ">>> No directory selected, cannot proceed (Enter)" quit ] cd :inp-dir read-dir inp-dir ; <-- does not work as expected, must use cd and what-dir instead ;read-dir what-dir new-line/all file-list on print mold file-list | |
Group: Databases ... group to discuss various database issues and drivers [web-public] | ||
Pekr: 4-Jul-2013 | Or differently, has anyone worked with excel files via ODBC, using either R2 or R3? I tried Graham's code, which works for .xls files, but not .xlsx files. When I convert my file to .xls, R2 returns - not enough memory :-( p: open [ scheme: 'ODBC target: "Driver={Microsoft Excel Driver (*.xls)};DriverId=790;Dbq=c:\path-to-file\file.xls" ] conn: first p insert conn "select * from [Sheet1$]" result: copy conn | |
Group: !REBOL3 ... General discussion about REBOL 3 [web-public] | ||
Endo: 18-Dec-2012 | it should probably: "CD=cd" it returns the current path on Windows. | |
Endo: 18-Dec-2012 | is the path correct? maker3-make is an executable? if so it should be maker3-make.exe. | |
Andreas: 18-Dec-2012 | All paths in the makefile use / as path separators. | |
Chris: 9-Jan-2013 | second load/next/header some-script ^^^^^^^^ In R2, this would get you to the point in a string immediately after a Rebol header. How do you get there in R3? Consider R2: >> load/next/header "#!/some/path 1foo^/REBOL []^/script here" == [<header> "^/script here"] | |
BrianH: 10-Jan-2013 | Chris, the easiest way to do what you are trying to do is to use sys/load-header, which returns a block of the decoded header object, the position of the script after the header (after decompressing it if need be), and the position after the whole script (useful for embedded scripts. If the script is embedded in a block it will decode the whole script and return the decoded block at the position after the header, but that can't be helped. R3 scripts are binary, not text, so the returned script position is binary. >> sys/load-header "#!/some/path 1foo^/REBOL []^/script here" == [make object! [ title: "Untitled" name: none type: none version: none date: none file: none author: none needs: none options: none checksum: none ] #{7363726970742068657265} #{}] >> to-string second sys/load-header "#!/some/path 1foo^/REBOL []^/script here" == "script here" Note that it will skip past one trailing newline after the header, if one exists. | |
BrianH: 10-Jan-2013 | Here's an example of that script-in-a-block embedding I mentioned: >> sys/load-header "#!/some/path 1foo^/[REBOL []^/script here] other stuff" == [make object! [ title: "Untitled" name: none type: none version: none date: none file: none author: none needs: none options: none checksum: none ] [ script here ] #{206F74686572207374756666}] | |
GrahamC: 12-Jan-2013 | How about adding that in eg. decode-url: func ["Decode a URL according to rules of sys/*parse-url." url] [ --- "This function is bound in the context of sys/*parse-url." out: make block! 8 parse/all url rules emit target last split-path url out ] | |
BrianH: 18-Jan-2013 | The time protocol mentioned in Vanity seems to need a change in design. There should never be a need for READ to have an /args option - that is what the path and query stuff are for. Instead of this: read/args time://time.nist.gov [ GMT ] it should be this: read time://time.nist.gov/gmt | |
Andreas: 18-Jan-2013 | `There should never be a need for READ to have an /args option - that is what the path and query stuff are for` That's obviously problematic for systems which already make use of URLs including path and query components. | |
BrianH: 18-Jan-2013 | Are you talking about HTTP, the only scheme that has query and paths built into the URL spec standard? Because we have WRITE for that situation. For other schemes, we can define our own meaning of the query (and in some cases path) so we don't break the model. | |
Andreas: 18-Jan-2013 | There are far more URL schemes which have defined uses for the path/query components. | |
Cyphre: 22-Feb-2013 | just unpack it and copy to <your path to codeblocks>/CodeBlocks/ main dir | |
GrahamC: 23-Feb-2013 | This is a tip for where you have those pesky @s in a username. You still can't get past that by using %40 in a url as Rebol converts those when it evaluates the url but you can do this >> cmd: open decode-url "ftp://user%40rebol.com:[password-:-ftp-:-rebol-:-com]" make object! [ title: "FTP Protocol" scheme: 'ftp ref: [scheme: 'ftp pass: "password" user: "user%40rebol.com" host: "ftp.rebol.com"] path: none host: "ftp.rebol.com" port-id: 21 pass: "password" user: "user%40rebol.com" ] port opened ... | |
MarcS: 10-Mar-2013 | One problem with the existing implementation is that xdg-open and x-www-browser are searched for in the PATH, so executables with the same names in a PATH directory that takes precedence will yield different behaviour. | |
Gregg: 31-Mar-2013 | I have an updated SPLIT-PATH, modeled on Ladislav's implementation where it holds that file = rejoin split-path file This does not match current REBOL behavior. His version arguably makes more sense, but will break code in cases like this: %/c/test/test2/ REBOL == [%/c/test/ %test2/] Ladislav's == [%/c/test/test2/ %""] Ladislav's func only seems to go really wrong in the case of ending with a slash an that's the only slash in the value which return an empty path and entire filespec as the target. Schemes (http://) don't work well either. REBOL also dirizes the file path if it's %. or %.., which Ladislav's does not. e.g. [%foo/ %../] == split-path %foo/.. | |
Gregg: 31-Mar-2013 | split-path: func [ "Returns a block containing a path and target, by splitting a filespec." filespec [any-string!] /local target ][ either any [ ; It's a url ending with a slash. This doesn't account for ; formed URLs. To do that, we would have to search for "://" all [slash = last filespec] all [url? filespec slash = last filespec] ; Only one slash, and it's at the tail. all [target: find/tail filespec slash tail? target] ][ reduce [copy filespec copy %""] ][ target: tail filespec if slash = last target [decr target] target: any [find/reverse/tail target slash filespec] reduce [copy/part filespec target to file! target] ] ] | |
Gregg: 31-Mar-2013 | It leaves open the question of what the best results are in cases where the target is a dir. Should it be part of the path, returning no target? Should it be the target? Should it be the target if there is no traliing slash, but if there is a trailing slash it should be part of the path? | |
Gregg: 31-Mar-2013 | And could/should it be generalized by adding a /WITH option to specify a path delimiter other than slash? | |
Gregg: 1-Apr-2013 | It makes sense to me Anton. I don't know why SPLIT-PATH does what it does today, by automatically dirizing that result. If everyone agrees, then the next question is whether a trailing %. or %.. should be returned as part of the path, or as the target. That is, do we presume that they are directories? SPLIT-PATH, today, returns the last dir in the path as the target, if the path ends in a dir. Here are some example values, and what SPLIT-PATH returns today. | |
Gregg: 1-Apr-2013 | To me, it's a matter of whether SPLIT-PATH should be consistent in how it handles the path, as a string to process, or whether it should try to be "helpful". The problem with being helpful is that it may make other things harder. | |
Gregg: 1-Apr-2013 | By saying that SPLIT-PATH always behaves the same way, depending on whether the path ends with a slash or not, it may not shortcut a few cases for us, but it does make it easy to reason about, and also to wrap for other behavior. e.g., you can always dirize the path before calling it. | |
sqlab: 1-Apr-2013 | after thinking again, I would perfer %./ as the last part of the result of split-path, as it has a trailing slash and it is still the samel | |
sqlab: 1-Apr-2013 | split-path %test/ should give [%test/ %./] | |
Andreas: 1-Apr-2013 | I think I would prefer split-path so split into the last non-slash component (target), and the original path with that last non-slash component removed. | |
Gregg: 1-Apr-2013 | And then make sure that wasn't the end of the original path. | |
Andreas: 1-Apr-2013 | Would behave mostly as the current split-path does. | |
Andreas: 1-Apr-2013 | I'd also prefer a stronger invariant, as REJOIN is relatively weak for joining path components. | |
Andreas: 1-Apr-2013 | Something more along the lines of set [d b] split-path f f = d/:b | |
Gregg: 1-Apr-2013 | OK, using that as a quality test, here's where the current SPLIT-PATH fails: Path quality failed: %/ %/none Path quality failed: %// %/ Path quality failed: %. %./none Path quality failed: %./ %./none Path quality failed: %./. %././ Path quality failed: %.. %../none Path quality failed: %../ %../none Path quality failed: %../.. %../../ Path quality failed: %foo/.. %foo/../ Path quality failed: %foo/. %foo/./ Path quality failed: %foo/../. %foo/.././ Path quality failed: http:// http:/ Path quality failed: http://..http://../ Path quality failed: http://.http://./ Path quality failed: http://../.http://.././ | |
Gregg: 1-Apr-2013 | And here's where my proposed SPLIT-PATH fails: Path quality failed: %. %/. Path quality failed: %.. %/.. | |
Gregg: 1-Apr-2013 | Anton, which is the behavior question. Do you expect SPLIT-PATH to return a target you can write to (i.e. a file)? | |
Andreas: 1-Apr-2013 | Here's a few example values and what I would expect: http://sprunge.us/AaDJ Where there is a third column, current R3 split-path differs from what I'd expect, and the third column is what split-path returns currently. | |
Andreas: 1-Apr-2013 | But with a "path component"-based invariant, the %. %.. and %/ cases will require more work to reconcile. With a "string"-based invariant (rejoin), those cases could more easily be described with the neutral %"" element: | |
Andreas: 1-Apr-2013 | Here's some examples based on a string-based invariant: http://sprunge.us/VeeH Which is, I guess, what your proposed split-path already implements :) | |
Gregg: 1-Apr-2013 | And where it fails the path (p/:t) invariant is in these cases: Path quality failed: %"" %/ Path quality failed: %foo %/foo Path quality failed: %. %/. Path quality failed: %.. %/.. | |
Andreas: 1-Apr-2013 | A slightly better path-based invariant: set [d b] split-path f clean-path/only f = clean-path/only d/:b | |
Gregg: 1-Apr-2013 | Using the clean-path test, here's where my proposed version fails: Path quality failed: %"" %/ %"" ; clean-path test %/ ; clean-path p/:t Path quality failed: %foo %/foo %foo ; clean-path test %/foo ; clean-path p/:t | |
Andreas: 1-Apr-2013 | dirname/basename does a clean-path before splitting. | |
Maxim: 1-Apr-2013 | I haven't had the time to follow all the discussion in detail, but to me, the second part of split-path should NEVER return a directory path. when doing set [dir file] I should be able to count on the fact that the second part is either a file or none. The same for the first part which should always be none or a dir. I have my own implementation in R2 which makes this strict and it simplifies a lot of code. so we can do with absolute certainty: if second set [dir file] split path [ ] IIRC some of the versions of my split perform a clean-path to simplify and add robustness to the result. | |
Ladislav: 2-Apr-2013 | Re: %/c/test/test2/ [%/c/test/ %test2/] - this test does not violate anything but it does not split the "pathfile" to "path" and "file" parts | |
Ladislav: 2-Apr-2013 | Regarding the split-path behaviour in the %foo case. I stongly object against the proposal to obtain [%. %foo], since for example INCLUDE whan obtaining %foo with empty path uses INCLUDE-CTX/PATH to find %foo (which may even exclude the %./ directory if it is not in INCLUDE-CTX/PATH), while when obtaining %./foo it just finds the file in the current directory (which is not equivalent) | |
Maxim: 2-Apr-2013 | split-path shoudn't invent information which isn't given to it | |
Ladislav: 2-Apr-2013 | As said, I prefer [%"" %foo] to have the invariant that file = rejoin split-path file | |
Bo: 2-Apr-2013 | I prefer split-path %foo == [%./ %foo] The reason is because I believe split-path shouldn't require an extra check if all you want to do is read the base directory that a file is in. I think this is a common use of split-path. | |
Gregg: 2-Apr-2013 | Do our preferences come from the basic difference of whether we want SPLIT-PATH to be "smart" about file specs, or whether it should assume nothing (the REJOIN invariant case)? For example, Andreas's path invariant (p/:t) makes a lot of sense, but some of his examples' results look wrong when just viewed as results. e.g.: ; %/ [%/ %/] ; %// [%/ %/] ; %./ [%./ %./] | |
Gregg: 2-Apr-2013 | Got it. As you might all guess, since my proposal is most like Ladslav's, that's my current preference. As I posted, it only misses a couple edge cases to also meet the path invariant. For Max, I undersand the value of NONE. So much so that I have an NONE-OR-EMPTY? mezz. | |
Gregg: 2-Apr-2013 | For reference, those cases are: Path quality failed: %. %/. Path quality failed: %.. %/.. | |
Gregg: 2-Apr-2013 | And while I understand that a file with no path implies the current directory, we lose information by assuming it. For example, if I let a user specify a path or filename, and I split it, now I can't tell if they gave me just a filename, or if they gave me %./<file>. | |
Ladislav: 2-Apr-2013 | we have got quite a few combinations to consider: missing path: * yielding %. * yielding %"" * yielding #[none] missing file * yielding the last directory in the path * yielding %"" * yielding #[none] In total that is 6 variants but only some combinations make sense, I think | |
Gregg: 2-Apr-2013 | And it doesn't satisfy either the string (REJOIN) or path invariant. If we care about either of those, it's a problem. | |
Maxim: 2-Apr-2013 | but what is usefull in the rejoin invariant? we know the path before the split... | |
Andreas: 2-Apr-2013 | The plain "path-invariant" (just d/:b) I posted earlier was too simple, only the later refined one, including clean-path caters for the corner cases I posted as well. | |
Andreas: 2-Apr-2013 | Maxim, the problem with requiring that SPLIT-PATH should _never_ return a directory as second component, is that SPLIT-PATH cannot decide that based on a file! alone. | |
Andreas: 2-Apr-2013 | I'm fine with a purely REJOIN-based invariant as well. (Even though I personally find a path-based invariant more useful.) | |
Izkata: 2-Apr-2013 | Isn't a convention that %foo/ is a directory while %foo is not? That's one way to tell if a given file! directory or not... It's what I generally expect, and I agree with Maxim that it makes the most sense for split-path to return #[none] if there is no file. | |
Maxim: 2-Apr-2013 | Andreas, the trailing slash is the separator. Are you proposing that split-path do a system check to verify if its a file? like dir? does in R2? | |
Gregg: 2-Apr-2013 | Max said: "split-path shoudn't invent information which isn't given to it" I agree, if we consider split-path to be operating in string mode (the rejoin invariant). If we want to have a file-system aware option, what would we call the refinement? Or should it be a separate function? As far as returning none for either part, it strikes me as inconsistent (if convenient, which it may be). That is, if you split a series into two parts, splitting at the head or tail should just give you an empty series for that part, shouldn't it? This comes back to my SPLIT-AT question. | |
Maxim: 2-Apr-2013 | if it where a generic string handling function I'd agree with you... but its not... it has added meaning, it splits filesystem paths. its not just a string. if it where, I'd use parse or some tokenize func. I see absolutely no merit in trying to make split-path act like a generic string handling func. the point of the func is to separate folder and file into two parts. to me it comes down to either you decide that when there is no data you invent a default, or use the internal one which is none, which works well with soooo many other funcs. if there is no directory part in the path, do not try to find a suitable value for it... there is none... funny, even when trying to explain my point of view, the actual sentence reads almost like a line of rebol source. :-) | |
Maxim: 2-Apr-2013 | if you give me split-path %"" I'd return [none none] if you want a meaningfull default for the dir, then just use clean-path before supplying the value to split-path, then you'll be assured of always getting a directory. | |
Gregg: 2-Apr-2013 | I understand your view Max, but that's not what I asked. It doesn't work the way you want today, but maybe there's a way to provide a solution that is better than what we have now. I'd love to see your custom version, so we can compare its results. And I'm asking about SPLIT-AT for a reason, separate from SPLIT-PATH. I'd love to get everyone's thoughts. The funny thing is how much we can all care about the details of this func we (at least I) use a lot, and yet which none of us seem to like all that much. I think it points out that the normal case is the most important, where there is both a path and a file component. And maybe now is the time that we can make it just a little bit better, a little more consistent. | |
Gregg: 9-Apr-2013 | I'm also going to post more thoughts and questions about funcs, like I did with SPLIT-PATH, because now is the time to make any changes, IMO. | |
Group: !R3 Building and Porting ... [web-public] | ||
Arnold: 21-Dec-2012 | There are plenty of possibilities here. Either port VID and have to deal with it's flaws and the history with it or go the path of the RebGUI or redo VID I have read somewhere that Carl expected someone to come up with something better than VID. I like VID yet it has its oddities, like when positioning elements using 'at. It could be improved in some of its behaviours, if you import it you may be hindered by this aspect, and it may get harder than restarting with a restricted base set of widgets. |
101 / 1928 | 1 | [2] | 3 | 4 | 5 | ... | 16 | 17 | 18 | 19 | 20 |