Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

[REBOL] how to export a function from a context?

From: Patrick::Philipot::laposte::net at: 30-Dec-2003 21:58

Hi List As I was reading "Make-doc.r" from Carl Sassenrath, I came upon a construction I had not noticed before. Or perhaps, I had not noticed how important it was before. Nothing new for a lot of you, but ... I think it's cool to see some Rebol code once and a while on this list. 8< - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Rebol [ date: 30-12-2003 purpose: { FAQ Q - "how to export a function from a context?" A - "by using SET. SET always define a global word" } ] private-room: context [ a: b: 2 set 'public-fn func [][print [a]] ] a: "Some text" print [a] ; ==Some text public-fn ; 2 8< - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - And finally, I will borrow my whishes from the new year from Freddie Mercury. The one thing we're all waiting for is peace on earth - an end to war. It's a miracle we need - the miracle -- Best regards, Patrick