procspace
One more level of "namespacing" but for procedures only (cannot include anything but procedures). Makes package APIs much nicer because logically grouped by nouns. Cannot be nested.
Package example:
package ecs
# DCI EXAMPLE IN RUBY (with some prototype elements) | |
# Blog post: https://www.ludyna.com/oleh/dci-example-in-ruby | |
# | |
# More info: | |
# | |
# Creator of MVC & DCI, Trygve Reenskaug: DCI: Re-thinking the foundations of | |
# object orientation and of programming | |
# http://vimeo.com/8235394 | |
# | |
# James Coplien: Why DCI is the Right Architecture for Right Now |
# | |
# Oleh's tmux config | |
# | |
# INSTALLATION NOTES | |
# 1. Install Homebrew (https://github.com/mxcl/homebrew) | |
# 2. brew install zsh | |
# 3. Install OhMyZsh (https://github.com/robbyrussell/oh-my-zsh) | |
# 4. brew install reattach-to-user-namespace --wrap-pbcopy-pbpaste && brew link reattach-to-user-namespace | |
# 5. Install iTerm2 | |
# 6. In iTerm2 preferences for your profile set: |
--------- Blocked statement and count | |
SELECT count(current_statement_in_blocking_process), db.current_statement_in_blocking_process FROM ( | |
SELECT DISTINCT blocked_locks.pid AS blocked_pid, | |
blocked_activity.usename AS blocked_user, | |
blocking_activity.query AS current_statement_in_blocking_process | |
FROM pg_catalog.pg_locks blocked_locks | |
JOIN pg_catalog.pg_stat_activity blocked_activity ON blocked_activity.pid = blocked_locks.pid | |
JOIN pg_catalog.pg_locks blocking_locks | |
ON blocking_locks.locktype = blocked_locks.locktype | |
AND blocking_locks.DATABASE IS NOT DISTINCT FROM blocked_locks.DATABASE |
// Just an idea, not sure if it is any good | |
I have next procs to work with vkPhysicalDevice: | |
physical_device__get_extensions :: proc(device: vk.PhysicalDevice, allocator := context.temp_allocator) -> (exts: []vk.ExtensionProperties, res: vk.Result) | |
physical_device__find_swapchain_support :: proc(device: vk.PhysicalDevice, surface: vk.SurfaceKHR, allocator := context.temp_allocator) -> (support: Swapchain_Support, result: vk.Result) | |
physical_device__find_queue_families :: proc(device: vk.PhysicalDevice, surface: vk.SurfaceKHR) -> (ids: Queue_Family_Indices, ok: bool) | |
physical_device__score :: proc(vk_device: vk.PhysicalDevice, vk_surface: vk.SurfaceKHR) -> (pdd: Physical_Device_Data) | |
In my package I have global variable g_physical_device (it could be local variable too, it doesn't matter). |
// Allow question mark(?) at the end of ODIN proc names. It works like that in Ruby language and is very nice. | |
// REASON: Improves readability a lot. | |
// Also maybe at the end of any constant? | |
old: | |
is_pipeline_initialized :: proc() -> bool { | |
} | |
if is_pipeline_initized { | |
} |
procspace
One more level of "namespacing" but for procedures only (cannot include anything but procedures). Makes package APIs much nicer because logically grouped by nouns. Cannot be nested.
Package example:
package ecs