00:00:00 --- log: started retro/11.04.15 07:01:36 --- join: aisa (~aisa@173-10-243-253-Albuquerque.hfc.comcastbusiness.net) joined #retro 07:06:55 http://sprunge.us/XHPH 07:08:09 C vm, with no globals 07:27:14 each VM structure gets its own input stacks, stats, etc. 07:41:13 I've tested this with multiple vm instances, it seems to work ok 08:29:59 yay for no globals :) 14:41:59 --- quit: aisa (Quit: aisa) 15:04:24 --- join: erider (~chatzilla@unaffiliated/erider) joined #retro 15:04:28 hi 16:32:55 --- quit: erider (Read error: Connection reset by peer) 16:33:34 --- join: erider (~chatzilla@pool-108-3-149-46.bltmmd.fios.verizon.net) joined #retro 16:33:52 --- quit: erider (Changing host) 16:33:53 --- join: erider (~chatzilla@unaffiliated/erider) joined #retro 17:30:55 hi erider 17:32:12 I'm still unhappy with .s 17:32:27 but the new C code with no globals is working nicely 17:58:17 .s returns the value on the stack right 17:59:07 .s displays the values on the stack 18:01:38 are you using getc() or are you grabbing a stream with fgets 18:02:30 in the c code, I use getc(): 18:02:31 CELL rxReadConsole(VM *vm) { 18:02:31 CELL c; 18:02:31 if ((c = getc(vm->input[vm->isp])) == EOF && vm->input[vm->isp] != stdin) { 18:02:31 fclose(vm->input[vm->isp--]); 18:02:32 c = 0; 18:02:34 } 18:02:36 if (c == EOF && vm->input[vm->isp] == stdin) 18:02:39 exit(0); 18:02:41 return c; 18:02:43 } 18:05:53 hmm 18:06:14 I wonder if I should use fgets 18:11:58 what are you trying to do? 18:18:24 write a minimalistic scheme 18:31:05 i've not worked on parsing a language like lisp in years 18:35:14 if it helps, I've got some stuff from years ago (C, and Python) at http://rx-core.org/lisp.tar.bz2 18:36:04 gcc lisp-listener.c lisp-interpreter.c -o lisp 18:36:12 that should suffice to build it 18:37:03 the minimal lisp system is ~200 lines of C code, and there's a parser for a lisp-style language in ~40 lines of python 18:48:50 crc: cool thanks 19:01:54 hey crc can you pass stdin to strstr() 19:02:23 no, stdin isn't a string, it's (basically) a file handle 19:02:41 hmm 19:02:44 ok 19:03:50 see the prototype for strstr: char *strstr(const char *haystack, const char *needle); 19:04:09 and for stdin: extern FILE *stdin; 19:09:02 yeah I and trying to find a good way to handle char constant 19:09:43 ie #\space 19:11:08 crc: remember I am using ungetc and getc to parse 19:14:00 I've never used ungetc 19:16:10 its just away to look ahead at the next char then put it back 19:16:57 crc: any suggestions 19:17:27 I want to match the pattern space after #\ 19:17:58 currently I have a switch(c) on '#' and '\\' 19:19:31 can you pastebin what you have? 19:25:37 I can't do this without a loop right: case '\\': case 's': case 'p': case 'a': case 'c': case 'e': 19:26:01 fallthrough? 19:26:54 hmm so I want it to match against # \ s p a c e 19:27:50 in that order, or match any single one? 19:28:25 without doing if(c = 's') getc if( c = 'p') etc... 19:28:52 yeah I know, I am going to need a loop 19:28:53 read a token and do a string comparison 19:29:20 with strstr ? 19:29:24 that would work 19:30:42 how 19:31:09 strstr takes two char [] 19:31:17 yup, the haystack and the needle 19:31:32 strstr(token, "#\\space"); 19:31:40 you need to read a token 19:31:46 build a string from the input source 19:32:07 ungetc is problematic here, since you can't reliably push multiple values back onto the input stream 19:32:55 while (isalph(c = getc(in))) 19:33:05 something like that 19:41:39 something like: http://sprunge.us/gbbh 19:42:19 (not the best, since there's no checks for buffer overflows, valid addresses, etc) 19:43:19 I will take a look in a minute I may have something too 19:43:35 this will return a token, when stdin is ( ) or a space character (up to, but not including the delimiter character) 19:44:03 this discards the delimiter; you could use ungetc to push that back to the input stream if necessart 19:44:06 *necessart 19:44:14 err, bad typing 19:44:19 *necessary 20:11:00 is the l returning the str count? 20:11:19 yes, sans the terminating zero 20:12:49 ah ok 20:22:37 I am going to see if I can use your example to do what I want it to do 20:22:40 thanks 20:22:45 np 20:23:22 * crc is heading to bed. 20 hours up, and growing sleepy 20:23:43 I'll be back tomorrow a little during the morning, and then at some point during the evening 23:59:59 --- log: ended retro/11.04.15