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: 101 end: 200]
world-name: r3wp
Group: Ann-Reply ... Reply to Announce group [web-public] | ||
Graham: 29-Dec-2008 | Get the pdf ... and you can bind it as many times as you like. See Ladislav's notes on REBOL bindology. | |
Group: !AltME ... Discussion about AltME [web-public] | ||
Graham: 6-Jul-2006 | Wonderful *** AltME ERROR *** Sorry, AltME found an error while it was starting up. This should never happen, but it looks like it just did. Go to http://www.altme.com/feedback.htmland cut/paste the text below. We'll fix the problem right away! Thanks. ERROR: Error starting module: a00 [ code: 303 type: 'script id: 'expect-arg arg1: 'bind arg2: 'known-word arg3: [word!] near: [ctx-text: context bind ctx-text system/view] where: 'do-module ] Press enter key | |
Volker: 6-Jul-2006 | looks like they somehow mixed versions. "ctx-text: context bind ctx-text system/view" that feature is somewhat new. does it try to load new source with the old exe? | |
Group: RAMBO ... The REBOL bug and enhancement database [web-public] | ||
Ladislav: 1-Jul-2005 | this looks strange: >> o: make object! [test-word: none] >> do bind probe reduce [to set-path! 'test-word to lit-word! 'test-contents] in o 'self [test-word: 'test-contents] == test-contents >> probe o make object! [ test-word: none ] | |
Ladislav: 2-Sep-2005 | to the VALUE? crash: the following code crashes too: x: bind make block! {error? try [any-type? get/any 'variable]} 'system do x | |
BrianH: 27-Oct-2005 | Integer operations: - conversions between integers and binary and back - bswap opcode for endian conversion - picki and pokei, like pick and poke but for bytewise access to integers - perhaps allow tuples to be treated like integers for opcode purposes, or to-tup/to-int for conversions between them Word operations: - set indirect for things like forall, 'a parameters, other uses - for objects/contexts: bind ["Bind a variable to a context" word! word!] Struct operations: - sets ["Set a field value of a struct" word! word! word!] - gets ["Get a field value of a struct" word! word! word!] - copys/changes or picks/pokes (see other group for details) | |
Volker: 7-Dec-2005 | But yes, the words have to exist in case something in a block wants to bind to it. Or it gets complicated. | |
[unknown: 5]: 24-Dec-2005 | I'm not saying that it doesn't bind a word to system/words - its just my opinion that it shouldn't do so until it correctly ensuring the syntax is correct of the alias function | |
Group: Core ... Discuss core issues [web-public] | ||
Brett: 2-Mar-2005 | I guess what I'm saying is that the idea of a lookup chain is not needed to understand rebol. We only need to know that a rebol word is a member of some context and that association between a word and its context can be changed by functions like Context, Bind, Func and Use when they are evaluated. | |
ChristianE: 29-May-2005 | func: func [ "Defines a user function with given spec and body." [catch] spec [block!] {Help string (opt) followed by arg words (and opt type and string)} body [block!] "The body block of the function" /name word [word!] ][ either name [ use [self] [ self: word throw-on-error [make function! spec bind body 'self] ] ][ throw-on-error [make function! spec body] ] ] | |
Ladislav: 23-Jun-2005 | bind to-word "no-b" 'no-a | |
Piotr: 23-Jun-2005 | so, fifth line (of example above) looks like: foreach x [a b c] [ d: to-word join "no-" x bind d 'no-a set d "test-2" ] but his still does not work (for me) | |
Ladislav: 23-Jun-2005 | ctx: context [ no-a: no-b: no-c: none set 'test does [ foreach x [no-a no-b no-c] [set x "test-1"] foreach x [a b c] [ d: bind to-word join "no-" x 'no-a set d "test-2" ] foreach x [a b c] [print [join "no-" x get (to-word join "no-" x)]] foreach x [no-a no-b no-c] [print [x get x]] ] ] test probe no-a probe ctx/no-a | |
Volker: 23-Jun-2005 | i guess bind returns a new word here, but does not change the old? so it must be d: bind d 'no-a | |
Volker: 23-Jun-2005 | >> c: context[a: 123] >> a: 234 == 234 >> b: 'a == a >> get b == 234 >> bind b c == a >> get b == 234 >> b: bind b c == a >> get b == 123 | |
Volker: 23-Jun-2005 | thats to-word and 'bind. your problem was that bind does not change its argument, but returns a new different bound word. which may confuse because with a block, it changes that block. | |
Piotr: 23-Jun-2005 | i think that bind and varialbles "bounded to local or global context" are black magick for new rebolers; hard to understand and even harder to explain... | |
Pekr: 25-Jun-2005 | Is it possible to get b/1 evaluated? I am not sure it is because of non-aggresive word evaluation, but maybe question for you 'bind gurus? :-) | |
Pekr: 25-Jun-2005 | foreach :b a [print bind b 'x] ? | |
Pekr: 25-Jun-2005 | and for gurus - what happens here? :-) foreach :b a [print bind b first :b] 3 3 3 3 3 3 | |
Volker: 25-Jun-2005 | >> b: [x y] == [x y] >> foreach :b [1 2 3 4 5 6][bind b 'x print get b/1] | |
Pekr: 25-Jun-2005 | yes, I know, but you used 'x ... that is the tricky question - we wanted to create it dynamically, so we wanted to use bind b b/1 (we thought that instead of b/1 interpreter somehow will understand cleverly, that we mean x in context of foreach function :-) | |
Brett: 26-Jul-2005 | ; Q1 Or if you know you can reduce it you could do something obtuse like: block: ["a" none "b" none none] use [none][none: does [copy {}] bind block 'none] reduce block | |
Rebolek: 8-Aug-2005 | I'm tring to expand functions, but unfortunatly I'm not good in bind-magic so I've no success. I've got following code: | |
Rebolek: 8-Aug-2005 | I've tried to bind it to 'a or 'value but without success. Can somebody help me? | |
Chris: 9-Aug-2005 | ; Similar, but you can ensure the position of a word to bind to -- b: func [value][print ["value:" value]] a: func [value][[value] probe value] append second :a bind [b value] first first second :a | |
Ladislav: 9-Aug-2005 | ...you just need one properly bound variable and you can bind all other code using | |
Chris: 9-Aug-2005 | That makes it difficult -- to bind one context to another, you need that word from the target context. And functions don't have a 'self value like objects. Nor are 'first and 'third values bound to the 'second. | |
Chris: 9-Aug-2005 | eg. I don't think it'd be possible to bind any block to -- a: func [x y][] | |
Geomol: 5-Sep-2005 | context question: If I inside a context block (an object) in one program write: do %some-program.r then I can't reach words and functions in the first program from the second. I've also tried to bind words to the first context, but without luck. Any ideas? Maybe I should put 2 small test-scripts here: | |
Gabriele: 5-Sep-2005 | do bind load %prg2.r self | |
Geomol: 6-Sep-2005 | Gabriele, thanks! That "do bind load <something> self" is, what I'm after. :-) | |
Group: I'm new ... Ask any question, and a helpful person will try to answer. [web-public] | ||
RobertS: 5-Aug-2007 | re: comments in 'core' on the plague of MI ... multiple inheritance works rather nicely in Curl since you are required to provide 'secondary' constructors - I prefer prototype-based with an option for class hierarchies, personally ( try experimenting with Logtalk if you can find time ). I am watching Io, the language, evolve as Rebol3 emerges: what is interesting to me is that I ask 'But is that Oz ?' in Oz. ( which is multi-paradigm ) I used to hear a lot of 'getting it' about Prolog and Smalltalk. After almost 2 decades in both, I think many of them "didn't get it" ( class hierarchy obsessed, as ST purists are/were ). Ruby is so much like Smalltalk that I am quite enjoying watching Groovy play catch-up with Ruby Most issues in Rebol have a parallel in Javascript; where ( for the neophyte) experiments with typeof in a console is about the only way for the average developer to 'get it' given d1 = Date // now you use d1 as a function d1() d2 = Date() // d2 is a string that looks like a number d3 = new Date() // d3 is an object but it is UTC but it is presented local time but it is compared UTC .... or s1 = "string" s2 = String("string") s3 = new String('string') s3[1] = 6 // s3 is an object, as typeof of reveals; String 'equality' in JavaScript even with === is no end of grief and for what convenience ? s3["size"] = 6 or a1 = Array(42) a2 = new Array(42) I think the latter 2 show just how rushed LiveScript was pushed/forced out to market as "LavaScript" before the Sun "StrongTalk" folks had much influence on the Netscape folks .... Rebol3 is in better hands than 'ActionScrtpt' as it drifts into classes - because it is being kept 'in hand'' The changes in Groovy as it complied with the JSR for Java scripting are interesting ( Groovy is almost neat as Rebol would be if it were confined to, say, living on top of VisualBasic ;-) Now to avoid 'Rebol on Rails' ... I think some people who adopted Spring to cope with Java would appreciate Rebol ( there, too, you have to 'get it ' ) MySubClassObject.prototype = new MyParentClassObject() // now go mess with THAT object before it is useful ... // ... MySubClassObject.prototype.superclass = MyParentClass // to fake having a superclass other than Object cannot be much easier to "get" than anything about Rebol use ; now mostly use /local and bind ; modifies the block it is passed; use COPY refinement to preclude this side-effect Smalltalk80 was like "Rebol4" as compared to the first passes at an O-O language ... someone who actually understands Smalltalk contexts/blocks and JavaScript should 'get it' with Rebol ( some of those people are using Seaside with Squeak, Dolphin and/or VisualWorks ST ) my 2 cents: a1 should have been an array of fixed size and only a2 should be a Vector object | |
RobertS: 30-Aug-2007 | ; Just FYI ... Ladislav Mecir has an excellent page on bind at http://www.fm.tul.cz/~ladislav/rebol/contexts.html But it does not warn you not to try >> someWord: make word! ":test:" >> print bind? 'someWord ; BAD IDEA I am fine with >> none? bind? 'someWord or >> equal? bind? 'someWord bind? 'someContext Printing the global context seems like a bad idea, at least when my PC is carrying a heavy load ;-) | |
RobertS: 13-Sep-2007 | bind to two valid paths compose with one word nested in a block you can append all you want type? is path and the path will not be valid | |
Anton: 21-Jan-2008 | You can copy the code from the default engage function, but you will fall into a trap; some of the words used in the default engage handler are bound to specific contexts. Your code will bind all the words in your context or global context. I'm talking about the words focal-face (which is in system/view), unlight-text, highlight-start, highlight-end and edit-text (which are in ctx-text). | |
Anton: 21-Jan-2008 | So you should bind your code first to system/view, then to ctx-text, before making the function: | |
Anton: 21-Jan-2008 | style my-field field feel [ engage: func [face action event] bind bind [ ; your code which uses focal-face, unlight-text etc... ] system/view ctx-text ] | |
Anton: 21-Jan-2008 | view layout [field feel [insert body: second :engage bind [if all [act = 'key event/key = tab][focus f3 exit]] body/2] field f3: field "This is f3"] | |
SteveT: 21-Jan-2008 | Yes on Antons one liner with the three filed and overriding the tab to filed three the 'bind' is alien to me! | |
Henrik: 21-Jan-2008 | yes, by using the BIND function, you can bind a word to one or more contexts simultaneously. | |
Henrik: 21-Jan-2008 | you can study this by creating objects with words in them and try to bind them to different contexts (other objects). | |
SteveT: 21-Jan-2008 | Think I get it - It's the object oriented side of Rebol - you could say that bind is a sort of inheritance ? | |
Anton: 21-Jan-2008 | code: [] append code in o1 'my-word append code in o2 'my-word append code bind [my-word] o3 | |
SteveT: 21-Jan-2008 | o1: context [mu-word: "hello"] >> o2: context [my-word: "there"] >> o3: make object! [my-word: "SteveT"] >> code: [] == [] >> append code in o1 'my-word == [none] >> append code in o2 'my-word == [none my-word] >> append code bind [my-word] o3 == [none my-word my-word] >> print code none there SteveT Yep think so that 's what i got now | |
Anton: 21-Jan-2008 | A word isn't really a binding target, so you can't bind a word to itself (or any other word.) | |
Anton: 21-Jan-2008 | (BIND accepts a known-word argument. It is the *object* that the known-word is from, not the known-word itself, which is the target for the bind.) | |
Anton: 21-Jan-2008 | Correct. (context = object). So my above example could be modified to: append code bind [my-word] in o3 'self which is in fact how we used to have to do it, because BIND didn't have object! in list of accepted types for its known-word argument. | |
Anton: 21-Jan-2008 | so these are all the same: append code bind [my-word] o3 append code bind [my-word] in o3 'self append code bind [my-word] in o3 'my-word (we would use the 'self word because it's in every object by default.) | |
SteveT: 21-Jan-2008 | The order of execution throws me more than anytihing I would have had to do your code like this code append bind(my-word etc) I'm so used to starting with the item | |
Gregg: 21-Jan-2008 | Also, in VB there is the WITH statement (USING in C# I think). In REBOL, you can write your own like this: with: func [object block] [ if object [do bind/copy block in object 'self] ] | |
BrianH: 21-Jan-2008 | Gregg, your code is more complex than it needs to be. Try this: with: func [object [any-word! object! port!] block [block!]] [ do bind/copy block object ] This is unnecessary in R3, where you can use DO IN instead of WITH. | |
Gregg: 21-Jan-2008 | Object as the known-word arg to BIND. | |
SteveT: 25-Jan-2008 | Journal of a 'Newbie' by SteveT ------------------------------------------- Hi all, second week of using Rebol. had to travel to London this week so you guy's have had less 'Noise' from me ;-/ Had some good help off Anton/Henrik with regard to trapping key-presses. I'm hoping that some of the properties (refinements) missing from R2 will be in R3 - things like forcing case.. I'm getting to grips with 'PARSE' will be great if the proposed lecture comes off. Still struggling with 'BIND' but I think I've learned enough about PARSE, BIND, CONTEXT & DIALECTS, to start using some of these facilities in some apps. Biggest lesson so far this week has been 'Don't use it just because it's there!' Stepping back from some of the things I've tried have lead me to simplifying my app rather than achieving a complicated solution! Happy trails... SteveT | |
btiffin: 25-Jan-2008 | Congrats Steve; I didn't even look at BIND for, well umm, yet. :) Don't learn too fast or I'll have to think about rewriting http://www.rebol.org/cgi-bin/cgiwrap/rebol/art-display-article.r?article=lf019t Then again; that article uses Sunanda's rebol.org Mini Wiki (miki) feature so feel free to update it. :) | |
Group: Parse ... Discussion of PARSE dialect [web-public] | ||
BrianH: 26-May-2007 | Aside from the one-time bind, repeat may be faster than loop with a self-incremented index. | |
BrianH: 26-May-2007 | It looks like repeat doesn't bind its argument, so it is definitely faster in this case. | |
Anton: 27-May-2007 | BrianH, what ? Repeat does bind its argument, doesn't it ? >> repeat n 4 [] >> n ** Script Error: n has no value ** Near: n | |
Rebolek: 7-Jun-2007 | just a quick idea: FORALL is implemented as mezzanine function. It calls FORSKIP which is mezzanine also. As you can see, it's probably not the fastest method. So here's the idea. Cannnot be FORALL rewritten to make it faster and is it possible to use PARSE to do this? So I tried and came up with this simple function: parall: func [ 'word body /local data ][ data: get :word parse data compose/deep [ some [(to set-word! word) any-type! (to paren! [do bind body :word])] ] ] (parall is just a shortcut for parse version of forall). this is very simple function written in five minutes and not very well checked, it needs some additional work (eg. it does not return same value as 'forall etc). So let's do some test (using Ladislav's %timblk.r): >> n: copy [] repeat i 100 [append n i] == [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 4... >> time-block [forall n [b: n/1 + 1]] 0.05 == 3.623046875E-4 >> time-block [parall n [b: n/1 + 1]] 0.05 == 3.814697265625E-6 >> 3.62e-4 / 3.81e-6 == 95.0131233595801 95x faster? whooo.... and what about bigger block? >> n: copy [] repeat i 10000 [append n i] == [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 4... >> time-block [forall n [b: n/1 + 1]] 0.05 == 3.540625E-2 >> time-block [parall n [b: n/1 + 1]] 0.05 == 3.7994384765625E-6 >> 3.54e-2 / 3.8e-6 == 9315.78947368421 9000x ? omg... comments? | |
BrianH: 7-Jun-2007 | First tip: You don't have to bind the body - it just uses the existing binding of the word. | |
Group: Linux ... [web-public] group for linux REBOL users | ||
Anton: 18-Dec-2006 | Playing with View 1.2.1 REQUEST-FILE You can bind the patched REQUEST-FILE body to the REQ-FILE context, and that makes it work. | |
Group: Dialects ... Questions about how to create dialects [web-public] | ||
Volker: 16-Sep-2006 | rebol [ Title: "Immersive" Usage: { >> fed fed> p 3 This is a demo line, its not loadable :) p with 3 " This is a demo line, its not loadable :)" fed> print "This is pure rebol" This is pure rebol fed> "this too" == "this too" fed> } ] ctx-fed: context [ arg-lens: [p 2] line: cmd: none last-err: none p: func [lineno line] [print ["p with" lineno mold line] exit] t: func [lineno] [print ["t with" lineno] exit] e: func ["format err"] [throw last-err] do-line: func [line /local arg-len-pos res] [ set [val rest] load/next line either arg-len-pos: find/skip arg-lens val 2 [ cmd: reduce [val] loop arg-len-pos/2 - 1 [ set [val rest] load/next rest append cmd val ] append cmd rest ] [ cmd: load/all line ] bind cmd self case [ error? set/any 'res try [do cmd] [ probe disarm last-err: res ] value? 'res [print ["==" mold :res]] ] ] rebol/words/fed: func [] [ forever [ do-line ask "fed> " ] ] ] fed | |
Group: SDK ... [web-public] | ||
Louis: 28-Mar-2006 | The main problem I have with the SDK is that it makes it harder to find bugs. Does anyone have any idea what is causing this error message: ** Script Error: bind expected known-word argument of type: word ** Near: ctx-text: context bind ctx-text system/view ** Press enter to quit... | |
Gabriele: 29-Mar-2006 | louis, my guess is that the encap version you are running is older than the version that code is expecting. (bind allowing objects is a rather new thing) | |
Henrik: 2-Mar-2010 | RT should look into how Luxology does it with the 3D modeler, Modo. That model is worth copying parts of and is probably possible to graft onto RT. Here's how they do it: - Create a strong and unique product from scratch using people with many years of experience in the business. - Keep a community forum on the main site. - Keep a community creation portfolio on the main site. That's important, perhaps more than the forum. - Have a charismatic front person who is daily in touch with the community. Creates a weekly podcast that also includes personal content and interviews. - This person is so close in contact with the community that he can discuss product pricing and licensing with the community. - Being a private company, they are free to opine on the policies of other companies, and Adobe and Autodesk are often criticized openly by Luxology. - Make it really, really, really, REALLY easy to buy the program. - Make upgrade paths really, really clear. - Make the licensing scheme very loose. Don't bind it to a platform, but to a computer. - Create content, tutorials and other items that are purchasable for a small amount (10-20 USD or so). - Paid content is really cleverly done as an extension of the program. You can buy "kits" that for example let you easily set up studio lighting. This allows people to use the program in ways that were not originally intended or would be laborious to build on your own. In a sense, the 3D modeler is suddenly not only attracting 3D artists but photographers as well. It works similarly to how modules would work in R3. I suspect this will be one of their main income sources. - Keep proprietary tech to yourself and license it to various vendors. This seems to be what they are mainly making their money on now. This model works really well for them and they are growing constantly and with a fanbase about as strong and loyal as RTs. Luxology feels like a distinctively non-corporate entity, and like more a bunch of people having fun. Purely through years of word of mouth they got their program visible in one of the featurettes for the Avatar movie and on the Apple website demoing the Mac Pro. They even have guys from Pixar on the forums and making tutorials. Modo is known for being different than other 3D modelers much like in the same way that REBOL is different from other programming languages, making it fun to use. In a sense REBOL as a product is not dissimilar to Modo (it's fun to use) and with their business model already working, I think it could be grafted onto RT's business model. | |
Group: !RebGUI ... A lightweight alternative to VID [web-public] | ||
Ashley: 4-Jun-2005 | Question for the bind experts out there. Given two files (named %include.r and %test.r respectively): REBOL [] context [ a: "A" b: does [print reform ["Value:" a]] c: does [print reform ["Value:" d]] ] REBOL [] RebGUI: context [ d: "D" ctx: #include %include.r if issue? ctx [ctx: do %include.r] ] RebGUI/ctx/b RebGUI/ctx/c How do I bind %include.r to the RebGUI context such that it can see 'd (as the #include successfully allows). | |
Volker: 4-Jun-2005 | ctx: do bind load %include.r 'self | |
Chris: 5-Jun-2005 | REBOL [] load-include: func [include [any-block!]][ either parse inlcude reduce [to-issue 'include file!][load include/2][include] ] RebGUI: context [ d: "D" ctx: do bind load-include [#include %include.r] 'self ] RebGUI/ctx/b RebGUI/ctx/c | |
Anton: 6-Jun-2005 | (*possible* way, I should say. I haven't tested that, and it needs bind in ctx-rebgui 'self.) | |
Ashley: 6-Jun-2005 | I eventually solved it with: ctx-rebgui: context [ ... edit: #include %rebgui-edit.r if issue? edit [edit: do bind load %rebgui-edit.r 'self] ... ] it's two lines as opposed to one, but *much* clearer! ;) | |
OneTom: 22-Oct-2005 | how can i bind actions to key combinations globally? | |
Group: rebcode ... Rebcode discussion [web-public] | ||
BrianH: 18-Oct-2005 | I found an advantage to the new opcode-always-first syntax of rebcode that hadn't occured to me before, while examining the source of the assembler. With the old assembly syntax, the binding of the opcodes to the internal rebcodes object was performed by a bind of the whole code block, and all subblocks (except fot the do blocks). This bind was performed to all words, including those used as arguments and variables. Because of this the assembly opcodes were essentially keywords that could not be used as variables or as the names of externally referenced values like the functions called by apply. This made it very difficult to integrate with external code. Also, since more opcodes are being added all the time, your parameters and other variables could end up converted to keywords in future revisions of the VM and your code could stop working. Now, all opcodes are the first word in a statement, no keywords are anywhere else in rebcode statements and the every statement starts with an opcode. The assembler is able to just bind the first word in each statement to the rebcodes object during the syntax check, and to simply reject any statement that isn't valid syntax, including invalid opcodes. You can even use the opcode words as variables in your code, or refer to external values by those names without any difficulty. This simplified syntax would be easier to execute as well. The implication of this is that rebcode is now a strict statement-based dialect, instead of an expression-based one like the do dialect. The advantage to this is that you can always tell where a statement begins, where it ends, and what it is operating on. This kind of code is easy to follow and quick to execute. It can be trickier to write though, as you have to decompose those expressions you are used to writing into their component parts. | |
BrianH: 26-Oct-2005 | REBOL [] use [fixup-rule label-rule label-fixup-rule label-error-rule here] [ ; Initialize the intermediate rules label-rule: make block! 0 label-fixup-rule: make block! 0 label-error-rule: make block! 0 ; Build the fixup-rule based on the opcode-rule fixup-rule: copy/deep rebcode*/opcode-rule parse fixup-rule [ some [ here: lit-word! block! '| ( unless find ['bra 'brat 'braf] here/1 [insert here/2 [label-error-rule |]] ) | lit-word! 'word! '| ( unless 'label = here/1 [here/2: [label-error-rule | word!]] ) | lit-word! | '| | 'block! | 'series! | 'word! (here/1: [label-error-rule | word!]) | 'any-type! (here/1: [label-fixup-rule | any-type!]) | into ['integer! '| 'word! | 'word! '| 'integer!] ( insert here/1 [label-fixup-rule |] ) | block! (insert here/1 [label-error-rule |]) ] ] ; Replace the fix-bl function rebcode*/fix-bl: func [block /local labels here there label rule] bind [ labels: make block! 16 block-action: :fix-bl if debug? [print "=== Fixing binding and labels... ==="] parse block [ some [ here: subblock-rule (here/1: bind here/1 words) | 'label word! (here/1: bind here/1 words insert insert tail labels here/2 index? here) | 'offset word! integer! ( here/1: bind 'set words here/3: 3 + here/3 + index? here if (here/3 < 1) or (here/3 > 1 + length? block) [ error/with here "Offset out of bounds:" ] ) | opcode-rule (here/1: bind here/1 words) | skip (error here) ] ] either 0 < length? labels [ label-rule: make block! length? labels foreach [key val] labels [insert insert tail label-rule to-lit-word key '|] clear back tail label-rule label-fixup-rule: [there: label-rule (there/1: 2 + select labels there/1)] label-error-rule: [label-rule (error/with here "Cannot use label here:")] rule: fixup-rule ] [ rule: opcode-rule ] parse block [ some [ here: ['bra word! | 'brat word! | 'braf word!] ( if not label: select labels here/2 [error/with here "Missing label:"] here/2: label - index? here ) | rule | skip (error here) ] ] ] rebcode* ] | |
Volker: 3-Nov-2005 | Not sure, we can now take the value of a word? with bind or something? and then apply that? | |
Volker: 3-Nov-2005 | i thought we have some sort if binding in rebcode now. then it would be like rebcode[][ set word 'rcmul bind word ctx setw x word apply x [..] ] but not soure if its really there, and about syntax. | |
Rebolek: 3-Nov-2005 | Volker, there's no 'bind in system/internal/rebcodes | |
DideC: 3-Nov-2005 | Why not doing it this way? : >> ctx: context [b: 4 rcmul: rebcode [a][mul a b return a]] >> rca: rebcode [a] bind [apply x rcmul [a] return x] ctx >> rca 2 == 8 >> ctx/b: 3 == 3 >> rca 2 == 6 | |
BrianH: 8-Dec-2005 | Kru, you can use apply in or apply bind to get a word bound to the object field, and then use setw and getw to get at the values. | |
Coccinelle: 23-Feb-2007 | peut-être que cela te serait utile : ; Patch to rebcode assembler ; - Add setl opcode -> setl: ["Set variable to label offset (0 based offset)" word! word!] ; - very usefull to call sub routine system/internal/rebcode*: make system/internal/rebcode* [ fix-bl: func [block /local labels here label][ labels: make block! 16 block-action: :fix-bl if debug? [print "=== Fixing binding and labels... ==="] parse block [ some [ here: subblock-rule (here/1: bind here/1 words) | 'label word! (here/1: bind here/1 words insert insert tail labels here/2 index? here) | 'setl word! word! | opcode-rule (here/1: bind here/1 words) | skip (print "LA" error here) ] ] parse block [ some [ here: ['bra word! | 'brat word! | 'braf word!] ( fix-label labels at here 2 here 0 ) | 'brab into [some word!] word! ( label: here/2 forall label [ fix-label labels label here -1 ] ) | 'brab word! word! ( fix-label labels at here 2 here -1 ) | 'setl word! word! ( here/1: 'set here/1: bind here/1 words here/3: -1 + any [ select labels to word! here/3 error/with here join "Missing label '" [here/3 ":"] ] ) | opcode-rule | skip (print "ICI" error here) ] ] ] system/internal/assemble: func [ "REBCODE Assembler" body /local frame here do-blks labels tmp rule ][ body: second :body fix-bl body ] ] | |
Group: Windows/COM Support ... [web-public] | ||
Graham: 3-Jun-2008 | Anton, can you see anything wrong with this ... crashes Rebol rebol [] ; download the skype4com dll from https://developer.skype.com/Docs/Skype4COM/Start ; and register the library ; regsvr32 skype4com.dll ; example of using sms ; https://developer.skype.com/Docs/Skype4COMLib/Sms_vbs COMlib: do %comlib.r COMlib/initialize do bind [ oSkype: CreateObject "Skype4COM.Skype" oSMS: GetObject [ oSkype ".SendSms( %s, %s)" "+12345679" "Hello!" ] ] COMlib/api This should send a SMS using the Skype installed on your PC. | |
Graham: 12-Jun-2008 | COMlib: do %comlib.r COMlib/initialize if error? set/any 'err try [ do bind [ oSkype: CreateObject "Skype4COM.Skype" if -1 <> res: GetInteger [oSkype "Client.IsRunning"] [ CallMethod [oSkype "Client.Start()"] ] cUserStatus_Offline: GetInteger [oSkype ".Convert.TextToUserStatus(%s)" "OFFLINE"] ] COMlib/api ] [ probe mold disarm err ] | |
Group: Tech News ... Interesting technology [web-public] | ||
BrianH: 4-May-2007 | I've been following the Silverlight and DLR developments a lot this week. It seems to me that this would be a good way to get REBOL in the browser. You could market a REBOL based on the DLR as a /Services integration library. Rebol Universal Services Transport, a way to bind all of those Iron languages to light-as-air REBOL/Services :) | |
Oldes: 14-May-2007 | I really would like to see some of my functions compilable, using rebcode or something else... Since I'm now working on a new version of my rebol/flash dialect, I found very difficult to bind functions into another (recursive) function's context. At this moment I still have to define these "inside" functions in the recursive function always when I call it, so it must be slower. Maybe it would be enough form me, just to have some more easy and fast way how to get such functions into specified context. But maybe I just have bad approach. | |
Maxim: 15-May-2007 | but wouldn't the bind command and any internal rebol binding, be in fact where the JIT calls are made? aren't these explicit points in time where a JIT could be applied? | |
Gabriele: 16-May-2007 | Jaime, again, that was a REBOL 1.0 to Scheme compiler, and it was not even complete!!! REBOL 1.0 was sooo limited compared to REBOL 2.0 that it's even hard to call it REBOL. Just consider that BIND took one argument. (Which implies that it had the notion of scope!) It had no ports... | |
Group: !REBOL3-OLD1 ... [web-public] | ||
Geomol: 5-Apr-2006 | ok, I see the difference. And I guess, it's benefitial, because using bind can be difficult. And your question is, if closure should have a third block with "cheap" initializations? | |
Geomol: 5-Apr-2006 | If the idea with closure is, that programmers having trouble with func (and feel going into using bind is difficult), then the more complicated syntax will also not be good, as you say. | |
Pekr: 6-Apr-2006 | As for my reply to closures, I am not that skilled to understand its immediate value - first example - what was difference to example using reduce? And couldn't the same be done with bind somehow? :-) | |
Group: Postscript ... Emitting Postscript from REBOL [web-public] | ||
Graham: 18-Apr-2006 | I guess I need to bind somewhere... | |
Group: Plugin-2 ... Browser Plugins [web-public] | ||
Dockimbel: 13-Oct-2006 | bind-extern CGI to [ .cgi .r ] | |
Dockimbel: 13-Oct-2006 | bind-extern CGI to [.cgi] | |
Group: !Cheyenne ... Discussions about the Cheyenne Web Server [web-public] | ||
amacleod: 1-Jun-2007 | Has anyone tested php on windows. And do I need to uncomment : ; bind fastcgi to [.php .php3 .php4] and :; extern fastcgi [ ; command "php -b $port" ; pool min 1 max 4 ; server 192.168.0.100 ; port 1234 ; root-dir "/home/dk/fcgi/" ; ] | |
Terry: 2-Jun-2007 | Ok.. PHP is running on XP.. uncomment this line in httpd.cfg bind fastcgi to [.php .php3 .php4] | |
Dockimbel: 12-Jun-2007 | Btw, mod-action provides a general purpose background tasks launcher, you could use it for making your first "bg handler". Here's a small sample code for implementing a bg task handler called "demo" : - Add in %httpd.cfg in globals section : bind-extern demo to [.dem] - Add %handlers/demo.r : REBOL [ Title: "DEMO handler" ] install-module [ name: 'demo on-task-received: func [data][ data: reduce load data wait 0:0:3 ; simulates a 3sec long processing result: reform [ ; you have to return the response string in 'result <html><body> "You're IP is :" data/ip </html></body> ] ] ] - Then create a fake %www/test.dem file (with any content, not used in this demo handler) - Launch Cheyenne and try : http://localhost/test.dem | |
MikeL: 18-Jun-2007 | Petr, Isn't this AddHandler the same as was demonstrated with the Demo.r which can be defined in the %httpd.cfg globals section bind-extern demo to [.dem] Add demo.r which in %handlers/ can do anything you like with the content? | |
Pekr: 18-Jun-2007 | so you think I could do: bind-extern pekr-rsp to [.html .htm] and then putting pekr-rsp.r into %handlers/ ? | |
Dockimbel: 5-Jul-2007 | bind fastcgi to [.php .php3 .php4] | |
Pekr: 5-Jul-2007 | modules [ ; userdir internal static action fastcgi rsp ssi alias ; embed ] globals [ bind SSI to [.shtml .shtm] bind fastcgi to [.php .php3 .php4] bind-extern CGI to [.cgi .r] bind-extern RSP to [.j .rsp] ; user nobody ; group nobody ] default [ root-dir %/c/!Docs-private/Xidys/cheyenne-r0914/Cheyenne/www/ default [%index.html %index.rsp %index.php] on-status-code [ 404 "/custom404.html" ] webapp [ virtual-root "/testapp" root-dir %www/testapp/ auth "/testapp/login.rsp" debug ] ; "/" [ ; redirect http://softinnov.org ; ] ; extern fastcgi [ ; command "php -b $port" ; pool min 1 max 4 ; server 127.0.0.1 ; port 1234 ; root-dir "/home/dk/fcgi/" ; ] ] ;rebol.si.org [ ; root-dir %//dev/si-org/old/ ; default %main.html ; ; redirect 301 "/mysql*" "http://si.org/rebol/mysql.shtml" ; redirect 301 "/rebox*" "http://si.org/rebol/rebox.shtml" ; redirect 301 "/" "http://si.org" ;] ; ### ; To add a new virtual host just duplicate and fill the following ; example host : ; ; my.vhost.com [ ; root-dir %/www/ ; documents root directory ; default [...] ; default files ; ] ; ### | |
Group: !CureCode ... web-based bugtracking tool [web-public] | ||
Steeve: 22-Sep-2009 | pie-chart: func [ con [block!] ;-- block of overriden constants cmd [block!] ;-- commands to draw the pie-chart /local push angle middle bottom pane bout sens size back-color start line text ][ ;-- default constants (overridable by con block) size: 300x200 ;--size of the box back-color: white ;-- back color of the drawing start: -90 ;-- starting angle of the pie chart (in degrees) line: [pen gray line] ;-- draw block used for lines text: [pen none fill-pen gray text vectorial] ;-- draw block used for texts ;-- do bind con 'size pane: make block! 30 push: func [data][append pane compose data] center: size / 2 ; -- center of the pie chart radius: to-pair divide min size/x size/y 2.5 sens: true bottom: 0 foreach [title color percent] cmd [ if issue? color [color: to-tuple debase/base color 16] push [pen back-color fill-pen (color) arc center radius (start) (angle: round/ceiling percent * 360) closed] middle: angle / 2 + start push line push [ (center + as-pair radius/x * cosine middle radius/x * sine middle) (bout: center + as-pair radius/x + 3 * cosine middle radius/x + 3 * sine middle) ] either 0 <= cosine middle [ unless sens [bottom: 0 send: true] push reduce [ bout: as-pair center/x + radius/x bout/y bout: as-pair bout/x + 8 max bout/y bottom bout: as-pair bout/x + 3 bout/y ] bottom: bout/y + 12 ][ if sens [bottom: size/y sens: false] push reduce [ bout: as-pair center/x - radius/x bout/y bout: as-pair bout/x - 8 min bout/y bottom bout: as-pair bout/x - 3 bout/y ] bottom: bout/y - 12 bout: as-pair bout/x - first size-text make face [ size: 5000x5000 text: title ] bout/y ] push text push [(bout + 1x-8 ) (title)] start: start + angle ] pane ] | |
Steeve: 22-Sep-2009 | pie-chart: func [ con [block!] ;-- block of overriden constants cmd [block!] ;-- commands to draw the pie-chart /local push angle middle bottom pane bout sens size back-color start line text font* font ][ ;-- default constants (overridable by con block) size: 300x200 ;--size of the box back-color: white ;-- back color of the pie font: make face/font [color: gray size: 12] start: -90 ;-- starting angle of the pie chart (in degrees) line: [pen gray line] ;-- draw block used for lines ;-- do bind con 'size font/offset: 0x0 pane: make block! 30 push: func [data][append pane compose data] center: size / 2 ; -- center of the pie chart radius: to-pair divide min size/x size/y 2.5 sens: true bottom: 0 font*: font foreach [title color percent] cmd [ if issue? color [color: to-tuple debase/base color 16] push [pen back-color fill-pen (color) arc center radius (start) (angle: round/ceiling percent * 360) closed] middle: angle / 2 + start push line push [ (center + as-pair radius/x * cosine middle radius/x * sine middle) (bout: center + as-pair radius/x + 3 * cosine middle radius/x + 3 * sine middle) ] text: to-image make blank-face [ size: size-text make face [size: 5000x5000 text: title font: font*] text: title font: font* color: none ] either 0 <= cosine middle [ unless sens [bottom: 0 sens: true] push reduce [ bout: as-pair center/x + radius/x bout/y bout: as-pair bout/x + 8 max bout/y bottom bout: as-pair bout/x + 3 bout/y ] bottom: bout/y + text/size/y ][ if sens [bottom: size/y sens: false] push reduce [ bout: as-pair center/x - radius/x bout/y bout: as-pair bout/x - 8 min bout/y bottom bout: as-pair bout/x - 3 bout/y ] bottom: bout/y - text/size/y bout: as-pair bout/x - text/size/x bout/y ] push [image (text) (bout + as-pair 1 text/size/y / -2 - 0.5 ) black ] start: start + angle ] pane ] |
101 / 992 | 1 | [2] | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |