Commit graph

35 commits

Author SHA1 Message Date
Daniel Kochmański
d495a41464 reader: add a new object to the system ecl_token
It represents unparsed token constructed by the reader.
2026-03-07 22:42:12 +01:00
Marius Gerbershagen
c6b4296bb8 cosmetic: fix some compiler warnings 2020-04-29 20:35:37 +02:00
Daniel Kochmański
6e5016dcb8 hash-table: add extension for generic predicates
Added:
- implementation
- test
- documentaiton entries

Additionally:
- remove #if 0 code branches (unused clutter)
- bring up-to-date help.lsp file for hints in slime
- wrap synchronized access in unwind protect
- write_ugly did not carry extensions in the printer
2019-05-25 09:56:08 +02:00
Daniel Kochmański
ea87100a06 long-float: remove conditionalization
Many parts of the source code were bent backward to support builds
without long floats which are always present given we depend expect
c99 compiler.

The corresponding C macros (ECL_LONG_FLOAT) and the *feature*
entry (:long-float) are marked as deprecated in the documentation.
2019-05-24 21:04:59 +00:00
Daniel Kochmański
51594b8037 complex-float: print like any other complex number
During printing we cons new floats for imag and real part. We could
opencode that but that would add a lot of code for a little gain. If
this proves to be a real bottleneck we will refactor float printing.
2019-05-15 16:35:16 +02:00
Daniel Kochmański
e1adfd2794 numeric tower: merge <complex float> with <complex>
cl_type_of: give better results for (type-of <complex>)

Instead of simply returning complex we return:

  (complex real)

when code is built without complex float support, and otherwise

  (complex rational)
  (complex single-float)
  (complex double-float)
  (complex long-float)

New functions:
- ecl_to_csfloat
- ecl_to_cdfloat
- ecl_to_clfloat
2019-05-15 16:35:16 +02:00
Daniel Kochmański
a0a92dc2af complex float: add a new types and builtin classes
What has changed:

- new types si:complex-float, si:complex-single-float,
  si:complex-double-float and si:complex-long-float
- new builtin classes long-float (for completness) and
  si:complex-float
- new internal function si:complex-float and si:complex-float-p for
  constructing complex floats (both arguments must be of the same
  float type) and a type predicate
- printer for new types (right now it conses, see below)
- a new feature :complex-float
- a new type is recognized as a type disjoint of complex and real

- cleanup: +built-in-type-list+: remove some redundancy
  For instance instread of saying
    (real (or integer single-float double-float ratio))
  We say
    (real (or integer float ratio))
  etc.

Flaws which will be fixed in upcoming commits:

- complex-float hierarchy is independent of the complex hierarchy
- ecl_make_complex_float could be replaced by _ecl_make_complex_*float
- write_complex_float allocates new objects for printing
- write_complex_float does print unreadable object
- math dispatchers doesn't recognize the object

Testing things out:

> (si:complex-float 0.0d0 0.0d0)
; #<CF(0.0d0 0.0d0)>
> (si:complex-float 0.0d0 0.0s0)       ; signals type error
> (+ (si:complex-float 0.0d0 0.0d0) 1) ; signals type error

lisp runtime: make si_complex-float a subtype of a number.
2019-05-13 19:48:54 +02:00
Daniel Kochmański
f78cb49def complex float: rename cl_lispunion member complex to gencomplex
Complex is a macro specified in complex.h for c99 to simplify using
_Complex type. This file also contains functions to work on complex
floats. To avoid conflicts we rename internal name complex to
gencomplex and update all references to it.
2019-05-06 08:17:33 +02:00
Daniel Kochmański
6ecd2473c4 complex float: add types and structures to core runtime
t_csfloat - ecl_csfloat,
t_cdfloat - ecl_cdfloat,
t_clfloat - ecl_clfloat.
2019-05-06 08:17:33 +02:00
Daniel Kochmański
3766821b25 cosmetic: indent, line breaks 2019-04-20 22:31:21 +02:00
Daniel Kochmanski
2575218ccb printer: fix wrong string printed in write_condition_variable
it printed #<semaphore> while it should be #<condition-variable>.
2018-12-28 10:08:38 +01:00
Marius Gerbershagen
4d3df3766b printer: fix printing of string input streams
Currently ECL crashes because we did not set the array element
    type for the stack allocated tag. Use the string pool instead.
    This should be plenty fast enough, since the performance of
    printing of string input streams is not important anyway.
2018-06-16 13:04:49 +02:00
Daniel Kochmański
ca0962cdb3 Printer addresses 2018-05-04 08:38:33 +00:00
Daniel Kochmański
c1067620a7 Improve rwlock built-in class recognition
Fixes #303.
2016-11-10 19:42:52 +01:00
Daniel Kochmański
5e8ec11bdd cosmetic: fix indent (rest of C) 2016-05-06 08:41:52 +02:00
Matthew Mondor
8f07cd58d8 The ECL code no longer uses tabulator characters, they were replaced
by spaces.

A custom script was used to insert/replace Emacs and ViM per-file editor
settings according to their type and the new ECL coding style.
2015-09-03 07:35:47 -04:00
Daniel Kochmański
de22539146 cosmetic: short-float: fix inconsistencies with short-float
Altough short-float is now implemented as single-float, there are
clear signs that there were attempts / was separate implementation of
that type with partly-abandoned efforts. This patch shapes a bit code
in predlib.lsp and adds comments in appropriate places, that this
files needs to be modified, if such separate implementation occurs.

Signed-off-by: Daniel Kochmański <daniel@turtleware.eu>
2015-07-26 12:54:10 +02:00
Daniel Kochmański
7a29be4337 CLOS: remove dead code and conditionals for non-clos builds
Builds without CLOS weren't possible for long time, yet a lot of dead
code for non-clos builds was spread across sources. This commit
removes all ifdefs and dead blocks from codebase.

Signed-off-by: Daniel Kochmański <dkochmanski@turtle-solutions.eu>
2015-07-01 16:56:17 +02:00
Daniel Kochmański
4d19a27424 cosmetic: untabify
Signed-off-by: Daniel Kochmański <dkochmanski@turtle-solutions.eu>
2015-06-21 14:38:20 +02:00
Philipp Marek
2929636a14 #276 [PATCH]: printing hashtables readably is broken
https://sourceforge.net/p/ecls/bugs/276/
Thanks, Stas.
2014-02-22 12:27:26 +01:00
Juan Jose Garcia Ripoll
e54d9a6173 Rename type_of -> ecl_t_of 2012-07-05 23:07:34 +02:00
Juan Jose Garcia Ripoll
825fc8cbd3 Cnil and Ct are now part of legacy 2012-06-30 23:01:40 +02:00
Juan Jose Garcia Ripoll
738d844fc0 Prefix the smm_ enumeration values 2012-06-30 22:11:48 +02:00
Juan Jose Garcia Ripoll
64a9168434 CHARACTERP, BASE_CHAR_P, BASE_CHAR_CODE_P, CODE_CHAR, CHAR_CODE, REAL_TYPE, IMMEDIATE, IMMEDIATE_TAG, FIXNUM_TAG, FIXNUM_MINUSP, FIXNUM_PLUSP, FIXNUMP and fix get the ecl_ prefix 2012-06-06 11:19:55 +02:00
Juan Jose Garcia Ripoll
b3e6bf772a New console streams for Windows. 2012-05-19 09:34:35 +02:00
Juan Jose Garcia Ripoll
dbd51915dc Remove further uses of cl_funcall in the C core 2012-05-05 10:40:14 +02:00
Juan Jose Garcia Ripoll
fbd3587b1a Removed further warnings about uninitialized or unused variables and functions 2012-04-11 23:04:27 +02:00
Juan Jose Garcia Ripoll
ad49125681 Implemented a first prototype of mailbox 2012-04-07 00:55:14 +02:00
Juan Jose Garcia Ripoll
05a46aca0b Print readably hash tables using the EXT:HASH-TABLE-FILL 2011-12-10 19:00:09 +01:00
Juan Jose Garcia Ripoll
dd05b04372 Implemented SEQUENCE-STREAMs 2011-08-27 17:33:12 +02:00
Juan Jose Garcia Ripoll
d08fd4f44e File streams are printed different from ANSI C streams 2011-06-19 17:08:33 +02:00
Juan Jose Garcia Ripoll
b2a8389730 Avoid using snprintf 2010-11-06 00:50:58 +01:00
Juan Jose Garcia Ripoll
17b611b580 Adjust buffer size in write_stream 2010-10-28 23:51:21 +02:00
Juan Jose Garcia Ripoll
d1ef5a13b1 In si_write_ugly_object dispatch is based on a pointer table. 2010-10-28 23:49:12 +02:00
Juan Jose Garcia Ripoll
79d8e9b569 Split printer into separate files, factorizing those for unreadable printing 2010-10-28 23:05:25 +02:00