Jump to content

David Heffernan

Members
  • Content Count

    3513
  • Joined

  • Last visited

  • Days Won

    174

Everything posted by David Heffernan

  1. You are quite wrong. No point freeing it. No point even creating it.
  2. It's not possible. How could it be?
  3. If the goal is to use RTTI then it seems questionable to use compile time generics. Will result in generic bloat. May as well pass the address of the record and the type info. Or if you want to ensure type safety have the generic method call a further helper method that is non-generic and receives the address of the record and the type info. That avoids the bloat and gives benefit of type safety.
  4. How will you use RTTI with this?
  5. David Heffernan

    Pitfalls of Anonymous methods and capture

    It's a typo. Should be SSCCE: http://sscce.org/
  6. David Heffernan

    How to switch condition position?

    The point about the order was to be sure that the condition was evaluated. Consider the two settings for the switch: 1. Left to right, condition is first sub expression, therefore it is evaluated. 2. Complete eval, all sub expressions are evaluated, therefore it is evaluated. QED
  7. David Heffernan

    How to switch condition position?

    You can count on it. http://docwiki.embarcadero.com/RADStudio/Tokyo/en/Expressions_(Delphi)#Complete_Versus_Short-Circuit_Boolean_Evaluation Very surprised you don't know this.
  8. David Heffernan

    How to switch condition position?

    Nothing to do with implementation details. The Python syntax is simply the Python equivalent of the C conditional operator. You know, the operator that is missing from Delphi.
  9. David Heffernan

    Pitfalls of Anonymous methods and capture

    It's an extra step for every one of your readers. In fact it's multiple steps. Down file. Unzip file. One goal of the writer is to make it easier for the reader to see and understand. For instance, if I was on a mobile device how would I read files in a zip file?
  10. David Heffernan

    How to switch condition position?

    That's certainly more concise but it has a completely different meaning. Think about it Rudy.
  11. David Heffernan

    How to switch condition position?

    Seems kind of a waste of time this entire discussion. The language is well documented and is quite concise. The are only a handful of conditional statements. The syntax for if is clear. You have to write the code in the language that is provided to you. Use an if statement. End of story.
  12. David Heffernan

    How to switch condition position?

    So you know the answer
  13. David Heffernan

    How to switch condition position?

    What does the documentation say?
  14. David Heffernan

    Pitfalls of Anonymous methods and capture

    I'd still see all the replies. It's an interesting topic that you raised but it needs a clearer example to bring out the issue.
  15. David Heffernan

    appending to a dynamic array

    The subject is dynamic arrays and not open arrays.
  16. David Heffernan

    Pitfalls of Anonymous methods and capture

    Whatever. The text in the blog post didn't make the types clear. I wasn't about to download some project from a file sharing site. It's quite easy to make a complete program in a simple console app. There must be a few posts on this topic out there already.
  17. David Heffernan

    Pitfalls of Anonymous methods and capture

    If we have no knowledge of the types involved in this code then for sure we can't know what's wrong with it.
  18. David Heffernan

    Should my record be a class instead?

    Nothing in that that suggests there is a need for a global variable.
  19. David Heffernan

    Should my record be a class instead?

    You claim that these global variables "need to be global". Why is that? It would not surprise me if it turned out not to be the case.
  20. Yeah, seriously you should remove this. As far as the question, I guess you need to decide on exactly what you want to implement. Security concerns are seldom as easy as "just add a signature". You see a lot of people who want to implement security without a solid understanding and it usually ends badly.
  21. What is Acrobat doing there? Is it a certificate is the security sense, or is it just an image? Now that we have your signature in the image in this post, can't we sign things and pretend to be you? If I steal your cheque book, can't I sign them now as you?
  22. David Heffernan

    operator overloding Equal vs Multiply

    Methods aren't normal functions by that argument, so why are open array parameters fine for them? The real problem here is the decision to allow literals to have type determined by context. So [10] is either a set or an array. That is incompatible with other language features. Like method and operator overloading. There is a good reason why other languages don't attempt to infer type of literals from context.
  23. David Heffernan

    operator overloding Equal vs Multiply

    In this circumstance, for testing equality, why do you believe that a function is better than an operator?
  24. David Heffernan

    operator overloding Equal vs Multiply

    It feels wrong isn't much of an argument. If open array arguments are fine for functions why not for operators, which are just functions with syntactic sugar. Can you explain your objection with reason, rather than relying on what it feels like. And surely you understand why operators are often preferred to functions.
  25. David Heffernan

    operator overloding Equal vs Multiply

    Operators are functions. There are certainly times when it might be useful to use arrays as operator arguments. I regret that the language designers have allowed literals to have meaning determined by context in various places. When there is insufficient context, as is inevitably the case on occasion, these kind of problems arise.
×