[fpc-pascal] Some questions regarding language changes in trunk

2014-02-08 Thread leledumbo
> http://wiki.freepascal.org/User_Changes_Trunk#Comparative_operators_can_have_any_result_type Is this a preparation for LINQ-like functionality? > http://wiki.freepascal.org/User_Changes_Trunk#True_and_False_are_not_keywords_anymore With false and true being integer, how could it be used in an

Re: [fpc-pascal] High() and Low() for empty dynamic arrays

2014-02-08 Thread Florian Klämpfl
Am 08.02.2014 18:06, schrieb Jürgen Hestermann: > > Am 2014-02-08 17:40, schrieb Florian Klaempfl: >> >>> You mean I should post thousands of code lines? >> >> Of course not, just a small example as I did. >> > > But for what reason? > It just generates work without benefit. > > If I had doubts

Re: [fpc-pascal] High() and Low() for empty dynamic arrays

2014-02-08 Thread Sven Barth
Am 08.02.2014 18:06 schrieb "Jürgen Hestermann" : > > > Am 2014-02-08 17:40, schrieb Florian Klaempfl: > >> >>> You mean I should post thousands of code lines? >> >> >> Of course not, just a small example as I did. >> > > But for what reason? > It just generates work without benefit. > > If I had d

Re: [fpc-pascal] High() and Low() for empty dynamic arrays

2014-02-08 Thread Jürgen Hestermann
Am 2014-02-08 17:40, schrieb Florian Klaempfl: You mean I should post thousands of code lines? Of course not, just a small example as I did. But for what reason? It just generates work without benefit. If I had doubts about my assumption regarding High and Low I would not have asked my q

Re: [fpc-pascal] High() and Low() for empty dynamic arrays

2014-02-08 Thread Florian Klaempfl
Am 08.02.2014 17:35, schrieb Jürgen Hestermann: > Unfortunatly you posted not a complete example which shows the behaviour but only uncompilable code snippts. > Post always complete examples when discussing strange behaviour. You mean I should post thousands of code lines? Of course not, ju

Re: [fpc-pascal] High() and Low() for empty dynamic arrays

2014-02-08 Thread Michael Van Canneyt
On Sat, 8 Feb 2014, leledumbo wrote: Here: var MyArray : array of longint; begin writeln(low(MyArray)); writeln(high(MyArray)); end. prints 0 -1 Is this (High() on empty dynamic arrays return -1) documented somewhere? It is now, in the system unit documentation for the High() fun

Re: [fpc-pascal] High() and Low() for empty dynamic arrays

2014-02-08 Thread Jürgen Hestermann
Am 2014-02-08 17:05, schrieb Florian Klaempfl: > Here: > var MyArray : array of longint; > begin > writeln(low(MyArray)); > writeln(high(MyArray)); > end. > prints > 0 > -1 Hmm. I was under the impression that both give back zero. But you are right. A closer look showed that the error I got f

Re: [fpc-pascal] High() and Low() for empty dynamic arrays

2014-02-08 Thread leledumbo
> Here: > > var MyArray : array of longint; > > begin >writeln(low(MyArray)); >writeln(high(MyArray)); > end. > > prints > > 0 > -1 Is this (High() on empty dynamic arrays return -1) documented somewhere? -- View this message in context: http://free-pascal-general.1045716.n5.nabble

Re: [fpc-pascal] High() and Low() for empty dynamic arrays

2014-02-08 Thread Florian Klaempfl
Am 08.02.2014 16:56, schrieb Jürgen Hestermann: because otherwise I would get an error in case the length is 0 because Low() and High() both give back 0. The result of both functions is the same as if the array had exact one element. Here: var MyArray : array of longint; begin writeln(low(

[fpc-pascal] High() and Low() for empty dynamic arrays

2014-02-08 Thread Jürgen Hestermann
Some time ago there was a discussion about the data type given back by the "length" function. Several reasons were given for the type beeing a *signed* integer. But what about High() and Low()? Shouldn't they give back signed integers too for the same reasons? Especially, when I have a dynamic a