• Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

World: r4wp

[#Red] Red language group

Gregg
29-Mar-2013
[6782x2]
And sqlite3...
Do I need everything in %MSDOS/Red/?
Kaj
29-Mar-2013
[6784x2]
Pretty much, but it's all there, so you can unpack it in one go
Try VIEW ["Hello" button "OK" [quit]]
Gregg
29-Mar-2013
[6786x2]
The zip doesn't want to download for me. Must be a sign I should 
run lean for the moment, and bug Doc for a few features. :-)
I'm really impressed with all you've done Kaj. And since I'm going 
to start on a DLL interface shortly myself, I will no doubt bug you 
for advice.
DocKimbel
30-Mar-2013
[6788]
I will be mostly offline this weekend as I'm making a trip by the 
coast.
Gregg
30-Mar-2013
[6789x3]
Have a nice break Doc.
I've hacked Ladislav's INCLUDE to let me build .red scripts, and 
I built a console with my mezzanines. When you get back, I'll chat 
with you about it, and send it to test. It compiles fine, but some 
funcs fail if compiled in. If I then paste them into the console, 
they work fine. e.g.

negate: func [n [number!]] [n * -1]
zero?: func [n [number!]] [n = 0]
divisible?: func [a b] [0 = remainder a b]
even?: func [n [number!]] [zero? remainder n 2]
even?_a: func [n [number!]] [0 = remainder n 2]
even?_b: func [n [number!]] [divisible? n 2]
remainder: func [
	a [number!]
	d [number!] "Divisor"
][
	a - (d * (a / d))
]

zero? 0 == true
zero? 1 == false
remainder 10 3 == crash!
divisible? 10 3 == false
divisible? 10 2 == false  INCORRECT
even? 10 crash
even?_a 10 == false  INCORRECT
even?_b 10 == false  INCORRECT
Kaj
30-Mar-2013
[6792x5]
Thanks, Gregg. Did you wait for the zip to be prepared? It takes 
the server around two minutes to create your archive of the latest 
versions
You can also use Fossil to download and update it comfortably:
http://web.syllable.org/news/2012-11-18-20-47-Red-high-level-programming-language-first-alpha.html
ZERO? is already implemented as a fast routine in my common deposit:
http://red.esperconsultancy.nl/Red-common/dir?ci=tip
Gregg
30-Mar-2013
[6797x2]
Ah, I didn't konw it built on demand. I was impatient.
I will steal your ZERO? :-)
Kaj
30-Mar-2013
[6799]
That's fine. There are several things in my repositories that may 
not be suitable for inclusion in core Red. Originally, Doc wanted 
natives, but he has also included some mezzanines by now. My Red-common 
repository is self-sufficient, but the others are bindings that core 
Red may not want to depend on, except perhaps functions from the 
C library, because core Red already links to that
Gregg
30-Mar-2013
[6800]
Yeah, I'm posting mezz stuff here so it can be evaluated and discussed, 
along with how to organize things, without polluting the core yet.
Kaj
30-Mar-2013
[6801]
Funny, it looks like you introduced a crash! type next to error! 
above :-)
Gregg
30-Mar-2013
[6802]
:-)
Kaj
30-Mar-2013
[6803x2]
For performance in the interpreter, better write remainder as a - 
(a / d * d)
However, all these simple number handling functions are better written 
as routines for performance
Gregg
30-Mar-2013
[6805x2]
Sure.Since 100'000 calls still seem instant, I'm OK with it for now. 
:-)
Baby steps.
Kaj
30-Mar-2013
[6807]
It sure is nice to develop in the interpreter and port to Red/System 
with minimal changes
Gregg
30-Mar-2013
[6808x2]
Agreed.
Also looking at what minimal behavior we need in the kernel to build 
on.
Kaj
30-Mar-2013
[6810]
You mean the operating system kernel?
Gregg
30-Mar-2013
[6811]
No, the Red/System kernel, sorry.
Kaj
30-Mar-2013
[6812]
Just checking. It's a relative notion
Gregg
30-Mar-2013
[6813]
Could just say "in Red/System" :-)
Gregg
31-Mar-2013
[6814]
In %boot.red, FOREACH says it only accepts a word, but it also seems 
to take a block of words just fine. Should block! be added to the 
word arg spec?
DocKimbel
1-Apr-2013
[6815x2]
Block!: yes.
Seems I broke something in the commit for the issue #455. All words 
are preset to unset instead of their value.
Gregg
1-Apr-2013
[6817]
value/header: TYPE_UNSET  ? ;-)
DocKimbel
1-Apr-2013
[6818x3]
That shouldn't be a problem because, it's on the symbol creation, 
before it gets a reference to a value...
The issue is the value slots in the global contexts now always return 
TYPE_UNSET...will track it in a few minutes.
It seems the issue is only when using the console.
Gregg
1-Apr-2013
[6821x2]
Interesting. How could that contaminate internals?
That is, I would expect a hard crash of some kind in that case.
DocKimbel
1-Apr-2013
[6823x2]
No idea for now, I'm looking into it...
Ok, got it, I've broken the internal word/load-in API....d'oh!
Gregg
1-Apr-2013
[6825]
Quick find. :-)
DocKimbel
1-Apr-2013
[6826]
Yep, but the fix is a bit longer.
Bo
3-Apr-2013
[6827x4]
Playing with Francois's OpenCV binding.  I get an error on Linux 
ARM when compiling his OpenCV camera test.  The error is:


./opencv-cam-test: symbol lookup error: ./opencv-cam-test: undefined 
symbol: atexit


I've looked through all the code for the OpenCV cam test, the OpenCV 
binding itself, related libraries and Red/System source and I can't 
find "atexit" anywhere.  Am I overlooking it?  Any ideas what code 
this message is coming from?
Sorry, the above error is not when compiling, but when trying to 
execute the compiled code on Arch Linux ARM.
Nevermind.  Windows search is a piece of garbage.  Wrote a Rebol 
search and found it right away in C-library.reds.
Seriously...how hard is it to write a search that actually works? 
 Microsoft has how many billions of dollars?
Kaj
3-Apr-2013
[6831]
Francois includes an old version of my C library binding. Newer versions 
use a different API on ARM to define on-quit