AltME groups: search
Help · search scripts · search articles · search mailing listresults summary
world | hits |
r4wp | 239 |
r3wp | 2252 |
total: | 2491 |
results window for this page: [start: 1401 end: 1500]
world-name: r3wp
Group: View ... discuss view related issues [web-public] | ||
Maxim: 12-May-2009 | this whole system is what the do event call in wake-events is for. | |
Maxim: 12-May-2009 | but here, if the trigger is met, you can call the do event yourself and THEN call your function :-) by returning none, the normal view handler will then ignore the event (since you've already handled it) | |
Maxim: 16-May-2009 | some view functions require the parent-face to be set in order to work.... this is sometimes usefull when you want to create stuff between a call to layout and one to show. | |
Maxim: 16-May-2009 | you can do directly within a call to style :-) | |
Maxim: 16-May-2009 | basically at each operation, like clicking on a folder to view its content, I use call with an ssh related command. I retrieve the output, report any errors or parse the return data and refresh the ui. currently, it starts with root dir list, and you click on folders to go into them, or click on a checkbox to select it for other file manipulations. each time I use call, the command-line must do a log-ing, since a system call is an atomic operation. | |
Maxim: 21-May-2009 | seems I can use my glayout version of show-popup hide-popup in VID directly , and that works flawlessly in a few tests.... even fixing the inform call indirectly. | |
Maxim: 21-May-2009 | part of the problem is that closing the window via the title bar doesn't propely call hide-popup. | |
Maxim: 25-May-2009 | I did whole evening of research on the ellipse and didn't find a single exact procedure to do it... some math dr have done their thesis just on finding ways to calculate its arc len ! though I think its possible to resolve the two foci based on the angle and distance of the point we want to pass through the arc, all the math needed to get to the proper major and minor axis (eventually equating to what people call the x and y radius) is pretty intensive. | |
Maxim: 10-Jul-2009 | the parent-face is set on a call to show. AFAIK. the reason is simple, when you build your layout, you can potentially change the face you put the layout into before showing it. | |
Anton: 26-Sep-2009 | Basically, you will want to make your own "right-click-handler.r", just copying scroll-wheel-handler.r's code and modifying the event type that is checked for to 'alt-down. Scroll-wheel-handler checks for an Anton-extended VID flag, SCROLL-WHEEL, to determine which face should handle the event. So I might also advise you define your own VID flag to indicate that a face handles alt-click, maybe call it simply ALT-DOWN like the event that triggers it, or CONTEXT-MENU-ACTIVE, or whatever you're doing. Then make sure that the faces you want to respond to your "right-click-handler.r" are flagged with this new flag. That's all, simple! | |
Steeve: 29-Sep-2009 | because the lo block you constructed contains a dialect, not rebol code. When you call the layout function, the dialect is processed and the values [edge [...]] are translated to code [face/edge: make face/edge [...]] | |
Maxim: 3-Nov-2009 | anyone know how to break a call to wait [] so wait returns? | |
Maxim: 5-Nov-2009 | the event handling dispatches code related to the event that triggered it. there is no way for that code to interrupt the even handler, especially when the event handler isn't programmed by yourself. when you add wait [] in a function, there are many reasons why to want that wait to return. in this case, modal operation of some code. wait is a nested system where a second call to wait doesn't break the first call to wait. To allow this I had to patch view's wake-event directly, but it works now.. there is no way for a normal action to interrupt event handling a part from closing all windows, which made this modal operation of my code especially complex to build without an interruption mechanism. I've had other situations like having a systray and view not collaborating, where closing a window ends the app even when the systray is running, or where the window wait keeps running even if all windows are closed and the systray was then hidden as well. a timer event would have easily solved that issue by interrupting appropriate event handlers when it detects some situations. | |
Dockimbel: 12-Jan-2010 | Yes, once only, I guess CALL would be ok, just need to install ImageMagic on Windows, test it, then install it on Linux server, test again, then add this package to the list of dependencies to maintain...cool! | |
Graham: 12-Jan-2010 | can't you call R3 from R2 ? | |
Geomol: 12-Jan-2010 | Call RESIZE with a loaded image. It'll save the img.png file, that'll have x-size of 160. It looks ok here. | |
Dockimbel: 15-Jan-2010 | For Lanczos filter, I find it even slow with NConvert for bigger images (1MB+), but I guess that the CALL overhead is significant there. | |
Maxim: 20-Feb-2010 | if you don't do a call to do-events, it won't be modal (blocking events to the main window) | |
Maxim: 20-Feb-2010 | for a window to be modal, a new call to wait must be done at some point. | |
Ashley: 22-Feb-2010 | This is the code I use for RebGUI: get-fonts: make function! [ "Obtain list of fonts on supported platforms." /cache file [file!] "Obtain fonts from file" /local s ] [ all [cache exists? file] [insert clear fonts unique load file] if empty? fonts [ either OS = 'Win [ call/output {reg query "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts"} s: copy "" s: skip parse/all s "^-^/" 4 request-progress/title (length? s) / 3 [ foreach [fn reg style] s [ fn: trim first parse/all fn "(" all [ not find fonts fn not find ["Estrangelo Edessa" "Gautami" "Latha" "Mangal" "Mv Boli" "Raavi" "Shruti" "Tunga"] fn not find fn " Bold" not find fn " Italic" not find fn " Black" not find fn "WST_" insert tail fonts fn ] wait .01 step ] ] "Loading fonts ..." ] [ call/output "fc-list" s: copy "" s: parse/all s ":^/" request-progress/title (length? s) / 2 [ foreach [fn style] s [ all [ not find fonts fn (size-text make widgets/gradface [text: "A" font: make font [name: fn size: 10]]) <> size-text make widgets/gradface [text: "A" font: make font [name: fn size: 12 style: 'bold]] insert tail fonts fn ] wait .01 step ] ] "Loading fonts ..." ] ] sort fonts ] | |
Henrik: 4-Apr-2010 | where do you call foreach? | |
Maxim: 23-Aug-2010 | the system I am using now, is doing double buffering. the AGG is rendered on the raster, and the call to show, tells view to update the window's bitmap so it reflects the changes to the raster. | |
Maxim: 24-Aug-2010 | wrt console I/O killing gfx speed.... with my new high-performance chrono lib, here are the results for printing... compared to a single (average) call to sine. [print ""] 0:00:00.000792139 [prin "."] 0:00:00.000168666 [sine 45] 0:00:00.000001014 | |
Maxim: 15-Sep-2010 | also make sure to only call show on the region of your graphics which will really contain particles... there no point in blitting the whole house if only the window is on fire. | |
Graham: 25-Sep-2010 | this is Ashley's code call/output {reg query "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts"} fonts: copy "" but although it works for me, I see that on other systems it just locks up. | |
Ashley: 26-Sep-2010 | get-fonts: make function! [ "Obtain list of fonts on supported platforms." /local s fonts ] [ fonts: copy [] either 3 = fourth system/version [ call/output {reg query "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts"} s: copy "" s: skip parse/all s "^-^/" 4 foreach [fn reg style] s [ fn: trim first parse/all fn "(" all [ not find fonts fn not find ["Estrangelo Edessa" "Gautami" "Latha" "Mangal" "Mv Boli" "Raavi" "Shruti" "Tunga"] fn not find fn " Bold" not find fn " Italic" not find fn " Black" not find fn "WST_" insert tail fonts fn ] ] ] [ call/output "fc-list" s: copy "" s: parse/all s ":^/" foreach [fn style] s [ all [ not find fonts fn (size-text make face [text: "A" font: make font [name: fn size: 10]]) <> size-text make face [text: "A" font: make font [name: fn size: 12 style: 'bold]] insert tail fonts fn ] ] ] sort fonts ] | |
Maxim: 18-Jan-2011 | though you can call a face's feel if you want. | |
Izkata: 27-Aug-2011 | I would call that a feature, not a bug. The (normal) breaking space allows word wrapping to split between words, rather than in the middle of words... | |
Endo: 27-Aug-2011 | How can you call that a feature? The text field is 100 pixels width, I put 500 space chars and then a word after that, and the word appears on the second line of the text field. Where is that 500 chars? Even if you insert new spaces (let say 1000 more) the word position doesn't change. If you think it as a html document (all whilte-spaces treated as one space char) then why it stands on the second line? | |
Endo: 20-Sep-2011 | I think so too, when trace/function true, I saw offset-to-caret and caret-to-offset calls, it crashes just after the caret-to-offset call. And also if I change h1 to label, it doesn't crash anymore. | |
Geomol: 2-Nov-2011 | ? layout tells you, what LAYOUT is. By knowing what layout is, you may see, what the layout call does in the example. An effect is, that X is being defined. ? x tells you, what X is. Look near the bottom, and you see DOC as being part of X. DOC is an abject within X, which also is an object. So ? x/doc simple ask info about doc within x. | |
Group: !REBOL3-OLD1 ... [web-public] | ||
BrianH: 8-Jan-2008 | Well, in the case you did above the effect of the closure is on the code block you pass to the inner call to func. A closure! is returned by the closure function above. When that closure! is run, the func call in its body then creates a function that is returned. | |
btiffin: 8-Jan-2008 | rxvt quick tests; stdio is not reliable (with the defaults - these are quick tests) $ ./rebhost.exe -q >> call "ls" works >> call "less readme.html" does not detect console. $./rebhost.exe < small.r does not work so in short, not a good choice for redirection, but seems ok for the testing I've been doing. Haven't tried running gnu readline with it yet to see if command line recall will work. I've gotten too used to editing source and do'ing. | |
ChristianE: 2-Feb-2008 | Is anyone able to point me to where to look for an error in some simple custom R3-VID-style? The following error message clearly doesn't cite my own code, some window handler code seems to try call FACE/FEEL/ON-MOVE on a FACE = NONE! oder FACE/FEEL = NONE! The error happens as soon as I hover the face in question: ** Script error: path face/feel/on-move is not valid for none! type ** Where: either handle handler while applier wake-up loop applier wait do-events catch if either if do begin do ** Near: either drag-gob [ either drag-min [ drag-gob/off... | |
BrianH: 17-Apr-2008 | Jerry, R2 just had one kind of context (2 if you include the autoexpand context used by system/words). Functions, objects and USE all used this type of context, and words were bound to this kind of context. A function! in R2 is bound to one of these contexts, which gets reused when the function is called. When the function is called recursively, the value block of the context is pushed on a stack but the context is reused - this is the main reason R2 could never be thread-safe. The only difference that object! contexts have over function! or USE contexts is that the word 'self is added to them. In R3, there is at least one more context type: stack-relative, which is used by the function! type. All of the words bound to a function! resolve their bindings relative to the context in the executing stack frame, rather than directly. When a function! starts it allocates a context on the stack; when it ends it deallocates the context. This means that the context of words bound to a function only exists when the function is running, so there is no point to referring to these words outside of the function. Although this slows down word references, it speeds up function! calls and reduces potential memory leaks due to word references in functions after they have returned. This slowdown in word references is the reason that R2-style rebcode doesn't make sense to add to R3 without some changes to its semantic model to make up for the difference. A closure! in R3 is like a USE call in R2 (USE in R3 is implemented using closure!). The words are direct-bound to a context (so word references are faster), but it creates a new context and bind/copy's the code block at the beginning of each closure! call. There is still no point to bind a word to a closure's context when the closure isn't running, since the next time the closure runs it will create a new context, but it does make sense to use a context created by a closure call after the closure has returned since it is a regular context like a R2 USE context. In general, it is better to use function! unless you need to refer to the context after the closure! returns - mostly useful for generators, currying and other functional programming tricks. In R3, object! contexts are like the R2 system/words context: they can expand, but not shrink; closure! and function! contexts can't expand though. There will be further changes to the way object! contexts work, and module! contexts will behave the same way. | |
BrianH: 7-Jul-2008 | The extension modules spec (as you call it) hasn't been specified, or even discussed at length yet. That's next. | |
Pekr: 8-Jul-2008 | We could as well call it GDI, it is already known in MS world :-) | |
Pekr: 8-Jul-2008 | There is SilverLight, MoonLight, Flash, we planned FireSide, SideLight, or something like that - but that is more for a product name, than to call some subsystem ... | |
Pekr: 8-Jul-2008 | Or we can call it similar to Flash - Fresh, or reFresh | |
shadwolf: 14-Jul-2008 | this way rebol is hum thought more a module manager and a mean idea of was software programming is than a monolitic virtual machine wich I call the BIG black box able to do anything but with a big mistery regarding how the thing are internally done. | |
ICarii: 15-Jul-2008 | i dont use GLUT with OpenGL - but rather call it direct - ive found GLUT is slow. | |
BrianH: 15-Jul-2008 | Then you will be someone I will call upon when I need to do an application :) | |
shadwolf: 21-Jul-2008 | a stronger link betwin "networking" and "visual" modules ??? hum that's like if Carl was preteneding we can't already do that !!?? What VID (or what ever called (turtle, springler, widlets reblets, reboing, rebelistic-view-system,widbol) needs is a better Interface Human machin a better set of functionnalities to reflect the most of the visual capabilities of now in days computers and a better set of widgets.... (call it cosmetic (code and rendering) and performancies to be short ) | |
shadwolf: 22-Jul-2008 | well with vID2 we done a MDP Makedoc renderer so doing HTML one is not so hard with actual VID but the fact is MD GUI and MDP GUI gots a big lack of widgets for the none document rendering part wich I will call the IHM (menu bars, tab-panels, ability to resize easyly the whole content or part of it and that what lead us to do rebGUI ... to enhance that aspect.) | |
shadwolf: 22-Jul-2008 | VID was already simple in comparasion to what are the other libraries I don't know if you ever tryed to deal with transparencies with raw X llibrary that pain in the head number 1 ^^. Well i'm not against simplifying the system but first how does the industry shape their GUI 99.9 percent of the time the GUI is build using a GUI designer and the only thing you have to do is set thru the GUI designer interface the settings for the widgets you graphically picked and organised then you have to write the call back code... Then to take your example back with the hyperlink people then don't code they only format text en even then most of now in days forum like PHP BB use javascripted/pugined rich text area to format their text you push a button it insert the text the way you want. and some of them on the php engine level are able to recognize http:// footage to build on the fly the hyperlink without requiering any tag adding by the user .... I'm not sure separating the way you organise the widget to the way you configure them will lead us to more easy way | |
shadwolf: 24-Jul-2008 | I don't think he can make money from R3. R2 has specific barriers that prevent you from implementing specific things in the free version. Those barriers are gone in R3. ---> Was true on the earlier version but as more ppl using it more way to bypass the limitations on free version have been found (using a C server to implements callback to a library overide all those limitations 4 years ago I told Carl those limitations where just futile they can slowing down the developpement nothing more...) examples: calling a .Exe file was bypassed first by the browse/ set-browser command wich lead me to co write the first free rebol WM packager a clone to a SDK (not as sharp) but witch was able to package in a .exe file a VM script and related datas (dependencies (iimages etc...). That project was grebox. and then It was obvious to allow free version to use call function. | |
Graham: 20-Sep-2008 | call it WMD browser | |
Terry: 20-Sep-2008 | Be serious. There's no way you can pull the necessary resources together to build anything like a browser. Just won't happen. Call that 'half-empty', if you want.. I call it 45:1 odds against it every happening.. any takers? | |
Pekr: 24-Oct-2008 | Henrik - I understand very well, why Carl tries to keep the design simple. And so far, VID 3.4 looks good, that is apparent. But - when something is imo oversimplified and we start to hear - "you can't do it easily, or the system would be complex", then we should ask ourselves - will user call for such features, or not? Because if users will require such features, they will start patching the system, which is not prepared to be patched, and it can lead to kludgy solutions ... | |
Henrik: 5-Nov-2008 | Source code for the style: doc: text-area [ about: "A tiny document markup method for embedded docs, notes, messages." options: [ text-edit: [string! block!] ] actors: [ on-make: [ ; See text-area style for details. face/state/value: face/facets/text-edit: parse-doc face/facets/text-edit init-text-caret face ; (call before make-text) append face/gob gob: make-text-gob face face/facets/size - 2 "empty" face/gob/size: gob/size ; estimate to start (may get resized) do-style face 'on-update none ] ] ] | |
Pekr: 5-Nov-2008 | Cyphre's editable what? If we want to call that a rich-text attempt, we are really doomed. It was not really usable for real work. | |
Henrik: 9-Nov-2008 | You could call it that. Building SCROLLER and SLIDER became way too difficult with a single DRAW block. | |
Oldes: 1-Dec-2008 | I would not call it trashcan, but "how to" category | |
Graham: 1-Dec-2008 | If it's a test bed ... then don't call it a developers forum. | |
Oldes: 6-Dec-2008 | I guess that in AGG you just must call unicode functions of the api. But I really don't know details. But the unicode in gui must be, else the changes in core were useles. | |
Pekr: 5-Jan-2009 | I think, that having really good /library component could bring us many more wrapped external libraries - call it a deployment. Currently, we are missing on most of outer library stuff, and we are living in rebol-only world. | |
Maxim: 5-Jan-2009 | If you set it up, I will participate :-) I have done library stuff a few times, even fixing ladislav's memcopy hacks once. right now, I am faced with an signed/unsigned issue related to 16 bit values needed for a lib call... I honestly can't say from the library docs, if the negative 32bit value in rebol's integer will stay negative once converted to 16bits... for example. this kind of information is Crucial for stability. | |
Sunanda: 5-Jan-2009 | Have you thought about using CALL to create temporary extra versions of REBOL.exe for the image processing? That's solve some of the issues. Though it would be clunky! | |
Graham: 5-Jan-2009 | And then I call 'recycle .. and boom! | |
btiffin: 7-Jan-2009 | No *you* want syntax errors. I want to load %kingjames.txt and call sort. ;) | |
BrianH: 9-Jan-2009 | Though I should have realized when you said launch instead of call. | |
btiffin: 21-Jan-2009 | Very Heisenberg; Call the post, Anton's Postulate for getting round the REBOL uncertainty principle. ;) | |
BrianH: 21-Jan-2009 | Languages that wrap function arguments in parentheses (like C and Pascal) or are line-oriented (like Basic and Python) or at least have statement separators (like ; ) have a way of telling where their argument lists end. REBOL can only do so if the arity of a function is determinable at the call site. This is the price we pay for getting rid of the parentheses. | |
Steeve: 21-Jan-2009 | you can call the actor with his full path anyway, but' it's not rebolish | |
BrianH: 27-Jan-2009 | Here's my %user.r function: explore: func [ "Open directory in the file manager (shell shortcut function)." 'path [file! word! path! string! unset!] "Accepts %file, :variables, and just words (as dirs)" ] [ path: case [ unset? :path [to-local-file what-dir] file? path [to-local-file path] string? path [path] true [to-local-file to-file path] ] call ajoin [{"} get-env "SystemRoot" {\explorer.exe" } mold path] ] | |
BrianH: 27-Jan-2009 | CALL is less capable (and less buggy) in R3, but CASE is more capable :) | |
BrianH: 27-Jan-2009 | CALL doesn't support block arguments or any options yet in R3, though you can workaround some of its limitations for now. | |
Janko: 4-Feb-2009 | 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." | |
kib2: 4-Feb-2009 | BrianH: in this case, don't call them programmers. A programmer is curious, and likes to think differently by nature! | |
BrianH: 7-Feb-2009 | Chris, yes, but that would double the code of DIRIZE and add refinement checking overhead to every call, so the effect is worse. | |
Janko: 8-Feb-2009 | maybe I understood Brian wrong.. I thought in current situatuion you need to call exists? somepath and dir? somepath to know that something exists and is a directory (which also means two query calls I suppose) | |
Anton: 8-Feb-2009 | Janko, yes, the current situation is exactly that; to know that a directory exists, you need to call exists? and dir?, which causes two QUERY calls. | |
BrianH: 9-Feb-2009 | Yes, those would be good names for the aformentioned 0-based versions of PICK and POKE. PICK0 and POKE0 have also been suggested as names, though I prefer *Z. They could be natives (or mezzanines?) that call PICK and POKE internally. I think the only reason we don't have them already is that PICK is an action!, and the naming disagreement. | |
TomBon: 11-Feb-2009 | erlangs concurrency model, hot code loading, easy process communication, robust message passing and a nice database (let's call it rebnesia)...all ported to our fabulous rebol. ...when did you said you are ready with this brian? :-)) | |
BrianH: 12-Feb-2009 | If you *only* model after INSERT it minimizes the changes to the builder code. We aren't saving memory on a single call, we allowing careful reuse of memory on multiple calls. I've done the tests, the overall memory overhead goes down drastically. | |
BrianH: 12-Feb-2009 | Yes, but watch out: If there is a function call, the *whole* call gets executed, even if it is long. Your granularity of preemption of your manual multithreading is going to be pretty coarse. | |
BrianH: 13-Feb-2009 | That sounds like a better function to call GATHER. ACCUMULATE will get called less than that. | |
BrianH: 13-Feb-2009 | Fold is called ACCUMULATE - only functional languages call it fold. | |
BrianH: 15-Feb-2009 | You style styles (what other GUI systems call controls). | |
Henrik: 15-Feb-2009 | I just call it VID3.4. | |
BrianH: 15-Feb-2009 | No decision yet. I call it R3 GUI. | |
BrianH: 15-Feb-2009 | Kib2: Not my call, though I think chat could use better user management functions before we open it up again. We need to be able to *delete* users and all of their messages to deal with spammers - not just disable. We also need for the admin to be able to rename a user on request, to cut down on duplicate user accounts when users change their mind about their ID - we already have those. | |
Reichart: 15-Feb-2009 | We offer a cool HTML only interface, this ensures we work woth almost everything (we call this Amish Quilt) We plan to offer a step up which offers "some" JS" Then there is Quilt (JS + HTML only). Several people are not playing with iPhone only client applications that will interface to Qtask. | |
BrianH: 27-Feb-2009 | Not my call - ask Carl. | |
BrianH: 4-Mar-2009 | Why are minimum-of and maximum-of being mezzanines now, instead of natives as in R2? Because we are cleaning down the core in R3, and those functions are rarely used. They are fast enough as mezzanines - the FORSKIP loop they call is native in R3. Mezzanines can be better for some purposes too - REBOL is a much more powerful language than C for some things, so it is sometimes a good idea to write the functions in REBOL instead, particularly when it needs to be flexible. This is why LOAD is a mezzanine in R3 (which calls native code to parse the REBOL data), and half of DO is an intrinsic (a built-in function written in REBOL that is called by native code). | |
BrianH: 5-Mar-2009 | I like the idea of a refinement to have HELP search, but I think all of the options can be collapsed into one /search refinement. Search for a datatype could check type specs, for a refinement could check for supported refinements, for a string can search doc strings, maybe more. In general we prefer full words for options, particularly for user-level functions like HELP, so maybe /args is not the best name for this option - that's why I suggested /search. Please don't call the refinement /find or /all, because that makes the implementation of HELP incredibly awkward. | |
Steeve: 12-Mar-2009 | i make a proposal: Most of the times, we use the same rules several times on different data. reword should be able to not reconstruct the rules if so. I used the similiar tricks in some scripts, for example: map-chars: func [ {replace/all pair chars in a string} data [string!] values [block!] /local chars pos ][ ;** if the first value in values is a bitset, do not reconstruct the bitset unless bitset? chars: first values [ chars: make bitset! 256 forskip array 2 [append chars array/1] insert values chars ] pos: data values: next values while [pos: find pos chars][pos: change/part pos select/skip values first pos 2 1] data ] data: "Hello You" map-chars copy data values: [#"s" "SS" #"t" #"T"] ;** the second call is faster map-chars copy data values | |
Pekr: 28-Mar-2009 | I really like, how this page is starting to look - that is what I call good realease-early, release often strategy - http://www.rebol.net/wiki/R3_Releases | |
Steeve: 28-Mar-2009 | Guys, there is some missunderstandings since a while. Size-text is not usable on draw gobs, only on text gobs (that what we call rich-text gobs). A multi-line text system should handle several text gobs (one per line). It's the most simple and fastest system (it's what i do). So that we don't need to calculate the size or the position of each chars in the line. And we don't need to manage a text wrapping mechanism. | |
BrianH: 3-Apr-2009 | load: func [ {Loads a file, URL, or string.} source [file! url! string! binary! block!] {Source or block of sources} /header {Includes REBOL header object if present. Preempts /all.} /next {Load the next value only. Return block with value and new position.} ; /library {Force file to be a dynamic library. (Command version)} ; /markup {Convert HTML and XML to a block of tags and strings.} /all {Load all values. Does not evaluate REBOL header.} /unbound {Do not bind the block.} /local data content val rst tmp ][ ; Note: Avoid use of ALL and NEXT funcs, because of /all and /next options content: val: rst: tmp: none ; In case people call LOAD/local ; Retrieve the script data data: case [ block? source [ ; Load all in block return map x source [apply :load [:x header next all unbound]] ] string? source [source] ; Will convert to binary! later binary? source [source] ; Otherwise source is file or url 'else [ ; See if a codec exists for this file type tmp: find find system/catalog/file-types suffix? source word! ; Get the data, script required if /header content: read source ; Must be a value, not unset case [ binary? :content [content] ; Assumed script or decodable string? :content [content] ; Assumed script or decodable header [cause-error 'syntax 'no-header source] block? :content [content] 'else [content: reduce [:content]] ] ; Don't LOAD/header non-script data from urls and files. ] ; content is data if content doesn't need copying, or none if it does ] ;print [1 "data type?" type? :data 'content true? :content] if string? :data [data: to-binary data] ; REBOL script is UTF-8 assert/type [data [binary! block!] content [binary! string! block! none!]] assert [any [binary? :data not header]] if tmp [ ; Use a codec if found earlier set/any 'data decode first tmp :data ; See if we can shortcut return the value, or fake a script if we can't case [ block? :data [if header [insert data val: make system/standard/script []]] header [data: reduce [val: make system/standard/script [] :data]] (to logic! unbound) and not next [return :data] ; Shortcut return any [next any-block? :data any-word? :data] [data: reduce [:data]] 'else [return :data] ; No binding needed, shortcut return ] assert/type [data block!] ; If we get this far ] ;print [2 'data mold to-string :data] if binary? :data [ ; It's a script unless find [0 8] tmp: utf? data [ ; Not UTF-8 cause-error 'script 'no-decode ajoin ["UTF-" abs tmp] ] ; Process the header if necessary either any [header not all] [ if tmp: script? data [data: tmp] ; Load script data ; Check for a REBOL header set/any [val rst] transcode/only data unless case [ :val = [rebol] [ ; Possible script-in-a-block set/any [val rst] transcode/next/error rst if block? :val [ ; Is script-in-a-block data: first transcode/next data rst: skip data 2 ] ; If true, val is header spec ] :val = 'rebol [ ; Possible REBOL header set/any [val rst] transcode/next/error rst block? :val ; If true, val is header spec ] ] [ ; No REBOL header, use default val: [] rst: data ] ; val is the header spec block, rst the position afterwards assert/type [val block! rst [binary! block!] data [binary! block!]] assert [same? head data head rst] ; Make the header object either val: attempt [construct/with :val system/standard/script] [ if (select val 'content) = true [ val/content: any [:content copy source] ] ] [cause-error 'syntax 'no-header data] ; val is correct header object! here, or you don't get here ; Convert the rest of the data if necessary and not /next unless any [next block? data] [data: rst: to block! rst] if block? data [ ; Script-in-a-block or not /next case [ header [change/part data val rst] ; Replace the header with the object not all [remove/part data rst] ; Remove the header from the data ] rst: none ; Determined later ] ] [rst: data] ; /all and not /header ] ; val is the header object or none, rst is the binary position after or none assert/type [val [object! none!] rst [binary! none!] data [binary! block!]] assert [any [none? rst same? head data head rst] any [val not header]] ;print [3 'val mold/all :val 'data mold/all :data "type?" type? :data] ; LOAD/next or convert data to block - block either way assert [block? data: case [ not next [ ; Not /next unless any [block? data not binary? rst] [data: to block! rst] data ] ; Otherwise /next block? data [reduce pick [[data] [first+ data data]] empty? data] header [reduce [val rst]] ; Already transcoded above binary? rst [transcode/next rst] ]] ; Bind to current global context if not a module unless any [ ; Note: NOT ANY instead of ALL because of /all unbound (select val 'type) = 'module ][ bind/new data system/contexts/current ] ;print [6 'data mold/all :data 'tmp mold/all :tmp] ; If appropriate and possible, return singular data value unless any [ all header next ; /all /header /next empty? data 1 < length? data ][set/any 'data first data] ;print [7 'data mold/all :data] :data ] | |
Pekr: 8-Apr-2009 | Sure - it is a known thing, but I would not call it being a show stopper. We haven't had this feature for 13 years, so why should it be important right now? And if there is a bug, just claim your interest and it might get fixed. | |
Oldes: 11-Apr-2009 | I use user.r to add functions which I use in Console. If you remove it, I can create a boot script myself and call rebol with it. I almost never run Rebol script just clicking on them. | |
BrianH: 11-Apr-2009 | Oldes, I frequently call REBOL scripts by just clicking on them, but those scripts load utility functions and halt to the console :) | |
BrianH: 11-Apr-2009 | We don't have file attribute setting or getting yet, so file copy/move might be out for now, unless you call platform functions. | |
Anton: 12-Apr-2009 | BrianH: I use user.r for a few little things, but mainly I get it to call my anton-user.r script. I forget when but there were some instances (when I was on Windows) where rebol would overwrite user.r (testing a fresh rebol beta?). That's why I decided to get all my code out of it and just DO my anton-user.r script from it. On linux I also set system/options/home where I want (not the user directory). I don't change environments much. All new rebol executables are placed into the same directory and beaten with a stick until they work using the same user.r and my anton-user.r script. | |
Geomol: 21-Apr-2009 | Yeah, maybe give functions like mine above, that users can call and get their input encoded, instead of having to know all the escaping rules themselves. If that solution is choosed, then this input should give an error, as it is an invalid url: ftp://[user-:-net-:-net]:[pass-:-server-:-net] Today R3 just accepts it. | |
BrianH: 23-Apr-2009 | Ladislav (continued from Rebol vs. Scheme), FUNCTOR currently isn't being used by any mezzanine code, so if we want to change it now is the time. If we go with your initialization block idea: - The initialization would have to be performed at function creation time, not first call. - The init block would be only the starting spec for the static object, not the final spec. We'd need to still do the search-for-setwords that FUNCT does, or there'd be no point to including FUNCTOR. - I'd suggest that the parameters be in spec, init, body order. | |
Ladislav: 23-Apr-2009 | re Functor: * in my opinion it does not make sense to initialize static local variables during function call, since they are static and therefore supposed to persist, so the only time suitable for the initialization seems to be the function creation time * the initialization (IMO) can perfectly serve another purpose: all initialized (during function creation) variables shall be static, while the other variables shall be dynamic IMO | |
BrianH: 23-Apr-2009 | They could be initialized at first call. We already have facilities to do what you describe. | |
Ladislav: 23-Apr-2009 | aha, during first call - how does the user find out which call is the first one? |
1401 / 2491 | 1 | 2 | 3 | 4 | 5 | ... | 13 | 14 | [15] | 16 | 17 | ... | 21 | 22 | 23 | 24 | 25 |