c scopes have tree structure { {}{{}{}}} etc so they ate just wrong
On Tue, 12 May 2026 12:22:20 +0200, fir wrote:
c scopes have tree structure { {}{{}{}}} etc so they ate just wrong
Just too limited. Lexical binding is better. You see the difference in languages which allow nested function/class definitions.
Lawrence DrCOOliveiro pisze:
what do you mean? you could give example if you want
On Tue, 12 May 2026 12:22:20 +0200, fir wrote:
c scopes have tree structure { {}{{}{}}} etc so they ate just
wrong
Just too limited. Lexical binding is better. You see the difference
in languages which allow nested function/class definitions.
On Wed, 13 May 2026 10:42:08 +0200, fir wrote:
Lawrence DrCOOliveiro pisze:
what do you mean? you could give example if you want
On Tue, 12 May 2026 12:22:20 +0200, fir wrote:
c scopes have tree structure { {}{{}{}}} etc so they ate just
wrong
Just too limited. Lexical binding is better. You see the difference
in languages which allow nested function/class definitions.
In <https://gitlab.com/ldo/pysmb2>, the function rCLdef_struct_classrCY is
a class factory -- it creates a new class every time it is called.
This is used to define the following classes, each of which is a
high-level wrapper around a corresponding C object in libsmb2:
Dirent = def_struct_class \
(
name = "Dirent",
ctname = "dirent",
specialmap =
{
"name" : lambda n : n.decode(),
}
)
FileBasicInfo = def_struct_class \
(
name = "FileBasicInfo",
ctname = "file_basic_info",
specialmap =
{
"creation_time" : lambda t : t.timeval,
"last_access_time" : lambda t : t.timeval,
"last_write_time" : lambda t : t.timeval,
"change_time" : lambda t : t.timeval,
}
)
FileStandardInfo = def_struct_class \
(
name = "FileStandardInfo",
ctname = "file_standard_info"
)
FileAllInfo = def_struct_class \
(
name = "FileAllInfo",
ctname = "file_all_info",
specialmap =
{
"basic" : lambda i : FileBasicInfo.from_ct(i),
"standard" : lambda i : FileStandardInfo.from_ct(i),
# "name_information"?
}
)
FileFSSizeInfo = def_struct_class \
(
name = "FileFSSizeInfo",
ctname = "file_fs_size_info"
)
FileFSDeviceInfo = def_struct_class \
(
name = "FileFSDeviceInfo",
ctname = "file_fs_device_info"
)
FileFSControlInfo = def_struct_class \
(
name = "FileFSControlInfo",
ctname = "file_fs_control_info"
)
FileFSFullSizeInfo = def_struct_class \
(
name = "FileFSFullSizeInfo",
ctname = "file_fs_full_size_info"
)
Lexical binding is key to that working.
system
{
renderer { //one scope
-a-a-a init();
-a-a-a blit();
-a-a-a resize();
-a-a-a //...
raster_functions
{
-a-a draw_line();
-a-a fill_circle();
}
-aaudio //audio scope
-a {
-a-a-a-a play_wav();
-a }
-aio
-a{
-a-a-a-a load();
-a-a-a-a audio
-a-a-a-a {
-a-a-a-a-a-a load_wav();
-a-a-a-a-a }
-a}
fir pisze:
system
{
renderer { //one scope
-a-a-a-a init();
-a-a-a-a blit();
-a-a-a-a resize();
-a-a-a-a //...
raster_functions
{
-a-a-a draw_line();
-a-a-a fill_circle();
}
-a-aaudio //audio scope
-a-a {
-a-a-a-a-a play_wav();
-a-a }
-a-aio
-a-a{
-a-a-a-a-a load();
-a-a-a-a-a audio
-a-a-a-a-a {
-a-a-a-a-a-a-a load_wav();
-a-a-a-a-a-a }
-a-a}
sorry mistyoes in braces
system
{
renderer { //one scope
-a-a-a init();
-a-a-a blit();
-a-a-a resize();
raster_functions
{
-a-a draw_line();
-a-a fill_circle();
}
} //end of renderer scope
-aaudio //audio scope (in system scope)
-a {
-a-a-a-a play_wav();
-a }
-aio //in system scope
-a{
-a-a-a-a load();
-a-a-a-a audio //additional part of audio scope in io scope
-a-a-a-a {
-a-a-a-a-a-a load_wav();
-a-a-a-a-a }
-a}
}
but it seems "lexical binding" is what you got in c and this is not
enough ...
| Sysop: | Amessyroom |
|---|---|
| Location: | Fayetteville, NC |
| Users: | 65 |
| Nodes: | 6 (0 / 6) |
| Uptime: | 02:04:21 |
| Calls: | 862 |
| Files: | 1,311 |
| D/L today: |
10 files (20,373K bytes) |
| Messages: | 264,321 |