r3wp [groups: 83 posts: 189283]
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

World: r3wp

[I'm new] Ask any question, and a helpful person will try to answer.

Anton
21-Jan-2008
[1260]
An object cannot be bound to anything. Only words can be bound.
SteveT
21-Jan-2008
[1261]
Sorry that's what I meant 'Word'
Anton
21-Jan-2008
[1262x2]
A word isn't really a binding target, so you can't bind a word to 
itself (or any other word.)
(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.)
SteveT
21-Jan-2008
[1264]
Right - the context it's from ????
Anton
21-Jan-2008
[1265x2]
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.
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
[1267]
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
Anton
21-Jan-2008
[1268x2]
Are you an ex-forther or something ?
(sorry, don't mean to sound rude...)
SteveT
21-Jan-2008
[1270]
No VB, C'#  You tent to start with the object and then using . notation 
you tell it what action to take on it.
Anton
21-Jan-2008
[1271]
Ah of course. Much better this way :)
SteveT
21-Jan-2008
[1272x2]
Rebol you say what you want to do then which object you want to do 
it to lol
As I said on my blog I'm just entering my second week of de-programming 
;-/
Anton
21-Jan-2008
[1274]
.. rebol is like:   VSO = Verb Subject Object
VB, C# is like:   SVO = Subject Verb Object
and Yoda is :  OSV
SteveT
21-Jan-2008
[1275]
Yeah your mind get comfortable one way or the other - takes a lot 
of breaking
Anton
21-Jan-2008
[1276x2]
So actually rebol is less like english in that respect. But actually 
english is crazy. It's better to have the verbs at the front.
Actually rebol has objects and path notation, so you SVO too.
eg.   ctx-text/unlight-text
SteveT
21-Jan-2008
[1278]
Yes 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 ;-)
Anton
21-Jan-2008
[1279]
If you think it would help :) I let you investigate and report your 
findings :)
SteveT
21-Jan-2008
[1280x2]
:)
Thanks for the help  Anton  brb
Anton
21-Jan-2008
[1282]
no prob
Gregg
21-Jan-2008
[1283x2]
You 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.
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]
]
SteveT
21-Jan-2008
[1285]
Hi 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 ;-\
Gregg
21-Jan-2008
[1286]
>> obj: context [val: none prn: does [print val]]
>> with obj [val: 2  prn]
2
BrianH
21-Jan-2008
[1287]
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
[1288x4]
Thanks!
Doesn't work on older versions of REBOL. Support for object came 
more recently.
Object as the known-word arg to BIND.
I might also have done mine the  way I did to support the case when 
an object is NONE. Can't recall for sure.
PeterWood
22-Jan-2008
[1292x2]
Henrik: 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
This 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
SteveT
23-Jan-2008
[1294]
Hi All, In a list you have the 'first mylist/picked'  is this not 
available for 'choice' ?
Anton
23-Jan-2008
[1295x4]
Check   index? face/data.
Actually, there are access functions. So use get-face and set-face.
view layout [
	size 200x300
	ch: choice "one" "two" "three" [
		print [index? face/data mold face/data]
		probe get-face face
	]
]
Mmm.. 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.)
SteveT
23-Jan-2008
[1299]
Hi 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!
Anton
24-Jan-2008
[1300]
No problem.
SteveT
25-Jan-2008
[1301]
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
[1302]
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.  :)
SteveT
26-Jan-2008
[1303]
Hi 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' 
 :)
Henrik
26-Jan-2008
[1304]
I hope you can see that REBOL has amazing depth :-)
SteveT
26-Jan-2008
[1305]
Hi 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.
SteveT
1-Feb-2008
[1306]
Hi 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
Henrik
1-Feb-2008
[1307]
Some 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. :-)
SteveT
2-Feb-2008
[1308]
Thanks 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?
Pekr
2-Feb-2008
[1309]
Steve - 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 ...