[fpc-pascal] Re: MacMode More Info

2009-05-11 Thread Pierre Paré



The results of your email command are provided below. Attached is your
original message.

- Results:
   Invalid confirmation string.  Note that confirmation strings expire
approximately 3 days after the initial subscription request.  If your
confirmation has expired, please try to re-submit your original  
request or

message.

- Unprocessed:
   confirm --
- Done.


Darn. Still not member. Not problem since this is my last post. I  
found my answer.


It's been a month , I hadn't had the time to follow up on my original  
question which was

What kind of object is used under Macpas compatibility mode ?

"Object Pascal, Mac style."   didn't say much.   (http://wiki.freepascal.org/Mode_MacPas 
)



Any way I did some trial runs. Here what I found : in Macpas  
compatibilty mode


Objects can not be use as a record ,
objectvariable.field := value ; 
	objectvariable.init ;compile but cause runtime exception  
AccessViolation


Objects need to be dynamicaly created first
	ObjectVariable := new (TObjectType,Init) 	does not compile , compile  
error : type identifier expected


NEW(ObjectVariable) ; ObjectVariable.init ; 
ObjectVariable := TObjectType.Init ; works

They are NOT compatible with (inheritable from) object types from the  
Objects unit :

TMyCollection = object (TCollection) end ;  cause 
compile error
			error 31 mix of different kind (class, object, interface,  
etc isn't allowed


error 37: internal error 200611081
but you can use them
TMyCollection = TCollection ;

They are compatible with class types from Classes unit
TMyCollection = object (TCollection) end ;  works



In conclusion it seems that objects in Macpas mode
are references, pointers and not just records
	represent the Delphi class sementic instead of the Delphi object  
sementic

but use "object" keyword instead of "class"
class methods are not allowed
does not need "virtual" keyword but use "override" keyword.

Is that right ?
Who can I send this post to and ask to add the information to
the Macpas mode Web page 
(http://wiki.freepascal.org/Mode_MacPas)
and the User's manual (7.1 Free Pascal compiler modes)
and the Programmer's manual (Appendix D.6 MAC mode)



___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


[fpc-pascal] Re: MacMode More Info / which compatibility mode and object class type to use with Mac OS X, XCode and Carbon

2009-04-12 Thread Pierre Paré

Thank for you answers and the links

I did subscribe to the list but it seems I needed to complete the  
process with a confirmation.
The FPC list and wiki servers are presently not responding ; my  
confirmation is bouncing back.
I could read some answers with a news reader program but was not able  
to reply.

This message comes from a email program.

With my XCode compiling configuration in MacPas mode
	the "class" keyword doesn't compile but need the TStringList type  
from Classes unit.
	the "object" keyword must be used but doesn't accept TStringList type  
from Objects unit .
	it seem to use dynamic class model with the "object" type keyword  
instead.


can't use class methods and class components ,

I wrongly assumed, since the installation into XCode had made it  
MacMode by default

target build option FPC_COMMON_OPTIONS = -Mmacpas -Sgi
 that it was necessary ;
I understand that ObjFPC has the most complete feature list, combining  
those of FPC and Delphi compatibility modes.
I could remove -MMacPas from the FPC_COMMON_OPTIONS of the target  
proprieties and remplace it with -Mobjfpc.


I still intend to use XCode since it's the prefered IDE to develop on  
Mac and that enventualy I'll want to use Carbon (baby steps) and  
eventualy Cocoa ; I'll probably need to learn ObjC to get there. I'm  
getting myself acquaint with the environment, the framework and the  
IDE  first and get right to programming. I don't want to relearn C/C++/ 
OjbC on top of that but start with something I already know.


If you want to get up to speed on Carbon programming in FPC, I have
some very detailed tutorial/demo programs available from Pascal
Central or on my own Pascal References page.

These are strictly carbon and do not include any object or class
objects.   It also requires macpas mode and the MacOSAll.p unit.

I will eventualy use the Carbon framework.  Is the MacPas mode still a  
choice or is mandatory to use the Carbon framework ?


  the longer version of my thougth process at the end, for short,  
here is the conclusion  ---


Then to eventualy continue to program with Carbon framework, I will  
need to
	to interface smoothly with MacOSAll Carbon framework which is   
compiled MacPas mode,
	encapsulate the procedural nature of the Carbon library in FPC  
objects or classes.


The question becomes then
		Will an objFPC compiled program be able to use the MacPas compiled  
MacOSAll unit  ?
 If it can, I guess I may choose to use either FPC objects or  
classes.  To which the answer seems yes.


But if the MacPas mode is necessary or better to interface with the  
MacPas compiled Carbon framework

or if Carbon does contain objects to be compatible with,
or if I choose to stay in MacPas mode
the question remains : which one does the MacPas compatibility mode  
uses :

static FPC object or dynamic FPC class ,
with base object framework objects Unit of Classes unit
so that my objects remains compatible with the Carbon framework ?

It seems to be implemented as a class type and compatible with units  
that uses class type but uses the object type syntax.


thank you

P.S. Is it my Mail program who send the message in HTML ?


- more thougths -

Does the Carbon framework uses objects. If Carbon uses object type,  
which one
	static or stack allocatable, dynamicly created with NEW handle  
(double) reference, explicitly dereferenced record object type
	dynamicly created with "NEW" , implicitly (handle (double) or  
single ?) reference, implicitly dereferenced class type


I did read the documentation but it is not organized by mode, the  
information are vastly distributed in different manuals and web sites  
and assume prior knowledge of how the different dialects implement  
their objects which I don't have :


	the user's manual has chapters on porting from TP or Delphi but not  
from Mac ; I did find the wiki page on Porting to Mac


	The programer's manual has some information on modes and MacPas mode  
but

seems outdated : use Mac instead of MacPas
much on macros nothing on object model

	The unit reference doesn't specify much which units to use on  
differents platforms and/or modes but the user's manual does but not  
for OS X

It did mention that macpas unit was automaticly used in macpas mode.
	A wiki page did mention that the MacOSAll and universal interfaces  
were available to use but I didn't find the unit. (oh yes there it is  
in the Packages directory)


	The language reference chapters on Objects and Classes insunuate  
about the difference in static object vs dynamic class

but doesn't indicate which is used in different dialect and platform.

	the MacMode wiki page only has the cryptic mention "Object Pascal Mac  
style" which doesn't say much if I don't already know how Mac style  
object is implemented.


I even try to read the RTL units sources but I do not kn

[fpc-pascal] FPC : MacMode more info

2009-04-10 Thread Pierre Paré

Hi

If not the appropriate list for this question, would you redirect the  
request


I installed FPC with XCode on an iMac OS X 10.5
I am not a developer  , I want to get back at programming for fun.
I did not use C++ long enough to learn it. So I chose to use Pascal  
that I learned at the university ,
I know Pascal well enough but have no prior knowledge on the "Mac  
Dialect"

I never used Delphi nor TurboPascal per se.

I would like more complete syntax and implementation infos on the "Mac  
Dialect" in FPC


What is "Object Pascal, Mac style" in FPC :
	which object model : like FPC object and record type or like  
reference FPC class type ,
	which class and methods modifiers can or must or must not be used  
(abstract, class or static, interfaces),

which units may, must or must not be used
for base object TObject : from Object or System unit
for framework : TCollection , TStringList from Object or Class 
unit

Do I need MacMode or will any other mode do ? Can interfaces, generics  
be used ?
Which object model will I need with Carbon librairies. It seems that  
accesing Cocoa is more difficult.


I am having a hard time finding (old) MPW, Think or CodeWarrior Pascal  
references manuals for the Pascal on Macintosh.
Pascal Central has some on general standards references and code banks  
but I didn't find technical language references specific to the Mac. I  
would appreciate some links.


Thank you

Pierre Paré

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal