Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Begin deprecating <format-string-condition> in favor of <simple-condition> #1613

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -361,16 +361,16 @@ and will assist you in analyzing values.

.. c:function:: bool dylan_simple_condition_p (D instance)

Tests whether instance is a ``<simple-condition>``.
Tests whether instance is a :class:`<simple-condition>`.

.. c:function:: D dylan_simple_condition_format_string (D instance)

Returns the format string stored in the given ``<simple-condition>``.
Returns the format string stored in the given :class:`<simple-condition>`.

.. c:function:: D dylan_simple_condition_format_args (D instance)

Returns the format string arguments stored in the given
``<simple-condition>``.
:class:`<simple-condition>`.

.. c:function:: bool dylan_class_p (D instance)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ Program Conditions
:open:
:abstract:

:superclasses: :const:`<format-string-condition>`
:superclasses: :class:`<simple-condition>`

:keyword compilation-stage: Defaults to the value of :var:`*current-stage*`.
:keyword program-note-creator: Defaults to the value of :var:`*current-dependent*`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ The extensions are:
- Collection model: :class:`<stretchy-sequence>`, :class:`<string-table>`,
:gf:`difference`, :func:`fill-table!`, :gf:`find-element`, :gf:`position`,
:gf:`remove-all-keys!`, :macro:`define table`, :gf:`split`, and :gf:`join`.
- Condition system: :class:`<format-string-condition>`,
:class:`<simple-condition>`, and :gf:`condition-to-string`.
- Condition system: :class:`<simple-condition>`, and :gf:`condition-to-string`.
- Control flow: :macro:`iterate` and :macro:`when`.
- Development conveniences:

Expand Down Expand Up @@ -143,7 +142,7 @@ The extensions are:

Returns a string representation of a general instance of
:drm:`<condition>`. There is a method on
:class:`<format-string-condition>` and method on
:class:`<simple-condition>` and method on
:drm:`<type-error>`.

.. macro:: debug-assert
Expand Down Expand Up @@ -522,25 +521,6 @@ The extensions are:
Formats a floating-point number to a string. It uses scientific
notation where necessary.

.. class:: <format-string-condition>
:sealed:
:instantiable:

The class of conditions that take a format string.

:superclasses: :drm:`<condition>`

:description:

The class of conditions that take a format string, as defined by
the DRM.

It is the superclass of Dylan's :class:`<simple-condition>`.

:seealso:

- The :doc:`Format module <../io/format>` in the :doc:`IO library <../io/index>`.

.. function:: ignore

A compiler directive that tells the compiler it must not issue a
Expand Down Expand Up @@ -777,20 +757,28 @@ The extensions are:
:sealed:
:instantiable:

The class of simple conditions.
The class of conditions that accept a format string and format arguments
with which to build a message describing the condition.

:superclasses: :class:`<format-string-condition>`
:superclasses: :class:`<condition>`

:description:

The class of simple conditions. It is the superclass of :drm:`<simple-error>`,
:drm:`<simple-warning>`, and :drm:`<simple-restart>`.
As the superclass of :drm:`<simple-error>`, :drm:`<simple-warning>`, and
:drm:`<simple-restart>`, the :class:`<simple-condition>` class provides
the ``format-string:`` and ``format-arguments:`` init keywords described
in the DRM.

:operations:

- :drm:`condition-format-string`
- :drm:`condition-format-arguments`

:seealso:

- The :doc:`format module <../io/format>` in the :doc:`IO library
<../io/index>`.

.. class:: <stretchy-sequence>
:open:
:abstract:
Expand Down
2 changes: 1 addition & 1 deletion documentation/source/library-reference/io/print.rst
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ IO library's *print* module.
end;

With the above method, an ``<account>`` object with name "foo" will print as
``{<account> "foo" #xDEADBEEF}``.
``{<account> "foo" 123}`` where ``123`` is a unique identifier for the object.


The pprint Module
Expand Down
2 changes: 1 addition & 1 deletion documentation/source/library-reference/network/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -731,7 +731,7 @@ This section lists the socket condition classes in the Network library.
:description:

The class of socket conditions. It inherits the ``format-string:``
and ``format-arguments:`` keywords from
and ``format-arguments:`` init keywords from
:class:`<simple-condition>`.

Slots:
Expand Down
4 changes: 2 additions & 2 deletions documentation/source/library-reference/system/file-system.rst
Original file line number Diff line number Diff line change
Expand Up @@ -797,10 +797,10 @@ File-System module.

.. class:: <file-system-error>

Error type signaled when any other functions in the File-System
Error type signaled when any of the functions in the File-System
module signal an error.

:superclasses: :drm:`<error>`, :class:`<simple-condition>`
:superclasses: :drm:`<simple-error>`

:description:

Expand Down
6 changes: 3 additions & 3 deletions documentation/source/library-reference/system/locators.rst
Original file line number Diff line number Diff line change
Expand Up @@ -85,16 +85,16 @@ The locators Module

All errors raised by the locator system should be instances of
this error.
:superclasses: :class:`<format-string-condition>`, :drm:`<error>`

:superclasses: :drm:`<simple-error>`


.. class:: <server-locator>
:open:
:abstract:

The abstract superclass of locators for servers.

:superclasses: :class:`<locator>`

:seealso:
Expand Down
2 changes: 1 addition & 1 deletion sources/common-dylan/format.dylan
Original file line number Diff line number Diff line change
Expand Up @@ -582,7 +582,7 @@ define method condition-to-string
end method condition-to-string;

define method condition-to-string
(condition :: <format-string-condition>) => (string :: <string>)
(condition :: <simple-condition>) => (string :: <string>)
apply(format-to-string,
condition-format-string(condition),
condition-format-arguments(condition))
Expand Down
4 changes: 2 additions & 2 deletions sources/common-dylan/library.dylan
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ end module byte-vector;
define module common-extensions
use dylan-extensions,
export: { <bottom>,
<format-string-condition>,
<format-string-condition>, // Deprecated...
<simple-condition>, // ...use this instead.
<stack-overflow-error>,
<arithmetic-error>,
<division-by-zero-error>,
Expand All @@ -75,7 +76,6 @@ define module common-extensions
<arithmetic-underflow-error>,
<stretchy-object-vector>,
<object-deque>,
<simple-condition>,
<stretchy-sequence>,
<string-table>,
false-or,
Expand Down
4 changes: 2 additions & 2 deletions sources/common-dylan/streams-protocol.dylan
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Copyright: Original Code is Copyright (c) 1995-2004 Functional Objects, Inc.
License: See License.txt in this distribution for details.
Warranty: Distributed WITHOUT WARRANTY OF ANY KIND

define open abstract class <stream-error> (<error>, <format-string-condition>)
define open abstract class <stream-error> (<error>, <simple-condition>)
constant slot stream-error-stream :: <stream>,
required-init-keyword: stream:;
end;
Expand All @@ -17,7 +17,7 @@ define generic stream-error-stream
// TODO: yuck. Would be nicer to just have a condition-to-string method..
// andrewa: note that then you need to update the runtime manager to
// know about the new class too, it is simpler to rely on subclassing
// <format-string-condition>.
// <simple-condition>.
define method make
(class :: subclass(<stream-error>),
#rest args,
Expand Down
2 changes: 1 addition & 1 deletion sources/dfmc/conditions/hierarchy.dylan
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ define function invoke-debugger (condition) end;
// best to subclass one of <program-error>, <program-note>, or
// <program-restart> instead.

define open abstract class <program-condition> (<format-string-condition>)
define open abstract class <program-condition> (<simple-condition>)

// TODO: Make this class primary.

Expand Down
4 changes: 2 additions & 2 deletions sources/dfmc/conditions/report.dylan
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ define thread variable *detail-level* :: <detail-level> = #"normal";
// specializable parameter.
//
// The default method for <program-condition>s takes advantage of the
// fact that all program conditions obey the <format-string-condition>
// (aka <simple-condition>) protocol of having a format string and its
// fact that all program conditions obey the <simple-condition>
// protocol of having a format string and its
// arguments in the condition itself. Methods for conditions outside
// the program condition hierarchy just handle the default level by
// using the %s/%= distinction in format.
Expand Down
4 changes: 2 additions & 2 deletions sources/dfmc/modeling/namespaces.dylan
Original file line number Diff line number Diff line change
Expand Up @@ -719,8 +719,8 @@ define &module dylan-extensions

create
\last-handler-definer,
<format-string-condition>,
<simple-condition>, // HACK: COMPATIBILITY
<format-string-condition>, // Deprecated...
<simple-condition>, // ...use this instead.
<stack-overflow-error>,
<arithmetic-error>,
<division-by-zero-error>,
Expand Down
2 changes: 1 addition & 1 deletion sources/dylan/condition-extras.dylan
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ end method abort;

/// TYPE-ERRORS

define open class <type-error> (<error>, <format-string-condition>) // Should be sealed?
define open class <type-error> (<simple-error>) // Should be sealed?
constant slot type-error-value, init-keyword: value:;
constant slot type-error-expected-type :: <type>, init-keyword: type:;
end class <type-error>;
Expand Down
1 change: 1 addition & 0 deletions sources/dylan/condition.dylan
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ define open abstract primary class <simple-condition> (<condition>)
constant slot condition-format-arguments, init-keyword: format-arguments:, init-value: #[];
end class <simple-condition>;

// Deprecated. Use <simple-condition> instead. This will be removed in a future release.
define constant <format-string-condition> = <simple-condition>;

// debug-message and its C primitive require the arguments as a vector.
Expand Down
2 changes: 1 addition & 1 deletion sources/dylan/number.dylan
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ define generic remainder

//// CONDITIONS

define open abstract class <arithmetic-error> (<error>, <format-string-condition>)
define open abstract class <arithmetic-error> (<error>, <simple-condition>)
inherited slot condition-format-string = "Arithmetic error";
end class <arithmetic-error>;

Expand Down
2 changes: 1 addition & 1 deletion sources/environment/commands/command-line.dylan
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ define open generic parse-next-argument

/// Utilities

define class <command-line-server-error> (<format-string-condition>, <error>)
define class <command-line-server-error> (<simple-error>)
end class <command-line-server-error>;

define class <command-error> (<command-line-server-error>)
Expand Down
2 changes: 1 addition & 1 deletion sources/environment/commands/properties.dylan
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ end method show-property;

/// Errors

define class <set-property-error> (<format-string-condition>, <error>)
define class <set-property-error> (<simple-error>)
end class <set-property-error>;

define method set-error
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ end class <class-breakpoint>;
///// <BREAKPOINT-ERROR>
// The class of all breakpoint errors

define abstract class <breakpoint-error> (<format-string-condition>, <error>)
define abstract class <breakpoint-error> (<simple-condition>, <error>)
end class <breakpoint-error>;


Expand Down
6 changes: 3 additions & 3 deletions sources/environment/protocols/condition-objects.dylan
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ define user-object-class <condition-object> (<user-object>)
binding <condition>, module: dylan, library: dylan;
end user-object-class <condition-object>;

define user-object-class <format-string-condition-object> (<condition-object>)
binding <format-string-condition>, module: dylan-extensions, library: dylan;
end user-object-class <format-string-condition-object>;
define user-object-class <simple-condition-object> (<condition-object>)
binding <simple-condition>, module: dylan-extensions, library: dylan;
end user-object-class <simple-condition-object>;

define constant $format-condition-string-id
= make(<definition-id>,
Expand Down
2 changes: 1 addition & 1 deletion sources/environment/tools/project-commands.dylan
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,7 @@ end method environment-open-file;

/// Project error handling

define class <project-error> (<format-string-condition>, <error>)
define class <project-error> (<simple-error>)
end class <project-error>;

define class <link-error> (<project-error>)
Expand Down
2 changes: 1 addition & 1 deletion sources/lib/dood/native-macros.dylan
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Copyright: Original Code is Copyright (c) 1995-2004 Functional Objects, Inc.
License: See License.txt in this distribution for details.
Warranty: Distributed WITHOUT WARRANTY OF ANY KIND

define class <dood-warning> (<format-string-condition>, <warning>)
define class <dood-warning> (<simple-warning>)
end class;

/*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ define method project-close-compilation-contexts
next-method()
end;

define class <debug-target-not-set-error> (<simple-condition>, <error>) end;
define class <debug-target-not-set-error> (<simple-error>) end;


define function verify-execution-target (project :: <interactive-project>)
Expand Down
2 changes: 1 addition & 1 deletion sources/system/file-system/file-system.dylan
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ end class <file-system-directory-locator>;
define class <file-system-file-locator> (<file-system-locator>, <file-locator>)
end class <file-system-file-locator>;

define sealed class <file-system-error> (<error>, <simple-condition>)
define sealed class <file-system-error> (<simple-error>)
end class <file-system-error>;

define sealed class <file-error> (<file-system-error>)
Expand Down
2 changes: 1 addition & 1 deletion sources/system/locators/locators.dylan
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ end method as;

/// Locator conditions

define class <locator-error> (<format-string-condition>, <error>)
define class <locator-error> (<simple-error>)
end class <locator-error>;

define function locator-error
Expand Down
2 changes: 1 addition & 1 deletion sources/system/tests/specification.dylan
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ define interface-specification-suite file-system-locators-specification-suite ()
(subclass(<locator>), <string>) => (<locator>);

// Locator conditions
instantiable class <locator-error> (<format-string-condition>, <error>);
instantiable class <locator-error> (<simple-error>);
function locator-error (<string>, #"rest") => (#"rest");

// Utilities
Expand Down
Loading