Welcome to the CHICKEN Scheme pasting service

I don't get varargs added by C-Keen on Tue May 24 14:36:55 2016

typedef struct cell
{
  ltype type;
  union {
    uint64_t data;
    struct cell* cell;
  } car;
  struct cell *cdr;
  gc_flag flag; /* GC Flag */
} cell;


void barf(char* msg, ...)
{
  va_list args;
  cell *c;
  va_start(args, msg);
  printf("PANIC: ");
  while (*msg){
    if (*msg == '%'){
      if (msg[1] == 'c'){
        msg++;
        c = va_arg(args, cell*);
        display(c);
      }
      printf("%c", *msg);
      msg++;
    } else {
      printf("%c", *msg);
    }
    msg++;
  }
  va_end(args);
  printf("\n");
  exit(1);
}

Leads to:

0x0000000000401ed2 in display (expr=0x2a) at l.c:578
578	    switch (typeOf(expr))
(gdb) up
#1  0x0000000000400b85 in barf (msg=0x405308 "c") at l.c:90
90	 display(c);
(gdb) p c
$10 = (cell *) 0x2a
(gdb) up
#2  0x0000000000402f1f in eval (expr=0x60e7b0, env=0x60e670) at l.c:1043
1043	   barf("Unbound Symbol: %c", expr);
(gdb) p *expr
$11 = {type = SYMBOL, car = {data = 99, cell = 0x63}, cdr = 0x60e7e0, flag = CLEAR}

Your annotation:

Enter a new annotation:

Your nick:
The title of your paste:
Your paste (mandatory) :
Which module provides `define-foreign-type'?
Visually impaired? Let me spell it for you (wav file) download WAV