Comments (6)
I don't understand the real reason for CStruct
and CStructEntity
because I'm not the create of CStruct
.
But I think that the creator wants to avoid class CUnion < CStruct
inheritance.
They exist for backward compatibility of DL (ruby-dl2): https://github.com/ruby/ruby/blob/ruby_2_1/ext/dl/lib/dl/struct.rb
ruby-dl uses Struct
and Union
directly and class Union < Struct
: https://github.com/ruby/ruby/blob/ruby_1_8_7/ext/dl/lib/dl/struct.rb
Anyway, we'll be able to improve them with keeping backward compatibility.
Normal users will use Fiddle::Importer.struct
instead of using Fiddle::CStructBuilder.create
directly.
from fiddle.
Ah, I got it. The creator wants to hide implementation details.
from fiddle.
The problem is that these terms are super vague. 'entity'? That could mean anything or nothing. Here, an 'entity' is really a pointer to an instance of a type.
And CStruct
is really a sort of factory... an object that supplies something used in a constructor. It could be a symbol like :struct
instead.
from fiddle.
What do you want to do in this issue?
Do you want to add more documents?
Do you want to reconstruct lib/fiddle/struct.rb
?
from fiddle.
I think I've clarified this in #41.
from fiddle.
OK.
I close this.
from fiddle.
Related Issues (20)
- parse_ctype() fails for "int long len" HOT 1
- Ruby test suite failures with libffi-3.4.2 HOT 15
- Pseudoclasses via ruby-fiddle?
- JRuby support HOT 2
- Raspberry Pi Cannot Update to 1.1.0 HOT 2
- Can't open linker script files HOT 4
- How to pass struct as argument of function HOT 5
- Unreachable code path in Fiddle::ValueUtil#wrap_arg HOT 5
- Fiddle::CParser should expose module methods HOT 3
- If the nested structure is an array of structures HOT 2
- No bool type HOT 7
- Support for Bit Field HOT 4
- Segfault when exiting due to `Fiddle::MemoryView` HOT 3
- struct implement memoryview HOT 1
- Installation of fiddle failing on Ruby 2.7.3 HOT 4
- Debug support in fiddle? HOT 2
- Question: How to allocate an array of structs? HOT 4
- Question: When passing a char as a function argument, should I pass the number obtained by calling the string's ord method? HOT 4
- Segfault when calling `dlopen` on certain Qt frameworks HOT 4
- NetWkstaGetInfo() always fails with INVALID PARAMETER HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fiddle.