tinycc-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Tinycc-devel] tcc and slang cooperation


From: Agathoklis D.E Chatzimanikas
Subject: [Tinycc-devel] tcc and slang cooperation
Date: Tue, 27 Mar 2018 11:58:58 +0300
User-agent: Mutt/1.9.0 (2017-09-02)

Hi,

As it can be easily realized by now, from anyone that read this thread:

http://lists.nongnu.org/archive/html/tinycc-devel/2018-03/msg00017.html

that slang and tcc is an ablolutelly sweet pair :).

I'm going soon to start to try to write a slang interpeter with an embeddable
tcc dynamical C interpeter.

But before, I should teach you now slang :-).

  -- Introduction to slang --

Ok, get your C and apply it freely. Except that:

You have always to remember that the stack in slang is dynamical. That
means that if you don't care for the returned value, pop() it from the
stack (otherwise, at some point, your programm will do the wrong thing),
like and with one of the following ways:

  some_fun_that_returns_a_val (...); pop;

or simply,

  () = some_fun_that_returns_a_val (...);

Now, that idiom in C:

   if (NULL == (var = some_fun ()))
     do this

it should be coded with the following way:
  
   if (NULL == (var = some_fun (), var))
     ...

Also, the dereference operator is the @, e.g., (function reference)

  variable ref = &strcat;

  (@ref) ("astring", "bstring");

... will be continued, with the last part, since here we covered the
difficult parts :).



reply via email to

[Prev in Thread] Current Thread [Next in Thread]