Re: [fpc-pascal] Question on TFPGMap
ppadilcdx--- via fpc-pascal schrieb am Mo., 2. Jan. 2023, 02:29: > Sorry copy and paste error. d = decode. Corrected below. But I think I > see what you mean. Just assigning a type to decode doesn't initialize > it. But the compiler is happy with it, i.e. it doesn't call as illegal > the statement "decode.create". > That is because constructors can also be called as regular methods. But the instance will only be created if you call a constructor using the type. Regards, Sven ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Question on TFPGMap
> On Jan 2, 2023, at 8:29 AM, ppadilcdx--- via fpc-pascal > wrote: > > Sorry copy and paste error. d = decode. Corrected below. But I think I see > what you mean. Just assigning a type to decode doesn't initialize it. But > the compiler is happy with it, i.e. it doesn't call as illegal the statement > "decode.create". Yeah you certainly need to assigned it to the variable or obviously that variable will be uninitialized and thus “d.add” will be an error. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Question on TFPGMap
Sorry copy and paste error. d = decode. Corrected below. But I think I see what you mean. Just assigning a type to decode doesn't initialize it. But the compiler is happy with it, i.e. it doesn't call as illegal the statement "decode.create". On 1/1/23 5:21 PM, Hairy Pixels via fpc-pascal wrote: On Jan 2, 2023, at 6:57 AM, ppadilcdx--- via fpc-pascal wrote: program ex; uses fgl; var decode: specialize TFPGMap; begin decode.create; decode.add('X', 1); end. This doesn’t make sense. It should be d := specialize TFPGMap.Create; Right? What is “decode” and why aren’t you assigning it to anything? Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Question on TFPGMap
> On Jan 2, 2023, at 6:57 AM, ppadilcdx--- via fpc-pascal > wrote: > > program ex; > > uses fgl; > > var d: specialize TFPGMap; > > begin >decode.create; >decode.add('X', 1); > > end. This doesn’t make sense. It should be d := specialize TFPGMap.Create; Right? What is “decode” and why aren’t you assigning it to anything? Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
[fpc-pascal] Question on TFPGMap
I have a simple example that gives an access violation on the latest macos (fpc mode, i.e. no mode switch). What am I missing? Thanks in advance: program ex; uses fgl; var d: specialize TFPGMap; begin decode.create; decode.add('X', 1); end. An unhandled exception occurred at $0001023917DE: EAccessViolation: Access violation $0001023917DE Regards Pete ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Programming Pascal using an AI Chatbot
> On Jan 1, 2023, at 6:43 AM, Anthony Walter via fpc-pascal > wrote: > > The following page hosts a series of Pascal programming questions I asked an > AI chatbot system while testing its abilities. > I’ve been testing using Chat GPT for work and it’s proving to be a better solution than searching in Google. It also can make things up though so be careful. For Pascal I was able to get it to implement some data types like hash maps and a “rope” even, which is something I was curious about but not familiar. It was also able to build a simple socket client/server which was nice if you needed a refresher. It’s very impressive I must say and worth real money since it’s saving me real time at work. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Open array in object constructor gives error
> On Dec 31, 2022, at 3:43 PM, Mattias Gaertner via fpc-pascal > wrote: > > Not supported. Has nothing to do with the parameter list. That’s disappointing. :( More reason we need an “advanced objects” mode switch. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Programming Pascal using an AI Chatbot
On Sat, 31 Dec 2022, Anthony Walter via fpc-pascal wrote: That's pretty damn amazing. It would be even more amazing if it could read information from the Internet and was accessible from from some API. Imagine being able to ask it to read all the source code from a git repository and convert it into HTML documentation, as you demonstrated. Or perhaps asking it to translate a large amount of C code from some compressed archive file into Pascal and sending you back the result. Of course imagine the advancements that they could make in 10 more years. I think in 10 years we'll need to redefine "programming". And many other jobs besides... Michael. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal