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

AltME groups: search

Help · search scripts · search articles · search mailing list

results summary

worldhits
r4wp5907
r3wp58701
total:64608

results window for this page: [start: 63801 end: 63900]

world-name: r3wp

Group: Red ... Red language group [web-public]
Dockimbel:
19-Feb-2012
Can you make a `red` global variable in C when `red` is already use 
as an enumeration value?
Endo:
19-Feb-2012
Can you make a red global var..
 No, we cannot.
document fixed
, still we cannot compile the examples on Windows,
because of "redeclaration of c" in win32.reds file.
Dockimbel:
19-Feb-2012
I mentioned it above, it needs a fix in the compiler and/or the runtime 
code.
Oldes:
20-Feb-2012
Endo - I'm sure that in a real life. you don't want to use #enum 
to define values like a, b, c, d as well as common names like red, 
blue etc.. Real life enum example naming is for example:
#enum DitherMethod! [
	  NoDitherMethod
	  RiemersmaDitherMethod
	  FloydSteinbergDitherMethod
]
Oldes:
20-Feb-2012
Such an enumeration you can use in the import like:
#import [
	"CORE_RL_wand_.dll" cdecl [ 
		MagickRemapImage: "MagickRemapImage" [

   ;== Replaces the colors of an image with the closest color from a 
   reference image

   ;-- MagickBooleanType MagickRemapImage(MagickWand *wand,const MagickWand 
   *remap_wand,const DitherMethod method)
			wand	             [MagickWand!] ;the magick wand.
			remap_wand	[MagickWand!]

   method	[DitherMethod!] ;choose from these dither methods: NoDitherMethod, 
   RiemersmaDitherMethod, or FloydSteinbergDitherMethod.
			return:               [MagickBooleanType!]
		]
	]
]
Oldes:
20-Feb-2012
I was also thinking about value test to prevent passing for example 
value 10 as a method in the MagickRemapImage, as it accepts only 
values 0, 1and 2. This is not implemented yet.
Endo:
20-Feb-2012
You are right.

The problem above, enumrated value clashes with a local variable 
in a function.

#enum test! [a b]
;...

f: func [a [integer!] /local b] []    ;<---- compile error, "redeclaration 
of b"
Endo:
20-Feb-2012
which could be problem in a big source.
...prevent passing...
 catch in compile time would be nice for sure.
Endo:
20-Feb-2012
its another issue I think, in my example there is no c.

Example 1:
#enum test [a b]
b = 0   ;<--- global, redeclaration error, which is correct.

Example 2:
b = 0  ;global
f: func [/local b] [] ;<--- no error, correct

Example 3:
#enum test [a b]

f: func [/local b] [] ;<--- redeclaration error, incorrect! local 
b should not be clashed with enumarated-global b
Oldes:
20-Feb-2012
I've modified the behaviour as you want, but we should wait what 
Doc will think about it. Now it works like:
#enum test! [a b]
f: func[/local b][
	b: 3
	?? b
]
f ;will print 3, not 1
Endo:
20-Feb-2012
I think this is the correct behaviour, more compatible with REBOL 
as well.

I'm not sure about giving a warning if a local var. clashes with 
a global one (just for enums may be?)
Pekr:
20-Feb-2012
warning's good in such a case imo, or your app will most probably 
behave incorrectly in the runtime anyway, no?
Oldes:
20-Feb-2012
And so what is expected behaviour for:
#enum test! [a b]
f: func[a [c-string]][]
PeterWood:
20-Feb-2012
In that case isn't a local to the function?
PeterWood:
20-Feb-2012
Yes it is possible to test for a warining message. assert-msg? simply 
does a find on the compiler output for the supplied string.
Dockimbel:
20-Feb-2012
Added support for `system/fpu/*` read/write properties. This allow 
controling the FPU at very low-level at runtime.

When compiling in debug mode, `show-fpu-state` function is available 
to print the current FPU properties: `show-fpu-state`

When called on IA-32, it would output::

FPU type: x87
- control word: 0000037A
- rounding    : nearest
- precision   : double extended (80-bit)
- raise exceptions for:
    - precision  : no
    - underflow  : no
    - overflow   : no
    - zero-divide: yes
    - denormal   : no
    - invalid-op : yes


See %red-system/runtime/system.reds for definitions and %debug.reds 
for a usage example.
Kaj:
20-Feb-2012
OK. Is it a standard that they should be disabled, or is WebKit just 
sloppy?
Kaj:
20-Feb-2012
Then it should indeed be in the C library binding, but probably in 
the main file, because I will also move a few other functions there 
that use floating point
Kaj:
20-Feb-2012
OK, I will wait a bit
Dockimbel:
20-Feb-2012
Ok, it's just the new tests added by Peter which are triggering a 
runtime error (related to issue #205). So, playing with your browser 
code should work fine.
PeterWood:
22-Feb-2012
I've found the easiest way to raise that runtime error is to accidently 
treat an integer as a pointer.
Dockimbel:
22-Feb-2012
FP exceptions: will look into it.


Peter: can you send me an example code of your use case raising a 
FP exception?
Kaj:
22-Feb-2012
You probably mainly meant that as a response to Petr
PeterWood:
22-Feb-2012
This code will cause an access violation as clock in libc returns 
an integer not a pointer to an integer.

pi: declare pointer! [integer!] 
#import [
	LIBC-FILE cdecl [
	  read-cpu-clock: "clock" [
	    return:    [pointer! [integer!]]
	  ]
    ]
]
pi: read-cpu-clock
pi/value
Pekr:
22-Feb-2012
One question towards library wrapping and type casting. One DLL function 
is defined as:

typedef bool (WINAPI *LSN_OPENCARD)(void);//open led card 


When I defined the return type of wrapper funciton as LOGIC!, it 
was always true. When I defined it as an integer, it was either 1, 
or some really high integer number. So i took Cyphre's advice towards 
R2's interface, and in R2 I used CHAR, and in Red/System, I used 
BYTE! type.


Pity construct of a type return: "as integer! [byte!]" is not allowed, 
but at least I now get correct result - 0, or 1, in my print statement, 
where I do: print [as integer! led-open-card lf]


So my question is - why using Red/System's LOGIC! did not work? Is 
C level BOOL a clearly defined type, or can it be defined in various 
ways, so I can't say, that I can automatically use LOGIC! = BOOL 
logic, when wrapping stuff?
PeterWood:
22-Feb-2012
From the spec Red/System does not support the use of  the logic! 
datatype in #import  - http://static.red-lang.org/red-system-specs.html#section-14.1


The spec is also silent about how a the logic! field is actually 
stored. I'd guess a byte! but I'd probably be wrong.


By the way no need to cast byte! to integer!, just test for #"^(00)" 
or #"^(01)".
Dockimbel:
22-Feb-2012
Logic! is stored as an integer (so 32-bit). The specification document 
is not supposed to describe the implementation (that's why I try 
to put implementation-specific details in special notes). Logic! 
uses 1/0 internally to represent true/false values, so if the imported 
function is not conforming to that convention, type casting to logic! 
won't work and a manual test would then be required.
Dockimbel:
22-Feb-2012
Right, we extended the import interface to allow logic!, the spec 
doc seems to lag behind on that feature, it needs to be updated (with 
a note about 1/0 requirement in such case).
Kaj:
22-Feb-2012
It's very nice that Red/System has a first class logic! but external 
code doesn't know that
Dockimbel:
22-Feb-2012
No! But you can use a macro to avoid making a function wrapper.
Kaj:
22-Feb-2012
Oh, right, the other way around. But how do you get a high integer 
from a library, then?
Dockimbel:
22-Feb-2012
Kaj: the same way as you get a low integer. :) The signed representation 
is just a convention, the actual data remains the same, signed or 
unsigned.
Kaj:
22-Feb-2012
It seems that Petr's library puts garbage in the high bytes if it 
returns 1 or a high integer
Pekr:
22-Feb-2012
yes, I confused it - ti came from R2, where I put char as a return 
value, and then to-integer ... I develop in in R2, Red/System, World, 
to see if eventual crashes are environment specific, or library specific
Pekr:
22-Feb-2012
the library is clearly a junk imo ... e.g. two consecutive calls 
to the same function do crash the app, etc.
Dockimbel:
22-Feb-2012
Kaj: I've just pushed a fix for the floats exceptions and regressions. 
Mandelbrot is running fine again now. Let me know if the issues are 
fixed for you too.
Pekr:
23-Feb-2012
How is that R/S jumped so high? A different test this time?
Kaj:
23-Feb-2012
As Doc explained, floating point performance is currently a bit hampered
Group: Topaz ... The Topaz Language [web-public]
Gabriele:
24-Sep-2011
Ok, we're out. You missed a good chance. :P
GrahamC:
24-Sep-2011
I got a message in Italian saying that I can't join the chat without 
a video camera
Dockimbel:
24-Sep-2011
Right, you need a webcam. We'll organize another short online meeting 
in October, if you have some questions for Red/Topaz, we'll be glad 
to answer them.
Dockimbel:
24-Sep-2011
It seems so. I was also a bit surprize when I connected. :)
Gabriele:
25-Sep-2011
Graham, I've been on Hangouts with Maarten and he was audio only. 
So my guess is you can ignore the message. It might work without 
a mic as well as they do have a text chat, though we also have altme 
for text.


No idea why Google would use *my* language when other people join... 
I guess they're just silly. :)
Gabriele:
25-Sep-2011
Let's try to pick a good day in October... suggestions welcome.
Dockimbel:
11-Oct-2011
We should make a new Google Hangout session tomorrow at 19:00 CEST. 
Guests are welcome to ask questions about Red & Topaz. I am waiting 
for Gabriele to confirm the meeting date/time.
Dockimbel:
11-Oct-2011
Graham: you have 24h to find a webcam. :-)
Gabriele:
12-Oct-2011
Of note, if there is interest, we could set up a day and be available 
the whole afternoon (for eg) so that more people can come (sort of 
a virtual devcon).
Janko:
12-Oct-2011
Me to: I got a message in Italian saying that I can't join the chat 
without a video camera

But I have webcam on .. I just logined to google + to see this thing 
..
Dockimbel:
12-Oct-2011
IIRC, there's a Google Hangout browser plugin to download to enable 
the webcam.
Dockimbel:
12-Oct-2011
Chat closed now. We were four peoples online this time (even 5 during 
a minute with Reichart coming to say hello).
Gabriele:
14-Oct-2011
Again, if people post here the dates/times they are available, we 
could do a virtual devcon or something like that.
Henrik:
14-Oct-2011
Perhaps you can do this on a regular basis at fixed times? I know 
there was talk a couple of years back to do regular devcons, but 
there was only one.
Kaj:
14-Oct-2011
Bas is intent on keeping up a half-yearly rhythm for the physical 
conferences. Denmark is not that far ;-)
Henrik:
15-Oct-2011
Gabriele, yes, however my theory is that if you pick a time (one 
that is friendly to people on both sides of the planet), people will 
eventually start showing up, if you are consistently using that date.
PeterWood:
15-Oct-2011
I never knew you were a flat earther Henrik.
james_nak:
15-Oct-2011
Gabriele, as Henrik said, pick a date and let's go from there. What 
has happened in the past is that I find out too late that you have 
had your Red/Topaz meetings.
Gabriele:
16-Oct-2011
Peter: if there are enough of you interested, we could do a "full 
day". The reason I'm asking is that it would just be silly to be 
there on Hangout all day with noone showing up.
PeterWood:
16-Oct-2011
I suspect that there would only be a couple of people from this part 
of the world so it probably wouldn't be pretty lonely.
Gabriele:
29-Oct-2011
>> a: [[1][2][3][[4]]]
== [[1] [2] [3] [[4]]]
>> b: parse a [collect any [keep *]]
== [1 2 3 [4]]
>> rule: [any [into rule | keep *]] b: parse a [collect rule]
== [1 2 3 4]

Just sayin'...
Gabriele:
2-Nov-2011
Reminder, i'll try to keep a G+ Hangout open all day tomorrow (Nov. 
3rd).
Henrik:
3-Nov-2011
Maybe also make a quick post about it on rebolforum.com?
Gabriele:
3-Nov-2011
not sure, feel free to but i don't know how many people we can handle 
(ie. random people coming in from a public web page)
Henrik:
3-Nov-2011
ok, I won't make a posting.
Gabriele:
3-Nov-2011
Cool. Maybe I'll take a 1 hour break now then, I guess more people 
are going to show up once you're there as well.
james_nak:
3-Nov-2011
Working on joining. I saw you two for a second.
Gabriele:
3-Nov-2011
I've seen you for a second as well.
Henrik:
3-Nov-2011
forgot I had to click a link...
Henrik:
3-Nov-2011
we are having a great talk, if anyone is interested in joining. :-)
james_nak:
3-Nov-2011
Henrik, it was nice to see you. That was a very cool meeting. OK, 
I'm going to get a camera.
Henrik:
3-Nov-2011
James, it was great talking to you, but the connection was sometimes 
poor, which was a shame.
Gabriele:
3-Nov-2011
i'll check back in a bit in case someone else is around. in any case, 
it was a great talk. i guess we can repeat this next month or so 
- my afternoon seems to be the best time. too bad Peter didn't get 
to meet everyone else. :)
Endo:
3-Nov-2011
* "a meeting note"
Gabriele:
4-Nov-2011
Peter, you may try to convince the others to show up earlier instead. 
;)


Endo: it was very informal, so it's hard to write a written summary 
or anything like that... though, Hangouts with extra has a note thing, 
next time we can try to use that. In any case, if you have a preferred 
date / time for next month, we can try to be there.
Janko:
12-Nov-2011
Hm.. i know now why I was looking at it this way. Because when I 
make a error in javascript now, browser shows me some line of code 
where it happened and I use that to know where to start fixing. Basically 
I usually can fix it imediatelly based on that info. 


If source lang. would be giving me for example line comments with 
source topaz code (I know it's not 1to1 but still) so I could aprox 
locate the same code in topaz it would be helpfull in this case
Robert:
12-Nov-2011
Geomol, interesting. I do the same. I have used a debugger 15+ years 
ago.
Gabriele:
14-Nov-2011
Janko, there are two cases here:

1) debugging the interpreter itself

2) debugging your own code (for eg. a web app written in Topaz)


I think that (2) is what interests you - in that case, you use the 
interpreter during development, so it's just the same as debugging 
in REBOL (well, I hope to provide a few more tools, but even without 
debugging REBOL code is not that difficult most of the time). Think 
of compilation as an optimization step, that you do only for production 
deployment etc. and only for some parts of your code (the parts where 
performance is important).
Pekr:
22-Nov-2011
Oldes in Other languages group - "Hm.. i gave it a try and must say 
that Topaz is much more interesting." So, I would like to ask - is 
there any progress lately? Is Topaz already usable for real-life 
code? An what is an speed overhead in doing some app in Topaz in 
comparison to direct JS execution?
Pekr:
23-Nov-2011
What's going to be a usage scenario though? I will have to compile, 
in order to get reasonable performance? I mean - I develop in Topaz, 
but client gets clean JS?
Pekr:
23-Nov-2011
Or is that like this? : When user hits the website, Topaz "libraries" 
are being downloaded (language, compiler, actual app). When you inspect 
the source of the website, you can see real Topaz code, not a JS. 
This code is being compiled by JS engine for further usage, so the 
first run is kind of slower, but then it runs fast = compiled?
BrianH:
23-Nov-2011
Can you make a compiler/interpreter written in JS that can automatically 
handle script blocks that have the right language set?
Gabriele:
24-Nov-2011
Petr: actually, you have the choice to do whichever you want. For 
a production web site precompiling the performance-critical parts 
is probably the best way.
Gabriele:
24-Nov-2011
note that in practice, you'll have a dialect that specifies the whole 
web application, and when you deploy it to production, you get html, 
css, js etc. generated. but, nobody forces you to use the dialect.
Marco:
26-Nov-2011
How can I try topaz in Windows? Is the try-topaz.html page the only 
method? Is there a way to write a topaz program with a text editor 
and then execute it in some way?
BrianH:
26-Nov-2011
Well, Topaz compiles to or is interpreted in JavaScript at the moment. 
There are several ways to run JS on Windows outside of web browsers 
- it is one of the ActiveScripting languages, so you can use cscript, 
for instance - or you can load the Topaz environment in a web page, 
which can be a local html file with no web server needed. None of 
this is tested yet, of course, so be sure to tell us how well that 
works for you :)
PeterWood:
26-Nov-2011
I wrote some notes on how to get and install Topaz at https://github.com/giesse/Project-SnowBall/wiki/Topaz-:-Getting-Started


There a little old but should still work. If not please let me know.
Gabriele:
27-Nov-2011
Peter's how to should work. Or, just use a real operating system. 
:P
BrianH:
27-Nov-2011
He was asking about how to run Topaz outside of a browser. All of 
the suggestions I made above apply to Linux as well, except you have 
to install your own JS interpreter instead of using the one that 
comes preinstalled on Windows. So, it's a bit harder on your "real" 
operating system.
BrianH:
27-Nov-2011
Oh, I see, you're installing a JS interpreter on Windows as well 
instead of using the built-in one, or even one that is made for Windows. 
Makes sense.
BrianH:
27-Nov-2011
OK, good, there's a node.js for Windows now (Cygwin doesn't count): 
http://npmjs.org/doc/README.html#Installing-on-Windows-Experimental
BrianH:
27-Nov-2011
A proper installer too, the latest version: http://nodejs.org/dist/v0.6.3/node-v0.6.3.msi
Gabriele:
28-Nov-2011
Brian... Windows is the odd one around, all the other operating systems 
just require installing a package. But, if windows has a built in 
JS interpreter, and if it is standard (and I don't mean the 1998 
standard at that), then you can run Topaz on it.
BrianH:
28-Nov-2011
It appears to be standard (it's the one in IE, so if you have IE9 
it is as standard as V8). However, it doesn't seem to have one of 
the objects or functions that Topaz's bootstrap depends on. Some 
time I'll try to do a proper port. In the meanwhile, Node just requires 
installing a package on Windows (at least as of the last couple months), 
so any Cygwin-related criticism can be ignored now :)
Gabriele:
2-Dec-2011
PARSE works in a similar way to DO, in that it returns the last "result". 
I will document this in detail before a 1.0 release. There is a slide 
in my september presentation about PARSE vs. INTERPRET which explains 
why I went this route.
BrianH:
2-Dec-2011
Does it return the subject series at the position of the last result, 
or does it return the last recognized pattern as a value?
Gabriele:
3-Dec-2011
Brian, each "rule" has two effect: it advances the series, and returns 
a result. Most rules return the matched value, but not all. Examples:

>> parse [1] [number!]
== 1
>> parse [1 2 3] [number! number! number!]
== 3
>> parse [1 2 3] [some number!]
== 3
>> parse [1 2 3] [object [a: number! b: number! c: number!]]
== object none [
==     a: 1
==     b: 2
==     c: 3
== ]

>> parse [1 2 3] [object [a: number! b: object [c: number! d: number!]]]
== object none [
==     a: 1
==     b: object none [
==         c: 2
==         d: 3
==     ]
== ]
BrianH:
3-Dec-2011
Seems a bit like a cross between a destructuring matcher and regex. 
Useful.
GiuseppeC:
15-Dec-2011
Hi, I am interested into building an maintaining documentation for 
those programming languages based on REBOL.
It would be nice to have a DOCBASE for them.
What I search is:
- Someone ABLE to SETUP the Linux and the Wiki Software
- Someone which would share with me the cost of hosting.
Do you like the idea ?
Write me at [giuseppe-:-chillemi-:-eu]
Gabriele:
8-Feb-2012
Thanks, I don't really use Windows so it's hard for me to keep up 
to date on that front. Peter already said he's going to update the 
wiki; if anyone else wants to help, I believe github allows a fork 
approach to the wiki as well, otherwise I can add you to the main 
wiki to edit it directly.
Gabriele:
8-Feb-2012
a topaz function for REBOL, you mean?
Gabriele:
8-Feb-2012
but, i guess you can use CALL to run node.js, or you can get node.js 
to listen to a tcp port and connect to it from REBOL, etc.
63801 / 6460812345...637638[639] 640641642643644645646647