Scilab Website | Contribute with GitLab | Mailing list archives | ATOMS toolboxes
Scilab Online Help
6.0.0 - 日本語

Change language to:
English - Français - Português - Русский

Please note that the recommended version of Scilab is 2024.0.0. This page might be outdated.
See the recommended documentation of this function

Scilabヘルプ >> Functions > Built-in & external > newfun

newfun

関数のテーブルに名前を追加する

呼出し手順

newfun(function_name, function_ptr)

引数

function_name

文字列, 有効な関数名を指定する

function_ptr

整数値を有する正の数 (以下参照)

説明

ユーティリティ関数 (上級者専用).

名前 function-nameを インタプリタに既知の関数テーブルに追加します.

function_ptrは整数1000*fun+finです. ただし,fun および finは, プリミティブfunction_nameの内部的なコーディングです.

この関数は,プリミティブを "gw_user.c" でコールされるゲートウェイ (fun=14)に関連付ける際に有用です. ただし, ilib_build関数が C, C++ または Fortranコードに基づき新しい関数で Scilabを拡張するためのより簡単な方法であることに注意してください.

この関数は,既存のプリミティブ関数にエイリアスを追加したり, リネームする場合にも使用可能です.

funptr および clearfun と共に使用すると,既存のプリミティブ関数にエイリアスを 追加したり, リネームすることができます.

absptr=funptr("abs");// get the function_ptr associated with the abs function
newfun("abs_bis",absptr) // create an alias of the abs function
abs_bis(-1+%i)
clearfun("abs") // remove abs as a known function

 //redefine abs
 function y=abs(x)
y=abs_bis(real(x));
 endfunction

abs(-1+%i)

参照

  • clearfun — プリミティブ(組み込み関数)を削除
  • funptr — プリミティブのコーディング ( 上級者向け )
  • ilib_build — utility for shared library management
Report an issue
<< intppty Built-in & external what >>

Copyright (c) 2022-2023 (Dassault Systèmes)
Copyright (c) 2017-2022 (ESI Group)
Copyright (c) 2011-2017 (Scilab Enterprises)
Copyright (c) 1989-2012 (INRIA)
Copyright (c) 1989-2007 (ENPC)
with contributors
Last updated:
Tue Feb 14 15:10:43 CET 2017