Paste: typology with clay

Author: elrood
Mode: text
Date: Thu, 26 Aug 2010 19:10:04
Plain Text |
import win32.*;

main() {
	var argc, argv = ...getArgcArgv();
	var pfd = PIXELFORMATDESCRIPTOR;
	
	var hWnd = CreateWindowExA(0u, cstring("edit"), LPCTSTR(0), DWORD(0), 0, 0, 0, 0, HWND(0), HMENU(0), HINSTANCE(0), LPVOID(0));
	var hDC = GetDC(hWnd);
	
	SetPixelFormat(hDC, ChoosePixelFormat(hDC, Pointer[PIXELFORMATDESCRIPTOR](&pfd)), Pointer[PIXELFORMATDESCRIPTOR](&pfd));
        //wglMakeCurrent(hDC, wglCreateContext(hDC));
}

Annotation: type specs

Author: elrood
Mode: factor
Date: Sun, 29 Aug 2010 09:29:07
Plain Text |
clay:
var pfd = PIXELFORMATDESCRIPTOR( UShort(TypeSize(PIXELFORMATDESCRIPTOR)), 1u16, CULong(PFD_DRAW_TO_WINDOW /*or PFD_SUPPORT_OPENGL or PFD_DOUBLEBUFFER*/), CUChar(PFD_TYPE_RGBA), 32u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 8u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 32u8, 0u8, 0u8, 0u8, 0u8, 0u32, 0u32, 0u32 );


c:
static const PIXELFORMATDESCRIPTOR pfd = { sizeof(PIXELFORMATDESCRIPTOR), 1, PFD_DRAW_TO_WINDOW|PFD_SUPPORT_OPENGL|PFD_DOUBLEBUFFER, PFD_TYPE_RGBA, 32, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 32, 0, 0, 0, 0, 0, 0, 0 }; 

are all those type specs absolutely necessary? tedious to write (and debug!) code like that

Annotation: first impressions

Author: elrood
Mode: text
Date: Sun, 29 Aug 2010 09:33:57
Plain Text |
import foobar; // one file per subdir / one subdir per file - policy?

alias foo = 0x80000000u32; // can't the type be inferred and the suffix omitted here?
var bar = 0xea, baz = foo; // < parse error at comma

main() {
	bar or baz; // < mistreated as bool
}

New Annotation

Summary:
Author:
Mode:
Body: