Re: [fpc-pascal] FPC 3.0 + MIPS Linux

2015-11-27 Thread Mark Morgan Lloyd
Juha Manninen wrote: According to this : http://forum.lazarus.freepascal.org/index.php/topic,30500.msg194271.html FPC 3.0 MIPS version for Linux works through cross-compilation. It is not mentioned in release notes. Android + MIPS is mentioned. I may buy a MIPS gadget later to see why

Re: [fpc-pascal] Implementing Factory Method with Pascal

2015-11-27 Thread Marcos Douglas
On Fri, Nov 27, 2015 at 7:44 PM, luciano de souza wrote: > If I need to do "TAnimalFactory.create(atDog) as Tdog", perhaps, it > would be better not to use a factory, doing simply "TDog.create". You're right, use simply TDog.Create. Why do you have a factory to create

Re: [fpc-pascal] Implementing Factory Method with Pascal

2015-11-27 Thread Marcos Douglas
On Fri, Nov 27, 2015 at 10:15 PM, luciano de souza wrote: > If I want to change the type of the instance, better is to use > generics. A factory is only a batch builder of the same objects. OK, but you don't need generics either ;) Marcos Douglas

Re: [fpc-pascal] Implementing Factory Method with Pascal

2015-11-27 Thread Marcos Douglas
On Fri, Nov 27, 2015 at 10:16 PM, Anthony Walter wrote: > if Animal is IBarkable then (Animal as IBarkable).Bark; Your approach is much better, but don't use casting is even better when we working with a true object oriented, because casting is a "procedural command" for the

Re: [fpc-pascal] Implementing Factory Method with Pascal

2015-11-27 Thread Mattias Gaertner
One solution: var animal: TDog; BEGIN animal := TAnimalFactory.create(atDog) as TDog; try animal.bark; finally animal.free; end; END. Mattias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org

Re: [fpc-pascal] Implementing Factory Method with Pascal

2015-11-27 Thread Graeme Geldenhuys
On 2015-11-27 21:21, luciano de souza wrote: > I'd like to understand how to implement the Factory Method pattern in Pascal. See my "Simple Factory Pattern" article. I've written about many other design patterns too. http://geldenhuys.co.uk/articles/ Regards, - Graeme - -- fpGUI Toolkit

[fpc-pascal] Implementing Factory Method with Pascal

2015-11-27 Thread luciano de souza
Hello all, I'd like to understand how to implement the Factory Method pattern in Pascal. In my example, there are four classes: 1. TAnimal - The parent and abstract class; 2. TDog and TCat - The specialized classes; 3. TAnimalFactory - The class which creates instances of animals, having

Re: [fpc-pascal] Implementing Factory Method with Pascal

2015-11-27 Thread luciano de souza
Marcos, Your answer and the excelent article of Graeme clarify the question. If I want to change the type of the instance, better is to use generics. A factory is only a batch builder of the same objects. Graeme, your article opened my mind. The mappings and the registers caused me a very

Re: [fpc-pascal] Implementing Factory Method with Pascal

2015-11-27 Thread Anthony Walter
type IBarkable = interface(IInterface) ['{B241068F-2ED9-43C7-066B-778B94CB58F9}'] procedure Bark; end; TAnimal = class(IInterface) end; TDog = class(TAnimal, IBarkable) public procedure Live; override; procedure Bark; end; and later ... if Animal is IBarkable then

Re: [fpc-pascal] FPC Pestering Peacock (3.0.0) release

2015-11-27 Thread Juha Manninen
How to get ARM Linux version for Raspberry Pi? BTW, you really should improve the download links. Now a user can select his CPU / platform from here: http://www.freepascal.org/download.var It looks good so far. Then he selects eg. Intel/i386 - FreeBSD. There is a top link for SourceForge which

Re: [fpc-pascal] [fpc-other] FPC Pestering Peacock (3.0.0) release

2015-11-27 Thread Vincent Snijders
2015-11-26 22:44 GMT+01:00 Jonas Maebe : > On 26/11/15 22:39, Florian Klämpfl wrote: > >> Am 26.11.2015 um 22:31 schrieb Jonas Maebe: >> >>> It just got posted on Slashdot too: >>> >>>

[fpc-pascal] FPC 3.0 + MIPS Linux

2015-11-27 Thread Juha Manninen
According to this : http://forum.lazarus.freepascal.org/index.php/topic,30500.msg194271.html FPC 3.0 MIPS version for Linux works through cross-compilation. It is not mentioned in release notes. Android + MIPS is mentioned. I may buy a MIPS gadget later to see why Lazarus does not work. I