/dpt/ - Daily Pascal thread

What pascal/delphi projects are you working on Sup Forums?

Last thread

Other urls found in this thread:

pastebin.com/T1JB1W4y
artima.com/weblogs/viewpost.jsp?thread=98196
pastebin.com/Q80H5f8y
anyforums.com/
twitter.com/AnonBabble

If someone guesses what im working on i will deposit 5 shekels into his account.

last thing today was batch processing of some OLE for a lazy customer

string overflow in delphi ?

>▲
At last, a program that will let newfags triforce?!

Last time i did pascal was Turbo Pascal in high school.

Hello internet and welcome to behind the meme today we have a look at this is sparta thank you all for suggesting this meme you guys wanted it now you have it HERE WE GO

im not usig ansistrings.

VERY CLOSE

What's the benefit of using ShortString over AnsiString?

Memory/performance and better garbage collection.

Should technically be more efficient if you don't need > 256 character strings, no allocation/deallocation on the heap.

If you somehow had an interface that expected "Pascal" strings (it looked for the length in the first byte) then ansistring obviously wouldn't work, but I don't know if such a thing exists like interfaces that expect null-terminated strings do because of C.

I see. And yes, I think I've struggled with that already, now that you say it

I'm currently working in a production system, still using Delphi 7 in Virtual Box with Windows XP.

OP aquí.
Parece que los unicos que quedan usando Pascal/Delphi son españoles o rusos.

Delphi 7 hasta la muerte.

Btw wich DB are you using. Last time I did a DB program it was SQlite. Firedac is super comfy.

some customer asked me to display additional information in a 3rd party application.

I managed to draw a panel with my info in the window but haven't been able to bind it to a specific tab for example.
Is that even possible without DLL injection?

How do tools like WinSpy++ get a window's contents and manipulate their properties?

as for the last question, I've found the source of it.

I'm using Firebird SQL.

pastebin.com/T1JB1W4y

>Python
>Ruby
>Node
>Go
>Erlang

Last time I used FreePascal was a game where you move a block and dodge other blocks and go through a maze.
a pascal's triangle creator?

the only true functional programming language, unlike Haskell

haskell is a truer functional programming language than racket
racket has objects and mutable variables and it does type checking at runtime via contracts which is pretty much the most dystopian possible situation as far as type systems go

>#t))))))]) self))
Meh, I don't like Lisps.

No helper functions, good luck getting me to read that.
Seems pretty neat tho, nice OOP implementation

no. racket is full of macros. not functional.

This.

Whenever people go on about Clojure specs or whatever runtime checking is currently popular, they completely miss the point.

I want to prove things about my code, not find out about them at runtime.

Sup Forums toddlers don't know the difference between metaprogramming and functional programming

Sup Forums autists think lisp isn't functional. it's the actual original functional language.
no they aren't functional at all. haskell is macro spam.

>pretty much the most dystopian possible situation as far as type systems go
At least it offers ways to easily introduce comprehensive runtime checks, it is fairly strict about how objects can be used, and doesn't implicitly convert types. It's much less dystopian than e.g. Python or JS. But ofc it's not statically typed so you'll never have the same guarantees as other languages like OCaml

>Lisp
>Functional
You have to be at least 18 to be posting here. Get out.

Python is strongly typed.

Congrats for Python. Python also has broken scope rules, can't decide if its OOP or not, and is entertaining the idea of a pathetic form of gradual typing

No it's Duck typed. It doesn't do implicit type conversion but nor does it do any type checking. It just checks for attributes/methods you access at run time.

how could borland/embarcadero do windows api better than microsoft themselves

>Python also has broken scope rules
que?

Don't forget that apparently Guido wants to remove lambdas from it.

Don't forget CPython.
>Don't forget that apparently Guido wants to remove lambdas from it.
que?

>Python also has broken scope rules
It doesn't.

>can't decide if its OOP or not,
Are you pretending that multiparadigm programming languages aren't a thing? It's not either--or.

It is strongly typed.

He thinks that since Python do function scoping (and not block scoping), that scoping is broken. He's just being retarded

artima.com/weblogs/viewpost.jsp?thread=98196

>The fate of reduce() in Python 3000
>by Guido van van Rossum

>About 12 years ago, Python aquired lambda, reduce(), filter() and map(), courtesy of (I believe) a Lisp hacker who missed them and submitted working patches. But, despite of the PR value, I think these features should be cut from Python 3000.

>function scoping
>scoping is broken
modus ponens

What Swift projects are you working on Sup Forums?

Pros of python scopes
>you don't have to press a few extra keys to define your variables

Cons of python scopes
>confusing behavior if you forget to type "global"
foo = 3
def incr_foo():
foo = foo + 1


>very hard to immediately tell if a variable is local or not
foo = 3
def example_1():
print(foo)

def example_2:
print(foo)
if True:
if False:
foo = 2


>confusing and broken rules for nested functions
def outer():
x = 3

def inner():
x = x + 1
# nope, impossible to mutate outer's x
return x

return inner

Wow, that's about the first nice thing GVR does.
One shouldn't cater Lisp feggits out of principle.

>It doesn't.
Not him, but that is where you are wrong, kiddo. Full block scoping is the only scoping that should exist, even thinking deviant from that should be rewarded with a bullet.

>>being so sore loser you literally have to samefag pretending to be two different posters
No dude. I'm the guy who originally posted that code and I'm also the guy who said Haskell is a truer functional programming language than Racket and listed things Racket has that aren't functional. I know Racket isn't true functional programming, I never wanted it to be, I was never drawn to it for that reason, and if I were, why the hell would I be trying to implement OOP in it, especially given that Racket already has OOP.

More important, Python doesn't forbid variable usage without declaration.

oh so it's not broken at all it's just like every other language without declarations

tapping on the flag opens this interface

w-what the hell is happening with our pascal bread q.q

>it's just like every other broken piece of shit scripting language
FTFY

...

variable declarations are hard user

I'm saying that languages that don't declare variables are bound to have really shitty behavior that could've been avoided by just making declarations explicit.
I consider this "broken" but I guess it's a matter of opinion

Yes. This makes it very annoying to refactor code, and makes all variable name typos runtime errors that could've been caught statically. "productive language" my ass

>making money off of brazilians
good luck

???

prove lisp isn't functional.

Fuck off

...

See

pastebin.com/Q80H5f8y

>Python doesn't forbid variable usage without declaration.
It does, wtf?

>Full block scoping is the only scoping that should exist
Tell that to Haskell developers

it's productive if your main goal is to write code quickly, regardless of how many bugs it has.

I remember learning Delphi in school

not really. after all a true functional language doesn't need variables.

>using windows
>using an IDE
>the IDE takes 12 seconds to load
>there are non-english characters in the source code
>building and running it creates a virus shitware program that sits on your windows
>shitware-chan is literally not even cute she looks like she was drawn by a 3 year old
so this is the power of
of
of
... of
of--
what the fuck actually is this

Haskell can get away with it because of immutability.

holy shit user, that's impressive. Any links?

It doesn't forbid it statically. Racket, for instance, is interpreted, but completely forbids variable usage without declaration.

>Tell that to Haskell Developers
Haskell has proper scoping rules

I want to write code quickly, be able to change code quickly, and I want to identify bugs quickly because they're bound to happen.

That is correct

...

read it. isn't proof.
holy fuck you made that. tell me, is it FOSS? source pls

I agree that it sucks but it's hardly unique to python.

what language is that? looks like a dialect of python

You are an embarrassment to the FOSS

Since it's my native language, why not add that translation?

Nice.
Github?

>anything I don't like is not a proof

That shit doesn't look anything like python.

haskell doesn't have true immutable memory though. nothing beats Cs const specifier (actually marks memory as readonly)

It's closed source, gullible children

epic meme

SOPA

Have you tried reading the thread title?

you're in the wrong bread

it does. but seriously what language is that?

>It doesn't forbid it statically.
It does. You can literally not use a variable without it having been declared first.

>Haskell has proper scoping rules
It only has function scoping.

>It does, wtf?
# no declaration
x = 1
if x == 2:
y = 1

# fails at runtime
print(y)

# boohoo, flow control was too hard to implement for GVR


>Hasklel
>aka the guys who couldn't even build a proper compiler for almost 20 years, much less a useful language
Why would I care for their opinions?

Delphi, a dialect of Object Pascal. Perhaps more similar to C# than Python, but the preference of words to symbols certainly makes it look more like Python than C-like languages.

it's pascal/delphi?

>>Haskell has proper scoping rules
>It only has function scoping.
But it doesn't cause the same problems in Haskell because Haskell values are immutable.

C++ question time.

Here's what I want to do: Have a manager class, that takes a member function/method and the instance it belongs to, then calls that method on the correct instance at some point down the line.

However: C++ does not like it when you try to pass around methods as function points, for understandable reasons.

So what's the proper way to design this?

If that's unclear, think of my manager class as a publisher, and the instances as subscribers. I want to be able to subscribe to the publisher's messages, via a callback or something.

DELPHI/PASCAL THREAD
IT'S FUCKING DELPHI
NOW GO AWAY

>It only has function scoping.
This isn't true. Where did you get this idea?

>I agree that it sucks but it's hardly unique to python.
True. Hilarious how Perl got this right, at least in strict mode everyone uses.

>identify bugs quickly
That's what static typing is for.

By knowing Haskell.

Haskell isn't truly functional since it lacks the const specifier.

pointer-to-members exist, you know

C++ and POO were both mistakes.

Stop posting other languages on this Pascal Thread. Read the title.

wtf is this oop goop

>fails at runtime
>fails
That is "forbidding variable use without declaration" are you literally retarded?