1 # This file is part of NIT ( http://www.nitlanguage.org ).
3 # Copyright 2011 Alexis Laferrière <alexis.laf@xymus.net>
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
9 # http://www.apache.org/licenses/LICENSE-2.0
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
23 printf( "%s\n", str );
34 new is extern `{ return malloc(1); `}
35 new new_implicit `{ return malloc(1); `}
36 new new_in_language
is extern in "C" `{ return malloc(1); `}
37 new new_in_language_implicit in "C" `{ return malloc(1); `}
39 fun m
: Int is extern `{ return 10; `}
41 fun n : String is extern import NativeString.to_s `{
42 return NativeString_to_s( "allo" );
45 fun o ( str : String ) is extern import String.to_cstring `{
46 f
( String_to_cstring( str
) );
49 fun p : Int import m `{
50 return A_m( recv
) + 5;
53 fun in_language : Int is extern in "C" `{
56 fun in_language_implicit : Int in "C" `{
59 fun simple_implicit `{
62 fun inline_implicit : Int `{ return 7; `}
69 extern class C
`{int*`}