On Thu, 6 Apr 2017 18:25:40 -0300
African Wild Dog wrote:
> Which integer types have their size dependent on platform?
> E.g. in Delphi, LongInt can 32 or 64 bits depending on the platform.
Why do you think that Delphi's longint has 64bits anywhere?
Delphi's NativeInt is 32 or 64bit depending on
Which integer types have their size dependent on platform?
E.g. in Delphi, LongInt can 32 or 64 bits depending on the platform.
The documentation says "every platform has a ”native” integer size,
depending on whether the platform is 8-bit, 16-bit, 32-bit or 64-bit. e.g.
On AVR this is 8-bit. ", but
Ryan,
If you want an example of a complete API implemented using reference
counted interfaces than you could do worse than look at my Firebird
Pascal API (See https://www.mwasoftware.co.uk/fb-pascal-api).
It's fully documented and works with both FPC and Delphi.
Tony Whyman
MWA
On 06/04/17
On Thu, Apr 6, 2017 at 12:23 PM, Ryan Joseph wrote:
>> In fact is the opposite:
>> TAction needs to have all methods that IAction have.
>> This TAction class in the example is not the same class in RTL.
>>
>> You shouldn't have so many methods in just one class.
>> So, it is simple implement all m
> On Apr 6, 2017, at 10:01 PM, Marcos Douglas B. Santos
> wrote:
>
> In fact is the opposite:
> TAction needs to have all methods that IAction have.
> This TAction class in the example is not the same class in RTL.
>
> You shouldn't have so many methods in just one class.
> So, it is simple im
On Thu, Apr 6, 2017 at 11:48 AM, Ryan Joseph wrote:
>
>> On Apr 6, 2017, at 9:42 PM, Marcos Douglas B. Santos
>> wrote:
>>
>> Lose type checking?
>> Of course not. You still use the same language, interfaces, classes...
>>
>> Don't confuse "New, the function" with "New, a method in a class".
>
>
> On Apr 6, 2017, at 9:42 PM, Marcos Douglas B. Santos wrote:
>
> Lose type checking?
> Of course not. You still use the same language, interfaces, classes...
>
> Don't confuse "New, the function" with "New, a method in a class".
I should say that you need to have a matching interface for all
On Thu, Apr 6, 2017 at 11:01 AM, Ryan Joseph wrote:
>
>
> > On Apr 6, 2017, at 8:54 PM, Marcos Douglas B. Santos
> > wrote:
> >
> > Pretty clear, right?
> >
> > Because this "problem" I have a "pattern" that I called "New Method".
> >
> > You can see how it works in my article:
> > (you need to
> On Apr 6, 2017, at 8:54 PM, Marcos Douglas B. Santos wrote:
>
> Pretty clear, right?
>
> Because this "problem" I have a "pattern" that I called "New Method".
>
> You can see how it works in my article:
> (you need to translate from Portuguese)
> http://objectpascalprogramming.com/posts/inte
On Thu, Apr 6, 2017 at 10:41 AM, Ryan Joseph wrote:
>
>> On Apr 6, 2017, at 8:13 PM, Marcos Douglas B. Santos
>> wrote:
>>
>> I can guarantee that reference counting is not a bad idea.
>> I have been using this for years and in my own code I do not use Free
>> method anymore (only if I need to u
> On Apr 6, 2017, at 8:13 PM, Marcos Douglas B. Santos wrote:
>
> I can guarantee that reference counting is not a bad idea.
> I have been using this for years and in my own code I do not use Free
> method anymore (only if I need to use some classes of RTL or some 3rd
> libs/frameworks), interna
> On Apr 6, 2017, at 7:45 PM, Sven Barth via fpc-pascal
> wrote:
>
> Arrays are reference counted, class instances are not. So if the compiler
> would blindly free the instance after it goes out of scope if might free
> something that another code part still uses.
>
I was thinking about jus
Hi Ryan,
On Thu, Apr 6, 2017 at 7:28 AM, Ryan Joseph wrote:
> Hmm, that sounds like a hack. Is the verdict this is generally a bad idea? I
> was
> just curious about it and it seems like a reasonable feature a language may
> have.
I can guarantee that reference counting is not a bad idea.
I ha
Am 06.04.2017 11:58 schrieb "Ryan Joseph" :
>
>
> > On Apr 6, 2017, at 4:26 PM, Sven Barth via fpc-pascal <
fpc-pascal@lists.freepascal.org> wrote:
> >
> > It's a difficult topic, cause in Object Pascal class instances are
always on the heap while in C++ they might be on the stack as well. Thus a
C
In our previous episode, Ryan Joseph said:
> >
> > And reference counting as garbage collection method has been discussed to
> > dead on various maillists and forums. Both Delphi and Lazarus/FPC.
>
> Hmm, that sounds like a hack. Is the verdict this is generally a bad idea?
There is a reason why
> On Apr 6, 2017, at 5:09 PM, Marco van de Voort wrote:
>
> No, since you don't declare an interface variable, but a class variable.
>
> There are a zillion Delphi faqs about this, but the crux is to use
>
> var
> scope:IInterface;
>
> And reference counting as garbage collection method has
In our previous episode, Ryan Joseph said:
> > See http://freepascal.org/docs-html/current/ref/refse48.html#x101-1230007.7
> > for an example.
> >
> > See also http://wiki.freepascal.org/How_To_Use_Interfaces
>
> "All COM interfaces use reference counting. This means that whenever an
> interface
> On Apr 6, 2017, at 4:26 PM, Sven Barth via fpc-pascal
> wrote:
>
> It's a difficult topic, cause in Object Pascal class instances are always on
> the heap while in C++ they might be on the stack as well. Thus a C++ compiler
> will insert calls to the destructor of such an object if it goes
> On Apr 6, 2017, at 4:30 PM, Tony Whyman
> wrote:
>
> See http://freepascal.org/docs-html/current/ref/refse48.html#x101-1230007.7
> for an example.
>
> See also http://wiki.freepascal.org/How_To_Use_Interfaces
"All COM interfaces use reference counting. This means that whenever an
interface
See http://freepascal.org/docs-html/current/ref/refse48.html#x101-1230007.7
for an example.
See also http://wiki.freepascal.org/How_To_Use_Interfaces
On 06/04/17 10:08, Ryan Joseph wrote:
On Apr 6, 2017, at 3:45 PM, Tony Whyman wrote:
Isn't this what a COM Interface does - or at least a desce
Am 06.04.2017 10:32 schrieb "Ryan Joseph" :
>
> Does it exist now or has it ever been discussed that a method in TObject
could be called when an instance of an object goes out of scope? It’s
common to clean up objects in a function body after the function exits and
calling a method would be a nice
> On Apr 6, 2017, at 3:45 PM, Tony Whyman
> wrote:
>
> Isn't this what a COM Interface does - or at least a descendent of
> TInterfacedObject?
>
> Tony Whyman
No idea. Examples?
Regards,
Ryan Joseph
___
fpc-pascal maillist - fpc-pascal@
Isn't this what a COM Interface does - or at least a descendent of
TInterfacedObject?
Tony Whyman
MWA
On 06/04/17 09:00, Ryan Joseph wrote:
Does it exist now or has it ever been discussed that a method in TObject could
be called when an instance of an object goes out of scope? It’s common t
Does it exist now or has it ever been discussed that a method in TObject could
be called when an instance of an object goes out of scope? It’s common to clean
up objects in a function body after the function exits and calling a method
would be a nice way to handle this. I think c++ has such a fe
On 05/04/17 17:55, Bart wrote:
> http://docwiki.embarcadero.com/RADStudio/Tokyo/en/Random
>
> "random returns a random number between 0 and abs(num-1)"
>
> IIUC, then Random() shoud always return a positive number.
>
Mmm, I don't think so:
For y := Random(num);
the unsigned value of 'y' will w
25 matches
Mail list logo