On 18/01/2010 06:29, Vincent Snijders wrote:
Juha Manninen schreef:
I was already thinking of moving all constants in SynEditKeyCmds and
IDECommands to one unit and changing them to enum type, and then
getting rid of this array and the similar EditorCommandStrs array.
"WriteStr" is able to re
Juha Manninen schreef:
I was already thinking of moving all constants in SynEditKeyCmds and
IDECommands to one unit and changing them to enum type, and then getting rid
of this array and the similar EditorCommandStrs array.
"WriteStr" is able to return the string representation of an enum.
Is
Hi!
>> IDECommandStrs: array[0..198] of TIdentMapEntry = (
>> // search
>> (Value: ecFind; Name: 'ecFind'),
>> (Value: ecFindAgain;Name: 'ecFindAgain'),
>>...
>
> Why create a fixed array for this?
> These items are registered, so you can do:
> ID
On Sun, 10 Jan 2010 18:40:49 +0200
Juha Manninen wrote:
>[...]
> IDECommandStrs: array[0..198] of TIdentMapEntry = (
> // search
> (Value: ecFind; Name: 'ecFind'),
> (Value: ecFindAgain;Name: 'ecFindAgain'),
>...
Why create a fixed array for this
On the zero-lower-bond question: I personally have become totally used
to 0 as a lower bound on arrays and use them all the time.
That reminds me of another problem:
The index type may not only be an integer, it can also be an enumeration type:
type MyEnumeration = (Home,Office,Iland,Remote)
John wrote:
array(0..Some_constant key_word_or_directive ) of
Option 1:
Reads much better as
MyArray: calculated array of TMyType = (value1, value2, ..);
Option 2:
Having the IDE check the length of the array by counting the values and
adjusting the upper bounds constant is a perfect
Doug Chamberlin wrote:
Duncan Parsons wrote:
Must confess, I feel "arr:[0..end] of " makes more sense to me than
use of "var" or "..]" The latter suggests something forgotten or a typo.
I agree that just leaving out the ending limit is against the spirit
of Pascal.
+1
I can live with the s
Doug Chamberlin schrieb:
Must confess, I feel "arr:[0..end] of " makes more sense to me than
use of "var" or "..]" The latter suggests something forgotten or a typo.
I agree that just leaving out the ending limit is against the spirit of
Pascal.
I can live with the syntax of MyArray:[0..var
Duncan Parsons wrote:
Must confess, I feel "arr:[0..end] of " makes more sense to me than use of "var" or
"..]" The latter suggests something forgotten or a typo.
I agree that just leaving out the ending limit is against the spirit of
Pascal.
I can live with the syntax of MyArray:[0..var] o
ilto:kle...@gmail.com]
Sent: 12 January 2010 14:22
To: Lazarus mailing list
Subject: Re: [Lazarus] const array syntax
On Tue, Jan 12, 2010 at 23:59, Paul Ishenin wrote:
> Jürgen Hestermann wrote:
>>
>> That's an issue, yes. Although, in this case the constant "auto"
Paul Ishenin schrieb:
That's an issue, yes. Although, in this case the constant "auto" could
be independend from the keyword "auto". So it would not fail. Instead
constant and array size would not be related in any way (although it
appears like that).
I can't. How compiler will decide whethe
Jürgen Hestermann schrieb:
IDECommandStrs: array[0..*] of TIdentMapEntry = (
IDECommandStrs: array[0..auto] of TIdentMapEntry = (
IDECommandStrs: array[0..end] of TIdentMapEntry = (
I would vote for "auto". But beside finding a good syntax I am not sure
whether it is so easy to implement such
On Tue, Jan 12, 2010 at 23:59, Paul Ishenin wrote:
> Jürgen Hestermann wrote:
>>
>> That's an issue, yes. Although, in this case the constant "auto" could be
>> independend from the keyword "auto". So it would not fail. Instead constant
>> and array size would not be related in any way (although i
Jürgen Hestermann wrote:
That's an issue, yes. Although, in this case the constant "auto" could
be independend from the keyword "auto". So it would not fail. Instead
constant and array size would not be related in any way (although it
appears like that).
I can't. How compiler will decide whethe
IDECommandStrs: array[0..*] of TIdentMapEntry = (
IDECommandStrs: array[0..auto] of TIdentMapEntry = (
IDECommandStrs: array[0..end] of TIdentMapEntry = (
I would vote for "auto".
I wont, since the following would fail:
const
auto = 10;
arr: [1..auto] of Integer = (1, 2, 3);
That's an issu
On tiistai, 12. tammikuuta 2010 00:30:09 Alexander Klenin wrote:
> 1) Proposed syntax seems somewhat suboptimal. Historically, Pascal
> used redundancy and keywords to minimize the chance of errors and
> make diagnostics easier. In that spirit, I think some active indication
> of arbitrary upper bo
Alexander Klenin schrieb:
1) Proposed syntax seems somewhat suboptimal. Historically, Pascal
used redundancy and keywords to minimize the chance of errors and
make diagnostics easier. In that spirit, I think some active indication
of arbitrary upper bound is preferable to a mere omission:
IDEComma
Alexander Klenin schrieb:
1) Proposed syntax seems somewhat suboptimal. Historically, Pascal
used redundancy and keywords to minimize the chance of errors and
make diagnostics easier. In that spirit, I think some active indication
of arbitrary upper bound is preferable to a mere omission:
IDECo
Alexander Klenin schrieb:
const
IDECommandStrs: array[0..] of TIdentMapEntry = (
So what about semantics. The semantics here is that you don't need to define
the upper bound for a const array.
Althoug I agree with Juha that in general, it is a good idea to free programmer
from the burden of
On Tue, Jan 12, 2010 at 1:30 AM, Alexander Klenin wrote:
>
> 1) Proposed syntax seems somewhat suboptimal. Historically, Pascal
> used redundancy and keywords to minimize the chance of errors and
> make diagnostics easier. In that spirit, I think some active indication
> of arbitrary upper bound i
Alexander Klenin wrote:
3) Finally, regardless of the preceeding discussion, that
IDECommandStrs array seems
like a tiresome and pointless exercise in code duplication. Why not use
function IDECommandStr(ec: TIdentMapEntry): String;
begin
WriteStr(ec, Result);
end;
instead?
Maybe it was n
On Mon, Jan 11, 2010 at 02:40, Juha Manninen wrote:
> Earlier in this thread you gave support for this new syntax:
>
> const
> IDECommandStrs: array[0..] of TIdentMapEntry = (
>
> So what about semantics. The semantics here is that you don't need to define
> the upper bound for a const array.
Al
On sunnuntai, 10. tammikuuta 2010 15:53:34 Hans-Peter Diettrich wrote:
> dmitry boyarintsev schrieb:
> >> At least the error message could mention the actual number of entries,
> >> as found in source code. This doesn't require any change to the language
> >> or compiler, only an change to the erro
23 matches
Mail list logo