Jump to content

Lars Fosdal

Administrators
  • Content Count

    3416
  • Joined

  • Last visited

  • Days Won

    113

Everything posted by Lars Fosdal

  1. I did mean dynamic arrays. My bad.
  2. Off-topic: There is another oddity with enumerations with explicit ordinal values. TEnum = (plough = 5, foo = 9, bar = 14, wtf = 1000); The above is valid, but wtf can't be used in a set. Makes me wonder if it would be better to generally do sets as dynamic arrays, instead of today's implementation of sets. I guess it would be more expensive.
  3. Lars Fosdal

    10.3.1 has been released

    Right you are, @dummzeuch : Problem solved.
  4. Lars Fosdal

    Migration tool: Access is denied

    To where are you trying to save the file?
  5. Lars Fosdal

    10.3.1 has been released

    Now I am suddenly not so happy about the Parnassus integration in 10.3. It murdered my 10.2 Parnassus plugins.
  6. Lars Fosdal

    Property editor - on the finest art

    I think it could be fantastic if it was possible to design custom property lists per class. The first time a class is seen, it could be added to a list of class property configs, with all the props present. In a config dialog somewhere, it could be possible to enable/disable each prop. The filter could even use digits 0..9 to select one of multiple configurations per class. Naturally, if it could be installed with default filters for many of the standard components, that would be nice. I really like the idea - more than I like quick edit. Nice work!
  7. Lars Fosdal

    10.3.1 has been released

    Very odd. I did have 10.3 from November installed and did a reinstall and the uninstall hung at the end. Perhaps I need to redo it 😕 - or wait until the new laptop arrives. I do love that Parnassus Bookmarks and Navigator is included, though!
  8. Lars Fosdal

    10.3.1 has been released

    Installed 10.3.1 using the web installer. Something looks strange. No 10.3.1 mention. Installed update is 10.2 update 2?
  9. He lives at https://twitter.com/uscle?lang=en
  10. How does SourceTree and Github Desktop compare?
  11. Declared: TEnum = (plough, foo, bar, wtf) Test order: [wtf, plough, bar, foo] Looping an Enum Set 1 wtf 5 plough 9 foo 14 bar Looping an Enum Array 1 wtf 5 plough 14 bar 9 foo Press Enter: You are right, @Stefan Glienke -I am so logging off now 😄
  12. Wow, I didn't notice that! And it is not related to declaration order, nor ordinal value. That is a bit disturbing.
  13. The inconsistent behavior between the two variations of enumerated types is another pitfall, I guess.
  14. Off-topic - I actually do reverse for in loops with a custom enumerator which starts on top and decrements instead.
  15. @Uwe Raabe Are you saying that for ix := Low(Array) to High(Array) do begin v := Array[ix]; is predictable - while for v in Array is not predictable ?
  16. I wonder how it behaves if I have a set enumerated type with hard coded ordinal values? Edit Change the declaration to TEnum = (plough = 5, foo = 9, bar = 14, wtf = 1); Now the set behaves just like the array.
  17. Except it is rare to see a TList or any other object structure "hardcoded" in plain sight, while arrays of simple types are not hard to read nor uncommon.
  18. For a list or any other object enumeration interface, I'd agree - but for an open array or a TArray?
  19. It is pretty quick to miss that "detail". They look the same, so unless you really pay attention to the type element type - there is little to tell you that you are looking at a set and not a list.
  20. Code that looks correct, and appear to compile alright, but which doesn't execute well. Can you spot the error? See my blog post for a link to a SCCE. var Handler: THandlerClass; hType: THandlers; begin Broker.Clear; for hType in [foo, bar] do begin case hType of foo: Handler := TFoo.Create; bar: Handler := TBar.Create; end; Broker.AddHandler(Handler.OnHandle); end; end; https://larsfosdal.blog/2019/02/08/delphi-pitfalls-of-anonymous-methods-and-capture/
  21. Lars Fosdal

    Pitfalls of Anonymous methods and capture

    Close, its a Self-Contained Compilable Example, sometimes also called a SSCCE, i.e. a Short SCCE. I'll rewrite the article for better readability.
  22. Is this related to databases?
  23. Lars Fosdal

    Pitfalls of Anonymous methods and capture

    There is one, but you "wasn't about to download some project from a file sharing site" (i.e. a zip file with source code from Google Drive)
  24. Lars Fosdal

    Pitfalls of Anonymous methods and capture

    @David Heffernan If you added me to your Ignore list here on DP, I would be totally fine with that.
×