But where on the page does it state such (kernel32.dll)?
Am I going blind?
Hi All,
Windows
I know from other sources that this call is to a function
in Kernel32.dll.
https://docs.microsoft.com/en-us/windows/win32/api/sysinfoapi/ns-sysinfoapi-memorystatusex
But where on the page does it state such (kernel32.dll)?
Am I going blind?
That's under the associated function:
Past the code sample, under Requirements
T,
But where on the page does it state such (kernel32.dll)?
It doesn't. You can even search for that 'sysinfoapi.h' file and get nowhere either.
Am I going blind?
Nope.
As far as MS is concerned, you do not need to know "trivial" low-level stuff like that. Just install their latest compiler and it will figure out for
you where all that stuff should be coming from.
And I wish you luck when you go look for (argument) constants : the names
and their purposes will be in a table, but you will need to grab their
actual values from somewhere else.
(I run in it all the time, as I'm an Assembly programmer.)
Want an example of their baddness ? Here :
https://docs.microsoft.com/en-us/windows/win32/api/shlwapi/ne-shlwapi-filetypeattributeflags
That list is not actually a enumeration but instead bitflags (0x1, 0x2, 0x4, 0x8, 0x10, etc.) *and* it misses some entries - which means that even if
you know that those constants are bitflags *and* realize that the
'"FTA_None" will most likely have the value 0x0 (I missed that the first
time around :-| ) you will get the wrong values for the constants later in the list. Like FTA_NoRecentDocs looks, from that list, to have the value 0x00020000, where it actually has the value 0x00100000 (entries for 0x00004000, 0x00040000 and 0x00080000 are missing).
You may guess three times how I know the above, and the first two don't count. :-)
tl;dr:
Become accustomed with being disappointed by the ammount of actual information an MSDN page provides.
Regards,
Rudy Wieser
And where they got "kernel32" from in the following line:
sub GlobalMemoryStatusEx(MEMORYSTATUSEX) is native('Kernel32') returns
int32 { * };
And they have the balls to call the page:
"A tutorial about creating and using classes in Raku"
When they refuse to define any of their terms starting
with "what is a 'class'?". You are left to guest from
context
I did find this in Perl 5, which ACTUALLY defines what
things are:
https://perldoc.perl.org/perlglossary#class
So a "class" is a declaration of a custom structure of
a collection of variables.
The name "class" is pulled out of someone's ear and you just have to live with the obscure meaning they have attached to it.
say (-5..5).rand.truncate.abs**3
Which means to picks out a random number between -5 and 5
T,
First things first: while my complaint about MSDN information still stands,
I made a mistake when looking at the link you provided : I fully missed it described a structure, not a function (as Kaz made clear). There is some logic to only have it refer to its "parent", the function, just as the function refers to its "parent", the DLL.
And where they got "kernel32" from in the following line:
sub GlobalMemoryStatusEx(MEMORYSTATUSEX) is native('Kernel32') returns
int32 { * };
You're asking where /they/ got their information from ? Thats impossible
to say ...
But, if you just want to know which DLL contains a certain function name, than, apart from googeling for it, you could extract the function names from all the Windows DLLs[1] and put them into lists for easy searching.
[1] which, alas, most of them do *not* contain any information about the ammount and types of their arguments.
And they have the balls to call the page:
"A tutorial about creating and using classes in Raku"
Hmmm... I can read that line as "you already know what a class is, here we describe how you use them in the Raku language".
As far as I can tell there is not much you can know about a class : its a container for methods (functions) and properties (variables), and you can create multiple instances from a single template[2]. The rest (implementation) is language dependant.
[2] In that regard its properties work the same as a function with local variables : each has and manages its own variables (properties). You can call such a function multiple times withouth having them mix up their local variables.
When they refuse to define any of their terms starting
with "what is a 'class'?". You are left to guest from
context
While you are right, think about it : how deep do they need to go ? At
some point they would end up telling you about the best places to delve silica sand to create the wavers from from which the chips are created that make your computer work. Also, what is commonly referred to as "electrical current" does not actually exist. Electrons flow from the negative terminal towards the postive one, not the other way around. :-)
But granted, I would have been nice of them to mention which knowledge they expect you to already have (so you can go google for it beforehand).
I did find this in Perl 5, which ACTUALLY defines what
things are:
https://perldoc.perl.org/perlglossary#class
I disagree that that is a good description. They could as well have said "see 'data type' "and be done with it.
Also, a class doesn't need to be "set of possible values, together with all the operations that know how to deal with those values". Take for instance a class which does a ROT16 operation. It doesn't need any kind of "possible values" (there is nothing it needs to "remember"). Just provide it a string as the argument, and the output is the result.
A class dealing with anything thats not actually stored inside of it but
acts as an intermediary (from accessing files al the way down to hardware) does not (need to) have any "possible values" to act upon either.
So a "class" is a declaration of a custom structure of
a collection of variables.
Nope. That would just be another structure. The difference is that a
class (normally) also has methods (functions) to work with those variables (properties).
Also, a class can have *internal* (private) variables[3] that you can only access by way of a method - which means that those internal variables are
not properties (that you can read from and/or write to).
[3] Though a language like Python does not offer such "private" variables : all of them directly accessible, making them properties.
The name "class" is pulled out of someone's ear and you just have to live
with the obscure meaning they have attached to it.
Just like any word ? :-)
My pet peeve ? "Obsolete". It has got two rather different (not even partially overlapping) definitions.
say (-5..5).rand.truncate.abs**3
I hope you notice that you are implicitily using a build-in object there (there is no class name present), the one dealing with values.
Also notice that that example mixes together function names with special function symbols ("**") that you most likely won't be able to define for
your own class(es).
Which means to picks out a random number between -5 and 5
Not quite. The "pick a random number" from a provided range is the *second* step. Storing that range into a "variable" is the first. You might be
able to do different things with that range than just to grab a random value from it.
Regards,
Rudy Wieser
The rest (implementation) is language dependant.
Oh good lord you have a gift for teaching.
Speaking of googling, it does not help that "raku" is also a form of
pottery.
I remember a college professor trying to get us to
think Negative --> Positive, but he gave us as all
the schematics are written the other way.
It is not as if I wanted the tutorial to explain
how OO worked, but a link as to how an explanation
would have been nice. Your explanation would have
been perfect too and no extraneous words either.
And I night point out that the (ha ha) tutorial
was for Raku, it need to explain how OO was
implemented into Raku, not leave it to guess work.
I just discovered that if I want to write to values
inside an Object, I have to declare the variable inside
the object as "rw" (read write). They are "ro" (read
only) by default.
Thank you!
The rest (implementation) is language dependant.
Did the tutorial forget something? AAAAAAHHHHH !!!!!
BTW, in my write up, I include zillions of examples
Honestly ? I wouldn't know.The rest (implementation) is language dependant.Did the tutorial forget something? AAAAAAHHHHH !!!!!
But as you have already found, a Raku object can limit access to its properties (and thus most likely also has private variables and
methods(!) ). In Python objects on the other hand nothing is private, /everything/ (properties, variables as well as methods and functions) is accessible from the outside.
IOW, although both have classes, they work differently.
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 379 |
Nodes: | 16 (2 / 14) |
Uptime: | 42:42:39 |
Calls: | 8,141 |
Calls today: | 4 |
Files: | 13,085 |
Messages: | 5,857,851 |