Commit Graph

439 Commits (64b248c5d504ee5e5814f6204ac4dba58977e137)

Author SHA1 Message Date
Joe Groff e5c65b2204 use word-props instead of singletons for enum>number conversion so there's not a big fat generic making the image buy another plane ticket 2010-04-21 22:22:06 -07:00
Joe Groff 4c7ab0e9a3 doll up ENUM: docs 2010-04-21 21:33:04 -07:00
Doug Coleman 339952697f Fix alien.enum docs 2010-04-21 21:32:33 -05:00
Joe Groff f9668be814 alien.enums: make enum>number foldable so it optimizes constant enums to constant ints, make number>enum a macro so it doesn't use c-type metadata at runtime 2010-04-20 17:05:14 -07:00
Erik Charlebois fdeb305a3c Use generic word for enum>number. Tests and documentations. 2010-04-19 20:08:40 -07:00
Erik Charlebois baab8c060d Remove ENUM: f and replace uses with CONSTANTs.
Fix bootstrap and load-all errors from enum classes.
2010-04-19 20:08:40 -07:00
Joe Groff 52903ee597 prettyprint ENUM: definitions 2010-04-19 20:07:18 -07:00
Joe Groff d3f770d545 add alien.enums vocab with enum-c-types that convert between symbols and integer values in the FFI. update ENUM: to define symbolic enums, and take an optional base type 2010-04-19 20:07:18 -07:00
Joe Groff e730d3b6d5 alien.c-types: use CONSULT: to define c-type-protocol methods on c-type-name 2010-04-19 20:07:17 -07:00
Joe Groff 6e55a3b8f5 alien.parser, alien.syntax: send ENUM: body to parse-enum 2010-04-19 20:07:17 -07:00
Joe Groff f394cb4fdc alien.parser: have define-enum handle the case when the enum name is f 2010-04-19 20:07:17 -07:00
Joe Groff 8c915e05f7 alien.parser, alien.syntax: refactor ENUM: to separate parsing from definition 2010-04-19 20:07:17 -07:00
Joe Groff 4bc915d526 C-ENUM: -> ENUM: 2010-04-19 20:07:16 -07:00
Slava Pestov 2eda6fc6aa io.encodings: add a fast-path for ascii, utf8 and 8-bit encodings when string only contains ASCII characters 2010-04-19 01:14:00 -05:00
Joe Groff 37784cd356 rearrange stuff in alien.arrays and alien.data to eliminate libc dependency from alien.arrays, and by extension, alien.syntax 2010-04-14 21:40:29 -07:00
Joe Groff 54015782f3 document FUNCTION-ALIAS: 2010-04-14 16:14:33 -07:00
Joe Groff d20bff5615 prettyprint FUNCTION-ALIAS: definitions 2010-04-14 12:40:10 -07:00
Joe Groff e5c1a82643 alien.syntax: FUNCTION-ALIAS: syntax to define a C function binding with a different Factor name 2010-04-14 12:06:45 -07:00
Slava Pestov becb7c78b7 Move non-parsing words out of alien.syntax, and use a symbol instead of a string variable to store the current library in alien.parser 2010-04-12 18:09:26 -05:00
Slava Pestov 2b4a55b53a Merge branch 'master' of git://github.com/erikcharlebois/factor 2010-04-10 18:01:19 -07:00
Erik Charlebois edc489f4c1 Change C-ENUM: to always take a type. Use f for anonymous enums. Update all uses. 2010-04-09 23:48:22 -07:00
Erik Charlebois 4b78fe690b Extend C-ENUM: to allow specifying the constant vvalues like in C. Add C-TYPED-ENUM: to automatically typedef a type. 2010-04-06 02:46:23 -07:00
Joe Groff 2240520e2d update some more doc examples using old abi strings 2010-04-02 23:16:53 -07:00
Joe Groff ef884ef7f2 Merge branch 'master' into abi-symbols 2010-04-01 15:28:36 -07:00
Joe Groff 98d1e7d006 update alien.libraries docs to link cdecl/stdcall symbols 2010-03-31 19:57:04 -07:00
Joe Groff f3dd625de6 "stdcall" -> stdcall 2010-03-31 19:29:04 -07:00
Joe Groff 65c3259761 "cdecl" -> cdecl 2010-03-31 19:20:35 -07:00
Slava Pestov 2b68f56c89 Document (free), move it out of libc.private and mention it in the "c-strings" help article (reported by Blei) 2010-03-30 17:32:51 -04:00
Slava Pestov 75d0f51b30 alien.debugger: fix USING: form 2010-03-17 19:35:12 +13:00
Slava Pestov 6ff0393e2f debugger: Untangle some dodgy dependencies that were loading locals before prettyprint, resulting in locals.prettyprint not being loaded 2010-03-17 19:19:43 +13:00
Joe Groff cd17a934ac cut commas off of FUNCTION: parameter names in stack effects again 2010-02-28 19:29:53 -08:00
Joe Groff 078ca0fa58 alien.parser: refactor FUNCTION: parsing to read from the source incrementally. parse errors in FUNCTION: should now correspond to their location within the definition 2010-02-28 16:20:45 -08:00
Slava Pestov 17b095a524 Slices over specialized arrays can now be passed to C functions, written to binary output streams, and given to malloc-byte-array 2010-02-25 04:50:31 +13:00
Slava Pestov af0ddd5985 Specialized arrays, structs and other objects responding to the >c-ptr / byte-length protocol can now be written to binary streams 2010-02-24 20:18:41 +13:00
Joe Groff b45ec6397b typo in alien.data docs 2010-02-23 12:20:47 -08:00
Joe Groff 1916b9269e "pointer-c-type" word-prop hack is now unnecessary since all pointer types behave uniformly now 2010-02-23 12:07:55 -08:00
Joe Groff db8b6baa2f typo in alien.parser test 2010-02-23 11:59:53 -08:00
Joe Groff 71d169e420 fix typos in alien docs 2010-02-23 11:56:10 -08:00
Joe Groff 4cfa1a6c77 rename current string-mangling "char*" to "c-string". char* is now just a boring old pointer to char 2010-02-23 11:42:02 -08:00
Joe Groff 818bbb4984 update docs about pointer types 2010-02-23 11:03:48 -08:00
Joe Groff 00a7559d55 have TYPEDEF:, STRUCT: etc. throw an error if you try to define a c type name ending with asterisk 2010-02-23 10:16:18 -08:00
Joe Groff 75e2a5098e if any typedef in the chain has a pointer-c-type, use it 2010-02-23 08:09:33 -08:00
Slava Pestov 7decccf8bb Merge branch 'master' of git://factorcode.org/git/factor 2010-02-23 20:26:41 +13:00
Joe Groff aef979b552 alien.fortran: update tests to reflect new pointer c-type objects 2010-02-22 21:58:18 -08:00
Erik Charlebois aead6e7dd8 Revert change to make-callback-type cause Slava already fixed it in parse-arglist 2010-02-22 19:34:34 -08:00
Joe Groff 829351f2f2 don't box struct pointer values when they're null 2010-02-22 19:08:43 -08:00
Joe Groff 1bf37f01e5 alien.arrays/classes.struct: ensure specialized array types for struct array slots get instantiated at parse time 2010-02-22 12:21:29 -08:00
Joe Groff 4d2ded634b alien.parser: properly generate return type name for FUNCTION: stack effects 2010-02-22 11:25:01 -08:00
Erik Charlebois 833372cd08 Merge alien/parser/parser.factor 2010-02-22 10:53:19 -08:00
Erik Charlebois 124982ce23 Fix CALLBACK: effect return type also not a string. Added accompanying unit test. 2010-02-22 10:48:21 -08:00