for..in loops?

classic Classic list List threaded Threaded
27 messages Options
12
Reply | Threaded
Open this post in threaded view
|

Re: for..in loops?

Marco van de Voort
> >>>never used them.
> >
> >
> > That's because they are quite limited if you have dynamic, non garbage collected
> > objects.
>
> Why? Use them with interfaces if you need garbage collection and it
> works perfectly.

Because that is not the same. A fully GC language can optimize a lot of
overhead away. GC duck-taped on a native language is not pretty useful. See
the only big experiment that uses interfaces this way: decal and its
abmyssal performance.

One can discuss if it comes back to native level as the .NET and Java
advocatist claim ( I don't), but no matter what you think about that
subject, native-with-gc is worse.
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: for..in loops?

Florian Klämpfl
Marco van de Voort wrote:

>>>>>never used them.
>>>
>>>
>>>That's because they are quite limited if you have dynamic, non garbage collected
>>>objects.
>>
>>Why? Use them with interfaces if you need garbage collection and it
>>works perfectly.
>
>
> Because that is not the same. A fully GC language can optimize a lot of
> overhead away. GC duck-taped on a native language is not pretty useful. See

With C++ you end also with ref. counted types in the best case. You
can't do it better. The reason why interfaces are used that those are
the only automated types which can be used to do everything. GC is
something completely different. I don't consider interfaces or
ansistring garbage collected.

> the only big experiment that uses interfaces this way: decal and its
> abmyssal performance.

That's something completely different. Decal's performance is so bad
because it has no templates.

>
> One can discuss if it comes back to native level as the .NET and Java
> advocatist claim ( I don't), but no matter what you think about that
> subject, native-with-gc is worse.
> _______________________________________________
> fpc-pascal maillist  -  [hidden email]
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal
>

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: for..in loops?

Dean Zobec
In reply to this post by Marco van de Voort
Marco van de Voort wrote:

>>Lukas Gebauer wrote:
>>    
>>
>
>  
>
>>>Look to next Pascal language enhancements
>>>in Delphi-2006... (like operator overloads or class variables...)
>>>we already have them in free pascal for a couple of years iirc and I've
>>>never used them.
>>>      
>>>
>
>That's because they are quite limited if you have dynamic, non garbage collected
>objects.
>
>For .NET that is no problem, since the objects are GCed, and for C++ they are static.
>
>But for native Delphi, there is no good solution to do OO without a thick
>helper layer.
>
>  
>
I remember I've successfully used them with refcounted interfaces in a demo
see
http://www.freepascal.org/cgi-bin/viewcvs.cgi/trunk/fcl/fpcunit/exampletests/money.pp

but still doing
a + b or a.add(b) it's not that different and maybe the second is clearer;

Ciao, Dean

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: for..in loops?

Marco van de Voort
In reply to this post by Marc Santhoff
> Am Sonntag, den 20.11.2005, 21:54 +1100 schrieb Moz:
> If you really need some new statement types you can
>
> - make patches for the compiler
> - or use a preprocessor
> - or use Smalltalk/Java/Eiffel/Python/Ruby (if you like Pascal better
> then ASM)
>
> If you'd ask me: My wish would be to see fpc compiling programmes for
> the BlackFin-CPUs and for the ECOS2 operating system, can this be
> implemented, please? ;)

Sure it can be implemented, and we are anxiously awaiting your patches.
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: for..in loops?

Mark Andrews-3
In reply to this post by Marc Santhoff
Marc Santhoff wrote:

>
>If you'd ask me: My wish would be to see fpc compiling programmes for
>the BlackFin-CPUs and for the ECOS2 operating system, can this be
>implemented, please? ;)
>
>Marc
>

So  the number of users of fpc is extended by two? three at most? :-)

Mark
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: for..in loops?

Peter Vreman
In reply to this post by Vincent Snijders
At 14:04 20-11-2005, you wrote:

>Florian Klaempfl wrote:
>>Lukas Gebauer wrote:
>>>enhancements in Delphi-2006... (like operator overloads or class
>>>variables...)
>>
>>... which has fpc for years :)
>
>I didn't know that. How do I declare a class variable in fpc?
>
>like this?
>type
>   MyClass = class(TComponent)
>   private
>     class FClassVar: integer;
>     FFieldVar: integer;
>   end;

FClassVar:integer;static;

And compile with -St


Peter

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: for..in loops?

Vincent Snijders
Peter Vreman wrote:

> At 14:04 20-11-2005, you wrote:
>
>> Florian Klaempfl wrote:
>>
>>> Lukas Gebauer wrote:
>>>
>>>> enhancements in Delphi-2006... (like operator overloads or class
>>>> variables...)
>>>
>>>
>>> ... which has fpc for years :)
>>
>>
>> I didn't know that. How do I declare a class variable in fpc?
>>
>> like this?
>> type
>>   MyClass = class(TComponent)
>>   private
>>     class FClassVar: integer;
>>     FFieldVar: integer;
>>   end;
>
>
> FClassVar:integer;static;
>
> And compile with -St

Florian told me the right syntax.
I used {$static on}.

See
http://www.freepascal.org/bugs/showrec.php3?ID=4528
and
http://www.freepascal.org/bugs/showrec.php3?ID=4529

Vincent.
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
12