AltME groups: search
Help · search scripts · search articles · search mailing listresults summary
world | hits |
r4wp | 64 |
r3wp | 928 |
total: | 992 |
results window for this page: [start: 201 end: 300]
world-name: r3wp
Group: RAMBO ... The REBOL bug and enhancement database [web-public] | ||
Anton: 26-Nov-2006 | body: second get in svv/vid-styles/tog/feel 'engage insert body bind bind [ if action = 'away [over face false event] if action = 'over [over face true event] ] svv/vid-styles/tog/feel body/4 view center-face layout [tog "hello"] | |
Anton: 2-Jan-2007 | Gabriele, I would like to raise the importance of http://www.rebol.net/cgi-bin/rambo.r?id=3571& I patch functions quite often, and then I usually need to bind to the function context. If the original function was not written by me (or even if it was), then it's tricky to find a good technique to find a suitable word local to the function context. I have to look in the function body for a local word and write code to select it, which usually looks like spaghetti. I do my best, but if the function body changes for whatever reason, then my patch code is probably also broken. None of us likes to write code that is so brittle. | |
Maxim: 2-Jan-2007 | I second Anton's request, I do the same myself, and for example, am using it within VIEW stuff to modify some event handlers... its often easier than trying to re-bind the body which comes from several contexts... | |
Anton: 12-May-2007 | Interesting problem: Why do I need BIND/COPY ? The aim is to copy the values of the facets in face F2 to face F1. f1: make face [] f2: make face [text: "hello"] facets: [text] set bind facets f1 reduce bind facets f2 f1/text ;== none ; <-- why ??? f1/text: none set bind/copy facets f1 reduce bind facets f2 f1/text ;== "hello" f1/text: none set bind facets f1 reduce bind/copy facets f2 f1/text ;== "hello" f1/text: none set bind/copy facets f1 reduce bind/copy facets f2 f1/text ;== "hello" | |
Volker: 29-May-2007 | ;Not perfect, but less clicky view layout [ style cfield field center feel [ redraw: func [face act pos] bind [ if all [in face 'colors block? face/colors] [ face/color: pick face/colors face <> focal-face ] foc?: same? face system/view/focal-face face/font/align: either foc? ['left] ['center] ] system/view ] cfield "hello" with [focus self] cfield "cflied2" cfield "cfield3" ] | |
Volker: 29-Jun-2007 | to block! does not bind. word is not included in system/words. sometimes that results in an error-mesage and sometimes in a crash. | |
Group: Core ... Discuss core issues [web-public] | ||
Anton: 24-Nov-2005 | Pekr, you can do it by binding your 'date-lay to the 'date-lay that is already in the function body. insert second :request-date bind [probe date-lay] pick pick second :request-date 10 2 (Mmm... request-date is quite an ill-behaved function. It sets 5 words in the global context.) | |
Anton: 24-Nov-2005 | Above I have bound your whole block of code to the existing 'date-lay word. It could be better (a more reliable way in other situations) to bind just the 'date-lay word in your new code (ie. only the words which need binding): insert second :request-date compose [probe (bind 'date-lay pick pick second :request-date 10 2)] | |
Volker: 28-Nov-2005 | f: func[/a va /b vb /opts blk][ if opts[do bind blk 'opts] ?? a ?? b ] f/opts [a: 5] | |
Henrik: 28-Nov-2005 | hmm... a bit confused about the BIND part... | |
MichaelB: 15-Dec-2005 | this is from the blog-chat: I liked Ladislavs function and just extended it a little bit: maybe bind would be nice like that - one can bind only the words one wants to and also only the types one likes, unless using plain, then all words of the same spelling get bound old-bind: :bind bind: func append copy third :bind [ /only only-words [block! any-word!] /plain /local pos rule item ][ if copy [words: copy words] either only [ if any-word? only-words [only-words: reduce [only-words]] if any-word? known-word [known-word: bind? known-word] if plain [forall only-words [change only-words to word! only-words/1]] parse words rule: [ any [ pos: set item any-word! ( if any [ all [plain find only-words to word! item] find only-words item ][ item: old-bind :item known-word change pos :item ] ) | into rule | skip ] ] ][ old-bind words known-word ] ] f: g: h: i: 1 bl: ['f g h i] c: context [f: 2 g: 3 h: 'hello] bind/only bl c [f 'h] get-values: [ get to-word first bl get to-word second bl get to-word third bl get to-word fourth bl ] probe reduce get-values bind/only/plain bl c [f 'h] probe reduce get-values bind bl 'system probe reduce get-values bind/only bl c 'g probe reduce get-values | |
MichaelB: 15-Dec-2005 | I hope a more correct version of only 'bind-only - just to have not something too wrong lurcking around bind-only: func [ {Binds only selected words to a context. If taken 'lit'erally even just words of the same kind.} words [block!] known-word [any-word! object! port!] only-words [block! any-word!] /lit /local pos rule item ][ if any-word? only-words [only-words: reduce [only-words]] if any-word? known-word [known-word: bind? known-word] unless lit [ only-words: copy only-words forall only-words [change only-words to word! only-words/1] ] parse words rule: [ any [ pos: set item any-word! ( if any [ find only-words to word! :item all [lit find only-words :item] ][ item: bind :item known-word change pos :item ] ) | into rule | skip ] ] words ] | |
JaimeVargas: 4-Jan-2006 | CounterClass: context [ c: 0 bump: does [c: c + 1] read: does [c] bump-by: func [inc][c: c + inc] ] make-instance: func [ class /local class-vars instance-data class-methods v ][ class-vars: copy [*-private-*] class-methods: copy [] instance-data: copy [] foreach w next first class [ either function! = type? v: get in class :w [ append class-methods compose/deep [ (to set-word! :w) func [(first :v)] [ bind second get in class (to lit-word! :w) '*-private-* do reduce [get in class (to lit-word! :w) (first :v)] ] ] ][ append class-vars :w append instance-data reduce [to set-word! :w :v] ] ] use class-vars compose/deep [ (instance-data) context [(class-methods)] ] ] ctr1: make-instance CounterClass crt2: make-instance CounterClass ctr1/bump ctr1/bump ctr1/read ctr2/bump ctr2/read | |
MichaelB: 6-Jan-2006 | Jaime: I checked your code above: first I thought it's not possible, then I thought wow, but I got one thing left that doesn't work: You're using the 'class word to bind the code of the functions of an object later to the right object - this doesn't work, because 'class is always bound to the function context and thus has the last object referenced - in your example no problem, because the code is the same - but with different code doesn't work anymore - maybe with one of the closures it would work - because 'class gets always bound to a new context (but I'm not sure yet whether I understand it right) CounterClass2: context [ d: 0 bump2: does [d: d + 1] read2: does [d] bump-by2: func [inc][d: d + inc] ] ctr1: make-instance CounterClass ctr2: make-instance CounterClass2 ctr1/bump ctr1/bump ctr1/read ctr2/bump2 ctr2/read2 fails, because at ctr1/bump, class is bound to object CounterClass2 which has only bump2 so if this gets sorted out - it seams to be really difficult to access the hidden contexts (or impossible, because after invoking the function the contexts are gone) | |
JaimeVargas: 6-Jan-2006 | make-instance: func [ class [object!] /local class-vars instance-data class-methods v ][ class-vars: copy [*-private-*] class-methods: copy [] instance-data: copy [] foreach w next first class [ either function! = type? v: get in class :w [ append class-methods compose/deep [ (to set-word! :w) func [(first :v)] [ bind second get in (:class) (to lit-word! :w) '*-private-* do reduce [get in (:class) (to lit-word! :w) (first :v)] ] ] ][ append class-vars :w append instance-data reduce [to set-word! :w :v] ] ] use class-vars compose/deep [ (instance-data) context [(class-methods)] ] ] | |
MichaelB: 6-Jan-2006 | ctr1/read == 2 >> ctr1/bump == 3 bl: [c] == [c] >> f: get in ctr1 'read >> o: third tenth second :f >> bind bl first second get in o 'read == [c] >> set first bl 12 == 12 >> ctr1/read == 12 :-) But how you want to prevent this ? I mean what property you talked about would get lost ? | |
MichaelB: 6-Jan-2006 | That's my problem with Rebol, on the one side I hate this vulnerability, on the other side it's so nice to be able to bind around like wished. | |
JaimeVargas: 6-Jan-2006 | Well ObjC allows you to bind to anything and instrospect anything. So I think is all is good. | |
JaimeVargas: 6-Jan-2006 | CounterClass: context [ c: 0 bump: does [c: c + 1] read: does [c] bump-by: func [inc][c: c + inc] ] make-instance: func [ class /local class-vars instance-data class-methods v ][ class-vars: copy [*-private-*] class-methods: copy [] instance-data: copy [] foreach w next first class [ either function! = type? v: get in class :w [ append class-methods compose/deep [ (to set-word! :w) func [(third :v)] [ (bind copy second get in class (to lit-word! :w) '*-private-*) ] ] ][ append class-vars :w append instance-data reduce [to set-word! :w :v] ] ] use class-vars compose/deep [ (instance-data) context [(class-methods)] ] ] ctr1: make-instance CounterClass ctr2: make-instance CounterClass ctr1/bump ctr1/bump ctr1/read ctr2/bump ctr2/read | |
Volker: 6-Jan-2006 | Not completely - the code still needs access to the global context. if you bind every word in an own context and put selected functions there, it would work. Still tricky, for example 'second can not be exposed, else you get the functions body. I may forget other issues. | |
JaimeVargas: 6-Jan-2006 | make-instance: closure [ class [object!] /local class-vars instance-data class-methods v ][ class-vars: copy [*-private-*] class-methods: copy [] instance-data: copy [] foreach w next first class [ either function! = type? v: get in class :w [ append class-methods compose/deep [ (to set-word! :w) func [(first :v)] [ bind second get in class (to lit-word! :w) '*-private-* do reduce [get in class (to lit-word! :w) (first :v)] ] ] ][ append class-vars :w append instance-data reduce [to set-word! :w :v] ] ] use class-vars compose/deep [ (instance-data) context [(class-methods)] ] ] | |
Henrik: 7-Jan-2006 | ah the joys of BIND... >> a: make object! [b: 0 c: b] >> a/b == 0 >> a/c == 0 >> set in a 'b 7 == 7 >> a/c == 0 How do I restore the context? | |
BrianH: 7-Jan-2006 | Bind isn't used here. | |
Pekr: 1-Mar-2006 | simply to bind 'do to the context of the function? | |
Volker: 1-Mar-2006 | ff: func [a] [str: "a + 1" blk: bind load str 'a do blk] | |
Volker: 1-Mar-2006 | bind the argument, not the 'do | |
Anton: 1-Mar-2006 | just do bind load str 'a | |
Pekr: 1-Mar-2006 | I thought bind is involved somehow :-) | |
Pekr: 1-Mar-2006 | following works: >> kontext: context [a: 1 b: 2 c: 3] >> do bind [a + b + c] in kontext 'a == 6 | |
Pekr: 1-Mar-2006 | but I first tried: do bind [a + b + c] 'kontext and it did not work. So is 'kontext itself a different context than in kontext 'a? :-) | |
JaimeVargas: 1-Mar-2006 | do bind [a + b + c] kontext ;; works. | |
JaimeVargas: 1-Mar-2006 | with: func [object [object!] block [block!]] [ do bind/copy block object ] >> kontext: context [a: 1 b: 2 c: 3] >> with kontext [a + b + c] == 6 | |
JaimeVargas: 1-Mar-2006 | The WITH mezz was proposed by greg his implementation is backward compatilble, while the above is for 2.6 core. For completeness here is his implementation: with: func [object block] [ if object [do bind/copy block in object 'self] ] | |
Volker: 1-Mar-2006 | do bind [a + b + c] 'kontext In which context is 'kcontext bound? ;) | |
Pekr: 1-Mar-2006 | well, the quote char was there simply by mistake and because I rewrote example according to initial syntax of do bind load str 'a, where 'a is quoted too ;-) | |
Graham: 18-Apr-2006 | how to bind this correctly ? | |
Anton: 18-Apr-2006 | Ye must bind to an example worde, as it is written in the olde texte. | |
Ingo: 19-Apr-2006 | Do you mean like this? >> b: "(blue)" == "(blue)" >> compose bind to block! b 'white == [0.0.255] You just have to give any word from the same context to bind ... so inthis case any word from the global context (i.e. system/words). The only point to be aware of: If all this happens in a different context, and you happen to have a word named 'white in this context, then you have to use another word. | |
Robert: 30-Apr-2006 | Hi, I need some help with BIND (I think that's what I need to use): I have a storage context, that has a bunch of function to handle the storage of other contexts. That those storage functions can work, they need to have access to the other context. I could do: storage/save-record context-to-save ... | |
Robert: 30-Apr-2006 | Is it possible to bind the storage functions dynamically to the context that should be saved and switch this binding in the app depending on which context should be stored? | |
Robert: 30-Apr-2006 | I think I need to switch the way it works: do bind [first object] storage | |
Anton: 30-Apr-2006 | >> c1: context [a: b: none] >> c2: context [a: b: none] >> do bind [a: 1 b: 2] c1 == 2 >> probe c1 make object! [ a: 1 b: 2 ] >> do bind [a: 100 b: 200] c2 == 200 >> probe c2 make object! [ a: 100 b: 200 ] | |
Anton: 30-Apr-2006 | Oh sorry, you specifically want to bind a function's body to the context. Let's see, I think this will work: bind second get in storage 'list-words A storage/list-words | |
Anton: 30-Apr-2006 | >> A: context [a: 1 b: 2 c: 3] >> storage: context [list-words: does [probe first self]] >> storage/list-words [self list-words] == [self list-words] >> bind second get in storage 'list-words A == [probe first self] >> storage/list-words [self a b c] == [self a b c] | |
Anton: 30-Apr-2006 | read as: "bind the body of list-words to A" | |
Robert: 30-Apr-2006 | Ok... now I think I got it. I was always trying to bind the WHOLE function, not only the body... | |
Anton: 30-Apr-2006 | Yes, bind needs a block! value, not a function! | |
Anton: 30-Apr-2006 | You wouldn't want to bind the whole function, which would probably imply binding its spec block as well, since that would unlink the argument spec block relative to the body block. | |
Robert: 30-Apr-2006 | I think I can bind a bunch of functions as well, right? | |
Robert: 30-Apr-2006 | So for example I specify a block of function names, that I want to bind. | |
Anton: 30-Apr-2006 | You could append each function's body block to a single, large block. Then bind that. | |
Anton: 30-Apr-2006 | blk: [] foreach func funcs [append blk second :func] bind blk ctx-A | |
Anton: 30-Apr-2006 | >> ctx-A: context [a: 60] >> my-func: func [][a: 5] >> bind second :my-func ctx-A == [a: 5] >> ?? ctx-A ctx-A: make object! [ a: 60 ] >> my-func == 5 >> ?? ctx-A ctx-A: make object! [ a: 5 ] | |
Anton: 30-Apr-2006 | >> ctx-A: context [a: 60] >> my-func: func [][a: 5] >> blk: [] append blk second :my-func == [a: 5] >> bind blk ctx-A == [a: 5] >> ?? ctx-A ctx-A: make object! [ a: 60 ] >> my-func == 5 >> ?? ctx-A ctx-A: make object! [ a: 60 ] | |
Anton: 30-Apr-2006 | foreach func funcs [bind second :func ctx-A] | |
Anton: 30-Apr-2006 | >> ctx-A: context [a: none] >> f1: does [a: 1] >> f2: does [a: 2] >> foreach func reduce [:f1 :f2][bind second :func ctx-A] == [a: 2] >> ?? ctx-A ctx-A: make object! [ a: none ] >> f1 == 1 >> ?? ctx-A ctx-A: make object! [ a: 1 ] >> f2 == 2 >> ?? ctx-A ctx-A: make object! [ a: 2 ] | |
Robert: 30-Apr-2006 | A BIND how-to, that not only explains what's going on but shows examples, examples, examples is what we need. | |
Robert: 30-Apr-2006 | Nothing for people getting into first touch with BIND. | |
BrianH: 30-Apr-2006 | I actually think that your best bet here is to pass the context you will be saving to the saving function as a parameter, like your original example storage/save-record context-to-save or if you really want to delegate you can assign the function as a member of context-to-save and call it like context-to-save/save-record context-to-save , but then you are changing the context you are saving wih saving overhead. REBOL does direct delegation by default, rather than mixin delegation like Delphi, because REBOL doesn't pass the object reference as a hidden parameter like object-oriented languages do. Rebinding your function body every time would be time-consuming and either non-recursion-safe (bind) or consume a lot of memory (bind/copy) - just passing the context as a parameter would be quicker. | |
BrianH: 30-Apr-2006 | Not that learning about bind wouldn't be fun... | |
Robert: 1-May-2006 | I might fall back to the parameter solution. My goal is, that with BIND the code becomes much more natural to read and maintain. Because teh storage context needs some knowledge about the context to save, as I'm using a dynamic field-mapping method. Hence I only need to alter the context-to-save (add / remove words) and the storage context can handle it automatically. I have to deal with scheme evolution and versioning. | |
Robert: 1-May-2006 | Ok, I have tested some ways. The bind solution is nice but has the disadvantage, that I can't handle more than one currenct storage-context. | |
Ladislav: 1-May-2006 | Anton: " >> ctx-A: context [a: 60] >> my-func: func [][a: 5] >> blk: [] append blk second :my-func == [a: 5] >> bind blk ctx-A == [a: 5] >> ?? ctx-A ctx-A: make object! [ a: 60 ] >> my-func == 5 >> ?? ctx-A ctx-A: make object! [ a: 60 ] - you would have to change it to: ctx-A: context [a: 60] my-func: func [][a: 5] blk: [] append/only blk second :my-func bind blk ctx-A ?? ctx-A my-func ; == 5 ?? ctx-A | |
Ladislav: 2-May-2006 | your problem is, that if you do bind copy block 'context the original BLOCK will stay unaffected | |
Joe: 22-May-2006 | Hi, I am a bit confused with bind and context e.g. blk: [a b] a: 1 b: 2 f: func [/local res][ res: bind/copy 'blk res probe reduce res ] >> f == [1 2] Here my understanding would be that a and b are not set in that context and the result is an error. Apart for understanding the current behaviour, what I want to accomplish is the behaviour that results in an error. I have a program where I set a lot of variables within a function but I don't want to set all of them as local, because it's repetitive and I sometimes miss a few so I'd like declare them as local using a block with all the variable names. Also, when I reduce the block I should get an error if some of the variables have not been set independently of whether any of these variables is set in the global context. Any ideas how to accomplish this ? | |
Anton: 22-May-2006 | >> a: 1 b: 2 == 2 >> vars: [a b] == [a b] >> f: func compose [/local res (vars)][bind vars 'res reduce vars] >> f == [none none] >> f: func compose [/local res (vars)][bind vars 'res a: 100 reduce vars] >> f == [100 none] | |
Joe: 22-May-2006 | I want to use the power of bind and contexts to make sure this works | |
Anton: 22-May-2006 | Or wait... you want a context to keep all your template variables in: template: context [title: introduction: cost: none] then unset all the variable in the template: unset bind next first template template Your function references words in the template and receives an error for the first one which is unset. f: func [template][do bind [?? title] template] f template ** Script Error: title has no value ** Where: ?? ** Near: mold name: get name but works fine when they have values: template/title: "hello" f template ; ==> title: "hello" | |
Ladislav: 22-May-2006 | unbind: func [ {unbind words} [catch] words [word! block!] /local word result object ] [ if word? words [words: reduce [words]] result: copy [] unless parse words [ any [set word word! (insert tail result to set-word! word)] ] [throw make error! "unexpected data"] exclude result [self:] insert tail result none object: make object! result either find result first [self:] [first object] [ exclude first object [self] ] ] blk: [a b] a: 1 b: 2 f: func [/local res][ res: bind/copy unbind blk 'res probe reduce res ] f blk | |
Joe: 22-May-2006 | I get script error: self has no value and I get the same error if I set a and b after bind in function f | |
Joe: 22-May-2006 | unbind: func [ "unbind words" [catch] words [word! block!] /local word result object ][ if word? words [words: reduce [words]] result: copy [] unless parse words [ any [set word word! (insert tail result to set-word! word)] ][ throw make error! "unexpected data" ] exclude: result [self:] insert tail result none object: make object! result either find result first [self:] [first object] [ exclude first object [self] ] ] blk: [a b] a: 1 b: 2 f: func [/local res][ res: bind/copy unbind blk 'res a: 1 b: 1 probe reduce res ] f blk | |
Joe: 22-May-2006 | template: to block! "<html><head><title> title </title></head><body>tag1 tag2 tag3</body></html>" blk: remove-each val load copy template [tag? val] ?? blk ; == [title tag1 tag2 tag3] tag3: "this is a fake value, should not appear" eval-template: func [ /local res ][ res: copy "" title: "hey" tag1: "this is tag1^/" tag2: "i am tag 2^/" ;tag3: "might not be set^/" bind/copy template 'res repend res template res ] | |
Joe: 22-May-2006 | template: to block! "<html><head><title> title </title></head><body>tag1 tag2 tag3</body></html>" blk: remove-each val load copy template [tag? val] ?? blk ; == [title tag1 tag2 tag3] tag3: "this is a fake value, should not appear" eval-template: func [ /local res ][ res: copy "" title: "hey" tag1: "this is tag1^/" tag2: "i am tag 2^/" ;tag3: "might not be set^/" bind/copy unbind blk 'res repend res template res ] | |
Group: Syllable ... The free desktop and server operating system family [web-public] | ||
Kaj: 12-Sep-2008 | This release focuses on making the system usable for running a number of standard servers, and several innovative REBOL servers. The development files of the system, program headers, static libraries and development documentation, were moved to a separate area in /system/development/ and are now shipped in a separate package. If you want to compile software on Syllable Server, you need to install and register this package. The development files need to match the system: you can't use a package of any other Syllable version. (You will also need to install the Developer's Delight package collection and possibly other packages.) User directories were moved from /home/ to /users/. Resource packages are in the process of moving from /usr/ to /resources/. /resources/ is currently a symbolic link to /usr/ so that resource packages will work from both places during the migration. Many fixes were made, including more fixes for the CUPS print server and GhostScript. Creation of extra user accounts is possible now. Many packages were updated, including the Linux kernel, IPTables, the GCC libraries, OpenSSH, SDL and QEmu. DirectFB was not upgraded due to incompatibility with Links2. CDRTools were included for burning CDs, and the NetCat networking tool and the Transmission BitTorrent client were added. In addition to the Syllable-specific early initialisation scripts (in the early-init subdirectory of packages), the late initialisation scripts (in the init subdirectory of packages) are now also executed. Several more initialisation scripts from Linux From Scratch were also added. Some servers can be started with the LFS scripts, others with the Syllable scripts (this will be unified in later releases). The OpenSSH server was configured and now runs by default. At the first system start, security keys are generated that identify the server. A collection of well-known root certificates from Certification Authorities was added to allow OpenSSL-based programs (such as OpenSSH) to establish the identity of destination points for network connections. A MIME-types database was added in /etc/mime.types that is used by many programs, such as web servers, to identify the MIME types of files based on their file name extensions. Several REBOL software stacks were added: - The REBOL/Services Service Oriented Architecture. - The UniServe network server framework. - The Cheyenne Apache-class web server. - A CAPTCHA library. - A MySQL network protocol. - The QuarterMaster web programming framework, based on a Model-View-Controller architecture. By default, it's configured to run on Cheyenne. - The TINY library for parsing text, abstracting data access and building templates of generic text formats (including HTML). This library is an original creation and targets both ORCA and REBOL. Configurations, including initialisation scripts, were added for the OpenSSH remote access server, the CUPS print server, the BIND domain name server, the Apache web server, the RSync file synchronisation server, the SaMBa Windows-compatible file server, the INetUtils FTP server and the VSFTP FTP server. Several of these are not included in the system, but need to be installed separately (the system is prepared for them). The sshd, cupsd and initd servers are started by default. S3Cmd/S3Sync was included, a tool for accessing the Amazon Simple Storage Service (S3) and synchronising files with it. As a demo, the Genode operating system framework, its Nitpicker windowing server (built on SDL) and its demonstration programs were included. | |
Group: Linux ... [web-public] group for linux REBOL users | ||
Robert: 22-Sep-2008 | So, the first strange thing is that I get a: "Bind socket to interface: No such device". | |
Group: Rebol School ... Rebol School [web-public] | ||
BrianH: 2-Jan-2009 | Note that all functions of this type have bind/copy overhead of the code block (including FOREACH). | |
BrianH: 2-Jan-2009 | Speaking of which, good catch on the foreach bind/copy eliminating an explicit copy :) | |
BrianH: 3-Jan-2009 | Note that the copy performed by the FOREACH is a bind/copy, not a copy/deep. This means that only any-words, blocks and parens are copied, all other types are just referenced, including the function. | |
BrianH: 3-Jan-2009 | I think path! types are also copied by bind/copy. | |
Henrik: 8-Feb-2009 | kib2, since you can bind contexts everywhere, even inside other contexts, they are not really secure and so you can't make things really private to a context. Modules will do that, I believe. | |
Steeve: 16-Feb-2009 | i made optimizations in R3, removed change/dup , parents, temp vars, etc... I also replaced repeat or for structures by loops (to avoid bind/copy ) It changes nothing. It remains slow. The reason is that the script does (10000 * i) iterations in R3, by just doing iterations and a show (no computations) it takes 4 seconds. Then, by just adding the square-root calcul, it takes 8 seconds (2 times slower). | |
Group: !REBOL3-OLD1 ... [web-public] | ||
BrianH: 5-Sep-2006 | I was just using the same refinement /copy that bind uses, but I agree that its reuse as a local variable isn't very readable. I should use /local like my conjoin does. Speaking of conjoin, what do you think of the one above? The only speedup I can see to do is to replace the insert reduce with four inserts, but otherwise it seems useful. | |
JaimeVargas: 20-Dec-2006 | But if function pre-bind blocks or pre-reduce, you lose CODE-AS-DATA, beside making function evaluation slower. | |
Group: !Cheyenne ... Discussions about the Cheyenne Web Server [web-public] | ||
Dockimbel: 13-Apr-2008 | Just remove .r from this line : bind-extern CGI to [.cgi .r], and .r file will be served as static files. | |
Dockimbel: 16-Oct-2008 | From v0.9.19, using 'do would by default bind your loaded code to the webapp context (and not to the global context). Btw, if you're using an external INCLUDE function, it may clash with RSP's global INCLUDE function. | |
Dockimbel: 21-Oct-2008 | Webapps are, from v 19, contained in their own context (object!). 'do will first bind the loaded code to the webapp context before executing it. | |
Janko: 1-Mar-2009 | I am not 100% on few things ... should I use short names like req opt or whole required optional ... and more technical about check and do (I will rename this to proc or process ) .. should I create/bind to words that are the same as field names , like this upthere ... or maybe use something like this so you use ( to-visible-url this ) I don't like creating a bunch of words that won't get used mostly... but I thought I need to so I can use this for typical password / retype password example like this ... password req . password2 req check ( either password == password2 [ none ] [ "passwords don't match" ] ) . ... | |
Janko: 1-Mar-2009 | but I figured out I could use current and previous then this example and probably some others will work anyway.. and I can bind in do ( code ) anyway if I really need custom variables password req . password2 req check ( either current == previous ) [ none ] [ "no match" ] ) . I will go with this way | |
Dockimbel: 21-Apr-2009 | Cheyenne process script files declared in %httpd.cfg config file. In the default config file, you have : bind-extern CGI to [.cgi .r] which means that both .cgi and .r are treated as CGI scripts and executed. | |
Dockimbel: 21-Apr-2009 | If you want to serve .r files as static files, just remove it from the BIND-EXTERN command in config file. | |
Dockimbel: 16-May-2009 | I guess you're using 0.9.19. DO has been redefined in the RSP engine to bind, by default, loaded code to webapp context. If you want to load libs that have to be visible in the global context, you have to use DO/GLOBAL. | |
Dockimbel: 21-May-2009 | Having the TCP/IP part open-sourced in R3 will be great. It will allow to use much faster OS hooks for file transfers, extend the port! API to bind only on selected interfaces, etc...I wonder if the main event loop will be there also, so we can replace the not-scalable Select( ) call by other faster ones or even integrate libevent. That would definitely make Cheyenne able to handle a much higher number of connections. | |
Maxim: 20-Jun-2009 | cool. and I'm reiterating the need to provide a sample file ala apache with a paragraph of comments or two which explain all configs... just in case you forgot to note it... this for me is big hassle. for example... the subtleties behind 'BIND and 'BIND-EXTERN are not obvious to deduce just by the name... -what is the difference in how they are cached? -is an external handler explicitely needed with 'BIND-EXTERN (no, in fact, but it enables it) -how does one use an external handler? | |
Dockimbel: 20-Jun-2009 | BIND associates one or more file extensions to a Cheyenne internal mod. BIND-EXTERN associates on or more file extensions to a background handler (worker process through task-master service). | |
Dockimbel: 20-Jun-2009 | The handler name declare in BIND or BIND-EXTERN have to match a mod ID or a background handler name. Examples: bind SSI to .shtml => processed by mod-ssi.r (SSI is used as a matching key in the mod) bind-extern CGI to .cgi => processed by mod-action.r (bind-extern's dispatcher), then by CGI.r external handler in a worker process. | |
Maxim: 20-Jun-2009 | yes... I already new... but I had to trace the code and lost some time wondering why my page wasn't being re-rendered when I first used 'BIND ;-) I also had to trace the logic to make sure that cheyenne wasn't actually expecting an external handler if I used 'BIND-EXTERN... I ended up loosing more than an hour to figure it out myself... now that is just one config... there are MANY... a lot of them I don't even know exist. the above is exactly the kind of information which should be included within the httpd.cfg file, even if an example is commented out, but provided as an example use. just like apache does it. | |
Maxim: 20-Jun-2009 | when the config do is performed, I noticed you do a bind on the block... the thing I wonder is to what it is bound... its not obvious to me | |
Maxim: 2-Jul-2009 | in the http.cfg file its assigned as a cgi script: bind-extern CGI to [.cgi .r] and the CGI handler will execute it. | |
Dockimbel: 5-Aug-2009 | Nope, but you can bind a domain to a specific listen port. For ex: globals [ listen [80 8000] ... ] my.domain.com:8000 [ webapp [ ... ; this webapp should only be accessed through port 8000 ] ] | |
Dockimbel: 17-Aug-2009 | *do means "bind to the global context", but even the wrapper DO wouldn't help you there. As a rule of thumb, *always* initialize your global variables in your RSP script (or at least put them in some local context). Never expect that a variable would be available in another RSP script unless you put it in session object. |
201 / 992 | 1 | 2 | [3] | 4 | 5 | 6 | 7 | 8 | 9 | 10 |