' mark
[1/3] from: keckman:welho at: 7-Aug-2010 23:09
Why there must be that ' -mark in front of draw functions?
append plot reduce [
'fill-pen ((r * (1.0.0)) + (g * (0.1.0)) + (b * (0.0.1)))
'polygon xy xy0 xy1 xy2 xy
]
What does it mean?
[2/3] from: ammon:johnson:gma:il at: 7-Aug-2010 13:21
That's a lit-word. It keeps the word from being interpreted whilst allowing
you to use variables in the draw block without having to do any fancy tricks
to make them work.
Enjoy!!
~~ Ammon ;~>
On Aug 7, 2010 1:14 PM, "Petri Keckman" <keckman-welho.com> wrote:
Why there must be that ' -mark in front of draw functions?
append plot reduce [
'fill-pen ((r * (1.0.0)) + (g * (0.1.0)) + (b * (0.0.1)))
'polygon xy xy0 xy1 xy2 xy
]
What does it mean?
[3/3] from: gregg:pointillistic at: 7-Aug-2010 14:47
Hi Petri,
PK> Why there must be that ' -mark in front of draw functions?
PK> append plot reduce [
PK> 'fill-pen ((r * (1.0.0)) + (g * (0.1.0)) + (b * (0.0.1)))
PK> 'polygon xy xy0 xy1 xy2 xy
PK> ]
As Ammon said, it can simplify things when using REDUCE. For example,
using COMPOSE in your example would look like this:
append plot compose [
fill-pen ((r * (1.0.0)) + (g * (0.1.0)) + (b * (0.0.1)))
polygon (xy) (xy0) (xy1) (xy2) (xy)
]
If you haven't already, read the manual where it discusses evalutation
and the different word types
(http://www.rebol.com/docs/core23/rebolcore-4.html). It's a key to
using REBOL effectively. And play around in the console to get a feel
for how things work.
>> a: 1 b: 2 c: 3
== 3
>> blk: [a b c]
== [a b c]
>> reduce blk
== [1 2 3]
>> blk: ['a b c]
== ['a b c]
>> reduce blk
== [a 2 3]
-- Gregg