Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
pike
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pikelang
pike
Commits
24f3e6ca
Commit
24f3e6ca
authored
28 years ago
by
Fredrik Hübinette (Hubbe)
Browse files
Options
Downloads
Patches
Plain Diff
clone and new added
Rev: lib/master.pike:1.5
parent
6ba48cc0
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/master.pike
+34
-30
34 additions, 30 deletions
lib/master.pike
with
34 additions
and
30 deletions
lib/master.pike
+
34
−
30
View file @
24f3e6ca
...
@@ -2,36 +2,6 @@ string describe_backtrace(mixed *trace);
...
@@ -2,36 +2,6 @@ string describe_backtrace(mixed *trace);
string pike_library_path;
string pike_library_path;
/* This function is called when an error occurs that is not caught
* with catch(). It's argument consists of:
* ({ error_string, backtrace }) where backtrace is the output from the
* backtrace() efun.
*/
void handle_error(mixed *trace)
{
predef::trace(0);
werror(describe_backtrace(trace));
}
/* Note that create is called before add_precompiled_program
*/
void create()
{
/* make ourselves known */
add_constant("master",lambda() { return this_object(); });
add_constant("describe_backtrace",describe_backtrace);
add_constant("version",lambda() { return "Pike v0.2"; });
add_constant("mkmultiset",lambda(mixed *a) { return aggregate_multiset(@a); });
add_constant("strlen",sizeof);
add_constant("clone",lambda(program p,mixed ... a)
{ return p(@a); } );
add_constant("new",lambda(program p,mixed ... a)
{ return p(@a); } );
random_seed(time() + (getpid() * 0x11111111));
}
mapping (string:program) programs=([]);
mapping (string:program) programs=([]);
/* This function is called whenever a module has built a clonable program
/* This function is called whenever a module has built a clonable program
...
@@ -69,6 +39,40 @@ program cast_to_program(string pname)
...
@@ -69,6 +39,40 @@ program cast_to_program(string pname)
return programs[pname]=ret;
return programs[pname]=ret;
}
}
/* This function is called when an error occurs that is not caught
* with catch(). It's argument consists of:
* ({ error_string, backtrace }) where backtrace is the output from the
* backtrace() efun.
*/
void handle_error(mixed *trace)
{
predef::trace(0);
werror(describe_backtrace(trace));
}
object new(mixed prog, mixed ... args)
{
return ((program)prog)(@args);
}
/* Note that create is called before add_precompiled_program
*/
void create()
{
/* make ourselves known */
add_constant("master",lambda() { return this_object(); });
add_constant("describe_backtrace",describe_backtrace);
add_constant("version",lambda() { return "Pike v0.2"; });
add_constant("mkmultiset",lambda(mixed *a) { return aggregate_multiset(@a); });
add_constant("strlen",sizeof);
add_constant("new",new);
add_constant("clone",new);
random_seed(time() + (getpid() * 0x11111111));
}
/*
/*
* This function is called whenever a inherit is called for.
* This function is called whenever a inherit is called for.
* It is supposed to return the program to inherit.
* It is supposed to return the program to inherit.
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment