World: r3wp
[Core] Discuss core issues
older newer | first last |
Steeve 23-Mar-2010 [16089] | Great work, would be a nice alias to add in Rebol. >> whereof: [get in disarm try [+] 'where] >> g: f: does [print ["my name is" do whereof]] >> g my name is g >> f my name is f |
ChristianE 23-Mar-2010 [16090] | >> I guess the processes that aren't listening on a port could touch a file Likely the easiest way to go, I've always went for that approach, Graham. Renaming files afaik is an atomic operation, so you can toggle process states between %process-a.running and %process-a.finished or %process-b.failed etc. Not suggesting that there aren't better ways ... |
Steeve 23-Mar-2010 [16091] | obviously, it can't be a mezz |
ChristianE 23-Mar-2010 [16092] | Steeve, please make sure that BrianH doesn't see what you are suggesting here ;-) That method is so wrong! |
Steeve 23-Mar-2010 [16093x2] | eh why that ? :) |
it's rebolish enough for me | |
ChristianE 23-Mar-2010 [16095x2] | Mainly, I was just kidding. |
On the other hand, it really is just a dirty hack, not more. The main point is, it doesn't provide an answer to the function's "What is my name?"-question. Functions have no names. | |
Steeve 23-Mar-2010 [16097] | (If you want BrianH accept it, just let him think he find the trick himself) |
ChristianE 23-Mar-2010 [16098x2] | I'm not argueing that it wouldn't come in handy sometimes ... If you know what you do. |
(That wasn't nice of you, but LOL) Brian hopefully can LOL too :) | |
Steeve 23-Mar-2010 [16100] | Don't worry ;-) |
ChristianE 23-Mar-2010 [16101x3] | There is another aspect of this. Questions on functions names probably occur too often to not answer them by a proper language construct. I was always thinking that something like a SELF word in functions would suffice. A function would then be able to envoke itself, and only itself, without worrying about it's "name", whatever that is. |
I am no language designer, though, I'm not able to overlook the implications that would have. | |
A SELF word in a function always evaluating to the exact same function wouldn't be very different from being a keyword, whilst Rebol claims to have no keywords. I don't see a way around this. | |
Ladislav 23-Mar-2010 [16104] | re 'self as a keyword: do not worry, Christian, many Rebol dialects have keywords, e.g. 'self is already a keyword of the object specification dialect, as I see it. Just the Do dialect is promoted to not have keywords, alghough the names of infix operators actually are treated as keywords in R2, as I noted elsewhere |
ChristianE 23-Mar-2010 [16105] | But, when Rebol evaluates a function / the code in a function's body - isn't that the DO dialect at its work? An isn't >> a: func [value] [value] >> a: func [value] [do [value]] pretty much the same? |
Steeve 23-Mar-2010 [16106] | Are you asking why whereof can't be a function ? |
Ladislav 23-Mar-2010 [16107] | as far as I am concerned, I do not understand the people who ask for the name of the function - I never needed that, so it may be a design problem - they want to do something, that can be done in Rebol more elegantly, than they are trying to do it |
Sunanda 23-Mar-2010 [16108] | I'd want it for better error reporting... error near append a b is not very helpful! Hoping R3's stack etc functions will help. |
Ladislav 23-Mar-2010 [16109] | but, I can define (easily) a special function specification dialect using the word 'self analogically as objects do, if that is of any interest |
ChristianE 23-Mar-2010 [16110x2] | Ladislav, I think I'm with you on that. Asking for name of a function makes no sense in REBOL, code that relies on the name of a function better be rewritten to get along without. |
But the fact that the question always resurfaces points to a where the REBOL programming paradigm isn't easy to grasp. The SELF aware function I mentioned above is a poorly worded mere thought experiment on that to ease the paradigm change, I was *not* suggesting that this should be standard behaviour of all functions. | |
Ladislav 23-Mar-2010 [16112] | yes, understood, it is OK, I just wanted to note, that you do not need to worry whether any specific dialect, like e.g. the function body specification dialect, at least for specific functions you define in the way that you find useful, uses any keywords you find useful for a specific purpose - that is the principle of Rebol dialects: do whatever you find useful |
BrianH 23-Mar-2010 [16113] | Don't worry, I see the humor in it :) |
Graham 26-Mar-2010 [16114x4] | I asked this before .. but what's a good way of monitoring a large number of rebol processes on the windows platform? |
Some of them are listening to ports, but others are just processing queues ...so the former I can open and close a port to them, the latter I can not. | |
And of course I'd like to be able to restart any processes that have locked up ... | |
One thing that I don't like is that if an encapped application dies with an error, it stays resident with any file locks active. Wouldn't it be better to have an option to just quit ( writing a log entry first ) ? So, then I can just check to see if the app is running. | |
Steeve 26-Mar-2010 [16118] | can't you have a process to manage others using an udp port for instance ? |
Graham 26-Mar-2010 [16119] | some of these are core apps ... |
Steeve 26-Mar-2010 [16120] | R2 ? |
Graham 26-Mar-2010 [16121] | all r2 |
Steeve 26-Mar-2010 [16122] | and so, you could have a specific process which monitors the others, using tcp or udp, no ? |
Graham 26-Mar-2010 [16123] | I can monitor some by tcp .. .but how can I use udp to monitor the others? |
Steeve 26-Mar-2010 [16124] | the others have some loop and wait process i guess, just insert a wait on an udp port as well |
Graham 26-Mar-2010 [16125] | So, if it is doing stuff .. it will miss the udp ping ? |
Steeve 26-Mar-2010 [16126x2] | no, if the monitor accept some lantency; For example if a process is not responding after few pings. |
But in the case of huge process, the client process should send himself a ping to the monitor to advert is doing stuffs (at some points of the code) | |
Graham 26-Mar-2010 [16128] | like a log file |
Steeve 26-Mar-2010 [16129] | eh ? |
Graham 26-Mar-2010 [16130x2] | if you write to a log file, then that's like a ping to a monitor |
But actually the monitor is a user app that they run from their desktop .. so it can't accept pings from the process. | |
Steeve 26-Mar-2010 [16132x2] | but a port dialing is more efficient and has less overhead |
why it can't ? | |
Graham 26-Mar-2010 [16134] | how does it know where the user app is? |
Steeve 26-Mar-2010 [16135x2] | Simple. Each time a targetted process start,k it send its id to the monitor. (hey ! Mr Monitor i'm here and my name is "toto") |
it's a standard client/server exchange, each client has to establish a connection with the server. | |
Graham 26-Mar-2010 [16137] | So, I need a central server as well... |
Steeve 26-Mar-2010 [16138] | It's the monito actually. You have one monitor (the server) for several processes (the clients) |
older newer | first last |