[Mono-list] PDF Creaation Library for Mono

2004-10-17 Thread mono-list . 1 . tracyanne
What I would like to know is how did you get iTextSharp to compile under
Mono. I've used it and compiled it successfully under .NET, but never
Mono.

When I attempt to compile it under Mono (Mono 1.0.2) I get the following
error messafges


[Task:File=/home/tracy/Mono/iTS4/iTextSharp/text/rtf/RtfRow.cs,
Line=222, Column=-1, Type=Error, Description=Expecting `;'(CS1002)


[Task:File=/home/tracy/Mono/iTS4/iTextSharp/text/pdf/PdfGraphics.cs,
Line=387, Column=-1, Type=Error, Description=The container
`com.lowagie.text.pdf.PdfGraphics2D' already contains a definition for
`transform'(CS0102)


[Task:File=/home/tracy/Mono/iTS4/iTextSharp/text/pdf/PdfGraphics.cs,
Line=587, Column=-1, Type=Error, Description=The container
`com.lowagie.text.pdf.PdfGraphics2D' already contains a definition for
`clip'(CS0102)


But I am unable to find anything wrong with the code.






On Mon, Oct 04, 2004 at 06:25:14PM -0700, tracy Anne scribbled:
> I've been using ITextSharp> http://itextsharp.sourceforge.net/>=20>
http://sourceforge.net/projects/itextsharp/>=20> but I notice that there
has been no work done on it> for some time.After posting my second mail,
I've come across this:

http://sharppdf.sourceforge.net/

it compiled with mono without any problems - seems to be quite feature
complete and actively maintained :)

regards,

marek


-- 
Regards

Tracy Barlow

TracyAnne Software
Phone:  07 4124 5092
Mobile: 0416 00 38 61
Web:www.tracyannesoftware.net/
___
Mono-list maillist  -  [EMAIL PROTECTED]
http://lists.ximian.com/mailman/listinfo/mono-list


Re: [Mono-list] Can mono can be made case insensitive.

2004-10-17 Thread Antony Lesuisse
Jonathan Pryor <[EMAIL PROTECTED]> [041016]:
> On Fri, 2004-10-15 at 08:24, Lokesh N wrote:
> > If so can mono be made case insensitive
> 
> Not likely.  At least, not efficiently.  On a case-sensitive
> file-system, Mono would need to try every permutation of a filename to
> see if it exists, e.g.
> 
>   admin
>   Admin
>   aDmin
>   adMin
>   ...
> 
> There are 2^5 (32) such permutations.  It gets worse as the length of
> the filename increase, and this is *not* something we'd want to do when
> accessing every file in the system.

What about listing the complete directory and growing an Hashtable with
keys="lowercase name" and value="original name" ?  I think samba and
wine do something similar.

The default mode has to be case sensitive, but a --case-insensistive
mode for mono would probably be useful to run uncareful closed-source
assemblies.

> It's far faster for you to correct case-sensitivity issues in your code.

-- 
Antony Lesuisse
___
Mono-list maillist  -  [EMAIL PROTECTED]
http://lists.ximian.com/mailman/listinfo/mono-list


Re: [Mono-list] Cross platform app on usb drive

2004-10-17 Thread Dmitry Kostenko

I have tried something similar, but on Windows only. It worked.
For quick testing you can make use of SUBST'ed drives in Windows.
e.g. You create a drive as
> mkdir D:\env1
> subst S: D:\env
and install Mono onto it.
Now you can 'hide' installed mono by 
> Subst S: /D

Let's pretend you make a distribution onto drive Z:
You clean drive Z:
Install mono into Z:\mono
Fix the .BAT files and remove all references to Z: from them.
Now mono works on Z: only by starting \Mono\mono
Copy you application into Z:\YourApp
Put .bat file into root:
@cd \YouApp
@\mono\mono YouApp.exe

To test whether installation is drive-independent (on Windows) you can
use different substed drive letters.

Under Linux it should be easy too: 
Let's pretend, that your mountpoint it /mnt/flash (which is the same as
Z:\ under Windows).
Package mono-linux into /mnt/flash/mono-linux.
Put startup .sh script into /mnt/flash 
#!/bin/sh

# WD is rooted path to working directory/mount point
WD=`basename $0`
if [ -z "$WD" ] ; then WD=`which $0`; fi
if [ "$WD" = "./" ]; then WD=$PWD; fi

export LD_LIBRARY_PATH=$WD/mono-linux/lib
export MONO_PATH=$WD/mono-linux/lib:$WD/mono-linux/lib/mono/1.0:
$WD/mono-linux/lib/mono/gtk-sharp

$WD/mono-linux/bin/mono $WD/YourApp/YourApp.exe $*
___
Mono-list maillist  -  [EMAIL PROTECTED]
http://lists.ximian.com/mailman/listinfo/mono-list


Re: [Mono-list] Gtk-sharp and mono

2004-10-17 Thread Dmitry Kostenko
On Thursday 14 October 2004 21:27, Butler, Jennifer M. wrote:
> All -
>
[Skipped]
>
> (:2120): libglade-WARNING **: unknown property `decorated' for
> class `G
> tkWindow'
>
Most probably you use Gtk+ 2.4 or newer under Linux (You should have with 
Glade 2.6.x).
And AFAIK Gtk# officially supports (and is distributed with) Gtk+ 2.2, which 
does not support those classes or properties.

[skipped]
>
>
> And then the program throws a NullReferenceException and quits
> (System.NullReferenceException: Object reference not set to an instance of
> an object)
>
Most probably you have declared a Gtk.ToolButton widget in your window, and 
you reference it in the code. And since Gtk+ 2.2 does not have such class, 
your widget pointer is initialized with null, and that's why you receive the 
exception.
>
> So, how can I fix this problem? Do I need different Mono / Gtk / Glade
> versions?
Either use Glade compatible with Gtk+ 2.2 (I use Glade 1.1.3). Or get Gtk+ 2.4 
binaries from sf.net (see http://sf.net/projects/gaim ;) ).

-- 
Dmitry Kostenko
.NET Developer
Registered Linux User #286813
___
Mono-list maillist  -  [EMAIL PROTECTED]
http://lists.ximian.com/mailman/listinfo/mono-list


Re: [Mono-list] [Off-topic] "if else" or "switch" ?

2004-10-17 Thread Marcus
I will try to dig up the tests or to recreate them.

You are probably correct that this is not a very large problem in practice. As 
I recall, I had to make the number of iterations quite large to see a 
substantial difference in time.

On the other hand, I did this test because I have a program that needs to 
perform a large number of three-way decisions like this.

Marcus


On Sunday 17 October 2004 9:45 am, Paolo Molaro wrote:

> We may add the code to turn a switch with less than 3-4 destinations
> to a if/else sequence, but I'm not sure if this is really a speed
> problem in practice. Marcus reported behaviour may be due to different IL
> code generated by the compiler: I'd like to see the actual IL code
> to determine what actually caused the performance issue he reported.

___
Mono-list maillist  -  [EMAIL PROTECTED]
http://lists.ximian.com/mailman/listinfo/mono-list


Re: [Mono-list] ByteFX.Data.Mysql....

2004-10-17 Thread clemente tort
My Mysql version is 4.0 and the string that I use is:

"Server=localhost; Database=test; User ID=root; Password=;"

The one that I found in go-mono.

Thanks :D

On Sun, 17 Oct 2004 11:03:00 -0500, Reggie Burnett <[EMAIL PROTECTED]> wrote:
> What version of MySQL are you trying to connect to and what connection
> string are you using?
> 
> -reggie
> 
> 
> 
> > -Original Message-
> > From: [EMAIL PROTECTED] [mailto:mono-list-
> > [EMAIL PROTECTED] On Behalf Of clemente tort
> > Sent: Saturday, October 16, 2004 6:48 PM
> > To: [EMAIL PROTECTED]
> > Subject: [Mono-list] ByteFX.Data.Mysql
> >
> > Hi,
> > Im new in mono, and I would like contributing on source community
> > developing software :D. Well I have a little problem (I hope) using
> > the bitefx libraries for mysql. In the web www.go-mono.com I could get
> > some info about mysql on mono, I tryed to do a little program
> > connecting to mysql, but I get some errors, I thought that I was the
> > problem :) so i tryed with the  > href="http://www.go-mono.com/mysql.html";>example from go-mono web,
> > but I get the same error:
> >
> > Unhandled Exception: ByteFX.Data.MySqlClient.MySqlException: Unable to
> > connect to any of the specified MySQL hosts
> > in [0x00056] (at
> >
> /home/brandon/work/mcs-1.0.1/class/ByteFX.Data/mysqlclient/Driver.cs:102
> )
> > ByteFX.Data.MySqlClient.Driver:Open
> > (ByteFX.Data.MySqlClient.MySqlConnectionString)
> > in [0x00017] (at
> > /home/brandon/work/mcs-
> > 1.0.1/class/ByteFX.Data/mysqlclient/ConnectionInternal.cs:106)
> > ByteFX.Data.MySqlClient.MySqlInternalConnection:Open ()
> > in [0x0005a] (at
> > /home/brandon/work/mcs-
> > 1.0.1/class/ByteFX.Data/mysqlclient/MySqlPool.cs:95)
> > ByteFX.Data.MySqlClient.MySqlPool:CreateNewPooledConnection ()
> > in [0x000fa] (at
> > /home/brandon/work/mcs-
> > 1.0.1/class/ByteFX.Data/mysqlclient/MySqlPool.cs:72)
> > ByteFX.Data.MySqlClient.MySqlPool:GetPooledConnection ()
> > in [0x00020] (at
> > /home/brandon/work/mcs-
> > 1.0.1/class/ByteFX.Data/mysqlclient/MySqlPool.cs:126)
> > ByteFX.Data.MySqlClient.MySqlPool:GetConnection ()
> > in [0x00061] (at
> > /home/brandon/work/mcs-
> > 1.0.1/class/ByteFX.Data/mysqlclient/MySqlPoolManager.cs:48)
> > ByteFX.Data.MySqlClient.MySqlPoolManager:GetConnection
> > (ByteFX.Data.MySqlClient.MySqlConnectionString)
> > in [0x00035] (at
> > /home/brandon/work/mcs-
> > 1.0.1/class/ByteFX.Data/mysqlclient/Connection.cs:304)
> > ByteFX.Data.MySqlClient.MySqlConnection:Open ()
> >
> > I dont know what I did wrong, I have the mysql server running ok (I
> > can access it from other applications), what I could do bad was
> > installing the drivers (I installed them in /usr/lib).
> >
> > I hope you can help me. Thanks :D
> >
> > PS:
> > Sry for my english but i'm spanish ;)
> > --
> > Si una piedra cae sobre un huevo, mala suerte para el huevo
> > Si un huevo cae sobre una piedra, mala suerte para el huevo
> > ___
> > Mono-list maillist  -  [EMAIL PROTECTED]
> > http://lists.ximian.com/mailman/listinfo/mono-list
> 
> 


-- 
Si una piedra cae sobre un huevo, mala suerte para el huevo
Si un huevo cae sobre una piedra, mala suerte para el huevo
___
Mono-list maillist  -  [EMAIL PROTECTED]
http://lists.ximian.com/mailman/listinfo/mono-list


Re: [Mono-list] Where is glib-sharp?

2004-10-17 Thread Sergio Paracuellos
El vie, 15-10-2004 a las 19:51 -0600, Kevin White escribió:
> I am trying to compile the example from
> http://www.gotmono.com/docs/gnome/bindings/gtk-sharp/packingdemonstrationprogram.html
> to learn how to use GTK# and am having a problem.
> 
> When I type:
> mcs -pkg:gtk-sharp,glib-sharp -r:System.Drawing packer.cs I get errors
> that the glib-sharp.pc cannot be found (indeed this does not exist on
> my system, though glib-sharp files exist in the gac).

Have you instaled devel libraries of glib-dev? (I don't know what is the
exactly name). Devel libraries of packages have the .pc files you need
for compile some gtk-sharp programs. If you have installed the libraries
and the problem continues, you can try to set the PKG_CONFIG_PATH
variable with the directory pkgconfig where are .pc files.

echo $PKG_CONFIG_PATH
/usr/local/lib/pkgconfig/:/lib/pkgconfig

Good Luck!

Sergio
> ___
> Mono-list maillist  -  [EMAIL PROTECTED]
> http://lists.ximian.com/mailman/listinfo/mono-list


signature.asc
Description: Esta parte del mensaje =?ISO-8859-1?Q?est=E1?= firmada	digitalmente


RE: [Mono-list] Problem with xml.Serialization

2004-10-17 Thread Sergio Paracuellos
Thank you very much for the example. 

Now, I solve de problem but I have had to solve a bug of mcs too. 

http://bugzilla.ximian.com/show_bug.cgi?id=61358

Regards,

Sergio

El vie, 15-10-2004 a las 11:10 +0200, RoBiK escribió:
> Hi,
> 
> I see another problem here. It is not an good idea to derive from ArrayList,
> because the XmlSerializer has special handling for ArrayList and also
> classes that derive from it. Instead you should Package the ArrayList indo
> another class (this may be for example a custom collection type).
> The second thing you need to do is to tell the serializer if there are any
> instances of custom objets, that you are inserting into the ArrayList. This
> is done by the XmlInclude attribute.
> Try this example:
> 
> using System;
> using System.Collections;
> using System.IO;
> using System.Xml.Serialization;
> using System.Text;
> namespace XmlSerializationTest
> {
> class Program
> {
> static void Main(string[] args)
> {
> Subject subject = new Subject();
> subject.name = "Subject Name";
> subject.comment = "Subject Comment";
> SubjectList subjectList = new SubjectList();
> subjectList.subject = subject;
> subjectList.list.Add("Test");
> subjectList.list.Add(123);
> CustomObject co = new CustomObject();
> co.customString = "Custom String";
> subjectList.list.Add(co);
> XmlSerializer serializer = new
> XmlSerializer(typeof(SubjectList));
> StringBuilder sb = new StringBuilder();
> StringWriter sw = new StringWriter(sb);
> serializer.Serialize(sw, subjectList);
> Console.WriteLine(sb.ToString());
> Console.ReadLine();
> }
> }
> [XmlInclude(typeof(CustomObject))]
> public class SubjectList
> {
> public Subject subject;
> public ArrayList list;
> public SubjectList()
> {
> list = new ArrayList();
> }
> }
> public class Subject
> {
> public string name;
> public string comment;
> }
> public class CustomObject
> {
> public string customString;
> }
> }
> 
> Robert
> 
> -Original Message-
> From: Sergio Paracuellos [mailto:[EMAIL PROTECTED] 
> Sent: Donnerstag, 14. Oktober 2004 16:03
> To: RoBiK
> Cc: [EMAIL PROTECTED]
> Subject: RE: [Mono-list] Problem with xml.Serialization
> 
> El jue, 14-10-2004 a las 15:42 +0200, RoBiK escribió:
> > As the error message says: The type gorganizer.Subject was not 
> > expected. Use the XmlInclude or SoapInclude attribute to specify types 
> > that are not known statically.
> > You are assinging an instance of type gorganizer.Subject to a "obj" 
> > variable of type object. When the serializer tries to serialize this 
> > variable, it finds that this is not an instance of type object but 
> > something it did not expected. So either use the XmlInlude attribude 
> > to tell the serializer what to expect, or rework your code to use another
> aproach.
> > 
> > Robert
> 
> If I change the list to work with "Subject" the error is the same.
> 
> Could you put me an example of how to say the serializer what I want to
> serialize? 
> 
> Thanks!
> 
> > 
> > 
> > 
> > -Original Message-
> > From: [EMAIL PROTECTED] 
> > [mailto:[EMAIL PROTECTED] On Behalf Of Sergio 
> > Paracuellos
> > Sent: Donnerstag, 14. Oktober 2004 15:27
> > To: [EMAIL PROTECTED]
> > Subject: [Mono-list] Problem with xml.Serialization
> > 
> > Hi!
> > 
> > I'm doing an application and I need to serialize in xml a list of 
> > objects. I get the following error:
> > 
> > Unhandled Exception: System.InvalidOperationException: The type 
> > gorganizer.Subject was not expected. Use the XmlInclude or SoapInclude 
> > attribute to specify types that are not known statically.
> > in <0x001d0>
> > System.Xml.Serialization.XmlSerializationWriter:WriteTypedPrimitive
> > (string,string,object,bool)
> > in <0x00380>
> > System.Xml.Serialization.XmlSerializationWriterInterpreter:WriteObject
> > (System.Xml.Serialization.XmlTypeMapping,object,string,string,bool,boo
> > l,bool
> > )
> > in <0x00ca0>
> > System.Xml.Serialization.XmlSerializationWriterInterpreter:WriteMember
> > Elemen t (System.Xml.Serialization.XmlTypeMapElementInfo,object)
> > in <0x004f8>
> > System.Xml.Serialization.XmlSerializationWriterInterpreter:WriteListCo
> > ntent 
> > (System.Xml.Serialization.TypeData,System.Xml.Serialization.ListMap,ob
> > ject,S
> > ystem.Text.StringBuilder)
> > in <0x0024c>
> > System.Xml.Serialization.XmlSerializationWriterInterpreter:WriteListEl
> > ement
> > (System.Xml.Serialization.XmlTypeMapping,object,string,string)
> > in <0x0050c>
> > System.Xml.Serialization.XmlSerializationWriterInterpreter:WriteObject
> > (System.Xml.Serialization.XmlTypeMapping,object,string,string,bool,boo
> > l,bool
> > )
> > in <0x001c0>
> > System.Xml.Serializat

Re: [Mono-list] ToTitleCase

2004-10-17 Thread Rob Brown-Bayliss




On Thu, 2004-10-14 at 17:09 -0400, Miguel de Icaza wrote:




Thanks for pointing this out, a fix is on CVS.



No, I believe it is I who should be thanking you.  Thank you.




--



Rob Brown-Bayliss







"We train our children to drop fire on people, but we won't let them write 'fuck' on
the sides of their airplanes, because it's obscene."
Colonel Kurtz (Marlon Brando) in Apocalypse Now.















Re: [Mono-list] Where is monodis?

2004-10-17 Thread Duncan Mak
On Fri, 2004-10-15 at 08:52 -0600, Kevin White wrote:
> I have mono 1.0.2 installed on my laptop, and have seen references to
> "monodis" in the man pages, but cannot find the referenced monodis
> tool.  Is it no longer shipping?  Replaced by some other disassembly
> tool?
> 
> What is the best analog to Microsoft's ildasm tool?
> 

It's part of the mono-core-devel package.

-- 
Duncan Mak <[EMAIL PROTECTED]>
___
Mono-list maillist  -  [EMAIL PROTECTED]
http://lists.ximian.com/mailman/listinfo/mono-list


Re: [Mono-list] Cross platform app on usb drive

2004-10-17 Thread Miguel de Icaza
Hello,

> My company is looking to develop a lightweight application that would 
> run completely on a usb drive. We want to be able to plug the usb drive 
> in and run the app without having to go through any kind of install 
> process. We want it to be cross platform and we are considering using 
> mono/.NET to build it. My question is can we package the runtime so 
> that it will run on the drive or does the have to be installed native 
> to the machine? Does anyone have experience with anything like this?

In the case of .NET it has to be installed in the machine.

With Mono it is possible to run from the drive.
___
Mono-list maillist  -  [EMAIL PROTECTED]
http://lists.ximian.com/mailman/listinfo/mono-list


Re: [Mono-list] Where is monodis?

2004-10-17 Thread Miguel de Icaza
> I have mono 1.0.2 installed on my laptop, and have seen references to
> "monodis" in the man pages, but cannot find the referenced monodis
> tool.  Is it no longer shipping?  Replaced by some other disassembly
> tool?
> 
> What is the best analog to Microsoft's ildasm tool?

It might be on a separate package, but its part of the standard mono
tarball source distribution.
___
Mono-list maillist  -  [EMAIL PROTECTED]
http://lists.ximian.com/mailman/listinfo/mono-list


RE: [Mono-list] ByteFX.Data.Mysql....

2004-10-17 Thread Reggie Burnett
What version of MySQL are you trying to connect to and what connection
string are you using?

-reggie

> -Original Message-
> From: [EMAIL PROTECTED] [mailto:mono-list-
> [EMAIL PROTECTED] On Behalf Of clemente tort
> Sent: Saturday, October 16, 2004 6:48 PM
> To: [EMAIL PROTECTED]
> Subject: [Mono-list] ByteFX.Data.Mysql
> 
> Hi,
> Im new in mono, and I would like contributing on source community
> developing software :D. Well I have a little problem (I hope) using
> the bitefx libraries for mysql. In the web www.go-mono.com I could get
> some info about mysql on mono, I tryed to do a little program
> connecting to mysql, but I get some errors, I thought that I was the
> problem :) so i tryed with the  href="http://www.go-mono.com/mysql.html";>example from go-mono web,
> but I get the same error:
> 
> Unhandled Exception: ByteFX.Data.MySqlClient.MySqlException: Unable to
> connect to any of the specified MySQL hosts
> in [0x00056] (at
>
/home/brandon/work/mcs-1.0.1/class/ByteFX.Data/mysqlclient/Driver.cs:102
)
> ByteFX.Data.MySqlClient.Driver:Open
> (ByteFX.Data.MySqlClient.MySqlConnectionString)
> in [0x00017] (at
> /home/brandon/work/mcs-
> 1.0.1/class/ByteFX.Data/mysqlclient/ConnectionInternal.cs:106)
> ByteFX.Data.MySqlClient.MySqlInternalConnection:Open ()
> in [0x0005a] (at
> /home/brandon/work/mcs-
> 1.0.1/class/ByteFX.Data/mysqlclient/MySqlPool.cs:95)
> ByteFX.Data.MySqlClient.MySqlPool:CreateNewPooledConnection ()
> in [0x000fa] (at
> /home/brandon/work/mcs-
> 1.0.1/class/ByteFX.Data/mysqlclient/MySqlPool.cs:72)
> ByteFX.Data.MySqlClient.MySqlPool:GetPooledConnection ()
> in [0x00020] (at
> /home/brandon/work/mcs-
> 1.0.1/class/ByteFX.Data/mysqlclient/MySqlPool.cs:126)
> ByteFX.Data.MySqlClient.MySqlPool:GetConnection ()
> in [0x00061] (at
> /home/brandon/work/mcs-
> 1.0.1/class/ByteFX.Data/mysqlclient/MySqlPoolManager.cs:48)
> ByteFX.Data.MySqlClient.MySqlPoolManager:GetConnection
> (ByteFX.Data.MySqlClient.MySqlConnectionString)
> in [0x00035] (at
> /home/brandon/work/mcs-
> 1.0.1/class/ByteFX.Data/mysqlclient/Connection.cs:304)
> ByteFX.Data.MySqlClient.MySqlConnection:Open ()
> 
> I dont know what I did wrong, I have the mysql server running ok (I
> can access it from other applications), what I could do bad was
> installing the drivers (I installed them in /usr/lib).
> 
> I hope you can help me. Thanks :D
> 
> PS:
> Sry for my english but i'm spanish ;)
> --
> Si una piedra cae sobre un huevo, mala suerte para el huevo
> Si un huevo cae sobre una piedra, mala suerte para el huevo
> ___
> Mono-list maillist  -  [EMAIL PROTECTED]
> http://lists.ximian.com/mailman/listinfo/mono-list

___
Mono-list maillist  -  [EMAIL PROTECTED]
http://lists.ximian.com/mailman/listinfo/mono-list


Re: [Mono-list] [Off-topic] "if else" or "switch" ?

2004-10-17 Thread Paolo Molaro
On 10/17/04 Michal Moskal wrote:
> > No, I don't think that it's a completely a runtime issue. There are at least 
> > three fundamentally-different mechanisms for handling a switch statement, 
> > including hashing, binary search, and a linear if/else. With CIL, there is 
> > the further complication of using the switch instruction versus the compare 
> > and branch sequences.
> 
> However, when you have switch in the CIL, it's up to the JIT how to handle
> it. And choosing between the if-else and the jump-table implementation
> can be machine dependent, performance wise.

It's also cpu-dependent: some processors may not do branch prediction
with indirect branches generated by a switch, but they do it with
conditional branches generated with if/else.
We may add the code to turn a switch with less than 3-4 destinations
to a if/else sequence, but I'm not sure if this is really a speed 
problem in practice. Marcus reported behaviour may be due to different IL code 
generated by the compiler: I'd like to see the actual IL code
to determine what actually caused the performance issue he reported.

lupus

-- 
-
[EMAIL PROTECTED] debian/rules
[EMAIL PROTECTED] Monkeys do it better
___
Mono-list maillist  -  [EMAIL PROTECTED]
http://lists.ximian.com/mailman/listinfo/mono-list


Re: [Mono-list] Enum problem

2004-10-17 Thread Iain McCoy
On Sat, 2004-10-16 at 10:53 -0700, gennady wexler wrote:
> On 10/16/04 4:33 AM, "Iain McCoy" <[EMAIL PROTECTED]> wrote:
> 
> > On Sat, 2004-10-16 at 13:17 +0200, Francis Brosnan Blázquez wrote:
> >> Hi.
> >> 
> >> Working with enumerations I've found an strange behaviour. If you
> >> compile the following source code and run it:
> >> 
> >> --
> >> using System;
> >> 
> >> public class EnumTest {
> >> 
> >> public enum TipoCarga {
> >> Positivo = 1/3,
> >> Negativo = 1 + (1/3),
> >> Neutro   = 1,
> >> }
> 
> > suspect what you're seeing is the compiler automatically coercing all of
> > your enum values to ints. This means that 1/3 = 0, so 1 + 1/3 = 0 and
> 
> if 1/3 is 0 then how would 1 + 1/3 be 0 too?
blargh, sorry, not thinking straight. What I meant was 1 + 1/3 = 1. I
believe I was right on the big-picture stuff, I just stuffed up a number
in the example.

Sorry,
-- 
Iain McCoy <[EMAIL PROTECTED]>

___
Mono-list maillist  -  [EMAIL PROTECTED]
http://lists.ximian.com/mailman/listinfo/mono-list


Re: [Mono-list] [Off-topic] "if else" or "switch" ?

2004-10-17 Thread Michal Moskal
On Sat, Oct 16, 2004 at 07:08:09PM -0500, Marcus wrote:
> On Saturday 16 October 2004 3:53 am, Michal Moskal wrote:
> 
> No, I don't think that it's a completely a runtime issue. There are at least 
> three fundamentally-different mechanisms for handling a switch statement, 
> including hashing, binary search, and a linear if/else. With CIL, there is 
> the further complication of using the switch instruction versus the compare 
> and branch sequences.

However, when you have switch in the CIL, it's up to the JIT how to handle
it. And choosing between the if-else and the jump-table implementation
can be machine dependent, performance wise.

-- 
: Michal Moskal :: http://www.kernel.pl/~malekith :: GCS !tv h e>+++ b++
: ::: Logic is a nice contrast to the Real World. :: UL$ C++ E--- a?
___
Mono-list maillist  -  [EMAIL PROTECTED]
http://lists.ximian.com/mailman/listinfo/mono-list


Re: [Mono-list] [Off-topic] "if else" or "switch" ?

2004-10-17 Thread Michal Moskal
On Sat, Oct 16, 2004 at 07:11:49PM -0500, Marcus wrote:
> On Saturday 16 October 2004 7:20 am, Mike Welham wrote:
> 
> Yes, and in fact, according to the CLI spec, it is difficult for the JIT to 
> determine whether the a tail call can be used when the ldloca and ldarga 
> instructions are involved. 

According to the spec -- it's not. You simply cannot have tailcall if
any ldloca/ldarga are involved. Since then you would have to pass
managed pointer to the called function, which is not permitted in the
verifiable CIL. So the ,,rationale'' for the tail prefix listed there
seems bogus.

> I must admit that I do not quite understand how 
> ldloca and ldarga interact would interact with tail calls.

ld{loc,arg}a loads address of a value in the current stack frame.
Which you're going to destroy with the tail call.

-- 
: Michal Moskal :: http://www.kernel.pl/~malekith :: GCS !tv h e>+++ b++
: ::: Logic is a nice contrast to the Real World. :: UL$ C++ E--- a?
___
Mono-list maillist  -  [EMAIL PROTECTED]
http://lists.ximian.com/mailman/listinfo/mono-list