www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Semantics of range::put

reply Oliver Kanai <oliverkania googlemail.com> writes:
Hello,
according to my understanding of the "put" method for ranges, which is part of
the output-range interface, the following should work :

private string[] m_arrHalloStrings = ["Hallo", "Du", "Da", "wie", "?"];
m_arrHalloStrings.put("Hallo");

it compiles but does not execute:
the compiler gives the message 

core.exception.AssertError std.array(256): Assertion failure

Best regards, Oliver
Aug 05 2009
next sibling parent Oliver Kanai <oliverkania googlemail.com> writes:
I found out that an "appender" or operator ~= will work,
but still do not understand why put makes the program terminate.

Oliver Kanai Wrote:

 Hello,
 according to my understanding of the "put" method for ranges, which is part of
the output-range interface, the following should work :
 
 private string[] m_arrHalloStrings = ["Hallo", "Du", "Da", "wie", "?"];
 m_arrHalloStrings.put("Hallo");
 
 it compiles but does not execute:
 the compiler gives the message 
 
 core.exception.AssertError std.array(256): Assertion failure
 
 Best regards, Oliver
 
 
Aug 05 2009
prev sibling next sibling parent Oliver Kanai <oliverkania googlemail.com> writes:
I found out that an "appender" or operator ~= will work,
but still do not understand why put makes the program terminate.

Oliver Kanai Wrote:

 Hello,
 according to my understanding of the "put" method for ranges, which is part of
the output-range interface, the following should work :
 
 private string[] m_arrHalloStrings = ["Hallo", "Du", "Da", "wie", "?"];
 m_arrHalloStrings.put("Hallo");
 
 it compiles but does not execute:
 the compiler gives the message 
 
 core.exception.AssertError std.array(256): Assertion failure
 
 Best regards, Oliver
 
 
Aug 05 2009
prev sibling parent Jarrett Billingsley <jarrett.billingsley gmail.com> writes:
On Wed, Aug 5, 2009 at 3:45 AM, Oliver Kanai<oliverkania googlemail.com> wrote:
 Hello,
 according to my understanding of the "put" method for ranges, which is part of
the output-range interface, the following should work :

 private string[] m_arrHalloStrings = ["Hallo", "Du", "Da", "wie", "?"];
 m_arrHalloStrings.put("Hallo");

 it compiles but does not execute:
 the compiler gives the message

 core.exception.AssertError std.array(256): Assertion failure
I can't reproduce this. It works for me. I'm guessing you have an older version of DMD, since with 2.031, std.array.put is no longer on line 256. Try updating.
Aug 05 2009