From bd8cca2bded3dcd53b4b65dcc572bfcd25f1dc7c Mon Sep 17 00:00:00 2001 From: pmoura Date: Mon, 19 Feb 2007 19:05:42 +0000 Subject: [PATCH] Logtalk 2.29.4 files. git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@1800 b08c6af1-5177-4d33-ba66-4b1c6b8b522a --- Logtalk/examples/bottles/NOTES.txt | 15 ++ Logtalk/examples/bottles/SCRIPT.txt | 13 ++ Logtalk/examples/bottles/bottles.lgt | 31 +++++ Logtalk/examples/bottles/loader.lgt | 11 ++ Logtalk/examples/threads/blackboard/NOTES.txt | 14 ++ .../examples/threads/blackboard/SCRIPT.txt | 38 ++++++ .../threads/blackboard/blackboard.lgt | 66 +++++++++ .../examples/threads/blackboard/loader.lgt | 13 ++ Logtalk/examples/threads/buffer/NOTES.txt | 14 ++ Logtalk/examples/threads/buffer/SCRIPT.txt | 44 ++++++ Logtalk/examples/threads/buffer/buffer.lgt | 66 +++++++++ Logtalk/examples/threads/buffer/loader.lgt | 13 ++ Logtalk/library/listing.lgt | 128 ++++++++++++++++++ .../refman/builtins/threaded_notify1.html | 64 +++++++++ .../refman/builtins/threaded_wait1.html | 64 +++++++++ Logtalk/wenv/ctags/NOTES.txt | 21 +++ Logtalk/wenv/ctags/ctags | 8 ++ Logtalk/wenv/ctags/ctags.tmcodebrowser | 8 ++ .../Snippets/Category with protocol.tmSnippet | 27 ++++ .../Snippets/Category.tmSnippet | 26 ++++ .../Snippets/Class with all.tmSnippet | 30 ++++ .../Snippets/Class with category.tmSnippet | 28 ++++ .../Snippets/Class with metaclass.tmSnippet | 28 ++++ .../Snippets/Class with protocol.tmSnippet | 28 ++++ .../Logtalk.tmbundle/Snippets/Class.tmSnippet | 27 ++++ .../Snippets/Extended protocol.tmSnippet | 27 ++++ .../Snippets/Instance with all.tmSnippet | 29 ++++ .../Snippets/Instance with category.tmSnippet | 28 ++++ .../Snippets/Instance with protocol.tmSnippet | 28 ++++ .../Snippets/Instance.tmSnippet | 27 ++++ ...Private predicate (no arguments).tmSnippet | 19 +++ .../Snippets/Private predicate.tmSnippet | 20 +++ ...otected predicate (no arguments).tmSnippet | 19 +++ .../Snippets/Protected predicate.tmSnippet | 20 +++ .../Snippets/Protocol.tmSnippet | 26 ++++ .../Snippets/Prototype with all.tmSnippet | 29 ++++ .../Prototype with category.tmSnippet | 27 ++++ .../Snippets/Prototype with parent.tmSnippet | 27 ++++ .../Prototype with protocol.tmSnippet | 27 ++++ .../Snippets/Prototype.tmSnippet | 26 ++++ .../Public predicate (no arguments).tmSnippet | 19 +++ .../Snippets/Public predicate.tmSnippet | 20 +++ 42 files changed, 1243 insertions(+) create mode 100644 Logtalk/examples/bottles/NOTES.txt create mode 100644 Logtalk/examples/bottles/SCRIPT.txt create mode 100644 Logtalk/examples/bottles/bottles.lgt create mode 100644 Logtalk/examples/bottles/loader.lgt create mode 100644 Logtalk/examples/threads/blackboard/NOTES.txt create mode 100644 Logtalk/examples/threads/blackboard/SCRIPT.txt create mode 100644 Logtalk/examples/threads/blackboard/blackboard.lgt create mode 100644 Logtalk/examples/threads/blackboard/loader.lgt create mode 100644 Logtalk/examples/threads/buffer/NOTES.txt create mode 100644 Logtalk/examples/threads/buffer/SCRIPT.txt create mode 100644 Logtalk/examples/threads/buffer/buffer.lgt create mode 100644 Logtalk/examples/threads/buffer/loader.lgt create mode 100644 Logtalk/library/listing.lgt create mode 100644 Logtalk/manuals/refman/builtins/threaded_notify1.html create mode 100644 Logtalk/manuals/refman/builtins/threaded_wait1.html create mode 100644 Logtalk/wenv/ctags/NOTES.txt create mode 100644 Logtalk/wenv/ctags/ctags create mode 100644 Logtalk/wenv/ctags/ctags.tmcodebrowser create mode 100644 Logtalk/wenv/textmate/Logtalk.tmbundle/Snippets/Category with protocol.tmSnippet create mode 100644 Logtalk/wenv/textmate/Logtalk.tmbundle/Snippets/Category.tmSnippet create mode 100644 Logtalk/wenv/textmate/Logtalk.tmbundle/Snippets/Class with all.tmSnippet create mode 100644 Logtalk/wenv/textmate/Logtalk.tmbundle/Snippets/Class with category.tmSnippet create mode 100644 Logtalk/wenv/textmate/Logtalk.tmbundle/Snippets/Class with metaclass.tmSnippet create mode 100644 Logtalk/wenv/textmate/Logtalk.tmbundle/Snippets/Class with protocol.tmSnippet create mode 100644 Logtalk/wenv/textmate/Logtalk.tmbundle/Snippets/Class.tmSnippet create mode 100644 Logtalk/wenv/textmate/Logtalk.tmbundle/Snippets/Extended protocol.tmSnippet create mode 100644 Logtalk/wenv/textmate/Logtalk.tmbundle/Snippets/Instance with all.tmSnippet create mode 100644 Logtalk/wenv/textmate/Logtalk.tmbundle/Snippets/Instance with category.tmSnippet create mode 100644 Logtalk/wenv/textmate/Logtalk.tmbundle/Snippets/Instance with protocol.tmSnippet create mode 100644 Logtalk/wenv/textmate/Logtalk.tmbundle/Snippets/Instance.tmSnippet create mode 100644 Logtalk/wenv/textmate/Logtalk.tmbundle/Snippets/Private predicate (no arguments).tmSnippet create mode 100644 Logtalk/wenv/textmate/Logtalk.tmbundle/Snippets/Private predicate.tmSnippet create mode 100644 Logtalk/wenv/textmate/Logtalk.tmbundle/Snippets/Protected predicate (no arguments).tmSnippet create mode 100644 Logtalk/wenv/textmate/Logtalk.tmbundle/Snippets/Protected predicate.tmSnippet create mode 100644 Logtalk/wenv/textmate/Logtalk.tmbundle/Snippets/Protocol.tmSnippet create mode 100644 Logtalk/wenv/textmate/Logtalk.tmbundle/Snippets/Prototype with all.tmSnippet create mode 100644 Logtalk/wenv/textmate/Logtalk.tmbundle/Snippets/Prototype with category.tmSnippet create mode 100644 Logtalk/wenv/textmate/Logtalk.tmbundle/Snippets/Prototype with parent.tmSnippet create mode 100644 Logtalk/wenv/textmate/Logtalk.tmbundle/Snippets/Prototype with protocol.tmSnippet create mode 100644 Logtalk/wenv/textmate/Logtalk.tmbundle/Snippets/Prototype.tmSnippet create mode 100644 Logtalk/wenv/textmate/Logtalk.tmbundle/Snippets/Public predicate (no arguments).tmSnippet create mode 100644 Logtalk/wenv/textmate/Logtalk.tmbundle/Snippets/Public predicate.tmSnippet diff --git a/Logtalk/examples/bottles/NOTES.txt b/Logtalk/examples/bottles/NOTES.txt new file mode 100644 index 000000000..073e6576d --- /dev/null +++ b/Logtalk/examples/bottles/NOTES.txt @@ -0,0 +1,15 @@ +================================================================= +Logtalk - Object oriented extension to Prolog +Release 2.29.4 + +Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved. +================================================================= + + +To load this example and for sample queries, please see the SCRIPT +file. + +This folder contains a Logtalk version of the programming problem +"99 bottles of beer on the wall" , contributed to the web site: + + http://99-bottles-of-beer.net/ diff --git a/Logtalk/examples/bottles/SCRIPT.txt b/Logtalk/examples/bottles/SCRIPT.txt new file mode 100644 index 000000000..e0118ac04 --- /dev/null +++ b/Logtalk/examples/bottles/SCRIPT.txt @@ -0,0 +1,13 @@ +================================================================= +Logtalk - Object oriented extension to Prolog +Release 2.29.4 + +Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved. +================================================================= + + +% just load the example, which contains an initialization/1 directive +% that runs it: + +| ?- logtalk_load(bottles(loader)). +... diff --git a/Logtalk/examples/bottles/bottles.lgt b/Logtalk/examples/bottles/bottles.lgt new file mode 100644 index 000000000..5aa2468f6 --- /dev/null +++ b/Logtalk/examples/bottles/bottles.lgt @@ -0,0 +1,31 @@ +/******************************************************* + * 99 Bottles of Beer + * Paulo Moura - January 21, 2007 + * bottles.lgt + * To execute start Logtalk and use the query + * logtalk_load(bottles). + *******************************************************/ + +:- object(bottles). + + :- initialization(sing(99)). + + sing(0) :- + write('No more bottles of beer on the wall, no more bottles of beer.'), nl, + write('Go to the store and buy some more, 99 bottles of beer on the wall.'), nl, nl. + sing(N) :- + N > 0, + N2 is N -1, + beers(N), write(' of beer on the wall, '), beers(N), write(' of beer.'), nl, + write('Take one down and pass it around, '), beers(N2), write(' of beer on the wall.'), nl, nl, + sing(N2). + + beers(0) :- + write('no more bottles'). + beers(1) :- + write('1 bottle'). + beers(N) :- + N > 1, + write(N), write(' bottles'). + +:- end_object. diff --git a/Logtalk/examples/bottles/loader.lgt b/Logtalk/examples/bottles/loader.lgt new file mode 100644 index 000000000..c90ed3c36 --- /dev/null +++ b/Logtalk/examples/bottles/loader.lgt @@ -0,0 +1,11 @@ + +:- initialization( + logtalk_load(bottles)). + +/* +If you intend to use the FOP XSL:FO processor for generating PDF documenting +files, comment the directive above and uncomment the directive below + +:- initialization( + logtalk_load(bottles, [events(on), xmlsref(standalone)])). +*/ diff --git a/Logtalk/examples/threads/blackboard/NOTES.txt b/Logtalk/examples/threads/blackboard/NOTES.txt new file mode 100644 index 000000000..a06926e3a --- /dev/null +++ b/Logtalk/examples/threads/blackboard/NOTES.txt @@ -0,0 +1,14 @@ +================================================================= +Logtalk - Object oriented extension to Prolog +Release 2.29.4 + +Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved. +================================================================= + + +To load this example and for sample queries, please see the SCRIPT file. + +This folder contains a simple multi-threading example illustrating how +to use the Logtalk built-in predicates threaded_wait/1 and threaded_notify/1 +for synchronizing threads using shared resources. The example consists of +two persons, a student and a teacher, sharing a blackboard chalk and eraser. diff --git a/Logtalk/examples/threads/blackboard/SCRIPT.txt b/Logtalk/examples/threads/blackboard/SCRIPT.txt new file mode 100644 index 000000000..9cba47864 --- /dev/null +++ b/Logtalk/examples/threads/blackboard/SCRIPT.txt @@ -0,0 +1,38 @@ +================================================================= +Logtalk - Object oriented extension to Prolog +Release 2.29.4 + +Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved. +================================================================= + + +% start by loading the necessary library support files: + +| ?- logtalk_load(library(random_loader)). +... + + +% now you are ready for loading the example: + +| ?- logtalk_load(blackboard(loader)). +... + + +% start the producer and the consumer, each one running in its own thread: + +| ?- threaded_ignore(teacher::run(4)), threaded_ignore(student::run(10)). + +teacher is writing... +student is writing... +student is writing... +student is writing... +student is writing... +teacher is writing... +teacher is writing... +teacher is writing... +student is writing... +student is writing... +student is writing... +student is writing... +student is writing... +student is writing... diff --git a/Logtalk/examples/threads/blackboard/blackboard.lgt b/Logtalk/examples/threads/blackboard/blackboard.lgt new file mode 100644 index 000000000..0f4fc4b2f --- /dev/null +++ b/Logtalk/examples/threads/blackboard/blackboard.lgt @@ -0,0 +1,66 @@ + +:- category(using). % we can call the threaded_wait/1 and threaded_notify/1 predicates from category + % predicates; the importing object threads are used for exchanging notifications + :- public([pick_up/0, release/0]). + + pick_up :- + threaded_wait(free). % wait until the tool is available + + release :- + threaded_notify(free). % notify that the tool is now available + +:- end_category. + + +:- object(chalk, + imports(using)). + + :- threaded. % the chalk's thread is used for exchanging notifications + :- initialization(::release). % make the chalk initially available + +:- end_object. + + +:- object(eraser, + imports(using)). + + :- threaded. % the eraser's thread is used for exchanging notifications + :- initialization(::release). % make the eraser initially available + +:- end_object. + + +:- category(running). % in alternative to a category we could also have defined a class + + :- public(run/1). + + run(0) :- + !. + run(N) :- + N > 0, + eraser::pick_up, + chalk::pick_up, + self(Self), + write(Self), write(' is writing...'), nl, + random::random(1, 5, Random), % simulate a variable time + thread_sleep(Random), % spending on writing + chalk::release, + eraser::release, + N2 is N - 1, + run(N2). + +:- end_category. + + +:- object(teacher, + imports(running)). + + +:- end_object. + + +:- object(student, + imports(running)). + + +:- end_object. diff --git a/Logtalk/examples/threads/blackboard/loader.lgt b/Logtalk/examples/threads/blackboard/loader.lgt new file mode 100644 index 000000000..91f7dfc1b --- /dev/null +++ b/Logtalk/examples/threads/blackboard/loader.lgt @@ -0,0 +1,13 @@ + +:- initialization( + logtalk_load( + blackboard)). + +/* +If you intend to use the FOP XSL:FO processor for generating PDF documenting +files, comment the directive above and uncomment the directive below + +:- initialization( + logtalk_load( + blackboard, [xmlsref(standalone)])). +*/ diff --git a/Logtalk/examples/threads/buffer/NOTES.txt b/Logtalk/examples/threads/buffer/NOTES.txt new file mode 100644 index 000000000..47b793e9d --- /dev/null +++ b/Logtalk/examples/threads/buffer/NOTES.txt @@ -0,0 +1,14 @@ +================================================================= +Logtalk - Object oriented extension to Prolog +Release 2.29.4 + +Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved. +================================================================= + + +To load this example and for sample queries, please see the SCRIPT file. + +This folder contains a simple multi-threading example illustrating how +to use the Logtalk built-in predicates threaded_wait/1 and threaded_notify/1 +for synchronizing threads writing to and reading from a buffer that can +only contain an item at the same time. diff --git a/Logtalk/examples/threads/buffer/SCRIPT.txt b/Logtalk/examples/threads/buffer/SCRIPT.txt new file mode 100644 index 000000000..22cf91c1e --- /dev/null +++ b/Logtalk/examples/threads/buffer/SCRIPT.txt @@ -0,0 +1,44 @@ +================================================================= +Logtalk - Object oriented extension to Prolog +Release 2.29.4 + +Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved. +================================================================= + + +% start by loading the necessary library support files: + +| ?- logtalk_load(library(random_loader)). +... + + +% now you are ready for loading the example: + +| ?- logtalk_load(buffer(loader)). +... + + +% start the producer and the consumer, each one running in its own thread: + +| ?- threaded_ignore(producer::run(10)), threaded_ignore(consumer::run(10)). + +producer wrote item 0 +consumer read item 0 +producer wrote item 1 +consumer read item 1 +producer wrote item 2 +consumer read item 2 +producer wrote item 3 +consumer read item 3 +producer wrote item 4 +consumer read item 4 +producer wrote item 5 +consumer read item 5 +producer wrote item 6 +consumer read item 6 +producer wrote item 7 +consumer read item 7 +producer wrote item 8 +consumer read item 8 +producer wrote item 9 +consumer read item 9 diff --git a/Logtalk/examples/threads/buffer/buffer.lgt b/Logtalk/examples/threads/buffer/buffer.lgt new file mode 100644 index 000000000..126232290 --- /dev/null +++ b/Logtalk/examples/threads/buffer/buffer.lgt @@ -0,0 +1,66 @@ + +:- object(buffer). + + :- threaded. + + :- public([put/1, get/1]). + + :- private(item/1). + :- dynamic(item/1). + + put(N) :- + ( N > 0 % wait until the previous item is consumed + -> NP is N - 1, threaded_wait(consumed(NP)) % (except for the first item!) + ; true + ), + assertz(item(N)), + sender(Sender), + writeq(Sender), write(' wrote item '), write(N), nl, + threaded_notify(produced(N)). % notify consumer that a new item is available + + get(N) :- + threaded_wait(produced(N)), % wait until an item is available + retract(item(N)), + sender(Sender), + writeq(Sender), write(' read item '), write(N), nl, + threaded_notify(consumed(N)). % notify producer that the item was consumed + +:- end_object. + + +:- object(producer). + + :- public(run/1). + + run(N) :- + run(0, N). + + run(N, N) :- !. + run(M, N) :- + M < N, + random::random(1, 5, Random), % simulate a variable time to + thread_sleep(Random), % produce a new item + buffer::put(M), + M2 is M + 1, + run(M2, N). + +:- end_object. + + +:- object(consumer). + + :- public(run/1). + + run(N) :- + run(0, N). + + run(N, N) :- !. + run(M, N) :- + M < N, + random::random(1, 5, Random), % simulate a variable time + thread_sleep(Random), % to consume an item + buffer::get(M), + M2 is M + 1, + run(M2, N). + +:- end_object. diff --git a/Logtalk/examples/threads/buffer/loader.lgt b/Logtalk/examples/threads/buffer/loader.lgt new file mode 100644 index 000000000..b2b2038c8 --- /dev/null +++ b/Logtalk/examples/threads/buffer/loader.lgt @@ -0,0 +1,13 @@ + +:- initialization( + logtalk_load( + buffer)). + +/* +If you intend to use the FOP XSL:FO processor for generating PDF documenting +files, comment the directive above and uncomment the directive below + +:- initialization( + logtalk_load( + buffer, [xmlsref(standalone)])). +*/ diff --git a/Logtalk/library/listing.lgt b/Logtalk/library/listing.lgt new file mode 100644 index 000000000..2d55be120 --- /dev/null +++ b/Logtalk/library/listing.lgt @@ -0,0 +1,128 @@ + +:- category(listing). + + :- info([ + version is 1.0, + author is 'Paulo Moura', + date is 2007/2/8, + comment is 'Listing predicates.']). + + :- public(listing/0). + :- mode(listing, one). + :- info(listing/0, [ + comment is 'Lists all clauses of all dynamic predicates to the current output stream.']). + + :- public(listing/1). + :- mode(listing(+predicate_indicator), one). + :- info(listing/1, [ + comment is 'Lists all clauses of a dynamic predicate to the current output stream.', + argnames is ['Predicate']]). + + :- public(portray_clause/1). + :- mode(portray_clause(+clause), one). + :- info(portray_clause/1, [ + comment is 'Pretty prints a clause to the current output stream.', + argnames is ['Clause']]). + + :- protected(portray_body/1). + :- mode(portray_body(+callable), one). + :- info(portray_body/1, [ + comment is 'Pretty prints a clause body to the current output stream.', + argnames is ['Body']]). + + :- protected(spaces/1). + :- mode(spaces(+integer), one). + :- info(spaces/1, [ + comment is 'Prints N spaces to the current output stream.', + argnames is ['N']]). + + listing :- + ::current_predicate(Functor/Arity), + functor(Head, Functor, Arity), + ::predicate_property(Head, (dynamic)), + nl, + listing_properties(Head, Functor, Arity), + listing_clauses(Head, Functor, Arity), + fail. + listing. + + listing(Functor/Arity) :- + atom(Functor), + integer(Arity), + ::current_predicate(Functor/Arity), + functor(Head, Functor, Arity), + ::predicate_property(Head, (dynamic)), !, + listing_properties(Head, Functor, Arity), + listing_clauses(Head, Functor, Arity). + + listing_properties(Head, Functor, Arity) :- + ::predicate_property(Head, public), + write(':- public('), writeq(Functor/Arity), write(').'), + fail. + listing_properties(Head, Functor, Arity) :- + ::predicate_property(Head, protected), + write(':- protected('), writeq(Functor/Arity), write(').'), + fail. + listing_properties(Head, Functor, Arity) :- + ::predicate_property(Head, private), + write(':- private('), writeq(Functor/Arity), write(').'), + fail. + listing_properties(Head, _, _) :- + ::predicate_property(Head, declared_in(DclEntity)), + write(' % '), writeq(declared_in(DclEntity)), nl, + fail. + listing_properties(Head, Functor, Arity) :- + ::predicate_property(Head, (dynamic)), + write(':- dynamic('), writeq(Functor/Arity), write(').'), + fail. + listing_properties(Head, _, _) :- + ( ::clause(Head, _) -> + nl + ; write(' % no local clauses found'), nl + ), + fail. + listing_properties(Head, _, _) :- + ::predicate_property(Head, meta_predicate(Mode)), + write(':- meta_predicate('), writeq(Mode), write(').'), nl, + fail. + listing_properties(Head, Functor, Arity) :- + ::predicate_property(Head, synchronized), + write(':- synchronized('), writeq(Functor/Arity), write(').'), nl, + fail. + listing_properties(Head, Functor, Arity) :- + ::predicate_property(Head, alias(OFunctor/OArity)), + write(':- alias('), writeq(OFunctor/OArity), write(', '), writeq(Functor/Arity), write(').'), nl, + fail. + listing_properties(Head, _, _) :- + ::predicate_property(Head, non_terminal(NonTerminal//NTArity)) -> + write('% clauses resulting from the expansion of the non-terminal '), writeq(NonTerminal//NTArity), nl, + fail. + listing_properties(_, _, _). + + listing_clauses(Head, _, _) :- + ::clause(Head, Body), + ::portray_clause((Head :- Body)), + fail. + listing_clauses(_). + + portray_clause((Head :- true)) :- + !, + numbervars(Head, 0, _), + write_term(Head, [numbervars(true), quoted(true)]), write('.'), nl. + portray_clause((Head :- Body)) :- + numbervars((Head:-Body), 0, _), + write_term(Head, [numbervars(true), quoted(true)]), write(' :-'), nl, + ::portray_body(Body), + write('.'), nl. + + portray_body(Body) :- + spaces(4), write_term(Body, [numbervars(true), quoted(true)]). + + spaces(0) :- + !. + spaces(N) :- + put_char(' '), + N2 is N - 1, + spaces(N2). + +:- end_category. diff --git a/Logtalk/manuals/refman/builtins/threaded_notify1.html b/Logtalk/manuals/refman/builtins/threaded_notify1.html new file mode 100644 index 000000000..1741a072d --- /dev/null +++ b/Logtalk/manuals/refman/builtins/threaded_notify1.html @@ -0,0 +1,64 @@ + + + + + + + + Logtalk built-in predicate: threaded_notify/1 + + + + + + +
Logtalk reference manual
+
Built-in predicate: threaded_notify/1
+
+
+ + +

threaded_notify/1

+ + +

Description

+ +
threaded_notify(Term)
+

+Sends Term as a notification to any thread suspended waiting for it to proceed. The call must be made within the same object (this) containing the calls to the threaded_wait/1 predicate waiting for the notification. +

+ +

Template and modes

+ +
threaded_notify(@term)
+ +

Errors

+ +
+

+(none) +

+
+ +

Examples

+ +
+
Send the notification data_avaialble:
+
threaded_notify(data_avaialble)
+
+ + + + + + diff --git a/Logtalk/manuals/refman/builtins/threaded_wait1.html b/Logtalk/manuals/refman/builtins/threaded_wait1.html new file mode 100644 index 000000000..402566739 --- /dev/null +++ b/Logtalk/manuals/refman/builtins/threaded_wait1.html @@ -0,0 +1,64 @@ + + + + + + + + Logtalk built-in predicate: threaded_wait/1 + + + + + + +
Logtalk reference manual
+
Built-in predicate: threaded_wait/1
+
+
+ + +

threaded_wait/1

+ + +

Description

+ +
threaded_wait(Term)
+

+Suspends the thread making the call until a notification is received that unifies with Term. The call must be made within the same object (this) containing the calls to the threaded_notify/1 predicate that will eventually send the notification. +

+ +

Template and modes

+ +
threaded_wait(?term)
+ +

Errors

+ +
+

+(none) +

+
+ +

Examples

+ +
+
Wait until the data_avaialble notification is received:
+
threaded_wait(data_avaialble)
+
+ + + + + + diff --git a/Logtalk/wenv/ctags/NOTES.txt b/Logtalk/wenv/ctags/NOTES.txt new file mode 100644 index 000000000..7191dbfcf --- /dev/null +++ b/Logtalk/wenv/ctags/NOTES.txt @@ -0,0 +1,21 @@ +================================================================= +Logtalk - Object oriented extension to Prolog +Release 2.29.4 + +Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved. +================================================================= + + +This folder contains minimal support for using Exuberant Ctags +(http://ctags.sourceforge.net/) with Logtalk. There are two files +that you will need to rename and copy to your home directory: + + ctags + Rename this file to "$HOME/.ctags" or append its contents to + the "$HOME/.ctags" file if it already exists + + ctags.tmcodebrowser + Rename this file to "$HOME/.ctags.tmcodebrowser" or append its + contents to "$HOME/.ctags.tmcodebrowser" if it already exists + in order to use the MacOS X TextMate text editor and its + TmCodeBrowser plug-in (http://www.cocoabits.com/TmCodeBrowser/) diff --git a/Logtalk/wenv/ctags/ctags b/Logtalk/wenv/ctags/ctags new file mode 100644 index 000000000..71c7e6c1a --- /dev/null +++ b/Logtalk/wenv/ctags/ctags @@ -0,0 +1,8 @@ +--langdef=logtalk +--langmap=logtalk:.lgt +--regex-logtalk=/^[ \t]*:- object\(([a-z][a-zA-Z0-9_]*)/\1/Objects/ +--regex-logtalk=/^[ \t]*:- protocol\(([a-z][a-zA-Z0-9_]*)/\1/Protocols/ +--regex-logtalk=/^[ \t]*:- category\(([a-z][a-zA-Z0-9_]*)/\1/Categories/ +--regex-logtalk=/^[ \t]*:- public\(([a-z][a-zA-Z0-9_]*)/\1/Public predicates/ +--regex-logtalk=/^[ \t]*:- protected\(([a-z][a-zA-Z0-9_]*)/\1/Protected predicates/ +--regex-logtalk=/^[ \t]*:- private\(([a-z][a-zA-Z0-9_]*)/\1/Private predicates/ diff --git a/Logtalk/wenv/ctags/ctags.tmcodebrowser b/Logtalk/wenv/ctags/ctags.tmcodebrowser new file mode 100644 index 000000000..71c7e6c1a --- /dev/null +++ b/Logtalk/wenv/ctags/ctags.tmcodebrowser @@ -0,0 +1,8 @@ +--langdef=logtalk +--langmap=logtalk:.lgt +--regex-logtalk=/^[ \t]*:- object\(([a-z][a-zA-Z0-9_]*)/\1/Objects/ +--regex-logtalk=/^[ \t]*:- protocol\(([a-z][a-zA-Z0-9_]*)/\1/Protocols/ +--regex-logtalk=/^[ \t]*:- category\(([a-z][a-zA-Z0-9_]*)/\1/Categories/ +--regex-logtalk=/^[ \t]*:- public\(([a-z][a-zA-Z0-9_]*)/\1/Public predicates/ +--regex-logtalk=/^[ \t]*:- protected\(([a-z][a-zA-Z0-9_]*)/\1/Protected predicates/ +--regex-logtalk=/^[ \t]*:- private\(([a-z][a-zA-Z0-9_]*)/\1/Private predicates/ diff --git a/Logtalk/wenv/textmate/Logtalk.tmbundle/Snippets/Category with protocol.tmSnippet b/Logtalk/wenv/textmate/Logtalk.tmbundle/Snippets/Category with protocol.tmSnippet new file mode 100644 index 000000000..6818f7a49 --- /dev/null +++ b/Logtalk/wenv/textmate/Logtalk.tmbundle/Snippets/Category with protocol.tmSnippet @@ -0,0 +1,27 @@ + + + + + content + +:- category(${1:Category}, + implements(${2:Protocol})). + + :- info([ + version is 1.0, + author is '`niutil -readprop / /users/$USER realname`', + date is `date +%Y/%m/%d`, + comment is '${3:Description}']). + +$0 + +:- end_category. + + name + Category with protocol + scope + source.logtalk + uuid + 8A263B8A-73F7-11D9-8083-000D93589AF6 + + diff --git a/Logtalk/wenv/textmate/Logtalk.tmbundle/Snippets/Category.tmSnippet b/Logtalk/wenv/textmate/Logtalk.tmbundle/Snippets/Category.tmSnippet new file mode 100644 index 000000000..177a88066 --- /dev/null +++ b/Logtalk/wenv/textmate/Logtalk.tmbundle/Snippets/Category.tmSnippet @@ -0,0 +1,26 @@ + + + + + content + +:- category(${1:Category}). + + :- info([ + version is 1.0, + author is '`niutil -readprop / /users/$USER realname`', + date is `date +%Y/%m/%d`, + comment is '${2:Description}']). + +$0 + +:- end_category. + + name + Category + scope + source.logtalk + uuid + 8A2679C6-73F7-11D9-8083-000D93589AF6 + + diff --git a/Logtalk/wenv/textmate/Logtalk.tmbundle/Snippets/Class with all.tmSnippet b/Logtalk/wenv/textmate/Logtalk.tmbundle/Snippets/Class with all.tmSnippet new file mode 100644 index 000000000..d0a1540cc --- /dev/null +++ b/Logtalk/wenv/textmate/Logtalk.tmbundle/Snippets/Class with all.tmSnippet @@ -0,0 +1,30 @@ + + + + + content + +:- object(${1:Class}, + implements(${2:Protocol}), + imports(${3:Category}), + instantiates(${4:Metaclass}), + specializes(${5:Superclass})). + + :- info([ + version is 1.0, + author is '`niutil -readprop / /users/$USER realname`', + date is `date +%Y/%m/%d`, + comment is '${6:Description}']). + +$0 + +:- end_object. + + name + Class with all + scope + source.logtalk + uuid + 8A26A112-73F7-11D9-8083-000D93589AF6 + + diff --git a/Logtalk/wenv/textmate/Logtalk.tmbundle/Snippets/Class with category.tmSnippet b/Logtalk/wenv/textmate/Logtalk.tmbundle/Snippets/Class with category.tmSnippet new file mode 100644 index 000000000..1d4579792 --- /dev/null +++ b/Logtalk/wenv/textmate/Logtalk.tmbundle/Snippets/Class with category.tmSnippet @@ -0,0 +1,28 @@ + + + + + content + +:- object(${1:Class}, + imports(${2:Category}), + specializes(${3:Superclass})). + + :- info([ + version is 1.0, + author is '`niutil -readprop / /users/$USER realname`', + date is `date +%Y/%m/%d`, + comment is '${4:Description}']). + +$0 + +:- end_object. + + name + Class with category + scope + source.logtalk + uuid + 8A26CCD5-73F7-11D9-8083-000D93589AF6 + + diff --git a/Logtalk/wenv/textmate/Logtalk.tmbundle/Snippets/Class with metaclass.tmSnippet b/Logtalk/wenv/textmate/Logtalk.tmbundle/Snippets/Class with metaclass.tmSnippet new file mode 100644 index 000000000..19c06a765 --- /dev/null +++ b/Logtalk/wenv/textmate/Logtalk.tmbundle/Snippets/Class with metaclass.tmSnippet @@ -0,0 +1,28 @@ + + + + + content + +:- object(${1:Class}, + instantiates(${2:Metaclass}), + specializes(${3:Superclass})). + + :- info([ + version is 1.0, + author is '`niutil -readprop / /users/$USER realname`', + date is `date +%Y/%m/%d`, + comment is '${4:Description}']). + +$0 + +:- end_object. + + name + Class with metaclass + scope + source.logtalk + uuid + 8A270068-73F7-11D9-8083-000D93589AF6 + + diff --git a/Logtalk/wenv/textmate/Logtalk.tmbundle/Snippets/Class with protocol.tmSnippet b/Logtalk/wenv/textmate/Logtalk.tmbundle/Snippets/Class with protocol.tmSnippet new file mode 100644 index 000000000..5295ff80a --- /dev/null +++ b/Logtalk/wenv/textmate/Logtalk.tmbundle/Snippets/Class with protocol.tmSnippet @@ -0,0 +1,28 @@ + + + + + content + +:- object(${1:Class}, + implements(${2:Protocol}), + specializes(${3:Superclass})). + + :- info([ + version is 1.0, + author is '`niutil -readprop / /users/$USER realname`', + date is `date +%Y/%m/%d`, + comment is '${4:Description}']). + +$0 + +:- end_object. + + name + Class with protocol + scope + source.logtalk + uuid + 8A272A62-73F7-11D9-8083-000D93589AF6 + + diff --git a/Logtalk/wenv/textmate/Logtalk.tmbundle/Snippets/Class.tmSnippet b/Logtalk/wenv/textmate/Logtalk.tmbundle/Snippets/Class.tmSnippet new file mode 100644 index 000000000..c5f129340 --- /dev/null +++ b/Logtalk/wenv/textmate/Logtalk.tmbundle/Snippets/Class.tmSnippet @@ -0,0 +1,27 @@ + + + + + content + +:- object(${1:Class}, + specializes(${2:Superclass})). + + :- info([ + version is 1.0, + author is '`niutil -readprop / /users/$USER realname`', + date is `date +%Y/%m/%d`, + comment is '${3:Description}']). + +$0 + +:- end_object. + + name + Class + scope + source.logtalk + uuid + 8A275494-73F7-11D9-8083-000D93589AF6 + + diff --git a/Logtalk/wenv/textmate/Logtalk.tmbundle/Snippets/Extended protocol.tmSnippet b/Logtalk/wenv/textmate/Logtalk.tmbundle/Snippets/Extended protocol.tmSnippet new file mode 100644 index 000000000..e6b80a353 --- /dev/null +++ b/Logtalk/wenv/textmate/Logtalk.tmbundle/Snippets/Extended protocol.tmSnippet @@ -0,0 +1,27 @@ + + + + + content + +:- protocol(${1:Extended}, + extends(${2:Minimal})). + + :- info([ + version is 1.0, + author is '`niutil -readprop / /users/$USER realname`', + date is `date +%Y/%m/%d`, + comment is '${3:Description}']). + +$0 + +:- end_protocol. + + name + Extended protocol + scope + source.logtalk + uuid + 8A277A4C-73F7-11D9-8083-000D93589AF6 + + diff --git a/Logtalk/wenv/textmate/Logtalk.tmbundle/Snippets/Instance with all.tmSnippet b/Logtalk/wenv/textmate/Logtalk.tmbundle/Snippets/Instance with all.tmSnippet new file mode 100644 index 000000000..2f0c54a40 --- /dev/null +++ b/Logtalk/wenv/textmate/Logtalk.tmbundle/Snippets/Instance with all.tmSnippet @@ -0,0 +1,29 @@ + + + + + content + +:- object(${1:Instance}, + implements(${2:Protocol}), + imports(${3:Category}), + instantiates(${4:Class})). + + :- info([ + version is 1.0, + author is '`niutil -readprop / /users/$USER realname`', + date is `date +%Y/%m/%d`, + comment is '${5:Description}']). + +$0 + +:- end_object. + + name + Instance with all + scope + source.logtalk + uuid + 8A27A016-73F7-11D9-8083-000D93589AF6 + + diff --git a/Logtalk/wenv/textmate/Logtalk.tmbundle/Snippets/Instance with category.tmSnippet b/Logtalk/wenv/textmate/Logtalk.tmbundle/Snippets/Instance with category.tmSnippet new file mode 100644 index 000000000..8b32841df --- /dev/null +++ b/Logtalk/wenv/textmate/Logtalk.tmbundle/Snippets/Instance with category.tmSnippet @@ -0,0 +1,28 @@ + + + + + content + +:- object(${1:Instance}, + imports(${2:Category}), + instantiates(${3:Class})). + + :- info([ + version is 1.0, + author is '`niutil -readprop / /users/$USER realname`', + date is `date +%Y/%m/%d`, + comment is '${4:Description}']). + +$0 + +:- end_object. + + name + Instance with category + scope + source.logtalk + uuid + 8A27C6D7-73F7-11D9-8083-000D93589AF6 + + diff --git a/Logtalk/wenv/textmate/Logtalk.tmbundle/Snippets/Instance with protocol.tmSnippet b/Logtalk/wenv/textmate/Logtalk.tmbundle/Snippets/Instance with protocol.tmSnippet new file mode 100644 index 000000000..f0a15d3d7 --- /dev/null +++ b/Logtalk/wenv/textmate/Logtalk.tmbundle/Snippets/Instance with protocol.tmSnippet @@ -0,0 +1,28 @@ + + + + + content + +:- object(${1:Instance}, + implements(${2:Protocol}), + instantiates(${3:Class})). + + :- info([ + version is 1.0, + author is '`niutil -readprop / /users/$USER realname`', + date is `date +%Y/%m/%d`, + comment is '${4:Description}']). + +$0 + +:- end_object. + + name + Instance with protocol + scope + source.logtalk + uuid + 8A27EAEC-73F7-11D9-8083-000D93589AF6 + + diff --git a/Logtalk/wenv/textmate/Logtalk.tmbundle/Snippets/Instance.tmSnippet b/Logtalk/wenv/textmate/Logtalk.tmbundle/Snippets/Instance.tmSnippet new file mode 100644 index 000000000..bfda682b5 --- /dev/null +++ b/Logtalk/wenv/textmate/Logtalk.tmbundle/Snippets/Instance.tmSnippet @@ -0,0 +1,27 @@ + + + + + content + +:- object(${1:Instance}, + instantiates(${2:Class})). + + :- info([ + version is 1.0, + author is '`niutil -readprop / /users/$USER realname`', + date is `date +%Y/%m/%d`, + comment is '${3:Description}']). + +$0 + +:- end_object. + + name + Instance + scope + source.logtalk + uuid + 8A2814B5-73F7-11D9-8083-000D93589AF6 + + diff --git a/Logtalk/wenv/textmate/Logtalk.tmbundle/Snippets/Private predicate (no arguments).tmSnippet b/Logtalk/wenv/textmate/Logtalk.tmbundle/Snippets/Private predicate (no arguments).tmSnippet new file mode 100644 index 000000000..6e0b2e59f --- /dev/null +++ b/Logtalk/wenv/textmate/Logtalk.tmbundle/Snippets/Private predicate (no arguments).tmSnippet @@ -0,0 +1,19 @@ + + + + + content + :- private(${1:Functor}/0). + :- mode(${1:Functor}, ${2:Solutions}). + :- info(${1:Functor}/0, [ + comment is '${3:Description}']). + +$0 + name + (with no arguments) + scope + source.logtalk + uuid + DBFDEDF5-7F59-11D9-BA7A-000A95DAA580 + + diff --git a/Logtalk/wenv/textmate/Logtalk.tmbundle/Snippets/Private predicate.tmSnippet b/Logtalk/wenv/textmate/Logtalk.tmbundle/Snippets/Private predicate.tmSnippet new file mode 100644 index 000000000..0dea6c16b --- /dev/null +++ b/Logtalk/wenv/textmate/Logtalk.tmbundle/Snippets/Private predicate.tmSnippet @@ -0,0 +1,20 @@ + + + + + content + :- private(${1:Functor}/${2:Arity}). + :- mode(${1:Functor}(${3:Arguments}), ${4:Solutions}). + :- info(${1:Functor}/${2:Arity}, [ + comment is '${5:Description}', + arguments is ['$6'-'$7']]). + +$0 + name + Private predicate + scope + source.logtalk + uuid + 8A284660-73F7-11D9-8083-000D93589AF6 + + diff --git a/Logtalk/wenv/textmate/Logtalk.tmbundle/Snippets/Protected predicate (no arguments).tmSnippet b/Logtalk/wenv/textmate/Logtalk.tmbundle/Snippets/Protected predicate (no arguments).tmSnippet new file mode 100644 index 000000000..deb1b5421 --- /dev/null +++ b/Logtalk/wenv/textmate/Logtalk.tmbundle/Snippets/Protected predicate (no arguments).tmSnippet @@ -0,0 +1,19 @@ + + + + + content + :- protected(${1:Functor}/0). + :- mode(${1:Functor}, ${2:Solutions}). + :- info(${1:Functor}/0, [ + comment is '${3:Description}']). + +$0 + name + (with no arguments) + scope + source.logtalk + uuid + 4A25F29C-7F59-11D9-BA7A-000A95DAA580 + + diff --git a/Logtalk/wenv/textmate/Logtalk.tmbundle/Snippets/Protected predicate.tmSnippet b/Logtalk/wenv/textmate/Logtalk.tmbundle/Snippets/Protected predicate.tmSnippet new file mode 100644 index 000000000..13674b0c2 --- /dev/null +++ b/Logtalk/wenv/textmate/Logtalk.tmbundle/Snippets/Protected predicate.tmSnippet @@ -0,0 +1,20 @@ + + + + + content + :- protected(${1:Functor}/${2:Arity}). + :- mode(${1:Functor}(${3:Arguments}), ${4:Solutions}). + :- info(${1:Functor}/${2:Arity}, [ + comment is '${5:Description}', + arguments is ['$6'-'$7']]). + +$0 + name + Protected predicate + scope + source.logtalk + uuid + 8A286F7E-73F7-11D9-8083-000D93589AF6 + + diff --git a/Logtalk/wenv/textmate/Logtalk.tmbundle/Snippets/Protocol.tmSnippet b/Logtalk/wenv/textmate/Logtalk.tmbundle/Snippets/Protocol.tmSnippet new file mode 100644 index 000000000..f54096718 --- /dev/null +++ b/Logtalk/wenv/textmate/Logtalk.tmbundle/Snippets/Protocol.tmSnippet @@ -0,0 +1,26 @@ + + + + + content + +:- protocol(${1:Protocol}). + + :- info([ + version is 1.0, + author is '`niutil -readprop / /users/$USER realname`', + date is `date +%Y/%m/%d`, + comment is '${2:Description}']). + +$0 + +:- end_protocol. + + name + Protocol + scope + source.logtalk + uuid + 8A28B0F6-73F7-11D9-8083-000D93589AF6 + + diff --git a/Logtalk/wenv/textmate/Logtalk.tmbundle/Snippets/Prototype with all.tmSnippet b/Logtalk/wenv/textmate/Logtalk.tmbundle/Snippets/Prototype with all.tmSnippet new file mode 100644 index 000000000..ecaf14797 --- /dev/null +++ b/Logtalk/wenv/textmate/Logtalk.tmbundle/Snippets/Prototype with all.tmSnippet @@ -0,0 +1,29 @@ + + + + + content + +:- object(${1:Prototype}, + implements(${2:Protocol}), + imports(${3:Category}), + extends(${4:Parent})). + + :- info([ + version is 1.0, + author is '`niutil -readprop / /users/$USER realname`', + date is `date +%Y/%m/%d`, + comment is '${5:Description}']). + +$0 + +:- end_object. + + name + Prototype with all + scope + source.logtalk + uuid + 8A28E048-73F7-11D9-8083-000D93589AF6 + + diff --git a/Logtalk/wenv/textmate/Logtalk.tmbundle/Snippets/Prototype with category.tmSnippet b/Logtalk/wenv/textmate/Logtalk.tmbundle/Snippets/Prototype with category.tmSnippet new file mode 100644 index 000000000..31692143d --- /dev/null +++ b/Logtalk/wenv/textmate/Logtalk.tmbundle/Snippets/Prototype with category.tmSnippet @@ -0,0 +1,27 @@ + + + + + content + +:- object(${1:Prototype}, + imports(${2:Category})). + + :- info([ + version is 1.0, + author is '`niutil -readprop / /users/$USER realname`', + date is `date +%Y/%m/%d`, + comment is '${3:Description}']). + +$0 + +:- end_object. + + name + Prototype with category + scope + source.logtalk + uuid + 8A290A27-73F7-11D9-8083-000D93589AF6 + + diff --git a/Logtalk/wenv/textmate/Logtalk.tmbundle/Snippets/Prototype with parent.tmSnippet b/Logtalk/wenv/textmate/Logtalk.tmbundle/Snippets/Prototype with parent.tmSnippet new file mode 100644 index 000000000..10f072109 --- /dev/null +++ b/Logtalk/wenv/textmate/Logtalk.tmbundle/Snippets/Prototype with parent.tmSnippet @@ -0,0 +1,27 @@ + + + + + content + +:- object(${1:Prototype}, + extends(${2:Parent})). + + :- info([ + version is 1.0, + author is '`niutil -readprop / /users/$USER realname`', + date is `date +%Y/%m/%d`, + comment is '${3:Description}']). + +$0 + +:- end_object. + + name + Prototype with parent + scope + source.logtalk + uuid + 8A292E31-73F7-11D9-8083-000D93589AF6 + + diff --git a/Logtalk/wenv/textmate/Logtalk.tmbundle/Snippets/Prototype with protocol.tmSnippet b/Logtalk/wenv/textmate/Logtalk.tmbundle/Snippets/Prototype with protocol.tmSnippet new file mode 100644 index 000000000..378ee0be6 --- /dev/null +++ b/Logtalk/wenv/textmate/Logtalk.tmbundle/Snippets/Prototype with protocol.tmSnippet @@ -0,0 +1,27 @@ + + + + + content + +:- object(${1:Prototype}, + implements(${2:Protocol})). + + :- info([ + version is 1.0, + author is '`niutil -readprop / /users/$USER realname`', + date is `date +%Y/%m/%d`, + comment is '${3:Description}']). + +$0 + +:- end_object. + + name + Prototype with protocol + scope + source.logtalk + uuid + 8A29547D-73F7-11D9-8083-000D93589AF6 + + diff --git a/Logtalk/wenv/textmate/Logtalk.tmbundle/Snippets/Prototype.tmSnippet b/Logtalk/wenv/textmate/Logtalk.tmbundle/Snippets/Prototype.tmSnippet new file mode 100644 index 000000000..f6ba5d686 --- /dev/null +++ b/Logtalk/wenv/textmate/Logtalk.tmbundle/Snippets/Prototype.tmSnippet @@ -0,0 +1,26 @@ + + + + + content + +:- object(${1:Object}). + + :- info([ + version is 1.0, + author is '`niutil -readprop / /users/$USER realname`', + date is `date +%Y/%m/%d`, + comment is '${2:Description}']). + +$0 + +:- end_object. + + name + Prototype + scope + source.logtalk + uuid + 8A298BE0-73F7-11D9-8083-000D93589AF6 + + diff --git a/Logtalk/wenv/textmate/Logtalk.tmbundle/Snippets/Public predicate (no arguments).tmSnippet b/Logtalk/wenv/textmate/Logtalk.tmbundle/Snippets/Public predicate (no arguments).tmSnippet new file mode 100644 index 000000000..83dfcccd8 --- /dev/null +++ b/Logtalk/wenv/textmate/Logtalk.tmbundle/Snippets/Public predicate (no arguments).tmSnippet @@ -0,0 +1,19 @@ + + + + + content + :- public(${1:Functor}/0). + :- mode(${1:Functor}, ${2:Solutions}). + :- info(${1:Functor}/0, [ + comment is '${3:Description}']). + +$0 + name + (with no arguments) + scope + source.logtalk + uuid + D96B0926-7F56-11D9-BA7A-000A95DAA580 + + diff --git a/Logtalk/wenv/textmate/Logtalk.tmbundle/Snippets/Public predicate.tmSnippet b/Logtalk/wenv/textmate/Logtalk.tmbundle/Snippets/Public predicate.tmSnippet new file mode 100644 index 000000000..cdb12f9bc --- /dev/null +++ b/Logtalk/wenv/textmate/Logtalk.tmbundle/Snippets/Public predicate.tmSnippet @@ -0,0 +1,20 @@ + + + + + content + :- public(${1:Functor}/${2:Arity}). + :- mode(${1:Functor}(${3:Arguments}), ${4:Solutions}). + :- info(${1:Functor}/${2:Arity}, [ + comment is '${5:Description}', + arguments is ['$6'-'$7']]). + +$0 + name + Public predicate + scope + source.logtalk + uuid + 8A29B12E-73F7-11D9-8083-000D93589AF6 + +