Re: [fpc-pascal] Interface syntax: Is possible don't use specialize in mode objfpc?
On Fri, 31 Jul 2015, Maciej Izak wrote: 2015-07-31 8:37 GMT+02:00 Michael Van Canneyt : Attributes: http://svn.freepascal.org/svn/fpc/branches/joost/classattributes/ Looks like "dead branch"... No, it is not. It looks dead because the support is long finished, but it has not been integrated in trunk because the integration in trunk can only happen after the release of 3.0. So it has been waiting for a long time. New RTTI (I think): http://svn.freepascal.org/svn/fpc/branches/interfacertti/ IIRC this is bugfix for mORMot framework related to broken/lack of implementation of RTTI for interfaces. In Delphi this kind of RTTI is available since Delphi 7 or 6 (I don't remember precisely). As I hinted: I am not sure where this support is committed. Florian can tell us, I believe he created a branch for this. Michael. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
[fpc-pascal] Interactive command recognition & mapping to program functions & other 'cli' features as a unit
Hi, I tried piecing something like in $topic together, intended as an 'interactive' command interpreter for my program. (which will in time grow an 'embedded' web server and intended to run as a (windows) service, but it's too early for that at the moment) (I hooked some events of a TMemo to my interpreter, which currently recognizes commands by a static map/array of record of string and function pointers; and passes the rest of command line to the called function as string, then the function is a shim/wrapper over the deeper program functions; the entire parameter sanitizing and conversion from string to what the 'deeper' function expects, is done in the 'wrapper' function layer, and so is the function output converted back to string and spat out to the TMemo. It's growing too complicated to maintain for the purpose, day by day, and has problems with some more interactive commands or tab completion... Is there something I could use for the purpose that is ready-made, tested, free and open source AND of course in FreePascal ? (I can share my changes back if I do any, can't open the entire application though) Any hints, Any keywords, any lmgtfy's are welcome :) Kind Regards el es ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Interactive command recognition & mapping to program functions & other 'cli' features as a unit
Lukasz Sokol wrote: Hi, I tried piecing something like in $topic together, intended as an 'interactive' command interpreter for my program. (which will in time grow an 'embedded' web server and intended to run as a (windows) service, but it's too early for that at the moment) (I hooked some events of a TMemo to my interpreter, which currently recognizes commands by a static map/array of record of string and function pointers; and passes the rest of command line to the called function as string, then the function is a shim/wrapper over the deeper program functions; the entire parameter sanitizing and conversion from string to what the 'deeper' function expects, is done in the 'wrapper' function layer, and so is the function output converted back to string and spat out to the TMemo. It's growing too complicated to maintain for the purpose, day by day, and has problems with some more interactive commands or tab completion... Is there something I could use for the purpose that is ready-made, tested, free and open source AND of course in FreePascal ? (I can share my changes back if I do any, can't open the entire application though) Any hints, Any keywords, any lmgtfy's are welcome :) This might be better in the Lazarus mailing list. I've knocked together a special-purpose terminal emulator, it's actually an IBM 2741 terminal which uses totally non-standard codes internally and I wanted something for APL, early ALGOL implementations and so on. This is obviously character-by-character, and I was just about able to get something working for TMemo, TRichMemo and TListBox. Somebody else mentioned TCmdBox (?) but I wasn't able to get it working adequately and in the end discarded most of my attempts, it might be worth looking at if you're trying to process lines rather than characters. I think this was discussed a few months ago, and consensus was that there wasn't an adequate terminal emulator component. See below. http://free-pascal-lazarus.989080.n3.nabble.com/Lazarus-Xterm-konsole-etc-td4031905.html -- Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues] ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Interactive command recognition & mapping to program functions & other 'cli' features as a unit
On 31/07/15 14:46, Mark Morgan Lloyd wrote: > Lukasz Sokol wrote: >> Hi, >> >> I tried piecing something like in $topic together, >> >> intended as an 'interactive' command interpreter for my program. >> (which will in time grow an 'embedded' web server and intended to >> run as a (windows) service, but it's too early for that at the >> moment) [...] >> Any hints, Any keywords, any lmgtfy's are welcome :) > > This might be better in the Lazarus mailing list. Thanks, I'll post there too, however I though i start here... > > I've knocked together a special-purpose terminal emulator, it's > actually an IBM 2741 terminal which uses totally non-standard codes > internally and I wanted something for APL, early ALGOL > implementations and so on. This is obviously character-by-character, > and I was just about able to get something working for TMemo, > TRichMemo and TListBox. Somebody else mentioned TCmdBox (?) but I > wasn't able to get it working adequately and in the end discarded > most of my attempts, it might be worth looking at if you're trying to > process lines rather than characters. Will check TCmdBox... thanks! > > I think this was discussed a few months ago, and consensus was that > there wasn't an adequate terminal emulator component. See below. > > http://free-pascal-lazarus.989080.n3.nabble.com/Lazarus-Xterm-konsole-etc-td4031905.html > >From the above thread, http://wiki.freepascal.org/CmdLine popped up which I >think of looking at. Thanks again, el es ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Interactive command recognition & mapping to program functions & other 'cli' features as a unit
Lukasz Sokol wrote: On 31/07/15 14:46, Mark Morgan Lloyd wrote: Lukasz Sokol wrote: Hi, I tried piecing something like in $topic together, intended as an 'interactive' command interpreter for my program. (which will in time grow an 'embedded' web server and intended to run as a (windows) service, but it's too early for that at the moment) Looking at your question another way, I suppose that you also have the issue of parsing a command as well as handling the data entry. I think that there's various possibilities here depending on what you're trying to handle: * A simple sequence of names/numbers. * A unix-style command line, with leading options. * A sequence of email/HTTP headers. * XML. * Any of the above but with macro and/or numeric evaluation. I note in particular that PostgreSQL uses Flex and Bison, and if they'll parse (a fairly comprehensively extended) SQL I guess they'll parse about anything. Apart from that I've hacked something together for my own use based on Smalltalk (as an outer parser) with various evaluation possibilities (as an inner parser), this was intended as a way for programs to talk to each other and has its good points. I'm not sure whether getopts from the RTL provides a facility for you to feed it an arbitrary string for processing, but it would probably be a good place to start. -- Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues] ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal