Dave Millington (personal) 47 Posted Thursday at 09:43 AM Hey folks. Some of you may know I've been working on AI with RemObjects, and that has exposed me to Oxygene significantly. I have been getting a bit of a "wow" reaction. Oxygene can not only load and compile your Delphi projects (via LLVM, natively) but yes -- it has a case statement with strings. You can even use a case statement as an expression, like the existing ternary operator on steroids. https://blogs.remobjects.com/2025/09/10/texas-start-your-photocopiers/ 1 Share this post Link to post
Lajos Juhász 330 Posted Thursday at 10:36 AM Congratulations. Wow you went on a double-dark side? (Remobjects and Pascal instead of that other language). PS. I wonder will Remobjects do anything with Pascal Script in near future? While Delphi is far behind other languages PS is also lagging. Share this post Link to post
Daniel 423 Posted Thursday at 10:39 AM I'm sorry, @Dave, but this subforum was never intended for advertising. Changing companies is part of life, and it's not unusual to go to something like the competition. But honestly, you should be ashamed of your sarcastic blog post. It's in very poor taste and disappointing on a human level. Loyalty seems to have gone out of fashion, unfortunately. Be happy in your new job—but please refrain from advertising in places that are not intended for that purpose. There are subforums for that. 1 Share this post Link to post
david berneda 54 Posted Thursday at 11:53 AM (edited) If it can be of any help, case/switch In my "pet language" allows expressions at each case item. I choose the reserved keyword "when" just for fun, it can be another keyword in one second. https://github.com/davidberneda/Vidi // When. Multiple "ifs" (switch, case) num ::= 5 Console.PutLine(num) when num { < 3 { num:=123 } 4 { num:=456 } // is num equal to 4? <>6 { Console.PutLine('num is not six') } // otherwise else { num *= 7 - 1 } } Console.PutLine(num) // Works with any type when Name { "Jane" { Console.PutLine('Name is Jane') } "Peter" { Console.PutLine('Name is Peter') } // .Length=3 {} // TODO, use members "." } B : Text := 'b' when 'a'+B { "ab" { Console.PutLine('Text ab') } } Edited Thursday at 11:55 AM by david berneda < 3 ended up as a heart love emoji Share this post Link to post
Dave Millington (personal) 47 Posted Thursday at 04:20 PM (edited) 5 hours ago, Daniel said: I'm sorry, @Dave, but this subforum was never intended for advertising. Changing companies is part of life, and it's not unusual to go to something like the competition. But honestly, you should be ashamed of your sarcastic blog post. It's in very poor taste and disappointing on a human level. Loyalty seems to have gone out of fashion, unfortunately. Be happy in your new job—but please refrain from advertising in places that are not intended for that purpose. There are subforums for that. My apologies for seeming sarcastic. I understand why. I also know it's not intended as sarcasm. Text is hard and it's hard to balance the line of making points. I think it is wonderful when Delphi adds features, quite genuinely, and the post said so. I edited to try to help that understanding, but the original said "congratulations", and that is sincere, and I retained that comment. It's hard reading that kind of reply, Daniel, and I don't know what to make of it. I think the best thing is to apologise because it's clear you are offended: and I am sorry for that. Let me pontificate a bit: I worry about language compatibility. There are multiple Pascals out there: Free Pascal, DWScript, etc etc. Yet Pascal is a small language. If Delphi ever added any other feature Oxygene or Free Pascal or anyone else already has, and chose to do so with different, incompatible syntax, that would be a significant statement. I use Python a lot, it gives me the same "feeling" as Delphi when I use it, I have talked about Python a lot to people with quite some enthusiasm, it has a ternary if, and that ternary if is inverted -- that structure is legit, and Delphi could have used it, and then imagine if we had two versions in Pascal! Far better to copy, when it's already been done -- with code existing for years, it's key to keep the same syntax compatible. Equally, there's so much the language could do. When it moves forward, I hope it does so in ways that copy the path that has been led by others. Perhaps that is the message in the blog post: keep going; there's more, follow. I would certainly prefer it's read that way. Please read again, I hope it's gentler. For this forum... that was not the message. I had intended to directly answer a thread about a language feature with a blog post showing a snippet of the language feature the OP asked for. Message: it is possible, look! I fully respect you don't want other implementations mentioned, and will respect that. Edited Thursday at 04:22 PM by Dave Millington (personal) 3 Share this post Link to post
Dave Millington (personal) 47 Posted Thursday at 04:26 PM 4 hours ago, david berneda said: If it can be of any help, case/switch In my "pet language" allows expressions at each case item It is of help actually -- I was feeling quite bad. Your post cheered me up. Would you expand "when" to pattern matching? 1 Share this post Link to post
Dalija Prasnikar 1533 Posted Thursday at 06:49 PM 9 hours ago, Dave Millington (personal) said: Oxygene can not only load and compile your Delphi projects (via LLVM, natively) but yes -- it has a case statement with strings. Oxygene has plenty of features that would be great to have in Delphi. I wanted to have a case statement with strings for years now. I think it was even reported in the old, old Quality Central. If may look like a simple thing but it makes code more readable. Now when we got if expressions, maybe we wil eventually get case with strings, too. 1 Share this post Link to post
Stefan Glienke 2169 Posted Thursday at 08:16 PM 10 hours ago, Dave Millington (personal) said: Oxygene can not only load and compile your Delphi projects (via LLVM, natively) Yeah, sure... Share this post Link to post
Dave Millington (personal) 47 Posted yesterday at 10:11 AM (edited) 13 hours ago, Stefan Glienke said: Yeah, sure... Spring4D does not yet compile. I have to say I'm curious about when it does, to see LLVM-generated code for S4D. Edited yesterday at 10:12 AM by Dave Millington (personal) Share this post Link to post
david berneda 54 Posted 21 hours ago CPascal is another approach, it calls and generates LLVM from Pascal code. Ternary conditional is done C-style using "?" https://github.com/tinyBigGAMES/CPascal Share this post Link to post