Re: function parameters: is it possible to pass byref ... while being optional at the same time ?

2021-07-18 Thread someone via Digitalmars-d-learn
On Sunday, 18 July 2021 at 11:04:55 UTC, Adam D Ruppe wrote: On Sunday, 18 July 2021 at 03:52:30 UTC, someone wrote: That being said, one of the things that I felt in love with when I was first exposed to was OOP; with all its pros and cons. Yeah I like a lot about OOP and D's implementation

Re: function parameters: is it possible to pass byref ... while being optional at the same time ?

2021-07-18 Thread Adam D Ruppe via Digitalmars-d-learn
On Sunday, 18 July 2021 at 03:52:30 UTC, someone wrote: That being said, one of the things that I felt in love with when I was first exposed to was OOP; with all its pros and cons. Yeah I like a lot about OOP and D's implementation is one of the nicest out there. Very competent implementation

Re: function parameters: is it possible to pass byref ... while being optional at the same time ?

2021-07-17 Thread Ali Çehreli via Digitalmars-d-learn
On 7/17/21 8:52 PM, someone wrote: > I am a self-taught programmer Same here. > well before college Not here because I had access to a Sinclair Spectrum only in 1985. :/ > I have a degree in electronics engineering Same here. > one of the things that I felt in love with when I was first exp

Re: function parameters: is it possible to pass byref ... while being optional at the same time ?

2021-07-17 Thread someone via Digitalmars-d-learn
On Sunday, 18 July 2021 at 01:49:11 UTC, Brian Tiffin wrote: It's our best hope. Self taught programming is scary. School taught programming is scary. Corporate taught programming is scary. *Practice makes perfect? No, practice makes permanent.* The sanest path forward for the profession

Re: function parameters: is it possible to pass byref ... while being optional at the same time ?

2021-07-17 Thread Ali Çehreli via Digitalmars-d-learn
On 7/17/21 6:49 PM, Brian Tiffin wrote: > *Practice makes perfect? No, practice makes permanent.* One reference for that quote is "Classical Guitar Pedagogy" by Anthony Glise, Chapter Nine--Practicing. ;) Ali

Re: function parameters: is it possible to pass byref ... while being optional at the same time ?

2021-07-17 Thread Brian Tiffin via Digitalmars-d-learn
On Sunday, 18 July 2021 at 00:00:01 UTC, zjh wrote: On Saturday, 17 July 2021 at 22:40:35 UTC, someone wrote: On Saturday, 17 July 2021 at 21:46:38 UTC, Jack Applegame wrote: This must be `Forum Oriented Programming`. It's our best hope. Self taught programming is scary. School taught prog

Re: function parameters: is it possible to pass byref ... while being optional at the same time ?

2021-07-17 Thread zjh via Digitalmars-d-learn
On Saturday, 17 July 2021 at 22:40:35 UTC, someone wrote: On Saturday, 17 July 2021 at 21:46:38 UTC, Jack Applegame wrote: This must be `Forum Oriented Programming`.

Re: function parameters: is it possible to pass byref ... while being optional at the same time ?

2021-07-17 Thread someone via Digitalmars-d-learn
On Saturday, 17 July 2021 at 21:46:38 UTC, Jack Applegame wrote: Just remove `ref`, because in D clasess themselves are references. All refs are goners now; thanks :) !

Re: function parameters: is it possible to pass byref ... while being optional at the same time ?

2021-07-17 Thread someone via Digitalmars-d-learn
On Saturday, 17 July 2021 at 21:02:38 UTC, Adam Ruppe wrote: Why are you using ref here at all? Muscle memory I suppose; objects need to be passed by reference, these are the things I'll need to be re-wired to in D. You probably shouldn't be using it. But if it is legitimately needed you c

Re: function parameters: is it possible to pass byref ... while being optional at the same time ?

2021-07-17 Thread Jack Applegame via Digitalmars-d-learn
On Saturday, 17 July 2021 at 20:49:58 UTC, someone wrote: The following gives me a compiler error when I add the second parameter: is not an lvalue and cannot be modified ```d public bool add( ref classTickerID robjTickerID, ref classExchanges robjExchanges = null /// needing this option

Re: function parameters: is it possible to pass byref ... while being optional at the same time ?

2021-07-17 Thread Adam Ruppe via Digitalmars-d-learn
On Saturday, 17 July 2021 at 20:49:58 UTC, someone wrote: ref classTickerID robjTickerID Why are you using ref here at all? You probably shouldn't be using it. But if it is legitimately needed you can do a pointer instead of ref.

function parameters: is it possible to pass byref ... while being optional at the same time ?

2021-07-17 Thread someone via Digitalmars-d-learn
The following gives me a compiler error when I add the second parameter: is not an lvalue and cannot be modified ```d public bool add( ref classTickerID robjTickerID, ref classExchanges robjExchanges = null /// needing this optional ) { } ``` If I take out the null then the paramete