World: r3wp
[Core] Discuss core issues
older newer | first last |
Graham 18-Apr-2006 [3963x2] | need to get this working for my postscript dialect to be able to use rebol colours |
instead of tuples | |
Gregg 18-Apr-2006 [3965] | Can you use REDUCE/ONLY? |
Graham 18-Apr-2006 [3966x5] | let me try. |
same problem | |
this is what I want to do | |
{ font (red) } => [ font 255.0.0 ] | |
It may be that I have to include the colour words in my parser. | |
Ingo 19-Apr-2006 [3971] | Do you mean like this? >> b: "(blue)" == "(blue)" >> compose bind to block! b 'white == [0.0.255] You just have to give any word from the same context to bind ... so inthis case any word from the global context (i.e. system/words). The only point to be aware of: If all this happens in a different context, and you happen to have a word named 'white in this context, then you have to use another word. |
Graham 19-Apr-2006 [3972x2] | hey thanks Ingo! |
Anyone written a fetchmail in Rebol? | |
Gabriele 19-Apr-2006 [3974x2] | does send have a forward option - maybe you are looking at RESEND |
at = for | |
Graham 19-Apr-2006 [3976] | ahh.. a new function :) |
Henrik 19-Apr-2006 [3977] | this is probably outside of core and more at the OS level, but it would be nice to somehow check if a script is already running via LAUNCH, to make sure it's only launched one instance at a time. Is this possible? |
Anton 19-Apr-2006 [3978] | maybe try to launch a dummy script and catch the error. |
Henrik 19-Apr-2006 [3979] | another thing could be to have a masterscript running and let the other scripts report to it via LNS, but that's not very elegant... |
Gregg 19-Apr-2006 [3980] | You could use a semaphore of some kind (port/file). |
Anton 19-Apr-2006 [3981] | - the original script will be able to launch the dummy script and thus no error - the launched script will not be able to launch the dummy script and thus an error |
Henrik 19-Apr-2006 [3982] | a script can't launch itself? |
Anton 19-Apr-2006 [3983] | So you won't have to fiddle with files or ports and worry about deadlock conditions etc. |
Henrik 19-Apr-2006 [3984] | or "cascade launch" scripts |
Anton 19-Apr-2006 [3985x2] | A launched script cannot launch further scripts. |
So: do original-script -> launch sub-script -> launch ---> failure | |
Henrik 19-Apr-2006 [3987] | what if I have a menu system which launches subscripts A, B, C, D and E. I launch A and C. Then the menu crashes or is accidentally quit. I launch the menu system again, but then it should know the state of the running programs. |
Gregg 19-Apr-2006 [3988] | Sounds like you want an IPC mechanism of some kind. |
Henrik 19-Apr-2006 [3989] | seems it would be necessary... |
Ingo 19-Apr-2006 [3990x2] | Hi Graham, hope you understood my explanation - I wouldn't ;-) |
re. fetchmail ... What exactly are you looking for? fetchmail in its current incarnation fetches mail via pop3, and sends it via smtp to a local mta ... shouldn't be too hard. | |
Graham 19-Apr-2006 [3992x2] | Ingo, exactly .. not hard so has anyone done it? |
I am wondering whether I should install fetchmail, or just use/write a rebol version. | |
sqlab 19-Apr-2006 [3994] | Henrik: you can either assign every script an unique port number and try to open it at startup or (under window) give the console window a name and check if a window with that name already exists or (under **ix) check the command line with ps |
Graham 19-Apr-2006 [3995] | That is what I do .. my scripts up a listen port, and if they can't, they know an instance is already up and running. |
Ingo 19-Apr-2006 [3996] | Well, I once did a script that just downloads and stores mails locally, but none that works like fetchmail ... on linux I have fetchmail installed, and on win I don't have an mta ;-) |
Graham 19-Apr-2006 [3997] | I'm trying to setup Scalix on Suse, and just noted that Scalix lacks this facility natively. |
Geomol 20-Apr-2006 [3998x2] | Bit-shifting One way to do bit-shifting is to multiply or divide with (2 ** positions). To make the code more readable, I could start making a shift block: shift: [] repeat i 16 [append shift to-integer 2 ** i] == [2 4 8 16 32 64 128 256 512 1024 2048 4096 8192 16384 32768 65536] To e.g. shift the number 123 left 5 positions, you do: 123 * shift/5 == 3936 To check, that 3936 is actually 123 shifted left 5 positions: >> enbase/base debase/base to-hex 123 16 2 == "00000000000000000000000001111011" >> enbase/base debase/base to-hex 3936 16 2 == "00000000000000000000111101100000" To shift 3936 right 5 positions: 3936 / shift/5 == 123 As long as the numbers are not close to 4 byte long integer (2 ** 32), we don't get number overflow. |
This also doesn't work with negative integers, because the left-most bit is set in those cases. I have bit-operations for shift and rotate, that works on full 32-bit integers, if anyone needs those. | |
eFishAnt 24-Apr-2006 [4000x10] | HELP (please) I have installed Core 2.6 on an embedded Ubuntu Linux, and when I try to open the comm port, I get and Access Error for ttyC0 but when I look in the /dev/ directory, I see a ttyc0 but not a ttyC0 ... I tried as root to ln -s /dev/ttyc0 ttyC0 ... but get the same error. |
Anyone have an idea how to trick out Linux on this? | |
(or how to trick REBOL into asking for ttyc0 instead? | |
I do a serial-port: open/direct/binary/no-wait serial://port/38400/8/none/1 serial://port1/38400/8/none/1 | |
rather... serial-port: open/direct/binary/no-wait serial://port/38400/8/none/1 | |
no, exactly... serial-port: open/direct/binary/no-wait serial://port1/38400/8/none/1 | |
aha...just found some Ubuntu notes on www.rebol.net/builds/lib-dep.html...mahbe I need to get the debian update. | |
I found REBOL ubuntu, and downloaded, but same problem, Access error: Cannot Open ttyC0 | |
...simply doing open serial://port1 | |
added RAMBO Ticket #-639 | |
DideC 24-Apr-2006 [4010] | Look at system/port/serial and change it to reflect what you have in /dev/ I guess with [ttyc0 ttyc1] Almost it's what we have to do under Windows. |
eFishAnt 24-Apr-2006 [4011x2] | Thanks, DideC, it is [ttyC0 ttyC1] ; with caps... |
aha...system/ports/serial (was going fish-eyed on that...0-o-o< | |
older newer | first last |