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

World: r3wp

[Core] Discuss core issues

Graham
20-Nov-2009
[15056]
this is user written gui code which is why I bind to the local context 
to prevent them doing stuff that I think might be dangerous.  But 
I want to allow some exceptions.
Chris
20-Nov-2009
[15057]
Assign the global functions to local words:

context compose [alert: (:alert)]
Graham
20-Nov-2009
[15058x2]
this doesn't work ...


 test: func [ /local lo alert] compose/deep [alert: (:alert) dummy: 
 none lo:  {button "test" [ alert "hello" ]} view layout bind to-block 
 lo 'dummy]
dummy should be local too
Chris
20-Nov-2009
[15060]
Yeah, not sure why - do you get "alert has no value" ?
Graham
20-Nov-2009
[15061]
** Script Error: alert word has no context
** Where: func [face value][alert "hello"]
** Near: alert "hello"
Chris
20-Nov-2009
[15062x2]
do-protected: use [alert][
	alert: get in system/words 'alert
	func [txt][do bind to-block txt 'alert]
]

do-protected {alert "Foo"}
do-protected {print "Foo"}
So in theory it works, next how to apply to your function.
Graham
20-Nov-2009
[15064x3]
Not working in my function yet.
this works 


test: func [ /local lo alert dummy] compose/deep [alert: get in system/words 
'alert dummy: none lo:  {button "test" [ alert "hello" ]}    view 
layout bind to-block lo 'dummy ]

just not working in my script though
oh .. remove the compose/deep
Chris
20-Nov-2009
[15067x4]
Hmm, try this:
isolate: func [words [block!]][
	use words compose/only [
		set (copy words) forall words [change/only words get words/1]
		first (copy words)
	]
]


do-protected: func [txt allowed][do bind to-block txt isolate allowed]
do-protected {print "foo"} [print]
do-protected {alert "foo"} [print]
'isolate takes a block of words, creates an exclusive context, sets 
words in that context to their value in their current context and 
returns a word bound to that context.
Graham
20-Nov-2009
[15071]
In your code above, allowed is not a block of works
Mchean
23-Nov-2009
[15072]
some nice css - html expansion macros http://www.smashingmagazine.com/2009/11/21/zen-coding-a-new-way-to-write-html-code/
amacleod
24-Nov-2009
[15073]
A quick look at it - reminded me a little of Henrik's HTML Dialect
Henrik
24-Nov-2009
[15074]
I bet the guy who wrote that also likes regexp. :-)
Graham
25-Nov-2009
[15075]
Any easy way to detect whether running 32 or 64 bit windows?
BrianH
25-Nov-2009
[15076]
On WinXP 32bit:
>> get-env "ProgramFiles(x86)"
== none
On Win7 64bit:
>> get-env "ProgramFiles(x86)"
== "C:\Program Files (x86)"

Really, any non-none string value returned will signal 64bit.
Graham
26-Nov-2009
[15077]
cool
Janko
27-Nov-2009
[15078x3]
I have one question .. I don't want somebody to surprise me tomorrow 
on talk about rebol... if you use the "with" pattern for example 
for pop protocol

with-pop-do: func [ mbox addr code ] [ 
    set :mbox open addr
    do code
    close get :mbox
]
with-pop-do 'box get-pop-addr [
    pages: "something"
]
and define a variable/word "pages" in the block like I did .. this 
word changes the global binding probably? which is not very good 
because it might owerride some other binding ... am I correct and 
is there some elegant way to not introduce such negatiev side of 
this otherwise elegant pattern?
Geomol
27-Nov-2009
[15081]
Something like this?

use [pages] [
	with-pop-do 'box get-pop-addr [
		pages: "something"
	]
]
Janko
27-Nov-2009
[15082x3]
aha.. interesting.. I never knew what use does
I could also use "use" in definition of with-pop-do so that the external 
code is most beautifull
thanks a lot
Henrik
27-Nov-2009
[15085]
you can also wrap stuff in contexts, but it requires that you specify 
your vars as set-words.
Brock
30-Nov-2009
[15086]
@Janko:  How did your talk about Rebol go today?
Janko
1-Dec-2009
[15087x2]
Brock: it went okeyish ... otherwise it was great and I did sew some 
pushed out eyes (from few python programmers) towards the end. The 
problem was I had very programmer / code - centric presentation , 
where I was hoping to give (better) coders some clue what and how 
REBOL is different, but when I asked how many of them were programmers 
it was just like 20% or less . So I had somewhat hard time trying 
to show details of code and tons of code examples imagining that 
the most of listeners will have no clue whatsoever about what I'm 
talking ...
I see now that I should just focused my thoughts on those guys who 
were programmers instead of seeing all the nonprogrammers not understanding 
a thing I was saying. Basically I missjudged the audience. And there 
would probably be more programmers if there werent two very interesting 
talks with known names at the same time as mine.
Henrik
1-Dec-2009
[15089x2]
some pushed out eyes
 <- I would have loved to see that :-)
but overall, if you make just 2-3 people interested at the same time, 
that's a big thing for us. :-)
Janko
1-Dec-2009
[15091]
I am not joking about "pushed out eyes" ... I saw 2 that were programmers 
that were towards the end really intenselly looking at code I was 
showing and how I'll explain it.  


the whole thing about read http:// read %file ... open pop:// and 
process it as serries qute impressed one guy 


When I ended a couple of other programmers aproached me and asked 
me how this can be installed and if it's free etc .. and one pythonista 
said that email sending really impressed him, but otherwise he doesn't 
know yet .. there were also questions like "why this and not python" 
and "community size" and I had some explaining to do about code is 
data / data  is code big deal
Henrik
1-Dec-2009
[15092]
It makes me think that the process of downloading and installing 
REBOL is a great demo in itself.
Janko
1-Dec-2009
[15093x4]
Yes, I was thinking of putting the scripts there but then a lot less 
people would see it.. you know how people are .. first and foremost 
LAZY
When I asked how many were programmers and only 4 raised hands I 
almost wanted to stop talking because from that point on almost all 
slides are code and at the end I was trying to look at concrete scripts 
which I was worried also coders won't understand so quickly after 
finding out at rebol
not almost wanted, but serriously considered it .. but it was ok 
at the end .. it was a little stupid to all the nonprogrammers probably
I posted a link to screencast of slides in advocacy
Henrik
1-Dec-2009
[15097]
Many scientific talks are divided in two parts: One for the masses 
and one for the experts.
Janko
1-Dec-2009
[15098x2]
If I knew  how it would be I would prepare more light talk , with 
some cool stuff , only little code and more visual .. like doing 
a gui to post message on twitter all in few lines and typed in front 
of them . I had demo of this when I was preparing for talk
I haven't been to many scietific talks so I didn't know :)
Henrik
1-Dec-2009
[15100]
(I also only learned this recently)
Janko
1-Dec-2009
[15101]
I will be playing with some erlang soon , did anyone maybe yet work 
anything on the BERT serialisation .. http://bert-rpc.org/(it's 
the binary erlang term serialisation). BERT-RPC based on it also 
is very minimalistic , binary (so you can send over images or anything) 
, and has some really cool features ?
Gregg
2-Dec-2009
[15102x2]
Talks often dont' go as planned Janko. I'm sure you did fine. 


For a less technical audience, I try to focus on how little code 
it takes to do useful things; and how readable that code can be. 
Having some simple GUI examples is important, because normal people 
don't want console apps. For programmers, I emphasize that REBOL 
isn't really a programming language; it's a messaging language. As 
Carl has said "It was designed for the semantic exchange of information 
between people and machines." So it's never REBOL compared to Python, 
or Ruby, but compared to those languages plus XML or JSON.
I haven't seen anything on BERT, but Maarten has done some Erlang 
and may know.
Janko
2-Dec-2009
[15104x2]
It was ok.. I was not sooo satisfied with situation but I was satisfied 
on how I handeled it and it was ok.
One collegue smalltalker that we meet at previous barcamp wrote me 
on twitter something like "this is bloody usefull :-)" after seeing 
the slides and code examples screencast on internet.