Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
f2cl
f2cl
Commits
f274e125
Commit
f274e125
authored
Dec 18, 2018
by
Raymond Toy
Browse files
Fix some bad markup
parent
64e5f754
Changes
1
Hide whitespace changes
Inline
Side-by-side
README.md
View file @
f274e125
...
...
@@ -181,8 +181,7 @@ For a more detailed list of issues and notes, see src/NOTES.
We highlight just a few issues here.
o Block data statements.
*
Block data statements.
In Fortran, block data statments are used to initialize common
blocks. Since Fortran executables are loaded and run just once,
this is not a problem. However, in Lisp, this might not be true,
...
...
@@ -190,8 +189,7 @@ o Block data statements.
up to you to run the block data initializer at the right time, as
needed. f2cl cannot know when and where to call the initializer.
o Common blocks.
*
Common blocks.
F2cl converts common blocks to structures. However, common blocks
may be referenced in several different files, so the user must
tell f2cl when to define the structure. Use the :declare-common
...
...
@@ -204,13 +202,13 @@ o Common blocks.
changes how f2cl handles common blocks. A rather common use of
common blocks has the same common block using different variable
names. For example, one routine might have
```
COMMON /foo/ a(10), b, i(4)
```
and another might say
```
COMMON /foo/ b(9), c, d, j(2), k(2)
```
In Fortran, this is perfectly acceptable. Normally, f2cl expects
all common blocks to use the same variable names, and then f2cl
creates a structure for the common block using the variable names
...
...
@@ -218,11 +216,11 @@ o Common blocks.
f2cl gets confused. Hence, :common-as-array. We treat the common
block as an array of memory. So this gets converted into a
structure somewhat like
```
(defstruct foo
(part-0 (make-array 11 :element-type 'real))
(part-1 (make-array 4 :element-type 'integer4)))
```
(In a more general case, we group all contiguous variables of the
same type into one array. f2cl and Lisp cannot handle the case
where a real and integer value are allocated to the same piece of
...
...
@@ -231,7 +229,7 @@ o Common blocks.
Then in the individual routines, symbol-macrolets are used to
create accessors for the various definitions. Hence, for the
second version, we would do something like
```
(symbol-macrolet
(b (make-array 9 :displaced-to
(foo-part-0 *foo*)
...
...
@@ -245,15 +243,14 @@ o Common blocks.
(foo-part-1 *foo*)
:displaced-offset 2))
...)
```
Thus, we access the right parts of the common block, independent
of the name. Note that this has a performance impact since we
used displaced arrays.
o Conversion order.
*
Conversion order.
While not necessary, f2cl can do a significantly better job in
generating code if the functions are compiled in the correct
order. This means any function, F, that is called by another
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment