REBOL3 - I'm new (Ask any question, and a helpful person will try to answer. [web-public])

Return to Index Page
Most recent messages (300 max) are listed first.

#UserMessageDate
1462PeterWoodThanks Anton and Izkata. It looks as though the explanation of Will's "inconsistency" is that switch evaluates the content of the block not the block.25-Jun 9:43
1461Izkata>> do [[1]] == [1]

The console does the outermost 'do, resulting in your first example, Peter

24-Jun 7:09
1460Anton(The block *is* evaluated. Its contents are not.)23-Jun 10:01
1459Henriknot only a pain, it would ruin the foundations of how rebol works :-)23-Jun 7:12
1458PeterWoodFrom my point of view If anything is inconsistent it seems to be when Rebol evalutes blocks.

If you enter a block in the console, it doesn't get evaluated but other values do.

>> [1] == [1] >> a: 1 == 1

The block [1] was not evaluted, the word a was.

Though without this possible inconsistency using blocks would be a real pain.

23-Jun 7:06
1457GreggIt's not inconsistent. It's just the way it is. DO evaluates all the values in the block and returns the result of the last evaluation.22-Jun 20:26
1456WillThanks Anton 8-) my point was just that for a beginner in the cases block there is value and block to execute pairs, so it sounded logic that adding /default I would also need to append a block do be "done" I was surprised that case for default accept any and not a block , not a problem for me but we needed some minutes to understand that.22-Jun 14:31
1455AntonWell, you just pointed out that DO is inconsistent as well. As to how harmfully unexpected that is is another question. It obviously confused Will. Such things can be a problem, because there can be a loss of information. You get the same output from two different inputs, which can't be reversed.22-Jun 8:06
1454GreggWhy is it inconsistent?

>> do [1] == 1 >> do 1 == 1

22-Jun 4:09
1453WillThanks Chris, but then I would say it is either inconsistent or the description need some refinement21-Jun 10:38
1452ChrisIf the default case is a block, it is evaluated -- see: source switch21-Jun 3:22
1451WillI'm stuck, teaching rebol to my girlfriend, I come across this and really as per definition I would expect to get [1] as result and not 1

? switch USAGE: SWITCH value cases /default case /all

DESCRIPTION: Selects a choice and evaluates the block that follows it. SWITCH is a native value.

ARGUMENTS: value -- Value to search for. (Type: any) cases -- Block of cases to search. (Type: block)

REFINEMENTS: /default case -- Default case if no others are found. (Type: any) /all -- Evaluates all matches (not just first one). switch/default 2 [][1] ; 1 switch/default 2 [] 1 ; 1

21-Jun 3:16
1450Willtemporary fix for bug/3902: a: [a [ ] ; [a ] a: new-line/all a off ; [a ]

a: [a [ ] ; [a ] a: new-line/all copy a off ; [a]

3-Jun 0:33
1449PekrOnce VID3 goes to beta, we will see new styles added, and View kernel fixes/improvements, to become beta too. Just after that, rebservices will be revised, in order for DevBase to go fully public, and R3 source codes being uploaded into it. Then community can start porting open-source parts of REBOL to the platform of their wish, or the community can start to improve/fix those parts ...2-Jun 11:09
1448PekrREBOL 3 as a product, or this world? Well, you can find what is currently going on on rebol.com site, rebol 3 section. To summarize - RT is revising VID3 design (you might notice extensive blogging about the topic). There are also few features being considered for the core language, in order to make some constructs more easier/natural.2-Jun 11:08
1447SteveTHi All, what's happening with Rebol 3?2-Jun 10:33
1446DockimbelThat's a known bug, see http://www.rebol.net/cgi-bin/rambo.r?id=39029-Apr 18:52
1445Willmm.., >> new-line [ [ 1 [ ] false >> [1 ] shouldn't that return [1] ?9-Apr 17:26
1444RobertSbut IF'n ;[ fell in the first two chars of a line and ended in first 2 chars at (no shift key to reach { and } ) ;]29-Mar 17:03
1443RobertSIt does mean messing with the shift key which is un-rebolish But I can't see suggesting ;[ block-comment code falls in here ;] In CURL we have tag-matching using |tag-this# there will not be a duplicate tag until we reach #tagthis| || where |# until #| are vulnerable || I ask developer sto single line comment with double-bars but someone has to use |# multi-line comment on a single line to show they know how #|29-Mar 17:00
1442RobertSI try never to repress my silly ideas as some have been winners (time and $$$ for my employers, true ... but all the same )29-Mar 16:55
1441RobertSODE so I though mebbe ;{ which would only end at a ;} as }; will not do ... To take a page from Snobol both would have to be unindented, i.e., occupy first and second char of the line I live in curly-brace land in CURL and a missing brace becomes a headache even in a editor with a scroll-u-there brace-matcher29-Mar 16:53
1440JohanARhave to be careful with using { ... } to comment things out though.. I wanted to teporarily remove a block of code from a function, but I didn't think of that it was the last part of the function so the string got returned instead of the real value I wanted :)29-Mar 16:49
1439RobertS{ from guys on CORE } is as good as comment { so is this in a REBOL Survival Guide somewheres? } feelin' foolish as another 'good' idea meets my second cuppa java29-Mar 14:42
1438RobertSso is this in a REBOL Survival Guide somewheres?29-Mar 14:41
1437btiffinGo Brians Go29-Mar 4:36
1436AntonWhere ?29-Mar 2:01
1435BrianHThat would conflict with even more people here :)29-Mar 0:25
1434GrahamCall him Brain instead ...29-Mar 0:25
1433BrianHWe're taking over :)28-Mar 23:26
1432ReichartI'm inviting a friend of mine here, he is another brilliant langauge designer, I'll invite him as Fork (his real name is Brian, but we have enough Brians around here.28-Mar 21:21
1431SteveTHi Henrik, I found Nicks youTube tutorials to be very useful when I was searching for stuff. Great help!28-Mar 11:42
1430Gabrieleabout the above error - it may be an out-of-order event indeed. now the problem is finding a simple way to reproduce it.28-Mar 10:26
1429Gabrieleit may not be closed in case of errors, but as Brian said, the GC will catch that eventually (though maybe we should TRY and rethrow the error)28-Mar 10:24
1428Gabrielethe port is closed in the last line of send - am i missing something?28-Mar 10:24
1427Gabriele;-- Send as an SMTP batch or individually addressed: smtp-port: open [scheme: 'esmtp] either only [ ; Only one message to multiple addrs address: copy address ; remove non-email values remove-each value address [not email? :value] message: head insert insert tail net-utils/export header-obj newline m essage insert smtp-port reduce [from address message] ] [ foreach addr address [ if email? addr [ if not show [insert clear header-obj/to addr] tmp: head insert insert tail net-utils/export header-o bj newline message insert smtp-port reduce [from reduce [addr] tmp] ] ] ] close smtp-port28-Mar 10:23
1426Willnote the difference that seams to trigger the problem is the first line, the 'quit, where does it come from?28-Mar 0:43
1425Willthan suddenly this one:

Net-log: ["QUIT" "221"] Net-log: ["Opening" "tcp" "for" "esmtp"] Net-log: [none "220"] Net-log: "220 domain.com running core" Net-log: [["EHLO" system/network/host] "250"] Net-log: {250-domain.com hello mail.local (10.5.32.4)} Net-log: "250-PIPELINING" Net-log: "250-8BITMIME" Net-log: "250-BINARYMIME" Net-log: "250-CHUNKING" Net-log: "250-ENHANCEDSTATUSCODES" Net-log: "250-ETRN" Net-log: "250-AUTH CRAM-MD5 DIGEST-MD5 NTLM PLAIN LOGIN" Net-log: "250 SIZE 2147483647" Net-log: ["Supported auth methods:" [cram plain login]] Net-log: ["MAIL FROM: <admin@domain.com>" "250"] Net-log: "250 2.1.5 sender OK" Net-log: ["RCPT TO: <user@domain.com>" "250"] Net-log: "250 2.1.0 forwarding to user@domain.com" Net-log: ["DATA" "354"] Net-log: "354 send your message" Net-log: [none "250"] Net-log: "250 2.6.0 message received OK" Net-log: ["QUIT" "221"] Net-log: "221 2.0.0 domain.com closing connection"

error code: 501 description: access error, Port none not open near: [value: either series? :value [copy value]] where: confirm

28-Mar 0:42
1424Willhere is the net-log, a couple of this (no problem)::

Net-log: ["Opening" "tcp" "for" "esmtp"] Net-log: [none "220"] Net-log: "220 domain.com running core" Net-log: [["EHLO" system/network/host] "250"] Net-log: {250-domain.com hello mail.local (10.5.32.4)} Net-log: "250-PIPELINING" Net-log: "250-8BITMIME" Net-log: "250-BINARYMIME" Net-log: "250-CHUNKING" Net-log: "250-ENHANCEDSTATUSCODES" Net-log: "250-ETRN" Net-log: "250-AUTH CRAM-MD5 DIGEST-MD5 NTLM PLAIN LOGIN" Net-log: "250 SIZE 2147483647" Net-log: ["Supported auth methods:" [cram plain login]] Net-log: ["MAIL FROM: <majordomo@domain.com>" "250"] Net-log: "250 2.1.5 sender OK" Net-log: ["RCPT TO: <user@domain.com>" "250"] Net-log: "250 2.1.0 forwarding to user@domain.com" Net-log: ["DATA" "354"] Net-log: "354 send your message" Net-log: [none "250"] Net-log: "250 2.6.0 message received OK" Net-log: ["QUIT" "221"] Net-log: "221 2.0.0 domain.com closing connection"

28-Mar 0:42
1423Willeven had a recycle.. code: 501 description: access error, Port none not open near: [recycle wait 0.2 ] where: confirm27-Mar 22:58
1422Willlike this error: code: 501 description: access error, Port none not open near: [if none? i [return none] either ] where: confirm

or

code: 501 description: access error, Port none not open near: [if empty? block: reduce block] where: confirm

oly thing in common, is where: confirm and that I see only in net-utils, any idea ?

27-Mar 22:56
1421Willlooks like an asynchronous event error popping in the middle of execution of other code, possible??27-Mar 22:43
1420WillThanks BrianH, I'm trying to find a bug, I get random port none not open errors but they appear randomly everywhere, only thing sure is they come only after using 'send , but it may be word! conflict, variable rewrite, etc.. just maybe someone has a better idea where to look for.. 8/27-Mar 22:36
1419BrianHRecycle yourself if you're worried. Interesting idea on the return value.27-Mar 22:28
1418Willalso, 'send should probably return a value of type logic!27-Mar 22:07
1417Willok, but between recycles, I could reach the maximum connections limit of the smtp server?27-Mar 22:07
1416BrianHPorts are closed when the garbage collector gets them. If you are batch sending, the next time you call the SEND function it will assign none to the smtp-port local variable, rendering the previous reference assigned to that variable into garbage. The next time RECYCLE is run, any open ports in the garbage will be closed.27-Mar 21:56
1415Willlooking at source of 'send, am I right, if there is an error executing send, than the port is not closed, this will leave a lot of open connections when batching?27-Mar 21:46
1414GreggDidn't RT link to those from REBOL.com at some point? If not, they really should.27-Mar 19:55
1413ReichartHe is the top one "Nick"27-Mar 1:12
1412ReichartInteresting guy http://rockfactory.us/Teachers.html27-Mar 1:12
1411HenrikI can't believe I missed all those REBOL tutorials available on Youtube by Nick Antoniacco. Here's the complete list, in case newbies missed them too:

http://musiclessonz.com/rebol_video_links.html

26-Mar 21:25
1410RobertSthang -ks23-Mar 22:56
1409Sunanda.....But with 'reduce, 'thang is being evaluated, so: type? first reduce ['thang] == word!23-Mar 21:22
1408BrianHtype? first ['thang] 'thang is not being evaluated

type? 'thang 'thang is being evaluated. The result of that evaluation is a word!

23-Mar 21:15
1407RobertS; what is the rationale, I wonder of the difference >> lit-word? first [ 'thang thing] == true >> lit-word? 'thang == false >> type? first ['thang thing] == lit-word! >> type? 'thang == word!23-Mar 21:12
1406Gregghttp://www.fm.tul.cz/~ladislav/rebol/argstake.html17-Mar 4:43
1405GabrieleCarl had a nargs mezz somewhere (maybe he posted it on the ml?)16-Mar 9:19
1404BrianH"assign the use" -> "use"15-Mar 16:00
1403BrianHIf the datatypes the function value is expecting don't match the data that your function is passing to it, no problem: A nice error message will be generated at runtime that the developer of the function value can use to fix their function value. :)15-Mar 15:54
1402BrianHThe ARRAY function in 2.7.6 does the end-of-the-code-block method for function value arguments.15-Mar 15:44
1401BrianHDo source replace in REBOL 2.7.6 for an example of this - look for the parentheses.15-Mar 15:43
1400BrianHBe sure to assign the use or assign the result of the function call inside the parentheses, rather than outside them, in case the function takes less than the number of arguments you are expecting it to.15-Mar 15:42
1399BrianHYou don't have to manually check to see if the function takes two arguments; this is good, because doing so is awkward. All you really need to do is call the function in parentheses ( ) or at the end of a code block, so that it can't take more than two arguments even if it tries. If it takes less than two arguments, who cares?15-Mar 15:40
1398JohanARa little messy, but it appears to work :)15-Mar 9:39
1397JohanARgetargs: function [ :fun "Get arguments from this function" ][ out pblock ][ out: make block! 10 parse third :fun [ some [ string! ; Strip comments | [ [word! | get-word! | lit-word!] (pblock: [any-type!]) opt [string!] opt [set pblock block!] opt [string!] (append/only out pblock) ] ] ] out ]15-Mar 9:39
1396JohanARMm, I ended up writing something similar to that. Found out that I also have to check if third first :a is /local, which would also be a valid function15-Mar 9:15
1395PeterWood>> d: func [][print "no args"] >> c :d == none15-Mar 8:53
1394PeterWood>> c: func [a [function!]] [if 2 = length? first :a [print a 1 2]] >> c :b 315-Mar 8:52
1393PeterWoodI think you will need to "manually" check that the supplied function uses the correct number of arguments15-Mar 8:49
1392PeterWoodSorry about the formatting; let my try again: >> a: func [a [function!]] [ print a 1 2] >> b: func [x [integer!] y [integer!]] [add x y] >> a :b 315-Mar 8:48
1391PeterWoodThis is how you can pass a function to a function: >> a: func [a [function!]] [ print a 1 2] >> b: func [x [integer!] y [integer!]] [add x y] >> a :b 315-Mar 8:48
1390JohanARIs it possible to define a function, which takes another function as argument and that the argument func must take exactly two arguments in it's turn?15-Mar 8:15
1389JohanARyou can ofcourse use to-word "<" but it's not very good looking if you have to cover all of <, <=, >, >=, <> etc.. managed to avoid the case by using compose instead of reduce though14-Mar 21:39
1388BrianHThe first error isn't caught because the load happens before the attempt is called.14-Mar 18:42
1387BrianHThis relates to the sandboxing discussion I was just having with Paul.14-Mar 18:40
1386BrianH>> attempt [[<]] ** Syntax Error: Invalid tag -- < ** Near: (line 1) attempt [[<]] >> attempt [load "[<]"] == none14-Mar 18:39
1385BrianHI guess it is special-cased in the loader.14-Mar 18:37
1384Geomolhehe, funny! :)14-Mar 18:37
1383BrianH>> type? first [<] ** Syntax Error: Invalid tag -- < ** Near: (line 1) type? first [<] >> type? first [ < ] == word!14-Mar 18:37
1382Geomol>> blk: [=] == [=] >> blk: [<] ** Syntax Error: Invalid tag -- < ** Near: (line 1) blk: [<] >> blk: [<tag>] == [<tag>]14-Mar 18:36
1381GeomolMy guess is, that it's becuase < and > are part of tag type, like <tag>. So it's a restriction to make value evaluation easier internally.14-Mar 18:35
1380JohanAROn to the next question :) Why is '= valid but '< or '> aren't?14-Mar 17:51
1379JohanARthanks!14-Mar 17:49
1378PaulJohanAR, use this instead:

attach: func [a b][to type? a join a b]

14-Mar 12:56
1377Sunandajoin always returns a string unless the first value is of type? series. >> join 1 2 == "12" Try source join to see the actual code.14-Mar 12:14
1376JohanARwhy does join 'a 'b return "ab" instead of 'ab ?14-Mar 11:17
1375sqlaba little bit late

form-dec: func [ number [decimal!] ] [ form case [ number > 1 [number] number > 0 [ join "0" at form number + 1 2 ] number > -1 [ join "-0" at form number - 1 3 ] true [number] ] ]

9-Mar 12:52
1374Willthank you Oldes, I thought there was a native or mezz for that4-Mar 16:28
1373Oldesit depends what do you need... if is important the value or how the rounded value looks like4-Mar 16:19
1372Oldeshm.. maybe not the best as there is this issue: formDecimal 4E-3 2 == "0.00"4-Mar 16:17
1371Oldes>> formDecimal (4E-2 / 10) 3 == "0.004"4-Mar 16:15
1370OldesformDecimal: func[ number [decimal!] digits [integer!] /local negative? p result ][ if digits <= 0 [return form to-integer 0.5 + number] if negative?: number < 0 [number: - number] p: power 10 digits result: form to-integer number * p + 0.5 if number < 1 [ insert/dup result "0" (1 + digits - length? result) ] if negative? [ insert result "-" ] head insert skip tail result negate digits #"." ]

>> formDecimal 4E-2 4 == "0.0400"

4-Mar 16:13
1369Willwhat is the best way to convert this 4E-2 to 0.004 ?4-Mar 15:55
1368JohanARIt works! :) thanks alot3-Mar 16:37
1367Henrikblock: compose ['aword "blahblah" (either var [['avariable var]][[]])]3-Mar 16:34
1366JohanARI still seem to get a none in the block if the varable isn't available3-Mar 16:33
1365Henrikremember the extra block inside the if statement, otherwise only 'var will be returned from it3-Mar 16:29
1364Henrikbetter one: block: compose ['aword "blahblah" (if var [['avariable var]])]3-Mar 16:28
1363Henrikseems to include the rest as a block3-Mar 16:27
1362Henrikblock: reduce ['aword "blahblah" either var [['avariable var]][[]]]3-Mar 16:25
1361JohanARI have this reduce statement, that's supposed to form a block for later processing. Now I want to include in that a switch to add some more stuff if a variable is not none. However it seems like the if-statement returns a none which gets included in the result block :(

block: reduce [ 'aword "blah blah" if var [ 'avariable var ] ]

3-Mar 16:25
1360btiffinYeah; I think I was on my ninth or tenth version of "READ" when I started going with foreign languages. And being forthers, you wouldn't want to write TROUBLE-REPORT over and over again, so we got used to TRP and FLD and got really good at pronouncing just about any random collection of letters. TERP and FLUD (field) for the former. It's why I don't use the expression SeQueL It's SQEEL! :) Ahh, fun with words.21-Feb 2:12
1359RodHah, I can already appreciate that view, even with just a little reading and applying it to some work concepts I found the desire for words exploading!21-Feb 1:57
1358btiffinMost of had Starting Forth and Thinking Forth so our bosses bought us great huge fat Thesauri thinking it would make us better coders. We laughed at first, then our dictionary grew to the 100,000 word mark and they started to get dog eared. :)21-Feb 1:55
1357RodThanks Brian, will check out starting forth as well.21-Feb 1:52
1356btiffinWhoa. Elizabeth has posted a much nicer reprint on the forth.com site. http://www.forth.com/starting-forth/ Nice!21-Feb 1:47
1355btiffinRod. Classic. Not as classic as Starting Forth, but hey. Marcel Hendrix has posted Starting Forth as well, but had trouble with the cartoons, and the replacements are not quite as "fun". And just so ya know, only Marcel was given the right to copy, explicity only Marcel, by Forth Inc. http://home.iae.nl/users/mhx/sf.html21-Feb 1:41
1354RodSo for anyone new to REBOL or more generally to Forth (being one of the inspirations behind REBOL) I'd like to strongly recommend reading Leo Brodie's Thinking Forth - free PDF here - http://thinking-forth.sourceforge.net/

I stumbled across this group of programming books http://prog21.dadgum.com/19.html and it reminded me I had meant to do some reading on Forth. I'm now a third of the way through the Thinking Forth book kicking myself for not having dug into this earlier. Just like learning about the functional perspective with Lisp and Erlang this reading is expanding my programming perspective with every chapter. In addition to being valuable in the REBOL context it is simply a great book on programming in any context.

21-Feb 1:21
1353GreggPARSE-XML is a built-in func as well. Not as complete as Gavin's, but works well for basic things. The biggest mod I've made to it is to swap the order of element value and attributes in the resulting block. That way you can address the value using path notation or SELECT. Working with attributes takes a little more work.21-Feb 0:41
1352GeomolREBOL is quite useful for web-applications and handling data and technologies born from the internet-boom in the computing world. I bet, there are many REBOL-based solutions out there.20-Feb 18:58
1351SteveTThanks Sunanda20-Feb 18:29
1350Sunanda'parse-xml is a standard REBOL function in 'core that does some basic XML processing. It may be enough for you.

I use Gavin's XML-parse functions every day: http://www.rebol.org/cgi-bin/cgiwrap/rebol/view-script.r?script=xml-parse.r

Not tried John's yet :-)

20-Feb 18:28
1349GeomolYou're welcome!20-Feb 14:20
1348SteveTThat's great thank's guys !20-Feb 14:20
1347btiffinKinda ... out of the box XML is not 100% but load/markup may do what you want for some cases

If that is not sufficient, some rebols have written extensions. Umm, like John just posted. :)

20-Feb 14:19
1346GeomolYou can with my RebXML found here: http://home.tiscali.dk/john.niclasen/rebxml/

The script xml2rebxml.r read an XML structure into a block with content defined in the spec: http://home.tiscali.dk/john.niclasen/rebxml/rebxml-spec.html

20-Feb 14:18
1345SteveTHi all, can Rebol load XML structures straight into a block ?????20-Feb 14:12
1344SteveTJounal of a Newbie - by SteveT

Back on my travels again now (having to do paid work! ;-/

Have learn't an awful lot about Rebol this month. Managed to get a good prototype reasonably functional. Have finsished my little licence maker app for internal use. Our client records believe it or not were just on Excel!! (Mrs T ) likes Excel! So i've created the same data in a simple client app using Henriks List-View and RebDB. Perfect for our internal use.

Going to try to learn more about Rebol3 (VID3) during February (Clients permiting !)

Steve

8-Feb 9:51
1343SteveTHi Petr, It's a background project for me, clients in no mad rush, but will expect me to come up with the goods within twelve months - they also want desktop & web. it's an interactive availability/booking system for group of hotels.6-Feb 11:37
1342PekrSteveT: why wouldn't you use VID3 for the task given? I think in 12 months VID3 should be pretty mature ...6-Feb 11:32
1341Pekrhehe :-)6-Feb 11:32
1340SteveTOk, original app was done in Java (for internal use) external front end needs to be video quality, might look at Flex for web front end (now it's open source).6-Feb 10:44
1339Henrikstyles will probably be similar to the ones found in Trolltech's QT (not appearance, Pekr, but capability. :-))6-Feb 10:40
1338Henrikyes, that's wise for now. I expect also about 12 months before VID3 is near completion with most styles. It's conservative, however. :-)6-Feb 10:39
1337SteveTHi Henrik, just wanted a feel for where R3 will end up GUI wise. If in twelve months we end up with bells and whistles then cool - an app I've been asked to re-write needs to be very 'plush' so I'm going to have to use something else.6-Feb 10:37
1336Henrikthe best guess is the list that already exists in DocBase somewhere.6-Feb 10:36
1335Henrikhard to say at this point as I'm not done with that part yet.6-Feb 10:33
1334SteveTHi all, can anyone at RT outline the widget(controls) that WILL be available in VID3. Perhaps enter them as outlines in the VID User Guide?6-Feb 10:31
1333SteveTThanks Henrik, just got back in from being 'forced' to shop :-)2-Feb 18:59
1332Henrikand we disagree, because we are discussing it on different levels. :-)2-Feb 13:10
1331HenrikI hope nobody stops them. :-)2-Feb 13:10
1330Pekryou will not stop ppl to add those pictograms. I did not say anything about a requirement :-)2-Feb 13:09
1329HenrikI don't know where you get the idea that VID3's style system will require "funky pictograms". The abstraction is made so (and you know this) that different purpose buttons can have completely identical appearance. In fact, there might be so many button styles that it makes no sense to differ their look. Style designers are completely free to include or exclude funky pictograms. :-)2-Feb 12:45
1328PekrAnd I bet that most skinners will get it wrong too ... adding various funky pictograms to those buttons :-)2-Feb 12:42
1327Henrikit has nothing to do with appearance2-Feb 12:31
1326HenrikEven OSX does it this way.2-Feb 12:26
1325HenrikPekr, because you are getting it completely wrong. :-)2-Feb 12:25
1324PekrHenrik - to your post. It really sounds a bit terrifying, like old Win 3.1 visaul basic style ;-) I am really scared that I will see OK-button, Cancel-button and such styles. If I will see a pictogram on it, then really - we are going 10 years back - old design imo ....2-Feb 12:25
1323HenrikI have several posts lined up, but still need some research on some topics (time consuming) to complete them.2-Feb 12:23
1322PekrHenrik - any new blog of yours coming? IIRC you planned on something. You have very nice and descriptive style - your VID3 blog was very explanatory ..2-Feb 12:22
1321HenrikSteve, feel free to post my comment on your blog.2-Feb 12:12
1320SteveTI think I spotted mention of a 'Windows Mobile' plug-in the other day?2-Feb 11:21
1319SteveTYep, perhaps the paid for /pro /master versions may bring it together??2-Feb 11:17
1318Pekrhow will you solve the web part? Plug-in would be usefull here, wouldn't it? :-)2-Feb 11:15
1317SteveTI think VID 3 will be useful for an app I will be doing later this year where I want to offer access to data in a consistant interface for desktop, web and windows mobile.2-Feb 11:14
1316SteveTdefinitely ;-)2-Feb 11:10
1315PekrI think not. Qt is fro Trolltech, imo pretty advanced. They have also Qtopia version for mobile devices. However - for most simple apps View will be just fine ... and small :-)2-Feb 11:08
1314SteveTIs that the gui they did for tckl ??2-Feb 11:06
1313PekrI wonder if anyone tried looking into Qt? Seems rather complete. KDE 4 uses it. And now Nokia owns it ...2-Feb 11:05
1312SteveTYep, the development of VID 3 seems right on track IMO, they (RT) don't seem to be falling into the trap of making the program design too event-driven (Like - Visual Studio etc) Although I've used it for years! I think the event-driven design process is bad. You can very easily 'knock-up' an application user interface and it will look very pretty - but then you spend twice the time getting the 'back-end' of the application to work with the front-end!!2-Feb 11:03
1311Pekryes. I can't wait how VID3 turns out in that regard :-) We should get more interactivity out-of-the-box.2-Feb 10:56
1310SteveTHi Pekr, I understand that, in Visual Studio I would create my own 'custom' controls for various lookups or effect - that can be re-used through-out. If I am planning a full-blown application I would create the same tools. As I read thru the VID User Guide - I'm just playing with one-liners etc.2-Feb 10:55
1309PekrSteve - but even with VID2 you could pre-construct your styles by 'stylize and instantiate it by directing VID to your style, or you could stylize it even inline within VID, so that you don't need to override specific parts of your button each time ...2-Feb 10:48
1308SteveTThanks Henrik, so VID 3 will expect us to prepare our components or have some already prepared that we can then use - a bit like creating a'skin'. This is much better than 'hacking' each button or box in the middle of your layout. Eg, On my main menu example I could have my 'reflected image button' already pre-defined in my stylize section? Would you like me to post your clarification on my blog?2-Feb 9:52
1307HenrikSome notes for your blog post:

"'effects' are now 'options'" - the idea is here to remove the need for face hacking. Options is a clean, self documentable way to alter the settings for a specific style. But here, the fact that we can alter the appearance of the style is a bit of a fluke, because we wanted a simple way to test options. Originally it was the idea that altering any such effects parameters directly in your layout would be prohibited; The style would take care of this internally and you'd use specific button types that would then use a specific style. You would use buttons defined through its purpose rather than its appearance. You'd have zero control over the appearance of the button, because that is controlled by the style alone.

I know that sounds a little terrifying, but VID3 is meant to lift styling to a whole different level; You don't style every single face. You focus on the contents of your UI, and the purpose of each element, rather than its appearance and VID3 works out how to display it. This is for multiple reasons:

- VID3 can display on other devices than bitmapped displays, such as text consoles or vectored output. - Styling becomes the job of one or more dedicated developers rather than the application developer, which standardizes styling. It makes it much simpler to build very large applications and it becomes possible to switch consistently between different styles, where one won't look crappy while another one looks great. They'll work equally well. Compare it to VID which is just the Wild West of styling. :-) - Abstraction will make it possible to identify parts of a user interface, such as allowing VID3 to, on its own, find the cancel button in a window or automatically put key focus on the correct button for great consistency.

So when you, in your user interface design say: "I want a button that shows importance", you don't try to make a red button. You could use the 'warning-button style (just an example, doesn't exist yet). Similarly there will be styles for ok-button, cancel-button, etc. They are not called red-button, yellow-button, but are purely purpose oriented styles.

So while VID3 may look like just a prettier VID with resizing in a one-button example, it's actually a whole different beast. :-)

2-Feb 1:04
1306SteveTHi all, I couldn't resist! I just had to dip my toe into VID 3. It's like waiting for Christmas ;-) All those goodies!

I've posted a snipet on my blog. http://swt1962.spaces.live.com

Regards SteveT

1-Feb 23:47
1305SteveTHi Henrik, sure do! I've found that it's easy to step into one of the 'deeper' Rebol pools - say 'dialects' and thrash around not getting anything done in a disire to understand. This week I'm trying to learn just enough to do what I have on the drawing-board.26-Jan 12:35
1304HenrikI hope you can see that REBOL has amazing depth :-)26-Jan 12:32
1303SteveTHi Brian, that's brilliant !! I said I wanted to get productive with REBOL by the end of January! But I didn't say which January - did I ;-/

Think I'm entering level 5 !!!! I'm definately 'confused from Blackpool' :)

26-Jan 12:30
1302btiffinCongrats 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. :)26-Jan 3:30
1301SteveTJournal 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

26-Jan 0:00
1300AntonNo problem.24-Jan 8:00
1299SteveTHi Anton, sorry for slow rep, just drove to London. Sorry I asked the wrong question there. What I was after was the 'index' of the the item chosen!23-Jan 17:24
1298AntonMmm.. set-face is not implemented fully. Use this: layout [my-choice: choice ...] set-face my-choice my-choice/text: "two" (we have to update the face/text ourselves.)23-Jan 14:17
1297Antonview layout [ size 200x300 ch: choice "one" "two" "three" [ print [index? face/data mold face/data] probe get-face face ] ]23-Jan 14:14
1296AntonActually, there are access functions. So use get-face and set-face.23-Jan 14:08
1295AntonCheck index? face/data.23-Jan 14:07
1294SteveTHi All, In a list you have the 'first mylist/picked' is this not available for 'choice' ?23-Jan 11:14
1293PeterWoodThis even gives an inefficent way of extending an object:

>> a: make object! [b: func[][print "I'm from object a"]] >> a: make a [c: func[][print "My new method"]] >> a/b I'm from object a >> a/c My new method

22-Jan 8:41
1292PeterWoodHenrik: I believe that Rebol does have real inheritance, it's just based on protoytpes not classes:

>> a: make object! [b: func[][print "I'm from object a"]] >> c: make a [] >> c/b I'm from object a >> d: make a [e: func [][print "I'm an extension to a"]] >> d/e I'm an extension to a >> f: make d [b: func [][print "I'm not the one in a"]] >> f/b I'm not the one in a

22-Jan 8:39
1291GreggI might also have done mine the way I did to support the case when an object is NONE. Can't recall for sure.21-Jan 22:19
1290GreggObject as the known-word arg to BIND.21-Jan 22:15
1289GreggDoesn't work on older versions of REBOL. Support for object came more recently.21-Jan 22:14
1288GreggThanks!21-Jan 22:12
1287BrianHGregg, 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.

21-Jan 17:08
1286Gregg>> obj: context [val: none prn: does [print val]] >> with obj [val: 2 prn] 221-Jan 16:31
1285SteveTHi Gregg, yes I've used it a lot with refinements. Like I said I think French or Spanish speakers will think in the same order as Rebol ;-\21-Jan 16:30
1284GreggAlso, 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] ]

21-Jan 16:29
1283GreggYou can use the same kind of notation in REBOL as you would in VB, but using / instead of .(dot). It's called path notation in REBOL, and is used many places (objects, path types, refinements, etc.). Sometimes it's easier or clearer to write things one way or the other.21-Jan 16:27
1282Antonno prob21-Jan 13:43
1281SteveTThanks for the help Anton brb21-Jan 13:41
1280SteveT:)21-Jan 13:41
1279AntonIf you think it would help :) I let you investigate and report your findings :)21-Jan 13:40
1278SteveTYes that's where English is wierd for people to learn English say

Bus Station

Spanish say Station de Autobus

perhaps i should Rebol in spanish ;-)

21-Jan 13:39
1277AntonActually rebol has objects and path notation, so you SVO too. eg. ctx-text/unlight-text21-Jan 13:39
1276AntonSo actually rebol is less like english in that respect. But actually english is crazy. It's better to have the verbs at the front.21-Jan 13:37
1275SteveTYeah your mind get comfortable one way or the other - takes a lot of breaking21-Jan 13:37
1274Anton.. rebol is like: VSO = Verb Subject Object VB, C# is like: SVO = Subject Verb Object and Yoda is : OSV21-Jan 13:36
1273SteveTAs I said on my blog I'm just entering my second week of de-programming ;-/21-Jan 13:33
1272SteveTRebol you say what you want to do then which object you want to do it to lol21-Jan 13:31
1271AntonAh of course. Much better this way :)21-Jan 13:31
1270SteveTNo VB, C'# You tent to start with the object and then using . notation you tell it what action to take on it.21-Jan 13:30
1269Anton(sorry, don't mean to sound rude...)21-Jan 13:29
1268AntonAre you an ex-forther or something ?21-Jan 13:29
1267SteveTThe 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

21-Jan 13:27
1266Antonso 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.)

21-Jan 13:25
1265AntonCorrect. (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.

21-Jan 13:23
1264SteveTRight - the context it's from ????21-Jan 13:21
1263Anton(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.)21-Jan 13:20
1262AntonA word isn't really a binding target, so you can't bind a word to itself (or any other word.)21-Jan 13:19
1261SteveTSorry that's what I meant 'Word'21-Jan 13:18
1260AntonAn object cannot be bound to anything. Only words can be bound.21-Jan 13:17
1259AntonAn object is a container of word -> value pairs. When you ask for a word's value, the word's binding is checked to get the object.21-Jan 13:17
1258SteveTCan you get problems if an object gets bound to itself?21-Jan 13:17
1257AntonEach word carries its binding with it. ie. a reference to an object. (or no object if it is unbound).21-Jan 13:15
1256SteveTThink I understand that21-Jan 13:14
1255Anton? o1 ? o221-Jan 13:12
1254AntonOr of course you can use HELP or ?.21-Jan 13:11
1253AntonLists the words in each object, if you don't believe what IN is telling you.21-Jan 13:10
1252Antonfirst o1 first o221-Jan 13:10
1251Anton:)21-Jan 13:09
1250Anton'my-word is therefore not in o1 and so: in o1 'my-word == none21-Jan 13:09
1249SteveTDohhh! it's this eclectic keyboard lol21-Jan 13:09
1248Antonfirst line says "mu-word" :)21-Jan 13:09
1247SteveTo1: 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

21-Jan 13:08
1246Antoneg. in o1 'my-word ; <-- don't miss the '21-Jan 13:08
1245AntonMaybe you missed one of the single-quotes before a 'my-word (which makes it a lit-word!)21-Jan 13:08
1244AntonShow me the code and resulting error.21-Jan 13:04
1243SteveTI got a halt-view near my-word?21-Jan 13:04
1242AntonI first show two different ways of creating an object, and then I show two different ways of getting a word in an object.21-Jan 13:02
1241Antonprint code21-Jan 12:57
1240Antoncode: [] append code in o1 'my-word append code in o2 'my-word append code bind [my-word] o321-Jan 12:57
1239Antono1: context [my-word: "hello"] o2: context [my-word: "there"] o3: make object! [my-word: "SteveT"]21-Jan 12:56
1238AntonThis should be instructive. Type this into the console a line at a time:21-Jan 12:55
1237SteveTOO is ok but it doesn't always fit the real world (or programming productivity). that's why I think OO Databases have never really been adopted! they fit models but not the real world (Where the customer say's Ahh! didn't we mention that !! (LOL).21-Jan 12:50
1236SteveTYes, MS always partly implemented OO in VS. they didn't think there users could handle them ! Java is more of a full OO implementation but I find you end up having to override most objects and that's not good for code re-use.21-Jan 12:47
1235Henrikmore like membership. there is no real inheritance in Rebol.21-Jan 12:43
1234SteveTThink I get it - It's the object oriented side of Rebol - you could say that bind is a sort of inheritance ?21-Jan 12:40
1233Henrikit's all just a big re-dress of objects. :-)21-Jan 12:38
1232Henrikor more revealing:

>> source context context: func [ "Defines a unique (underived) object." blk [block!] "Object variables and values." ][ make object! blk ]

21-Jan 12:38
1231Henrikmake object! []

and context []

and see what's returned

21-Jan 12:37
1230Henrikyes. try:21-Jan 12:37
1229SteveTAh! you just answered that ;-)21-Jan 12:36
1228SteveTI understand that. Are contexts just what I would call an object?21-Jan 12:36
1227Henrikyou can study this by creating objects with words in them and try to bind them to different contexts (other objects).21-Jan 12:35
1226Henrik"yet it can appear anywhere in code" <--- actually that's a bit wrong. if the word is not defined for a particular context, then of course it's useless there. but if you use the word in the right context, for example inside an object in which it was originally created, then it will have meaning.21-Jan 12:34
1225Henrikyes, by using the BIND function, you can bind a word to one or more contexts simultaneously.21-Jan 12:33
1224SteveTRight one of the fundamentals of Rebol is that Word behaviour can change or is set by what contaxt it's in ?21-Jan 12:32
1223HenrikI believe this is how local words work in a function definition. the words don't work outside the function, because they are bound to its context.21-Jan 12:30
1222Henrikbindings are actually simply tieing a word to a list of words (a context), which is an object. outside the context, the word has no meaning, yet it can appear anywhere in code21-Jan 12:29
1221SteveTfield !21-Jan 12:27
1220SteveTYes on Antons one liner with the three filed and overriding the tab to filed three the 'bind' is alien to me!21-Jan 12:26
1219SteveTYes, I'm starting to understnad dialects and domains. Bindings I'm clue-less (LOL)21-Jan 12:23
1218Henrikparticularly bindings can be baffling, because it looks like function names are pulled out of thin air. :-)21-Jan 12:21
1217SteveTVery True, hopefully I will be able give back - in time21-Jan 12:21
1216Henrikyou're lucky to have us around, otherwise some of this would take a long time to figure out. I was frustrated for a long time about many of these things.21-Jan 12:19
1215SteveTI'm sorry for all these questions - It sounds like I want you to do my work for me! I don't maind having to figure some things out myself . But I was asked to present waht I found difficult from a newbie point of view.21-Jan 12:18
1214SteveTYeah I was trying to approach it with ( if chars < 6 allow it ) which got me in a mess.21-Jan 12:17
1213Antonor combining filter with length check: if any [ not find "0123...89" event/key 5 <= length? face/text ][ exit ]21-Jan 12:16
1212Antoneither 5 > length? face/text [ ; allow event to pass through ][ exit ; too many chars ! don't allow it ! ]21-Jan 12:14
1211SteveTOn one field I want to trap and convert any chars to uppercase, but also stopthe user from antering more than say 5 chars !21-Jan 12:12
1210SteveTYes, on a particular field I want to control what the user can and can't enter21-Jan 12:11
1209Antonyeah just exit when not find "0123456789" event/key21-Jan 12:10
1208AntonAh, you wanted to filter out non-number characters, etc ?21-Jan 12:10
1207AntonMy example shows how to inject any code you like.21-Jan 12:09
1206AntonOf course. Which events ?21-Jan 12:08
1205SteveTSo, can we have one engage that can act upon more than one event? I think that's my question!21-Jan 12:08
1204AntonMmm.. I don't think so...21-Jan 12:05
1203SteveTI wondered if the Rebol versions ended up becoming a lower-level parse.21-Jan 12:05
1202Anton(Note that the above example where I set 'body is a bit "polluting". It sets the 'body word global. It's not strictly necessary, you can just replace body/2 with second second :engage. I just added it to make the meaning clearer.)21-Jan 12:04
1201SteveTGot it!21-Jan 12:03
1200AntonWe're not using parse here.21-Jan 12:03
1199AntonThe parse dialect words 'all' and 'any' are not the same as normal rebol 'all' and 'any'. Don't get confused by that.21-Jan 12:03
1198SteveTWith 'ALL' and 'ANY' - in parse you also have 'SOME'. If you do 'exit' does it exit the event trap or can it move onto another event?21-Jan 12:02
1197AntonI've inserted that at the top of the function body, so if we handle the tab char key event, then we exit and it doesn't have a chance to be handled by the rest of the default code (which actually calls upon the large edit-text function from ctx-text to handle key events).21-Jan 12:01
1196Anton"if all the following conditions are true: - the act (action, same as event/type) = 'key (and not 'down, 'up mouse presses etc.) - the event/key = tab (the tab character) then: focus a face exit21-Jan 11:58
1195SteveTSo with the 'all' 'exit' combination you are handling any events (keypresses) you like in a form of 'switch' ?21-Jan 11:56
1194AntonYeah I forgot it first time around too.21-Jan 11:55
1193SteveTThanks Anton - what I was missing in my efforts last night was the 'exit' that obviously releases the event. I was getting frustrated cos it just sits there doing nothing ;-)21-Jan 11:53
1192AntonI agree too.21-Jan 11:50
1191Henrikabsolutely. VID3 will not require this level of knowledge to produce something useful and complete.21-Jan 11:50
1190SteveTI knew all this was possible, and I know a lot of people prefer things at this level to cover their own requirement.

But, returning to my original point. To make Rebol more general use - we need standard behaviour like this at a highr level?

21-Jan 11:49
1189Antonview 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"]21-Jan 11:49
1188SteveTah thanks21-Jan 11:45
1187AntonA very handy shortcut.21-Jan 11:45
1186Antonsystem/view/vid21-Jan 11:44
1185AntonYou could also handle key events and trap the tab key, directing the focus to any face you like.21-Jan 11:44
1184SteveTwhats svv ?21-Jan 11:44
1183AntonAREA does not have the 'return flag. probe svv/vid-styles/area/flags ; == [tabbed on-unfocus input]21-Jan 11:43
1182Antonlayout [f: field] probe f/flags ; == [field return tabbed on-unfocus input] view layout [f: field with [deflag-face self return]]21-Jan 11:42
1181SteveTOk thanks, Tab order might be cobbled by enlosing field in two or more vertical panels. Sorry missed the flag for CR.21-Jan 11:40
1180Antonwhether CR can act as tab can be determined with a face flag.21-Jan 11:39
1179AntonAha... the built-in tab-cycling system is simplistic. I made my own but it still goes in pane order.21-Jan 11:38
1178SteveTOne other funcionality I'm missing is to be able to set the tab order ! They won't always be the presented order. And wether CR should act a sTAB or not.21-Jan 11:36
1177AntonSee the Editors group to try out the edit-panel style.21-Jan 11:29
1176AntonMy edit-panel style is actually based on PANEL style, but pretty much supplants AREA, if you're happy with monospace font. (I haven't supported a single-line FIELD-like style, but could be easily done I expect.)21-Jan 11:29
1175Henrikprobably a good idea to learn about bindings first to know what it means :-)21-Jan 11:26
1174AntonHenrik, unlimited undo/redo.21-Jan 11:26
1173SteveTOk, just found some mention of ctx-text in the docs.21-Jan 11:26
1172Antonstyle my-field field feel [ engage: func [face action event] bind bind [

; your code which uses focal-face, unlight-text etc...

] system/view ctx-text ]

21-Jan 11:26
1171AntonSo you should bind your code first to system/view, then to ctx-text, before making the function:21-Jan 11:25
1170AntonYou 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).21-Jan 11:24
1169HenrikAnton's made a version that has undo/redo, right?21-Jan 11:20
1168Henrikthat's basically what vid-field.r does. it takes the existing FIELD style and changes its FEEL object to contain more options for better text handling.21-Jan 11:20
1167AntonYou can redefine the engage yourself like this: layout [ style my-field field feel [ engage: func [face action event][ .. ] ] ]21-Jan 11:19
1166Antonprint mold svv/vid-styles/field/feel You can see the engage function is where most of the event handling is.21-Jan 11:18
1165SteveTThanks Henrik , I'll have a go with that today.21-Jan 11:18
1164AntonYes, you can trap and handle in your own way all of the events a field style can receive.21-Jan 11:17
1163SteveTRight so I could create styles to override the field and include params for number of chars to allow or convert to upper and perhaps use parse to restrict to numbers ?21-Jan 11:15

Return to Index Page